Skip to content

Commit

Permalink
deps: aws sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Aug 5, 2023
1 parent 4f3d112 commit ed6aac4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
9 changes: 5 additions & 4 deletions crates/s3s-aws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions crates/s3s-aws/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<E, R>);

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?
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/s3s-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/s3s-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
7 changes: 4 additions & 3 deletions crates/s3s-proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
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()));
}
Expand Down

0 comments on commit ed6aac4

Please sign in to comment.