Skip to content

Commit 3d7cce5

Browse files
committed
Bump dependencies
1 parent 194ffab commit 3d7cce5

File tree

5 files changed

+223
-208
lines changed

5 files changed

+223
-208
lines changed

s3/Cargo.toml

+36-47
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-s3"
3-
version = "0.36.0-alpha.1"
3+
version = "0.36.0-alpha.2"
44
authors = ["Drazen Urch"]
55
description = "Rust library for working with AWS S3 and compatible object storage APIs"
66
repository = "https://github.com/durch/rust-s3"
@@ -44,86 +44,75 @@ async-std = { version = "1", optional = true }
4444
async-trait = "0.1"
4545
attohttpc = { version = "0.28", optional = true, default-features = false }
4646
# aws-creds = { version = "*", path = "../aws-creds", default-features = false }
47-
# aws-region = { version = "0.25.4", path = "../aws-region" }
48-
aws-region = "0.25"
4947
aws-creds = { version = "0.38", default-features = false }
48+
# aws-region = { version = "*", path = "../aws-region" }
49+
aws-region = "0.26"
5050
base64 = "0.22"
51+
block_on_proc = { version = "0.2", optional = true }
52+
bytes = { version = "1.2" }
5153
cfg-if = "1"
52-
time = { version = "^0.3.6", features = ["formatting", "macros"] }
5354
futures = { version = "0.3", optional = true }
5455
futures-io = { version = "0.3", optional = true }
5556
futures-util = { version = "0.3", optional = true, features = ["io"] }
5657
hex = "0.4"
5758
hmac = "0.12"
58-
http = "0.2"
59-
hyper = { version = "0.14", default-features = false, features = [
60-
"client",
61-
"http1",
62-
"stream",
63-
"tcp",
64-
], optional = true }
65-
hyper-tls = { version = "0.5.0", default-features = false, optional = true }
66-
hyper-rustls = { version = "0.24", default-features = false, optional = true }
67-
rustls = { version = "0.21", optional = true }
68-
tokio-rustls = { version = "0.24.1", optional = true }
69-
rustls-native-certs = { version = "0.6.3", optional = true }
59+
http = "1"
7060
log = "0.4"
7161
maybe-async = { version = "0.2" }
7262
md5 = "0.7"
63+
minidom = { version = "0.16", optional = true }
7364
percent-encoding = "2"
65+
quick-xml = { version = "0.36", features = ["serialize"] }
66+
reqwest = { version = "0.12", optional = true, features = ["stream",], default-features = false }
7467
serde = "1"
75-
serde_json = "1"
7668
serde_derive = "1"
77-
quick-xml = { version = "0.32", features = ["serialize"] }
69+
serde_json = "1"
7870
sha2 = "0.10"
71+
surf = { version = "2", optional = true, default-features = false, features = ["h1-client-rustls",] }
7972
thiserror = "1"
80-
surf = { version = "2", optional = true, default-features = false, features = [
81-
"h1-client-rustls",
82-
] }
83-
tokio = { version = "1", features = [
84-
"io-util",
85-
], optional = true, default-features = false }
73+
time = { version = "^0.3.6", features = ["formatting", "macros"], default-features = false}
74+
tokio = { version = "1", features = ["io-util",], optional = true, default-features = false }
8675
tokio-native-tls = { version = "0.3", optional = true }
87-
native-tls = { version = "0.2", optional = true }
76+
tokio-rustls = { version = "0.26", optional = true }
8877
tokio-stream = { version = "0.1", optional = true }
8978
url = "2"
90-
minidom = { version = "0.15", optional = true }
91-
bytes = { version = "1.2" }
92-
block_on_proc = { version = "0.2", optional = true }
9379

9480
[features]
95-
default = ["tags", "use-tokio-native-tls", "fail-on-err"]
96-
use-tokio-native-tls = [
97-
"with-tokio",
98-
"aws-creds/native-tls",
99-
"tokio-native-tls",
100-
"hyper-tls",
101-
"native-tls",
102-
]
103-
with-tokio = ["hyper", "tokio", "tokio/fs", "tokio-stream", "futures"]
104-
async-std-native-tls = ["with-async-std", "aws-creds/native-tls"]
105-
http-credentials = ["aws-creds/http-credentials"]
106-
with-async-std = ["async-std", "surf", "futures-io", "futures-util", "futures"]
81+
default = ["tags", "tokio-native-tls", "fail-on-err"]
82+
10783
sync = ["attohttpc", "maybe-async/is_sync"]
108-
no-verify-ssl = []
84+
with-async-std = ["async-std", "surf", "futures-io", "futures-util", "futures"]
85+
with-tokio = ["reqwest", "tokio", "tokio/fs", "tokio-stream", "futures"]
86+
87+
blocking = ["block_on_proc", "tokio/rt", "tokio/rt-multi-thread"]
10988
fail-on-err = []
110-
tokio-rustls-tls = [
89+
no-verify-ssl = []
90+
tags = ["minidom"]
91+
92+
http-credentials = ["aws-creds/http-credentials"]
93+
94+
tokio-native-tls = [
95+
"aws-creds/native-tls",
96+
"reqwest/native-tls",
97+
"dep:tokio-native-tls",
11198
"with-tokio",
99+
]
100+
tokio-rustls-tls = [
112101
"aws-creds/rustls-tls",
102+
"reqwest/rustls-tls",
113103
"tokio-rustls",
114-
"hyper-rustls",
115-
"rustls",
116-
"rustls-native-certs",
104+
"with-tokio",
117105
]
106+
107+
async-std-native-tls = ["with-async-std", "aws-creds/native-tls"]
108+
118109
sync-native-tls = ["sync", "aws-creds/native-tls", "attohttpc/tls"]
119110
sync-native-tls-vendored = [
120111
"sync",
121112
"aws-creds/native-tls-vendored",
122113
"attohttpc/tls-vendored",
123114
]
124115
sync-rustls-tls = ["sync", "aws-creds/rustls-tls", "attohttpc/tls-rustls"]
125-
blocking = ["block_on_proc", "tokio/rt", "tokio/rt-multi-thread"]
126-
tags = ["minidom"]
127116

128117
[dev-dependencies]
129118
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "fs"] }

s3/src/bucket.rs

+16-28
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ use crate::bucket_ops::{BucketConfiguration, CreateBucketResponse};
99
use crate::command::{Command, Multipart};
1010
use crate::creds::Credentials;
1111
use crate::region::Region;
12-
#[cfg(any(feature = "with-tokio", feature = "use-tokio-native-tls"))]
12+
#[cfg(any(feature = "with-tokio", feature = "tokio-native-tls"))]
1313
use crate::request::tokio_backend::client;
14-
#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
15-
use crate::request::tokio_backend::HttpsConnector;
16-
use crate::request::ResponseData;
1714
#[cfg(any(feature = "with-tokio", feature = "with-async-std"))]
1815
use crate::request::ResponseDataStream;
16+
use crate::request::{Request as _, ResponseData};
1917
use std::str::FromStr;
2018
use std::sync::Arc;
2119

@@ -33,7 +31,7 @@ pub type Query = HashMap<String, String>;
3331
#[cfg(feature = "with-async-std")]
3432
use crate::request::async_std_backend::SurfRequest as RequestImpl;
3533
#[cfg(feature = "with-tokio")]
36-
use crate::request::tokio_backend::HyperRequest as RequestImpl;
34+
use crate::request::tokio_backend::ReqwestRequest as RequestImpl;
3735

3836
#[cfg(feature = "with-async-std")]
3937
use async_std::io::Write as AsyncWrite;
@@ -52,7 +50,6 @@ use async_std::io::Read as AsyncRead;
5250

5351
use crate::error::S3Error;
5452
use crate::post_policy::PresignedPost;
55-
use crate::request::Request;
5653
use crate::serde_types::{
5754
BucketLifecycleConfiguration, BucketLocationResult, CompleteMultipartUploadData,
5855
CorsConfiguration, HeadObjectResult, InitiateMultipartUploadResponse, ListBucketResult,
@@ -108,14 +105,14 @@ pub struct Bucket {
108105
pub request_timeout: Option<Duration>,
109106
path_style: bool,
110107
listobjects_v2: bool,
111-
#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
112-
http_client: Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>>,
108+
#[cfg(any(feature = "tokio-native-tls", feature = "tokio-rustls-tls"))]
109+
http_client: Arc<reqwest::Client>,
113110
#[cfg(all(
114111
feature = "with-tokio",
115-
not(feature = "use-tokio-native-tls"),
112+
not(feature = "tokio-native-tls"),
116113
not(feature = "tokio-rustls-tls")
117114
))]
118-
http_client: Arc<hyper::Client<hyper::client::HttpConnector>>,
115+
http_client: Arc<reqwest::Client>,
119116
}
120117

121118
impl Bucket {
@@ -134,17 +131,8 @@ impl Bucket {
134131
}
135132
}
136133

137-
#[cfg(all(
138-
feature = "with-tokio",
139-
not(feature = "use-tokio-native-tls"),
140-
not(feature = "tokio-rustls-tls")
141-
))]
142-
pub fn http_client(&self) -> Arc<hyper::Client<hyper::client::HttpConnector>> {
143-
Arc::clone(&self.http_client)
144-
}
145-
146-
#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
147-
pub fn http_client(&self) -> Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>> {
134+
#[cfg(feature = "with-tokio")]
135+
pub fn http_client(&self) -> Arc<reqwest::Client> {
148136
Arc::clone(&self.http_client)
149137
}
150138
}
@@ -588,7 +576,7 @@ impl Bucket {
588576
request_timeout: DEFAULT_REQUEST_TIMEOUT,
589577
path_style: false,
590578
listobjects_v2: true,
591-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
579+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
592580
http_client: Arc::new(client(DEFAULT_REQUEST_TIMEOUT)?),
593581
}))
594582
}
@@ -614,7 +602,7 @@ impl Bucket {
614602
request_timeout: DEFAULT_REQUEST_TIMEOUT,
615603
path_style: false,
616604
listobjects_v2: true,
617-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
605+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
618606
http_client: Arc::new(client(DEFAULT_REQUEST_TIMEOUT)?),
619607
})
620608
}
@@ -629,7 +617,7 @@ impl Bucket {
629617
request_timeout: self.request_timeout,
630618
path_style: true,
631619
listobjects_v2: self.listobjects_v2,
632-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
620+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
633621
http_client: self.http_client.clone(),
634622
})
635623
}
@@ -644,7 +632,7 @@ impl Bucket {
644632
request_timeout: self.request_timeout,
645633
path_style: self.path_style,
646634
listobjects_v2: self.listobjects_v2,
647-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
635+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
648636
http_client: self.http_client.clone(),
649637
})
650638
}
@@ -662,7 +650,7 @@ impl Bucket {
662650
request_timeout: self.request_timeout,
663651
path_style: self.path_style,
664652
listobjects_v2: self.listobjects_v2,
665-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
653+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
666654
http_client: self.http_client.clone(),
667655
})
668656
}
@@ -677,7 +665,7 @@ impl Bucket {
677665
request_timeout: Some(request_timeout),
678666
path_style: self.path_style,
679667
listobjects_v2: self.listobjects_v2,
680-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
668+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
681669
http_client: Arc::new(client(Some(request_timeout))?),
682670
}))
683671
}
@@ -692,7 +680,7 @@ impl Bucket {
692680
request_timeout: self.request_timeout,
693681
path_style: self.path_style,
694682
listobjects_v2: false,
695-
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
683+
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
696684
http_client: self.http_client.clone(),
697685
}
698686
}

s3/src/error.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ pub enum S3Error {
2525
#[error("http: {0}")]
2626
Http(#[from] http::Error),
2727
#[cfg(feature = "with-tokio")]
28-
#[error("hyper: {0}")]
29-
Hyper(#[from] hyper::Error),
30-
#[cfg(feature = "use-tokio-native-tls")]
31-
#[error("native-tls: {0}")]
32-
NativeTls(#[from] native_tls::Error),
28+
#[error("reqwest: {0}")]
29+
Reqwest(#[from] reqwest::Error),
30+
#[cfg(feature = "with-tokio")]
31+
#[error("reqwest: {0}")]
32+
ReqwestHeaderToStr(#[from] reqwest::header::ToStrError),
33+
#[cfg(feature = "with-async-std")]
3334
#[error("header to string: {0}")]
3435
HeaderToStr(#[from] http::header::ToStrError),
3536
#[error("from utf8: {0}")]
@@ -38,6 +39,7 @@ pub enum S3Error {
3839
SerdeXml(#[from] quick_xml::de::DeError),
3940
#[error("invalid header value: {0}")]
4041
InvalidHeaderValue(#[from] http::header::InvalidHeaderValue),
42+
#[cfg(feature = "with-async-std")]
4143
#[error("invalid header name: {0}")]
4244
InvalidHeaderName(#[from] http::header::InvalidHeaderName),
4345
#[cfg(feature = "with-async-std")]

0 commit comments

Comments
 (0)