Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Aug 31, 2024
1 parent 194ffab commit 3d7cce5
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 208 deletions.
83 changes: 36 additions & 47 deletions s3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-s3"
version = "0.36.0-alpha.1"
version = "0.36.0-alpha.2"
authors = ["Drazen Urch"]
description = "Rust library for working with AWS S3 and compatible object storage APIs"
repository = "https://github.com/durch/rust-s3"
Expand Down Expand Up @@ -44,86 +44,75 @@ async-std = { version = "1", optional = true }
async-trait = "0.1"
attohttpc = { version = "0.28", optional = true, default-features = false }
# aws-creds = { version = "*", path = "../aws-creds", default-features = false }
# aws-region = { version = "0.25.4", path = "../aws-region" }
aws-region = "0.25"
aws-creds = { version = "0.38", default-features = false }
# aws-region = { version = "*", path = "../aws-region" }
aws-region = "0.26"
base64 = "0.22"
block_on_proc = { version = "0.2", optional = true }
bytes = { version = "1.2" }
cfg-if = "1"
time = { version = "^0.3.6", features = ["formatting", "macros"] }
futures = { version = "0.3", optional = true }
futures-io = { version = "0.3", optional = true }
futures-util = { version = "0.3", optional = true, features = ["io"] }
hex = "0.4"
hmac = "0.12"
http = "0.2"
hyper = { version = "0.14", default-features = false, features = [
"client",
"http1",
"stream",
"tcp",
], optional = true }
hyper-tls = { version = "0.5.0", default-features = false, optional = true }
hyper-rustls = { version = "0.24", default-features = false, optional = true }
rustls = { version = "0.21", optional = true }
tokio-rustls = { version = "0.24.1", optional = true }
rustls-native-certs = { version = "0.6.3", optional = true }
http = "1"
log = "0.4"
maybe-async = { version = "0.2" }
md5 = "0.7"
minidom = { version = "0.16", optional = true }
percent-encoding = "2"
quick-xml = { version = "0.36", features = ["serialize"] }
reqwest = { version = "0.12", optional = true, features = ["stream",], default-features = false }
serde = "1"
serde_json = "1"
serde_derive = "1"
quick-xml = { version = "0.32", features = ["serialize"] }
serde_json = "1"
sha2 = "0.10"
surf = { version = "2", optional = true, default-features = false, features = ["h1-client-rustls",] }
thiserror = "1"
surf = { version = "2", optional = true, default-features = false, features = [
"h1-client-rustls",
] }
tokio = { version = "1", features = [
"io-util",
], optional = true, default-features = false }
time = { version = "^0.3.6", features = ["formatting", "macros"], default-features = false}
tokio = { version = "1", features = ["io-util",], optional = true, default-features = false }
tokio-native-tls = { version = "0.3", optional = true }
native-tls = { version = "0.2", optional = true }
tokio-rustls = { version = "0.26", optional = true }
tokio-stream = { version = "0.1", optional = true }
url = "2"
minidom = { version = "0.15", optional = true }
bytes = { version = "1.2" }
block_on_proc = { version = "0.2", optional = true }

[features]
default = ["tags", "use-tokio-native-tls", "fail-on-err"]
use-tokio-native-tls = [
"with-tokio",
"aws-creds/native-tls",
"tokio-native-tls",
"hyper-tls",
"native-tls",
]
with-tokio = ["hyper", "tokio", "tokio/fs", "tokio-stream", "futures"]
async-std-native-tls = ["with-async-std", "aws-creds/native-tls"]
http-credentials = ["aws-creds/http-credentials"]
with-async-std = ["async-std", "surf", "futures-io", "futures-util", "futures"]
default = ["tags", "tokio-native-tls", "fail-on-err"]

sync = ["attohttpc", "maybe-async/is_sync"]
no-verify-ssl = []
with-async-std = ["async-std", "surf", "futures-io", "futures-util", "futures"]
with-tokio = ["reqwest", "tokio", "tokio/fs", "tokio-stream", "futures"]

blocking = ["block_on_proc", "tokio/rt", "tokio/rt-multi-thread"]
fail-on-err = []
tokio-rustls-tls = [
no-verify-ssl = []
tags = ["minidom"]

http-credentials = ["aws-creds/http-credentials"]

tokio-native-tls = [
"aws-creds/native-tls",
"reqwest/native-tls",
"dep:tokio-native-tls",
"with-tokio",
]
tokio-rustls-tls = [
"aws-creds/rustls-tls",
"reqwest/rustls-tls",
"tokio-rustls",
"hyper-rustls",
"rustls",
"rustls-native-certs",
"with-tokio",
]

async-std-native-tls = ["with-async-std", "aws-creds/native-tls"]

sync-native-tls = ["sync", "aws-creds/native-tls", "attohttpc/tls"]
sync-native-tls-vendored = [
"sync",
"aws-creds/native-tls-vendored",
"attohttpc/tls-vendored",
]
sync-rustls-tls = ["sync", "aws-creds/rustls-tls", "attohttpc/tls-rustls"]
blocking = ["block_on_proc", "tokio/rt", "tokio/rt-multi-thread"]
tags = ["minidom"]

[dev-dependencies]
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "fs"] }
Expand Down
44 changes: 16 additions & 28 deletions s3/src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ use crate::bucket_ops::{BucketConfiguration, CreateBucketResponse};
use crate::command::{Command, Multipart};
use crate::creds::Credentials;
use crate::region::Region;
#[cfg(any(feature = "with-tokio", feature = "use-tokio-native-tls"))]
#[cfg(any(feature = "with-tokio", feature = "tokio-native-tls"))]
use crate::request::tokio_backend::client;
#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
use crate::request::tokio_backend::HttpsConnector;
use crate::request::ResponseData;
#[cfg(any(feature = "with-tokio", feature = "with-async-std"))]
use crate::request::ResponseDataStream;
use crate::request::{Request as _, ResponseData};
use std::str::FromStr;
use std::sync::Arc;

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

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

use crate::error::S3Error;
use crate::post_policy::PresignedPost;
use crate::request::Request;
use crate::serde_types::{
BucketLifecycleConfiguration, BucketLocationResult, CompleteMultipartUploadData,
CorsConfiguration, HeadObjectResult, InitiateMultipartUploadResponse, ListBucketResult,
Expand Down Expand Up @@ -108,14 +105,14 @@ pub struct Bucket {
pub request_timeout: Option<Duration>,
path_style: bool,
listobjects_v2: bool,
#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
http_client: Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>>,
#[cfg(any(feature = "tokio-native-tls", feature = "tokio-rustls-tls"))]
http_client: Arc<reqwest::Client>,
#[cfg(all(
feature = "with-tokio",
not(feature = "use-tokio-native-tls"),
not(feature = "tokio-native-tls"),
not(feature = "tokio-rustls-tls")
))]
http_client: Arc<hyper::Client<hyper::client::HttpConnector>>,
http_client: Arc<reqwest::Client>,
}

impl Bucket {
Expand All @@ -134,17 +131,8 @@ impl Bucket {
}
}

#[cfg(all(
feature = "with-tokio",
not(feature = "use-tokio-native-tls"),
not(feature = "tokio-rustls-tls")
))]
pub fn http_client(&self) -> Arc<hyper::Client<hyper::client::HttpConnector>> {
Arc::clone(&self.http_client)
}

#[cfg(any(feature = "use-tokio-native-tls", feature = "tokio-rustls-tls"))]
pub fn http_client(&self) -> Arc<hyper::Client<HttpsConnector<hyper::client::HttpConnector>>> {
#[cfg(feature = "with-tokio")]
pub fn http_client(&self) -> Arc<reqwest::Client> {
Arc::clone(&self.http_client)
}
}
Expand Down Expand Up @@ -588,7 +576,7 @@ impl Bucket {
request_timeout: DEFAULT_REQUEST_TIMEOUT,
path_style: false,
listobjects_v2: true,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: Arc::new(client(DEFAULT_REQUEST_TIMEOUT)?),
}))
}
Expand All @@ -614,7 +602,7 @@ impl Bucket {
request_timeout: DEFAULT_REQUEST_TIMEOUT,
path_style: false,
listobjects_v2: true,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: Arc::new(client(DEFAULT_REQUEST_TIMEOUT)?),
})
}
Expand All @@ -629,7 +617,7 @@ impl Bucket {
request_timeout: self.request_timeout,
path_style: true,
listobjects_v2: self.listobjects_v2,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: self.http_client.clone(),
})
}
Expand All @@ -644,7 +632,7 @@ impl Bucket {
request_timeout: self.request_timeout,
path_style: self.path_style,
listobjects_v2: self.listobjects_v2,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: self.http_client.clone(),
})
}
Expand All @@ -662,7 +650,7 @@ impl Bucket {
request_timeout: self.request_timeout,
path_style: self.path_style,
listobjects_v2: self.listobjects_v2,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: self.http_client.clone(),
})
}
Expand All @@ -677,7 +665,7 @@ impl Bucket {
request_timeout: Some(request_timeout),
path_style: self.path_style,
listobjects_v2: self.listobjects_v2,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: Arc::new(client(Some(request_timeout))?),
}))
}
Expand All @@ -692,7 +680,7 @@ impl Bucket {
request_timeout: self.request_timeout,
path_style: self.path_style,
listobjects_v2: false,
#[cfg(any(feature = "use-tokio-native-tls", feature = "with-tokio"))]
#[cfg(any(feature = "tokio-native-tls", feature = "with-tokio"))]
http_client: self.http_client.clone(),
}
}
Expand Down
12 changes: 7 additions & 5 deletions s3/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ pub enum S3Error {
#[error("http: {0}")]
Http(#[from] http::Error),
#[cfg(feature = "with-tokio")]
#[error("hyper: {0}")]
Hyper(#[from] hyper::Error),
#[cfg(feature = "use-tokio-native-tls")]
#[error("native-tls: {0}")]
NativeTls(#[from] native_tls::Error),
#[error("reqwest: {0}")]
Reqwest(#[from] reqwest::Error),
#[cfg(feature = "with-tokio")]
#[error("reqwest: {0}")]
ReqwestHeaderToStr(#[from] reqwest::header::ToStrError),
#[cfg(feature = "with-async-std")]
#[error("header to string: {0}")]
HeaderToStr(#[from] http::header::ToStrError),
#[error("from utf8: {0}")]
Expand All @@ -38,6 +39,7 @@ pub enum S3Error {
SerdeXml(#[from] quick_xml::de::DeError),
#[error("invalid header value: {0}")]
InvalidHeaderValue(#[from] http::header::InvalidHeaderValue),
#[cfg(feature = "with-async-std")]
#[error("invalid header name: {0}")]
InvalidHeaderName(#[from] http::header::InvalidHeaderName),
#[cfg(feature = "with-async-std")]
Expand Down
Loading

0 comments on commit 3d7cce5

Please sign in to comment.