Loading crates/s3s-aws/src/connector.rs +17 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,8 @@ use s3s::S3Result; use std::ops::Not; use aws_sdk_s3::config::RuntimeComponents; use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnectorSettings, SharedHttpConnector}; use aws_smithy_runtime_api::client::http::{HttpConnector, HttpConnectorFuture}; use aws_smithy_runtime_api::client::orchestrator::HttpRequest as AwsHttpRequest; use aws_smithy_runtime_api::client::orchestrator::HttpResponse as AwsHttpResponse; Loading @@ -14,6 +16,21 @@ use hyper::header::HOST; use hyper::http; use hyper::{Request, Response}; #[derive(Debug)] pub struct Client(SharedS3Service); impl HttpClient for Client { fn http_connector(&self, _: &HttpConnectorSettings, _: &RuntimeComponents) -> SharedHttpConnector { SharedHttpConnector::new(Connector(self.0.clone())) } } impl From<SharedS3Service> for Client { fn from(val: SharedS3Service) -> Self { Self(val) } } #[derive(Debug, Clone)] pub struct Connector(SharedS3Service); Loading crates/s3s-aws/src/lib.rs +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ mod event_stream; pub mod conv; mod connector; pub use self::connector::Connector; pub use self::connector::{Client, Connector}; mod proxy; pub use self::proxy::Proxy; crates/s3s-fs/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ uuid = { version = "1.4.1", features = ["v4"] } anyhow = { version = "1.0.73", features = ["backtrace"] } aws-config = { version = "1.1.2", default-features = false } aws-credential-types = { version = "1.1.2", features = ["test-util"] } aws-sdk-s3 = "1.12.0" aws-sdk-s3 = { version = "1.12.0", features = ["behavior-version-latest"] } once_cell = "1.18.0" s3s-aws = { version = "0.9.0-dev", path = "../s3s-aws" } tokio = { version = "1.31.0", features = ["full"] } Loading crates/s3s-fs/tests/it_aws.rs +3 −3 Original line number Diff line number Diff line Loading @@ -68,13 +68,13 @@ fn config() -> &'static SdkConfig { b.build() }; // Convert to aws http connector let conn = s3s_aws::Connector::from(service.into_shared()); // Convert to aws http client let client = s3s_aws::Client::from(service.into_shared()); // Setup aws sdk config SdkConfig::builder() .credentials_provider(SharedCredentialsProvider::new(cred)) .http_connector(conn) .http_client(client) .region(Region::new(REGION)) .endpoint_url(format!("http://{DOMAIN_NAME}")) .build() Loading Loading
crates/s3s-aws/src/connector.rs +17 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,8 @@ use s3s::S3Result; use std::ops::Not; use aws_sdk_s3::config::RuntimeComponents; use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnectorSettings, SharedHttpConnector}; use aws_smithy_runtime_api::client::http::{HttpConnector, HttpConnectorFuture}; use aws_smithy_runtime_api::client::orchestrator::HttpRequest as AwsHttpRequest; use aws_smithy_runtime_api::client::orchestrator::HttpResponse as AwsHttpResponse; Loading @@ -14,6 +16,21 @@ use hyper::header::HOST; use hyper::http; use hyper::{Request, Response}; #[derive(Debug)] pub struct Client(SharedS3Service); impl HttpClient for Client { fn http_connector(&self, _: &HttpConnectorSettings, _: &RuntimeComponents) -> SharedHttpConnector { SharedHttpConnector::new(Connector(self.0.clone())) } } impl From<SharedS3Service> for Client { fn from(val: SharedS3Service) -> Self { Self(val) } } #[derive(Debug, Clone)] pub struct Connector(SharedS3Service); Loading
crates/s3s-aws/src/lib.rs +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ mod event_stream; pub mod conv; mod connector; pub use self::connector::Connector; pub use self::connector::{Client, Connector}; mod proxy; pub use self::proxy::Proxy;
crates/s3s-fs/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ uuid = { version = "1.4.1", features = ["v4"] } anyhow = { version = "1.0.73", features = ["backtrace"] } aws-config = { version = "1.1.2", default-features = false } aws-credential-types = { version = "1.1.2", features = ["test-util"] } aws-sdk-s3 = "1.12.0" aws-sdk-s3 = { version = "1.12.0", features = ["behavior-version-latest"] } once_cell = "1.18.0" s3s-aws = { version = "0.9.0-dev", path = "../s3s-aws" } tokio = { version = "1.31.0", features = ["full"] } Loading
crates/s3s-fs/tests/it_aws.rs +3 −3 Original line number Diff line number Diff line Loading @@ -68,13 +68,13 @@ fn config() -> &'static SdkConfig { b.build() }; // Convert to aws http connector let conn = s3s_aws::Connector::from(service.into_shared()); // Convert to aws http client let client = s3s_aws::Client::from(service.into_shared()); // Setup aws sdk config SdkConfig::builder() .credentials_provider(SharedCredentialsProvider::new(cred)) .http_connector(conn) .http_client(client) .region(Region::new(REGION)) .endpoint_url(format!("http://{DOMAIN_NAME}")) .build() Loading