From 4f3d112d0e38f0c25619ddc102c3fe80f09165fd Mon Sep 17 00:00:00 2001 From: Nugine Date: Sat, 5 Aug 2023 12:11:27 +0800 Subject: [PATCH 1/2] deps: upgrade --- codegen/Cargo.toml | 6 +++--- crates/s3s-aws/Cargo.toml | 4 ++-- crates/s3s-fs/Cargo.toml | 20 ++++++++++---------- crates/s3s-proxy/Cargo.toml | 6 +++--- crates/s3s/Cargo.toml | 18 +++++++++--------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 3ce23e04..bbe79817 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -9,7 +9,7 @@ codegen-writer = "0.2.0" heck = "0.4.1" nugine-rust-utils = "0.3.1" numeric_cast = "0.2.1" -regex = "1.8.4" -serde = { version = "1.0.164", features = ["derive"] } -serde_json = { version = "1.0.97", features = ["preserve_order"] } +regex = "1.9.1" +serde = { version = "1.0.171", features = ["derive"] } +serde_json = { version = "1.0.103", features = ["preserve_order"] } serde_urlencoded = "0.7.1" diff --git a/crates/s3s-aws/Cargo.toml b/crates/s3s-aws/Cargo.toml index 1beab465..76f3817c 100644 --- a/crates/s3s-aws/Cargo.toml +++ b/crates/s3s-aws/Cargo.toml @@ -10,14 +10,14 @@ keywords = ["s3"] categories = ["web-programming", "web-programming::http-server"] [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.71" aws-sdk-s3 = "0.28.0" aws-smithy-http = { version = "0.55.3", features = ["event-stream"] } aws-smithy-types = "0.55.3" aws-smithy-types-convert = { version = "0.55.3", features = ["convert-time"] } bytes = "1.4.0" futures = { version = "0.3.28", default-features = false, features = ["std"] } -hyper = "0.14.26" +hyper = "0.14.27" s3s = { version = "0.6.2-dev", path = "../s3s" } sync_wrapper = "0.1.2" tracing = "0.1.37" diff --git a/crates/s3s-fs/Cargo.toml b/crates/s3s-fs/Cargo.toml index a8d80bea..5e1bcc91 100644 --- a/crates/s3s-fs/Cargo.toml +++ b/crates/s3s-fs/Cargo.toml @@ -17,37 +17,37 @@ required-features = ["binary"] binary = ["tokio/full", "dep:clap", "dep:tracing-subscriber", "dep:hyper"] [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.71" base64-simd = "0.8.0" bytes = "1.4.0" chrono = { version = "0.4.26", default-features = false, features = ["std", "clock"] } -clap = { version = "4.3.5", optional = true, features = ["derive"] } +clap = { version = "4.3.17", optional = true, features = ["derive"] } futures = "0.3.28" hex-simd = "0.8.0" -hyper = { version = "0.14.26", optional = true, features = ["full"] } +hyper = { version = "0.14.27", optional = true, features = ["full"] } md-5 = "0.10.5" mime = "0.3.17" nugine-rust-utils = "0.3.1" numeric_cast = "0.2.1" path-absolutize = "3.1.0" s3s = { version = "0.6.2-dev", path = "../s3s" } -serde_json = "1.0.97" -thiserror = "1.0.40" -time = "0.3.22" -tokio = { version = "1.28.2", features = ["fs", "io-util"] } +serde_json = "1.0.103" +thiserror = "1.0.43" +time = "0.3.23" +tokio = { version = "1.29.1", features = ["fs", "io-util"] } tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.37" tracing-error = "0.2.0" tracing-subscriber = { version = "0.3.17", optional = true, features = ["env-filter", "time"] } transform-stream = "0.3.0" -uuid = { version = "1.3.4", features = ["v4"] } +uuid = { version = "1.4.1", features = ["v4"] } [dev-dependencies] -anyhow = { version = "1.0.71", features = ["backtrace"] } +anyhow = { version = "1.0.72", features = ["backtrace"] } aws-config = "0.55.3" aws-credential-types = { version = "0.55.3", features = ["test-util"] } aws-sdk-s3 = "0.28.0" once_cell = "1.18.0" s3s-aws = { version = "0.6.2-dev", path = "../s3s-aws" } -tokio = { version = "1.28.2", features = ["full"] } +tokio = { version = "1.29.1", features = ["full"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter", "time"] } diff --git a/crates/s3s-proxy/Cargo.toml b/crates/s3s-proxy/Cargo.toml index df60e42d..d753fac7 100644 --- a/crates/s3s-proxy/Cargo.toml +++ b/crates/s3s-proxy/Cargo.toml @@ -8,10 +8,10 @@ publish = false aws-config = "0.55.3" aws-credential-types = "0.55.3" aws-sdk-s3 = "0.28.0" -clap = { version = "4.3.5", features = ["derive"] } -hyper = { version = "0.14.26", features = ["full"] } +clap = { version = "4.3.17", features = ["derive"] } +hyper = { version = "0.14.27", features = ["full"] } s3s = { version = "0.6.2-dev", path = "../s3s" } s3s-aws = { version = "0.6.2-dev", path = "../s3s-aws" } -tokio = { version = "1.28.2", features = ["full"] } +tokio = { version = "1.29.1", features = ["full"] } tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter", "time"] } diff --git a/crates/s3s/Cargo.toml b/crates/s3s/Cargo.toml index 4e94421d..91ef32b0 100644 --- a/crates/s3s/Cargo.toml +++ b/crates/s3s/Cargo.toml @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] arrayvec = "0.7.4" -async-trait = "0.1.68" +async-trait = "0.1.71" atoi = { version = "2.0.0", default-features = false } base64-simd = "0.8.0" bytes = "1.4.0" @@ -27,25 +27,25 @@ hex-simd = "0.8.0" hmac = "0.12.1" http-body = "0.4.5" httparse = "1.8.0" -hyper = { version = "0.14.26", features = ["stream"] } -itoa = "1.0.6" +hyper = { version = "0.14.27", features = ["stream"] } +itoa = "1.0.9" memchr = "2.5.0" mime = "0.3.17" nom = "7.1.3" nugine-rust-utils = "0.3.1" -pin-project-lite = "0.2.9" +pin-project-lite = "0.2.10" quick-xml = { version = "0.30.0", features = ["serialize"] } -serde = { version = "1.0.164", features = ["derive"] } +serde = { version = "1.0.171", features = ["derive"] } serde_urlencoded = "0.7.1" sha1 = "0.10.5" sha2 = "0.10.7" -smallvec = "1.10.0" -thiserror = "1.0.40" -time = { version = "0.3.22", features = ["formatting", "parsing", "macros"] } +smallvec = "1.11.0" +thiserror = "1.0.43" +time = { version = "0.3.23", features = ["formatting", "parsing", "macros"] } tracing = "0.1.37" transform-stream = "0.3.0" urlencoding = "2.1.2" zeroize = "1.6.0" [dev-dependencies] -tokio = { version = "1.28.2", features = ["full"] } +tokio = { version = "1.29.1", features = ["full"] } From ed6aac482506a1733b34777dfe292ee9dce66a0f Mon Sep 17 00:00:00 2001 From: Nugine Date: Sat, 5 Aug 2023 14:38:56 +0800 Subject: [PATCH 2/2] deps: aws sdk --- crates/s3s-aws/Cargo.toml | 9 +++++---- crates/s3s-aws/src/error.rs | 5 +++-- crates/s3s-fs/Cargo.toml | 6 +++--- crates/s3s-proxy/Cargo.toml | 6 +++--- crates/s3s-proxy/src/main.rs | 7 ++++--- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/crates/s3s-aws/Cargo.toml b/crates/s3s-aws/Cargo.toml index 76f3817c..82d0e00d 100644 --- a/crates/s3s-aws/Cargo.toml +++ b/crates/s3s-aws/Cargo.toml @@ -11,10 +11,11 @@ categories = ["web-programming", "web-programming::http-server"] [dependencies] async-trait = "0.1.71" -aws-sdk-s3 = "0.28.0" -aws-smithy-http = { version = "0.55.3", features = ["event-stream"] } -aws-smithy-types = "0.55.3" -aws-smithy-types-convert = { version = "0.55.3", features = ["convert-time"] } +aws-sdk-s3 = "0.29.0" +aws-smithy-http = { version = "0.56.0", features = ["event-stream"] } +aws-smithy-runtime-api = { version = "0.56.0", features = ["client"] } +aws-smithy-types = "0.56.0" +aws-smithy-types-convert = { version = "0.56.0", features = ["convert-time"] } bytes = "1.4.0" futures = { version = "0.3.28", default-features = false, features = ["std"] } hyper = "0.14.27" diff --git a/crates/s3s-aws/src/error.rs b/crates/s3s-aws/src/error.rs index 974684d4..59469550 100644 --- a/crates/s3s-aws/src/error.rs +++ b/crates/s3s-aws/src/error.rs @@ -31,10 +31,11 @@ macro_rules! wrap_sdk_error { pub struct SetStatusCode<'a, 'b, E, R>(pub &'a mut s3s::S3Error, pub &'b aws_smithy_http::result::ServiceError); -impl<'a, 'b, E> SetStatusCode<'a, 'b, E, aws_smithy_http::operation::Response> { +impl<'a, 'b, E> SetStatusCode<'a, 'b, E, aws_smithy_runtime_api::client::orchestrator::HttpResponse> { pub fn call(self) { let Self(err, e) = self; - err.set_status_code(e.raw().http().status()); + err.set_status_code(e.raw().status()); + // TODO: headers? } } diff --git a/crates/s3s-fs/Cargo.toml b/crates/s3s-fs/Cargo.toml index 5e1bcc91..2a460380 100644 --- a/crates/s3s-fs/Cargo.toml +++ b/crates/s3s-fs/Cargo.toml @@ -44,9 +44,9 @@ uuid = { version = "1.4.1", features = ["v4"] } [dev-dependencies] anyhow = { version = "1.0.72", features = ["backtrace"] } -aws-config = "0.55.3" -aws-credential-types = { version = "0.55.3", features = ["test-util"] } -aws-sdk-s3 = "0.28.0" +aws-config = "0.56.0" +aws-credential-types = { version = "0.56.0", features = ["test-util"] } +aws-sdk-s3 = "0.29.0" once_cell = "1.18.0" s3s-aws = { version = "0.6.2-dev", path = "../s3s-aws" } tokio = { version = "1.29.1", features = ["full"] } diff --git a/crates/s3s-proxy/Cargo.toml b/crates/s3s-proxy/Cargo.toml index d753fac7..b60e608c 100644 --- a/crates/s3s-proxy/Cargo.toml +++ b/crates/s3s-proxy/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" publish = false [dependencies] -aws-config = "0.55.3" -aws-credential-types = "0.55.3" -aws-sdk-s3 = "0.28.0" +aws-config = "0.56.0" +aws-credential-types = "0.56.0" +aws-sdk-s3 = "0.29.0" clap = { version = "4.3.17", features = ["derive"] } hyper = { version = "0.14.27", features = ["full"] } s3s = { version = "0.6.2-dev", path = "../s3s" } diff --git a/crates/s3s-proxy/src/main.rs b/crates/s3s-proxy/src/main.rs index ae3e0991..1ad6dca0 100644 --- a/crates/s3s-proxy/src/main.rs +++ b/crates/s3s-proxy/src/main.rs @@ -48,15 +48,16 @@ async fn main() -> Result<(), Box> { let opt = Opt::parse(); // Setup S3 provider - let conf = aws_config::from_env().endpoint_url(&opt.endpoint_url).load().await; - let proxy = s3s_aws::Proxy::from(aws_sdk_s3::Client::new(&conf)); + let sdk_conf = aws_config::from_env().endpoint_url(&opt.endpoint_url).load().await; + let client = aws_sdk_s3::Client::from_conf(aws_sdk_s3::config::Builder::from(&sdk_conf).force_path_style(true).build()); + let proxy = s3s_aws::Proxy::from(client); // Setup S3 service let service = { let mut b = S3ServiceBuilder::new(proxy); // Enable authentication - if let Some(cred_provider) = conf.credentials_provider() { + if let Some(cred_provider) = sdk_conf.credentials_provider() { let cred = cred_provider.provide_credentials().await?; b.set_auth(SimpleAuth::from_single(cred.access_key_id(), cred.secret_access_key())); }