-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
2,773 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ members = [ | |
"sts", | ||
"transcribestreaming", | ||
"using-native-tls-instead-of-rustls", | ||
"smithy_orchestrator" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "smithy_orchestrator" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } | ||
aws-config = { path = "../../build/aws-sdk/sdk/aws-config" } | ||
aws-http = { path = "../../build/aws-sdk/sdk/aws-http" } | ||
aws-sigv4 = { path = "../../build/aws-sdk/sdk/aws-sigv4" } | ||
aws-sdk-s3 = { path = "../../build/aws-sdk/sdk/s3" } | ||
aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["rt-tokio"] } | ||
aws-smithy-client = { path = "../../build/aws-sdk/sdk/aws-smithy-client" } | ||
aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } | ||
aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } | ||
aws-smithy-interceptor = { path = "../../build/aws-sdk/sdk/aws-smithy-interceptor" } | ||
aws-smithy-orchestrator = { path = "../../build/aws-sdk/sdk/aws-smithy-orchestrator" } | ||
aws-smithy-token-bucket = { path = "../../build/aws-sdk/sdk/aws-smithy-token-bucket" } | ||
aws-types = { path = "../../build/aws-sdk/sdk/aws-types" } | ||
tokio = { version = "1.8.4", features = ["macros", "test-util", "rt-multi-thread"] } | ||
tracing = "0.1.37" | ||
tracing-subscriber = { version = "0.3.15", features = ["env-filter", "json"] } | ||
http = "0.2.3" | ||
http-body = "0.4.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
use aws_smithy_http::body::SdkBody; | ||
use aws_smithy_orchestrator::{AuthOrchestrator, BoxErr, ConfigBag}; | ||
|
||
pub struct GetObjectAuthOrc {} | ||
|
||
impl GetObjectAuthOrc { | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
impl AuthOrchestrator<http::Request<SdkBody>> for GetObjectAuthOrc { | ||
fn auth_request( | ||
&self, | ||
req: &mut http::Request<SdkBody>, | ||
cfg: &ConfigBag, | ||
) -> Result<(), BoxErr> { | ||
todo!() | ||
} | ||
} | ||
|
||
// signer: Arc::new(|req: &mut http::Request<SdkBody>, props: &PropertyBag| { | ||
// use aws_smithy_orchestrator::auth::error::Error; | ||
// | ||
// let signer = SigV4Signer::new(); | ||
// let operation_config = props | ||
// .get::<OperationSigningConfig>() | ||
// .ok_or(Error::SignRequest("missing signing config".into()))?; | ||
// | ||
// let (operation_config, request_config, creds) = match &operation_config | ||
// .signing_requirements | ||
// { | ||
// SigningRequirements::Disabled => return Ok(()), | ||
// SigningRequirements::Optional => { | ||
// match aws_sig_auth::middleware::signing_config(props) { | ||
// Ok(parts) => parts, | ||
// Err(_) => return Ok(()), | ||
// } | ||
// } | ||
// SigningRequirements::Required => aws_sig_auth::middleware::signing_config(props) | ||
// .map_err(|err| Error::SignRequest(Box::new(err)))?, | ||
// }; | ||
// | ||
// let _signature = signer | ||
// .sign(&operation_config, &request_config, &creds, req) | ||
// .expect("signing goes just fine"); | ||
// | ||
// Ok(()) | ||
// }), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
use aws_smithy_client::conns::Https; | ||
use aws_smithy_client::hyper_ext::Adapter; | ||
use aws_smithy_http::body::SdkBody; | ||
use aws_smithy_orchestrator::{BoxFallibleFut, ConfigBag, Connection}; | ||
|
||
pub struct HyperConnection { | ||
adapter: Adapter<Https>, | ||
} | ||
|
||
impl HyperConnection { | ||
pub fn new() -> Self { | ||
Self { | ||
adapter: Adapter::builder().build(aws_smithy_client::conns::https()), | ||
} | ||
} | ||
} | ||
|
||
impl Connection<http::Request<SdkBody>, http::Response<SdkBody>> for HyperConnection { | ||
fn call( | ||
&self, | ||
req: &mut http::Request<SdkBody>, | ||
cfg: &ConfigBag, | ||
) -> BoxFallibleFut<http::Response<SdkBody>> { | ||
todo!("hyper's connector wants to take ownership of req"); | ||
// self.adapter.call(req) | ||
} | ||
} |
Oops, something went wrong.