Unverified Commit ed6aac48 authored by Nugine's avatar Nugine
Browse files

deps: aws sdk

parent 4f3d112d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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"
+3 −2
Original line number Diff line number Diff line
@@ -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?
    }
}

+3 −3
Original line number Diff line number Diff line
@@ -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"] }
+3 −3
Original line number Diff line number Diff line
@@ -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" }
+4 −3
Original line number Diff line number Diff line
@@ -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()));
        }