From eb482614898d6a78c732d0d902b8a3acb4eefcef Mon Sep 17 00:00:00 2001 From: david-perez Date: Thu, 17 Oct 2024 17:50:28 +0200 Subject: [PATCH 1/5] `codegen-serde`: traverse operations of resources (#3882) The current implementation doesn't traverse a resource's operations if the serialization root is a service shape; the added test fails without this fix. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .../codegen/serde/SerializeImplGenerator.kt | 6 ++- .../rust/codegen/serde/SerdeDecoratorTest.kt | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt b/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt index b7c6c862d0..3db8d0086c 100644 --- a/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt +++ b/codegen-serde/src/main/kotlin/software/amazon/smithy/rust/codegen/serde/SerializeImplGenerator.kt @@ -6,6 +6,7 @@ package software.amazon.smithy.rust.codegen.serde import software.amazon.smithy.codegen.core.Symbol +import software.amazon.smithy.model.knowledge.TopDownIndex import software.amazon.smithy.model.shapes.BlobShape import software.amazon.smithy.model.shapes.BooleanShape import software.amazon.smithy.model.shapes.CollectionShape @@ -61,6 +62,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.hasConstraintTrait class SerializeImplGenerator(private val codegenContext: CodegenContext) { private val model = codegenContext.model + private val topIndex = TopDownIndex.of(model) fun generateRootSerializerForShape(shape: Shape): Writable = serializerFn(shape, null) @@ -78,7 +80,9 @@ class SerializeImplGenerator(private val codegenContext: CodegenContext) { applyTo: Writable?, ): Writable { if (shape is ServiceShape) { - return shape.operations.map { serializerFn(model.expectShape(it), null) }.join("\n") + return topIndex.getContainedOperations(shape).map { + serializerFn(it, null) + }.join("\n") } else if (shape is OperationShape) { if (shape.isEventStream(model)) { // Don't generate serializers for event streams diff --git a/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt b/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt index 1e419a3c76..4a1dc3a520 100644 --- a/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt +++ b/codegen-serde/src/test/kotlin/software/amazon/smithy/rust/codegen/serde/SerdeDecoratorTest.kt @@ -179,6 +179,58 @@ class SerdeDecoratorTest { structure NotSerde {} """.asSmithyModel(smithyVersion = "2") + @Test + fun `decorator should traverse resources`() { + val model = + """ + namespace com.example + use smithy.rust#serde + use aws.protocols#awsJson1_0 + + @awsJson1_0 + @serde + service MyResourceService { + resources: [MyResource] + } + + resource MyResource { + read: ReadMyResource + } + + @readonly + operation ReadMyResource { + input := { } + } + """.asSmithyModel(smithyVersion = "2") + + val params = + IntegrationTestParams(cargoCommand = "cargo test --all-features", service = "com.example#MyResourceService") + serverIntegrationTest(model, params = params) { ctx, crate -> + val codegenScope = + arrayOf( + "crate" to RustType.Opaque(ctx.moduleUseName()), + "serde_json" to CargoDependency("serde_json", CratesIo("1")).toDevDependency().toType(), + // we need the derive feature + "serde" to CargoDependency.Serde.toDevDependency().toType(), + ) + + crate.integrationTest("test_serde") { + unitTest("input_serialized") { + rustTemplate( + """ + use #{crate}::input::ReadMyResourceInput; + use #{crate}::serde::*; + let input = ReadMyResourceInput { }; + let settings = SerializationSettings::default(); + let _serialized = #{serde_json}::to_string(&input.serialize_ref(&settings)).expect("failed to serialize"); + """, + *codegenScope, + ) + } + } + } + } + @Test fun generateSerializersThatWorkServer() { serverIntegrationTest(simpleModel, params = params) { ctx, crate -> From c8c610f1e1a50a2d209f12cf50fca103b97a7ac9 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Thu, 17 Oct 2024 10:52:40 -0500 Subject: [PATCH 2/5] Add RDS URL signer (#3867) ## Motivation and Context [aws-sdk-rust/951](https://github.com/awslabs/aws-sdk-rust/issues/951) ## Description Adds a struct for generating signed URLs for logging in to RDS. See [this doc](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html) for more info. ## Testing I wrote a test. ## Checklist - [ ] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. - [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- aws/rust-runtime/Cargo.lock | 6 +- aws/rust-runtime/aws-config/Cargo.lock | 2 +- aws/rust-runtime/aws-inlineable/Cargo.toml | 3 + .../aws-inlineable/external-types.toml | 3 +- aws/rust-runtime/aws-inlineable/src/lib.rs | 2 + .../aws-inlineable/src/rds_auth_token.rs | 314 ++++++++++++++++++ aws/rust-runtime/aws-sigv4/Cargo.toml | 2 +- .../aws-sigv4/src/http_request/sign.rs | 7 + .../smithy/rustsdk/AwsCodegenDecorator.kt | 2 + .../rustsdk/customize/rds/RdsDecorator.kt | 45 +++ rust-runtime/Cargo.lock | 24 +- rust-runtime/aws-smithy-checksums/Cargo.toml | 2 +- 12 files changed, 394 insertions(+), 18 deletions(-) create mode 100644 aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs create mode 100644 aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 986f38dba7..1cd58e0136 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -118,6 +118,7 @@ dependencies = [ "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", + "aws-types", "bytes", "fastrand", "hex", @@ -132,6 +133,7 @@ dependencies = [ "tempfile", "tokio", "tracing", + "url", ] [[package]] @@ -182,7 +184,7 @@ version = "0.60.3" [[package]] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -227,7 +229,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.12" +version = "0.60.13" dependencies = [ "aws-smithy-http", "aws-smithy-types", diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 979c59de51..5a1aa2a578 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" dependencies = [ "aws-credential-types", "aws-smithy-http", diff --git a/aws/rust-runtime/aws-inlineable/Cargo.toml b/aws/rust-runtime/aws-inlineable/Cargo.toml index 054d41123c..07a00c99a1 100644 --- a/aws/rust-runtime/aws-inlineable/Cargo.toml +++ b/aws/rust-runtime/aws-inlineable/Cargo.toml @@ -18,6 +18,7 @@ http_1x = ["dep:http-1x", "dep:http-body-1x", "aws-smithy-runtime-api/http-1x"] aws-credential-types = { path = "../aws-credential-types" } aws-runtime = { path = "../aws-runtime", features = ["http-02x"] } aws-sigv4 = { path = "../aws-sigv4" } +aws-types = { path = "../aws-types" } aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["rt-tokio"] } aws-smithy-checksums = { path = "../../../rust-runtime/aws-smithy-checksums" } aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" } @@ -37,8 +38,10 @@ ring = "0.17.5" sha2 = "0.10" tokio = "1.23.1" tracing = "0.1" +url = "2.5.2" [dev-dependencies] +aws-credential-types = { path = "../aws-credential-types", features = ["test-util"] } aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async", features = ["test-util"] } aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http", features = ["rt-tokio"] } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["test-util"] } diff --git a/aws/rust-runtime/aws-inlineable/external-types.toml b/aws/rust-runtime/aws-inlineable/external-types.toml index 0e15e561d4..e2ff3ff6c1 100644 --- a/aws/rust-runtime/aws-inlineable/external-types.toml +++ b/aws/rust-runtime/aws-inlineable/external-types.toml @@ -1,5 +1,6 @@ allowed_external_types = [ - "aws_credential_types::provider::credentials::ProvideCredentials", + "aws_types::*", + "aws_credential_types::*", "aws_smithy_http::*", "aws_smithy_runtime_api::*", diff --git a/aws/rust-runtime/aws-inlineable/src/lib.rs b/aws/rust-runtime/aws-inlineable/src/lib.rs index 8fdbaf88b8..3a07c16b56 100644 --- a/aws/rust-runtime/aws-inlineable/src/lib.rs +++ b/aws/rust-runtime/aws-inlineable/src/lib.rs @@ -65,3 +65,5 @@ pub mod s3_expires_interceptor; /// allow docs to work #[derive(Debug)] pub struct Client; + +pub mod rds_auth_token; diff --git a/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs b/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs new file mode 100644 index 0000000000..8a85aea547 --- /dev/null +++ b/aws/rust-runtime/aws-inlineable/src/rds_auth_token.rs @@ -0,0 +1,314 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +//! Code related to creating signed URLs for logging in to RDS. +//! +//! For more information, see + +use aws_credential_types::provider::{ProvideCredentials, SharedCredentialsProvider}; +use aws_sigv4::http_request; +use aws_sigv4::http_request::{SignableBody, SignableRequest, SigningSettings}; +use aws_sigv4::sign::v4; +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::identity::Identity; +use aws_types::region::Region; +use std::fmt; +use std::fmt::Debug; +use std::time::Duration; + +const ACTION: &str = "connect"; +const SERVICE: &str = "rds-db"; + +/// A signer that generates an auth token for a database. +/// +/// ## Example +/// +/// ```ignore +/// use crate::auth_token::{AuthTokenGenerator, Config}; +/// +/// #[tokio::main] +/// async fn main() { +/// let cfg = aws_config::load_defaults(BehaviorVersion::latest()).await; +/// let generator = AuthTokenGenerator::new( +/// Config::builder() +/// .hostname("zhessler-test-db.cp7a4mblr2ig.us-east-1.rds.amazonaws.com") +/// .port(5432) +/// .username("zhessler") +/// .build() +/// .expect("cfg is valid"), +/// ); +/// let token = generator.auth_token(&cfg).await.unwrap(); +/// println!("{token}"); +/// } +/// ``` +#[derive(Debug)] +pub struct AuthTokenGenerator { + config: Config, +} + +/// An auth token usable as a password for an RDS database. +/// +/// This struct can be converted into a `&str` using the `Deref` trait or by calling `to_string()`. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct AuthToken { + inner: String, +} + +impl AuthToken { + /// Return the auth token as a `&str`. + #[must_use] + pub fn as_str(&self) -> &str { + &self.inner + } +} + +impl fmt::Display for AuthToken { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.inner) + } +} + +impl AuthTokenGenerator { + /// Given a `Config`, create a new RDS database login URL signer. + pub fn new(config: Config) -> Self { + Self { config } + } + + /// Return a signed URL usable as an auth token. + pub async fn auth_token( + &self, + config: &aws_types::sdk_config::SdkConfig, + ) -> Result { + let credentials = self + .config + .credentials() + .or(config.credentials_provider()) + .ok_or("credentials are required to create a signed URL for RDS")? + .provide_credentials() + .await?; + let identity: Identity = credentials.into(); + let region = self + .config + .region() + .or(config.region()) + .cloned() + .unwrap_or_else(|| Region::new("us-east-1")); + let time = config.time_source().ok_or("a time source is required")?; + + let mut signing_settings = SigningSettings::default(); + signing_settings.expires_in = Some(Duration::from_secs( + self.config.expires_in().unwrap_or(900).min(900), + )); + signing_settings.signature_location = http_request::SignatureLocation::QueryParams; + + let signing_params = v4::SigningParams::builder() + .identity(&identity) + .region(region.as_ref()) + .name(SERVICE) + .time(time.now()) + .settings(signing_settings) + .build()?; + + let url = format!( + "https://{}:{}/?Action={}&DBUser={}", + self.config.hostname(), + self.config.port(), + ACTION, + self.config.username() + ); + let signable_request = + SignableRequest::new("GET", &url, std::iter::empty(), SignableBody::empty()) + .expect("signable request"); + + let (signing_instructions, _signature) = + http_request::sign(signable_request, &signing_params.into())?.into_parts(); + + let mut url = url::Url::parse(&url).unwrap(); + for (name, value) in signing_instructions.params() { + url.query_pairs_mut().append_pair(name, value); + } + let inner = url.to_string().split_off("https://".len()); + + Ok(AuthToken { inner }) + } +} + +/// Configuration for an RDS auth URL signer. +#[derive(Debug, Clone)] +pub struct Config { + /// The AWS credentials to sign requests with. + /// + /// Uses the default credential provider chain if not specified. + credentials: Option, + + /// The hostname of the database to connect to. + hostname: String, + + /// The port number the database is listening on. + port: u64, + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + region: Option, + + /// The username to login as. + username: String, + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes at 900 seconds. + expires_in: Option, +} + +impl Config { + /// Create a new `SignerConfigBuilder`. + pub fn builder() -> ConfigBuilder { + ConfigBuilder::default() + } + + /// The AWS credentials to sign requests with. + pub fn credentials(&self) -> Option { + self.credentials.clone() + } + + /// The hostname of the database to connect to. + pub fn hostname(&self) -> &str { + &self.hostname + } + + /// The port number the database is listening on. + pub fn port(&self) -> u64 { + self.port + } + + /// The region to sign requests with. + pub fn region(&self) -> Option<&Region> { + self.region.as_ref() + } + + /// The DB username to login as. + pub fn username(&self) -> &str { + &self.username + } + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes out at 900 seconds. + pub fn expires_in(&self) -> Option { + self.expires_in + } +} + +/// A builder for [`Config`]s. +#[derive(Debug, Default)] +pub struct ConfigBuilder { + /// The AWS credentials to create the auth token with. + /// + /// Uses the default credential provider chain if not specified. + credentials: Option, + + /// The hostname of the database to connect to. + hostname: Option, + + /// The port number the database is listening on. + port: Option, + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + region: Option, + + /// The database username to login as. + username: Option, + + /// The number of seconds the auth token should be valid for. + expires_in: Option, +} + +impl ConfigBuilder { + /// The AWS credentials to create the auth token with. + /// + /// Uses the default credential provider chain if not specified. + pub fn credentials(mut self, credentials: impl ProvideCredentials + 'static) -> Self { + self.credentials = Some(SharedCredentialsProvider::new(credentials)); + self + } + + /// The hostname of the database to connect to. + pub fn hostname(mut self, hostname: impl Into) -> Self { + self.hostname = Some(hostname.into()); + self + } + + /// The port number the database is listening on. + pub fn port(mut self, port: u64) -> Self { + self.port = Some(port); + self + } + + /// The region the database is located in. Uses the region inferred from the runtime if omitted. + pub fn region(mut self, region: Region) -> Self { + self.region = Some(region); + self + } + + /// The database username to login as. + pub fn username(mut self, username: impl Into) -> Self { + self.username = Some(username.into()); + self + } + + /// The number of seconds the signed URL should be valid for. + /// + /// Maxes out at 900 seconds. + pub fn expires_in(mut self, expires_in: u64) -> Self { + self.expires_in = Some(expires_in); + self + } + + /// Consume this builder, returning an error if required fields are missing. + /// Otherwise, return a new `SignerConfig`. + pub fn build(self) -> Result { + Ok(Config { + credentials: self.credentials, + hostname: self.hostname.ok_or("A hostname is required")?, + port: self.port.ok_or("a port is required")?, + region: self.region, + username: self.username.ok_or("a username is required")?, + expires_in: self.expires_in, + }) + } +} + +#[cfg(test)] +mod test { + use super::{AuthTokenGenerator, Config}; + use aws_credential_types::provider::SharedCredentialsProvider; + use aws_credential_types::Credentials; + use aws_smithy_async::test_util::ManualTimeSource; + use aws_types::region::Region; + use aws_types::SdkConfig; + use std::time::{Duration, UNIX_EPOCH}; + + #[tokio::test] + async fn signing_works() { + let time_source = ManualTimeSource::new(UNIX_EPOCH + Duration::from_secs(1724709600)); + let sdk_config = SdkConfig::builder() + .credentials_provider(SharedCredentialsProvider::new(Credentials::new( + "akid", "secret", None, None, "test", + ))) + .time_source(time_source) + .build(); + let signer = AuthTokenGenerator::new( + Config::builder() + .hostname("prod-instance.us-east-1.rds.amazonaws.com") + .port(3306) + .region(Region::new("us-east-1")) + .username("peccy") + .build() + .unwrap(), + ); + + let signed_url = signer.auth_token(&sdk_config).await.unwrap(); + assert_eq!(signed_url.as_str(), "prod-instance.us-east-1.rds.amazonaws.com:3306/?Action=connect&DBUser=peccy&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=akid%2F20240826%2Fus-east-1%2Frds-db%2Faws4_request&X-Amz-Date=20240826T220000Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=dd0cba843009474347af724090233265628ace491ea17ce3eb3da098b983ad89"); + } +} diff --git a/aws/rust-runtime/aws-sigv4/Cargo.toml b/aws/rust-runtime/aws-sigv4/Cargo.toml index 49af10cc21..0d247d5436 100644 --- a/aws/rust-runtime/aws-sigv4/Cargo.toml +++ b/aws/rust-runtime/aws-sigv4/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-sigv4" -version = "1.2.4" +version = "1.2.5" authors = ["AWS Rust SDK Team ", "David Barsky "] description = "SigV4 signer for HTTP requests and Event Stream messages." edition = "2021" diff --git a/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs b/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs index dc8308dfda..414570791d 100644 --- a/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs +++ b/aws/rust-runtime/aws-sigv4/src/http_request/sign.rs @@ -93,6 +93,13 @@ pub enum SignableBody<'a> { StreamingUnsignedPayloadTrailer, } +impl SignableBody<'_> { + /// Create a new empty signable body + pub fn empty() -> SignableBody<'static> { + SignableBody::Bytes(&[]) + } +} + /// Instructions for applying a signature to an HTTP request. #[derive(Debug)] pub struct SigningInstructions { diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt index 31c9588db9..afa1afe607 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt @@ -19,6 +19,7 @@ import software.amazon.smithy.rustsdk.customize.ec2.Ec2Decorator import software.amazon.smithy.rustsdk.customize.glacier.GlacierDecorator import software.amazon.smithy.rustsdk.customize.lambda.LambdaDecorator import software.amazon.smithy.rustsdk.customize.onlyApplyTo +import software.amazon.smithy.rustsdk.customize.rds.RdsDecorator import software.amazon.smithy.rustsdk.customize.route53.Route53Decorator import software.amazon.smithy.rustsdk.customize.s3.S3Decorator import software.amazon.smithy.rustsdk.customize.s3.S3ExpiresDecorator @@ -77,6 +78,7 @@ val DECORATORS: List = Ec2Decorator().onlyApplyTo("com.amazonaws.ec2#AmazonEC2"), GlacierDecorator().onlyApplyTo("com.amazonaws.glacier#Glacier"), LambdaDecorator().onlyApplyTo("com.amazonaws.lambda#AWSGirApiService"), + RdsDecorator().onlyApplyTo("com.amazonaws.rds#AmazonRDSv19"), Route53Decorator().onlyApplyTo("com.amazonaws.route53#AWSDnsV20130401"), "com.amazonaws.s3#AmazonS3".applyDecorators( S3Decorator(), diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt new file mode 100644 index 0000000000..f5bf031a67 --- /dev/null +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/rds/RdsDecorator.kt @@ -0,0 +1,45 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +package software.amazon.smithy.rustsdk.customize.rds + +import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext +import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency +import software.amazon.smithy.rust.codegen.core.rustlang.Visibility +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.RustCrate +import software.amazon.smithy.rustsdk.AwsCargoDependency +import software.amazon.smithy.rustsdk.InlineAwsDependency + +class RdsDecorator : ClientCodegenDecorator { + override val name: String = "RDS" + override val order: Byte = 0 + + override fun extras( + codegenContext: ClientCodegenContext, + rustCrate: RustCrate, + ) { + val rc = codegenContext.runtimeConfig + + rustCrate.lib { + // We should have a better way of including an inline dependency. + rust( + "// include #T;", + RuntimeType.forInlineDependency( + InlineAwsDependency.forRustFileAs( + "rds_auth_token", + "auth_token", + Visibility.PUBLIC, + AwsCargoDependency.awsSigv4(rc), + CargoDependency.smithyRuntimeApiClient(rc), + CargoDependency.smithyAsync(rc).toDevDependency().withFeature("test-util"), + CargoDependency.Url, + ), + ), + ) + } + } +} diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index 1b609232bf..c84b962516 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -230,7 +230,7 @@ dependencies = [ "aws-runtime", "aws-sigv4", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-checksums 0.60.12 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-checksums 0.60.12", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -317,11 +317,12 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" version = "0.60.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" dependencies = [ - "aws-smithy-http 0.60.11", - "aws-smithy-types 1.2.7", + "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", - "bytes-utils", "crc32c", "crc32fast", "hex", @@ -329,23 +330,19 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", - "pretty_assertions", "sha1", "sha2", - "tokio", "tracing", - "tracing-test", ] [[package]] name = "aws-smithy-checksums" -version = "0.60.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" +version = "0.60.13" dependencies = [ - "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-http 0.60.11", + "aws-smithy-types 1.2.7", "bytes", + "bytes-utils", "crc32c", "crc32fast", "hex", @@ -353,9 +350,12 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", + "pretty_assertions", "sha1", "sha2", + "tokio", "tracing", + "tracing-test", ] [[package]] diff --git a/rust-runtime/aws-smithy-checksums/Cargo.toml b/rust-runtime/aws-smithy-checksums/Cargo.toml index 5c7a6b8a01..0888246992 100644 --- a/rust-runtime/aws-smithy-checksums/Cargo.toml +++ b/rust-runtime/aws-smithy-checksums/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-checksums" -version = "0.60.12" +version = "0.60.13" authors = [ "AWS Rust SDK Team ", "Zelda Hessler ", From de4bc4547df15e2472b9bca91c89f963ffad0b03 Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Fri, 18 Oct 2024 10:04:05 -0500 Subject: [PATCH 3/5] Allow multiple releases per day in the smithy-rs repository (#3875) ## Motivation and Context Currently, we can only make one `smithy-rs` release per day, and this restricts our ability to respond to urgent issues. This PR lifts that limitation, allowing us to make multiple releases per day. ## Description The core of this change is in the `render` subcommand of `changelogger`. When generating a date-based release tag, it now checks for existing tags on the same day. If a tag already exists, the `render` subcommand will append a numerical suffix to ensure the new tag is unique. In fact, appending a numerical suffix to make a release tag unique has been a workaround in our release pipeline (outside the `smithy-rs` repository) for quite some time. With the changes in this PR, we can eliminate that temporary solution from the release pipeline. Now that `changelogger` requires access to previous tags, CI steps that run `generate-smithy-rs-release` need to checkout the `smithy-rs` repository with all tags (`fetch-depth: 0` is for that purpose). ## Testing - [x] Added unit tests for `changelogger` - [x] Successfully bumped the release tag in [dry-run](https://github.com/smithy-lang/smithy-rs/actions/runs/11356509152/job/31588857360#step:8:26) (based on [this dummy change](https://github.com/smithy-lang/smithy-rs/commit/cb19b31eaa506d66d9869261c920784ccc311b15) to trick `changelogger` into thinking that it has to bump a release tag) - [x] Successfully bumped the release tag in the release pipeline (without the temporary hack we placed last year) ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .github/workflows/ci.yml | 3 + .../release-scripts/create-release.js | 2 +- .github/workflows/release.yml | 37 ++++-- tools/ci-build/changelogger/Cargo.lock | 2 +- tools/ci-build/changelogger/Cargo.toml | 2 +- tools/ci-build/changelogger/src/main.rs | 14 +- tools/ci-build/changelogger/src/render.rs | 124 ++++++++++++++++-- tools/ci-build/changelogger/tests/e2e_test.rs | 31 ++++- tools/ci-build/sdk-versioner/Cargo.lock | 20 +++ .../ci-build/smithy-rs-tool-common/src/git.rs | 18 +++ .../src/git/get_current_tag.rs | 86 ------------ .../src/git/get_last_commit.rs | 73 ----------- .../smithy-rs-tool-common/src/git/reset.rs | 77 ----------- 13 files changed, 216 insertions(+), 273 deletions(-) delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs delete mode 100644 tools/ci-build/smithy-rs-tool-common/src/git/reset.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7426f4f321..f1d641c61d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,9 @@ jobs: with: path: smithy-rs ref: ${{ inputs.git_ref }} + # `generate-smithy-rs-release` requires access to previous tags to determine if a numerical suffix is needed + # to make the release tag unique + fetch-depth: 0 # The models from aws-sdk-rust are needed to generate the full SDK for CI - uses: actions/checkout@v4 with: diff --git a/.github/workflows/release-scripts/create-release.js b/.github/workflows/release-scripts/create-release.js index fb10ea1b2c..8826b90d4e 100644 --- a/.github/workflows/release-scripts/create-release.js +++ b/.github/workflows/release-scripts/create-release.js @@ -10,7 +10,7 @@ const assert = require("assert"); const fs = require("fs"); const smithy_rs_repo = { - owner: "awslabs", + owner: "smithy-lang", repo: "smithy-rs", }; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12e168eb65..114443656e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -181,12 +181,18 @@ jobs: ref: ${{ inputs.commit_sha }} path: smithy-rs token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} + fetch-depth: 0 - name: Generate release artifacts uses: ./smithy-rs/.github/actions/docker-build with: action: generate-smithy-rs-release - name: Download all artifacts uses: ./smithy-rs/.github/actions/download-all-artifacts + # This step is not idempotent, as it pushes release artifacts to the `smithy-rs-release-1.x.y` branch. However, + # if this step succeeds but a subsequent step fails, retrying the release workflow is "safe" in that it does not + # create any inconsistent states; this step would simply fail because the release branch would be ahead of `main` + # due to previously pushed artifacts. + # To successfully retry a release, revert the commits in the release branch that pushed the artifacts. - name: Push smithy-rs changes shell: bash working-directory: smithy-rs-release/smithy-rs @@ -202,7 +208,7 @@ jobs: # to retry a release action execution that failed due to a transient issue. # In that case, we expect the commit to be releasable as-is, i.e. the changelog should have already # been processed. - git fetch --unshallow + git fetch if [[ "${DRY_RUN}" == "true" ]]; then # During dry-runs, "git push" without "--force" can fail if smithy-rs-release-x.y.z-preview is behind # smithy-rs-release-x.y.z, but that does not matter much during dry-runs. @@ -214,18 +220,7 @@ jobs: fi fi echo "commit_sha=$(git rev-parse HEAD)" > $GITHUB_OUTPUT - - name: Tag release - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} - script: | - const createReleaseScript = require("./smithy-rs/.github/workflows/release-scripts/create-release.js"); - await createReleaseScript({ - github, - isDryRun: ${{ inputs.dry_run }}, - releaseManifestPath: "smithy-rs-release/smithy-rs-release-manifest.json", - releaseCommitish: "${{ steps.push-changelog.outputs.commit_sha }}" - }); + # This step is idempotent; the `publisher` will not publish a crate if the version is already published on crates.io. - name: Publish to crates.io shell: bash working-directory: smithy-rs-release/crates-to-publish @@ -247,7 +242,23 @@ jobs: else publisher publish -y --location . fi + # This step is not idempotent and MUST be performed last, as it will generate a new release in the `smithy-rs` + # repository with the release tag that is always unique and has an increasing numerical suffix. + - name: Tag release + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }} + script: | + const createReleaseScript = require("./smithy-rs/.github/workflows/release-scripts/create-release.js"); + await createReleaseScript({ + github, + isDryRun: ${{ inputs.dry_run }}, + releaseManifestPath: "smithy-rs-release/smithy-rs-release-manifest.json", + releaseCommitish: "${{ steps.push-changelog.outputs.commit_sha }}" + }); + # If this step fails for any reason, there's no need to retry the release workflow, as this step is auxiliary + # and the release itself was successful. Instead, manually trigger `backport-pull-request.yml`. open-backport-pull-request: name: Open backport pull request to merge the release branch back to main needs: diff --git a/tools/ci-build/changelogger/Cargo.lock b/tools/ci-build/changelogger/Cargo.lock index a4ede11d28..c3075ab9bf 100644 --- a/tools/ci-build/changelogger/Cargo.lock +++ b/tools/ci-build/changelogger/Cargo.lock @@ -129,7 +129,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "changelogger" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "clap", diff --git a/tools/ci-build/changelogger/Cargo.toml b/tools/ci-build/changelogger/Cargo.toml index 5a5221a9c7..c8ff06f56c 100644 --- a/tools/ci-build/changelogger/Cargo.toml +++ b/tools/ci-build/changelogger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "changelogger" -version = "0.2.0" +version = "0.3.0" authors = ["AWS Rust SDK Team "] description = "A CLI tool render and update changelogs from changelog files" edition = "2021" diff --git a/tools/ci-build/changelogger/src/main.rs b/tools/ci-build/changelogger/src/main.rs index 664a487725..ed6ef19b75 100644 --- a/tools/ci-build/changelogger/src/main.rs +++ b/tools/ci-build/changelogger/src/main.rs @@ -89,6 +89,7 @@ mod tests { previous_release_versions_manifest: None, date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: None, }) }, Args::try_parse_from([ @@ -124,6 +125,7 @@ mod tests { previous_release_versions_manifest: None, date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -140,6 +142,8 @@ mod tests { "fromplace", "--changelog-output", "some-changelog", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); @@ -159,6 +163,7 @@ mod tests { )), date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -174,7 +179,9 @@ mod tests { "--changelog-output", "some-changelog", "--previous-release-versions-manifest", - "path/to/versions.toml" + "path/to/versions.toml", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); @@ -196,6 +203,7 @@ mod tests { )), date_override: None, smithy_rs_location: None, + aws_sdk_rust_location: Some(PathBuf::from("aws-sdk-rust-location")), }) }, Args::try_parse_from([ @@ -213,7 +221,9 @@ mod tests { "--current-release-versions-manifest", "path/to/current/versions.toml", "--previous-release-versions-manifest", - "path/to/previous/versions.toml" + "path/to/previous/versions.toml", + "--aws-sdk-rust-location", + "aws-sdk-rust-location", ]) .unwrap() ); diff --git a/tools/ci-build/changelogger/src/render.rs b/tools/ci-build/changelogger/src/render.rs index 40b0e14942..20fa1c3656 100644 --- a/tools/ci-build/changelogger/src/render.rs +++ b/tools/ci-build/changelogger/src/render.rs @@ -14,6 +14,7 @@ use smithy_rs_tool_common::changelog::{ ValidationSet, }; use smithy_rs_tool_common::git::{find_git_repository_root, Git, GitCLI}; +use smithy_rs_tool_common::release_tag::ReleaseTag; use smithy_rs_tool_common::versions_manifest::{CrateVersionMetadataMap, VersionsManifest}; use std::env; use std::fmt::Write; @@ -80,6 +81,9 @@ pub struct RenderArgs { // working directory will be used to attempt to find it. #[clap(long, action)] pub smithy_rs_location: Option, + // Location of the aws-sdk-rust repository, used exclusively to retrieve existing release tags. + #[clap(long, required_if_eq("change-set", "aws-sdk"))] + pub aws_sdk_rust_location: Option, // For testing only #[clap(skip)] @@ -97,18 +101,76 @@ pub fn subcommand_render(args: &RenderArgs) -> Result<()> { .unwrap_or(current_dir.as_path()), ) .context("failed to find smithy-rs repo root")?; - let smithy_rs = GitCLI::new(&repo_root)?; + let current_tag = { + let cli_for_tag = if let Some(aws_sdk_rust_repo_root) = &args.aws_sdk_rust_location { + GitCLI::new( + &find_git_repository_root("aws-sdk-rust", aws_sdk_rust_repo_root) + .context("failed to find aws-sdk-rust repo root")?, + )? + } else { + GitCLI::new(&repo_root)? + }; + cli_for_tag.get_current_tag()? + }; + let next_release_tag = next_tag(now, ¤t_tag); + + let smithy_rs = GitCLI::new(&repo_root)?; if args.independent_versioning { - let smithy_rs_metadata = - date_based_release_metadata(now, "smithy-rs-release-manifest.json"); - let sdk_metadata = date_based_release_metadata(now, "aws-sdk-rust-release-manifest.json"); + let smithy_rs_metadata = date_based_release_metadata( + now, + next_release_tag.clone(), + "smithy-rs-release-manifest.json", + ); + let sdk_metadata = date_based_release_metadata( + now, + next_release_tag, + "aws-sdk-rust-release-manifest.json", + ); update_changelogs(args, &smithy_rs, &smithy_rs_metadata, &sdk_metadata) } else { bail!("the --independent-versioning flag must be set; synchronized versioning no longer supported"); } } +// Generate a unique date-based release tag +// +// This function generates a date-based release tag and compares it to `current_tag`. +// If the generated tag is a substring of `current_tag`, it indicates that a release has already occurred on that day. +// In this case, the function ensures uniqueness by appending a numerical suffix to `current_tag`. +fn next_tag(now: OffsetDateTime, current_tag: &ReleaseTag) -> String { + let date_based_release_tag = format!( + "release-{year}-{month:02}-{day:02}", + year = now.date().year(), + month = u8::from(now.date().month()), + day = now.date().day() + ); + + let current_tag = current_tag.as_str(); + if current_tag.starts_with(&date_based_release_tag) { + bump_release_tag_suffix(current_tag) + } else { + date_based_release_tag + } +} + +// Bump `current_tag` by adding or incrementing a numerical suffix +// +// This is a private function that is only called by `next_tag`. +// It assumes that `current_tag` follows the format `release-YYYY-MM-DD`. +fn bump_release_tag_suffix(current_tag: &str) -> String { + if let Some(pos) = current_tag.rfind('.') { + let prefix = ¤t_tag[..pos]; + let suffix = ¤t_tag[pos + 1..]; + let suffix = suffix + .parse::() + .expect("should parse numerical suffix"); + format!("{}.{}", prefix, suffix + 1) + } else { + format!("{}.{}", current_tag, 2) + } +} + struct ReleaseMetadata { title: String, tag: String, @@ -126,16 +188,12 @@ struct ReleaseManifest { fn date_based_release_metadata( now: OffsetDateTime, + tag: String, manifest_name: impl Into, ) -> ReleaseMetadata { ReleaseMetadata { title: date_title(&now), - tag: format!( - "release-{year}-{month:02}-{day:02}", - year = now.date().year(), - month = u8::from(now.date().month()), - day = now.date().day() - ), + tag, manifest_name: manifest_name.into(), } } @@ -506,14 +564,19 @@ pub(crate) fn render( #[cfg(test)] mod test { - use super::{date_based_release_metadata, render, Changelog, ChangelogEntries, ChangelogEntry}; + use super::{ + bump_release_tag_suffix, date_based_release_metadata, next_tag, render, Changelog, + ChangelogEntries, ChangelogEntry, + }; use smithy_rs_tool_common::changelog::ChangelogLoader; + use smithy_rs_tool_common::release_tag::ReleaseTag; use smithy_rs_tool_common::{ changelog::SdkAffected, package::PackageCategory, versions_manifest::{CrateVersion, CrateVersionMetadataMap}, }; use std::fs; + use std::str::FromStr; use tempfile::TempDir; use time::OffsetDateTime; @@ -662,7 +725,8 @@ message = "Some API change" #[test] fn test_date_based_release_metadata() { let now = OffsetDateTime::from_unix_timestamp(100_000_000).unwrap(); - let result = date_based_release_metadata(now, "some-manifest.json"); + let result = + date_based_release_metadata(now, "release-1973-03-03".to_owned(), "some-manifest.json"); assert_eq!("March 3rd, 1973", result.title); assert_eq!("release-1973-03-03", result.tag); assert_eq!("some-manifest.json", result.manifest_name); @@ -817,4 +881,40 @@ message = "Some new API to do X" .trim_start(); pretty_assertions::assert_str_eq!(release_notes, expected_body); } + + #[test] + fn test_bump_release_tag_suffix() { + for (expected, input) in &[ + ("release-2024-07-18.2", "release-2024-07-18"), + ("release-2024-07-18.3", "release-2024-07-18.2"), + ( + "release-2024-07-18.4294967295", // u32::MAX + "release-2024-07-18.4294967294", + ), + ] { + assert_eq!(*expected, &bump_release_tag_suffix(*input)); + } + } + + #[test] + fn test_next_tag() { + // `now` falls on 2024-10-14 + let now = OffsetDateTime::from_unix_timestamp(1_728_938_598).unwrap(); + assert_eq!( + "release-2024-10-14", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-13").unwrap()), + ); + assert_eq!( + "release-2024-10-14.2", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14").unwrap()), + ); + assert_eq!( + "release-2024-10-14.3", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14.2").unwrap()), + ); + assert_eq!( + "release-2024-10-14.10", + &next_tag(now, &ReleaseTag::from_str("release-2024-10-14.9").unwrap()), + ); + } } diff --git a/tools/ci-build/changelogger/tests/e2e_test.rs b/tools/ci-build/changelogger/tests/e2e_test.rs index ced5bd851d..2ec84b635a 100644 --- a/tools/ci-build/changelogger/tests/e2e_test.rs +++ b/tools/ci-build/changelogger/tests/e2e_test.rs @@ -13,7 +13,7 @@ use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; use tempfile::TempDir; -use time::OffsetDateTime; +use time::{Duration, OffsetDateTime}; const SOURCE_MARKDOWN1: &str = r#"--- applies_to: ["aws-sdk-rust"] @@ -136,6 +136,18 @@ fn create_fake_repo_root( .unwrap(); release_commits.push(git.get_head_revision().unwrap()); } + + handle_failure( + "git-tag", + &Command::new("git") + .arg("tag") + .arg("release-1970-01-01") + .current_dir(path) + .output() + .unwrap(), + ) + .unwrap(); + (release_commits.remove(0), release_commits.remove(0)) } @@ -280,6 +292,7 @@ fn render_smithy_rs() { current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -309,7 +322,7 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", + "tagName": "release-1970-01-01.2", "name": "January 1st, 1970", "body": "**New this release:**\n- (all, [smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234), @another-dev) Another change\n\n**Contributors**\nThank you for your contributions! ❤\n- @another-dev ([smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234))\n\n", "prerelease": false @@ -383,10 +396,11 @@ fn render_aws_sdk() { changelog_output: dest_path.clone(), source_to_truncate: Some(dot_changelog_path.clone()), release_manifest_output: Some(tmp_dir.path().into()), - date_override: Some(OffsetDateTime::UNIX_EPOCH), + date_override: Some(OffsetDateTime::UNIX_EPOCH + Duration::days(1)), current_release_versions_manifest: None, previous_release_versions_manifest: Some(previous_versions_manifest_path), smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -402,7 +416,7 @@ fn render_aws_sdk() { // the other should be filtered out by the `since_commit` attribute pretty_assertions::assert_str_eq!( r#" -January 1st, 1970 +January 2nd, 1970 ================= **New this release:** - :bug: ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567), @test-dev) Some other change @@ -424,8 +438,8 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", - "name": "January 1st, 1970", + "tagName": "release-1970-01-02", + "name": "January 2nd, 1970", "body": "**New this release:**\n- :bug: ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567), @test-dev) Some other change\n\n**Service Features:**\n- `aws-sdk-ec2` (0.12.0): Some API change\n\n**Contributors**\nThank you for your contributions! ❤\n- @test-dev ([aws-sdk-rust#234](https://github.com/awslabs/aws-sdk-rust/issues/234), [smithy-rs#567](https://github.com/smithy-lang/smithy-rs/issues/567))\n\n", "prerelease": false }"#, @@ -480,6 +494,7 @@ Change from server current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -556,6 +571,7 @@ Change from client current_release_versions_manifest: None, previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -622,6 +638,7 @@ fn render_crate_versions() { current_release_versions_manifest: Some(current_versions_manifest_path), previous_release_versions_manifest: None, smithy_rs_location: Some(tmp_dir.path().into()), + aws_sdk_rust_location: None, }) .unwrap(); @@ -662,7 +679,7 @@ Old entry contents ); pretty_assertions::assert_str_eq!( r#"{ - "tagName": "release-1970-01-01", + "tagName": "release-1970-01-01.2", "name": "January 1st, 1970", "body": "**New this release:**\n- (all, [smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234), @another-dev) Another change\n\n**Contributors**\nThank you for your contributions! ❤\n- @another-dev ([smithy-rs#1234](https://github.com/smithy-lang/smithy-rs/issues/1234))\n\n**Crate Versions**\n
\nClick to expand to view crate versions...\n\n|Crate|Version|\n|-|-|\n|aws-config|0.54.1|\n|aws-sdk-accessanalyzer|0.24.0|\n|aws-smithy-async|0.54.1|\n
\n\n", "prerelease": false diff --git a/tools/ci-build/sdk-versioner/Cargo.lock b/tools/ci-build/sdk-versioner/Cargo.lock index 45d72fb58b..8d5cc0e293 100644 --- a/tools/ci-build/sdk-versioner/Cargo.lock +++ b/tools/ci-build/sdk-versioner/Cargo.lock @@ -942,6 +942,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "slab" version = "0.4.9" @@ -965,6 +978,7 @@ dependencies = [ "semver", "serde", "serde_json", + "serde_yaml", "thiserror", "toml 0.5.11", "tracing", @@ -1253,6 +1267,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "url" version = "2.5.0" diff --git a/tools/ci-build/smithy-rs-tool-common/src/git.rs b/tools/ci-build/smithy-rs-tool-common/src/git.rs index da57a95f5a..bee033b199 100644 --- a/tools/ci-build/smithy-rs-tool-common/src/git.rs +++ b/tools/ci-build/smithy-rs-tool-common/src/git.rs @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +use crate::release_tag::ReleaseTag; use crate::shell::{handle_failure, output_text}; use anyhow::{bail, Context, Result}; use std::borrow::Cow; @@ -10,6 +11,7 @@ use std::ffi::OsStr; use std::fmt::{self, Write}; use std::path::{Path, PathBuf}; use std::process::Command; +use std::str::FromStr; use tracing::debug; use tracing::warn; @@ -134,6 +136,9 @@ pub trait Git: Send + Sync { /// Returns list of changed files. fn changed_files(&self) -> Result>; + + /// Finds the most recent tag that is reachable from `HEAD`. + fn get_current_tag(&self) -> Result; } enum CommitInfo { @@ -397,6 +402,19 @@ impl Git for GitCLI { let (stdout, _) = output_text(&output); Ok(split_file_names(&stdout)) } + + fn get_current_tag(&self) -> Result { + let mut command = Command::new(&self.binary_name); + command.arg("describe"); + command.arg("--tags"); + command.arg("--abbrev=0"); + command.current_dir(&self.repo_path); + + let output = command.output()?; + handle_failure("get_current_tag", &output)?; + let (stdout, _) = output_text(&output); + ReleaseTag::from_str(stdout.trim()) + } } fn is_newline(c: char) -> bool { diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs b/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs deleted file mode 100644 index 4bf88a666e..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/get_current_tag.rs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, output_text, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct GetCurrentTag { - program: &'static str, - path: PathBuf, -} - -impl GetCurrentTag { - pub fn new(path: impl Into) -> GetCurrentTag { - GetCurrentTag { - program: "git", - path: path.into(), - } - } -} - -impl ShellOperation for GetCurrentTag { - type Output = String; - - fn run(&self) -> Result { - let mut command = Command::new(self.program); - command.arg("describe"); - command.arg("--tags"); - command.current_dir(&self.path); - - let output = command.output()?; - handle_failure("get current tag", &output)?; - let (stdout, _) = output_text(&output); - Ok(stdout.trim().into()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn get_current_tag_success() { - let tag = GetCurrentTag { - program: "./git_describe_tags", - path: "./fake_git".into(), - } - .run() - .unwrap(); - assert_eq!("some-tag", tag); - } - - #[cfg(feature = "async")] - #[tokio::test] - async fn get_current_tag_success_async() { - let tag = GetCurrentTag { - program: "./git_describe_tags", - path: "./fake_git".into(), - } - .spawn() - .await - .unwrap(); - assert_eq!("some-tag", tag); - } - - #[test] - fn get_current_tag_failure() { - let result = GetCurrentTag { - program: "./git_fails", - path: "./fake_git".into(), - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to get current tag:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -} diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs b/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs deleted file mode 100644 index 4a1fa26f62..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/get_last_commit.rs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, output_text, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct GetLastCommit { - program: &'static str, - repo_path: PathBuf, -} - -impl GetLastCommit { - pub fn new(repo_path: impl Into) -> GetLastCommit { - GetLastCommit { - program: "git", - repo_path: repo_path.into(), - } - } -} - -impl ShellOperation for GetLastCommit { - type Output = String; - - fn run(&self) -> Result { - let mut command = Command::new(self.program); - command.arg("rev-parse"); - command.arg("HEAD"); - command.current_dir(&self.repo_path); - - let output = command.output()?; - handle_failure("get last commit", &output)?; - let (stdout, _) = output_text(&output); - Ok(stdout.trim().into()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn get_last_commit_success() { - let last_commit = GetLastCommit { - program: "./git_revparse_head", - repo_path: "./fake_git".into(), - } - .run() - .unwrap(); - assert_eq!("commithash", last_commit); - } - - #[test] - fn get_last_commit_failure() { - let result = GetLastCommit { - program: "./git_fails", - repo_path: "./fake_git".into(), - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to get last commit:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -} diff --git a/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs b/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs deleted file mode 100644 index d5009258ef..0000000000 --- a/tools/ci-build/smithy-rs-tool-common/src/git/reset.rs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use crate::shell::{handle_failure, ShellOperation}; -use anyhow::Result; -use std::path::PathBuf; -use std::process::Command; - -pub struct Reset { - program: &'static str, - path: PathBuf, - args: Vec, -} - -impl Reset { - pub fn new(path: impl Into, args: &[&str]) -> Self { - Reset { - program: "git", - path: path.into(), - args: args.iter().map(|&s| s.to_string()).collect(), - } - } -} - -impl ShellOperation for Reset { - type Output = (); - - fn run(&self) -> Result<()> { - let mut command = Command::new(self.program); - command.arg("reset"); - for arg in &self.args { - command.arg(arg); - } - command.current_dir(&self.path); - - let output = command.output()?; - handle_failure("git reset", &output)?; - Ok(()) - } -} - -#[cfg(all(test, not(target_os = "windows")))] -mod tests { - use super::*; - - #[test] - fn reset_success() { - Reset { - program: "./git_reset", - path: "./fake_git".into(), - args: vec!["--hard".to_string(), "some-commit-hash".to_string()], - } - .run() - .unwrap(); - } - - #[test] - fn reset_failure() { - let result = Reset { - program: "./git_fails", - path: "./fake_git".into(), - args: vec!["--hard".to_string(), "some-commit-hash".to_string()], - } - .run(); - - assert!(result.is_err(), "expected error, got {:?}", result); - assert_eq!( - "Failed to git reset:\n\ - Status: 1\n\ - Stdout: some stdout failure message\n\n\ - Stderr: some stderr failure message\n\n", - format!("{}", result.err().unwrap()) - ); - } -} From 4b66264db149592fab8b517556ef2ed53cfd1155 Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Fri, 18 Oct 2024 14:28:27 -0500 Subject: [PATCH 4/5] Send `x-amzn-query-mode` to inform a service with the `awsQueryCompatible` trait that SDK is operating in that mode (#3883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation and Context If a client SDK is generated from a service model that has the [`awsQueryCompatible`](https://smithy.io/2.0/aws/protocols/aws-query-protocol.html#aws-protocols-awsquerycompatible-trait) trait, the SDK now sends `x-amzn-query-mode` in the request header for the service. ## Description The change in the PR itself is pretty simple, as said in the title. It's more important to understand why we are making these changes. The rest of the description will focus on the reason driving this change. The `awsQueryCompatible` trait, added by a service, is specifically for deserializing errors. It allows for deserializing errors in a backward compatible manner when the service migrates away from the AWS Query protocol. With [the awsQueryError trait](https://smithy.io/2.0/aws/protocols/aws-query-protocol.html#aws-protocols-awsqueryerror-trait), the AWS Query supports customizing error codes that is not supported in any other AWS protocol, e.g. ``` @awsQueryError( code: "AWS.SimpleQueueService.NonExistentQueue", httpResponseCode: 400 ) @error("client") structure QueueDoesNotExistException { message: String } ``` In short, the `awsQueryCompatible` trait makes it possible to continue using the custom error codes even when the service drops support for the AWS Query protocol and switches to other protocols such as `awsJson1_0` and `rpcv2Cbor` (see [example snippet](https://smithy.io/2.0/aws/protocols/aws-query-protocol.html#aws-protocols-awsquerycompatible-trait) in the Smithy documentation) The changes in this PR would be unnecessary if a service had originally supported only `@awsQuery` and had _atomically_ updated its Smithy model to replace `@awsQuery` with `@awsQueryCompatible` and `@awsJson1_0` in lockstep. However, that's not always the case in practice. Consider a service whose Smithy model supports two protocols: `@awsQuery` and `@awsJson1_0`. While the Rust SDK maintains [an ordered map of protocols](https://github.com/smithy-lang/smithy-rs/blob/de4bc4547df15e2472b9bca91c89f963ffad0b03/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/ClientProtocolLoader.kt#L38-L47) to determine which one to use, it’s possible for two groups of client SDKs to be generated over time, depending on which protocol was added first to the service: 1. Client SDKs that understand the `awsQuery` protocol (this group can interpret custom error codes sent in responses from the service) 2. Client SDKs that understand the `awsJson1_0` protocol (this group does not interpret custom error codes) Now, imagine if the service updated its Smithy model to remove `@awsQuery` and add `@awsQueryCompatible` (likely it would add the `awsQueryError` trait to an error structure somewhere as well). The supported protocols would then be `@awsJson1_0` and `@awsQueryCompatible`. Group 1 remains unaffected, as they can continue deserializing responses with custom error codes. However, group 2 would now be broken, as they would begin receiving custom error codes in responses due to the `awsQueryCompatible` trait. To prevent the issue for group 2 above, the `x-amzn-query-mode` header in this PR informs the service that it should only send back custom error codes if the client SDK is built with the `awsQueryCompatible` trait. With this update, client SDKs built only with the `awsJson1_0` will remain unaffected, as they do not send the `x-amzn-query-mode` header to the service and, therefore, will not receive custom error codes in response. ## Testing - Added a Kotlin test to check for the `x-amzn-query-mode` header - Added `x-amzn-query-mode` as a required header to a protocol test for the `awsQueryCompatible` ## Checklist - [x] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .changelog/1729271936.md | 12 ++ .../protocols/AwsQueryCompatibleTest.kt | 185 ++++++++++-------- .../aws-json-query-compat.smithy | 6 +- .../smithy/protocols/AwsQueryCompatible.kt | 5 +- 4 files changed, 119 insertions(+), 89 deletions(-) create mode 100644 .changelog/1729271936.md diff --git a/.changelog/1729271936.md b/.changelog/1729271936.md new file mode 100644 index 0000000000..485a426db4 --- /dev/null +++ b/.changelog/1729271936.md @@ -0,0 +1,12 @@ +--- +applies_to: +- aws-sdk-rust +authors: +- ysaito1001 +references: +- smithy-rs#3883 +breaking: false +new_feature: false +bug_fix: false +--- +Client SDKs built with the `awsQueryCompatible` trait now include the `x-amzn-query-mode` header. This header signals the service that the clients are operating in compatible mode. diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt index dcb322b447..7de72b7d8f 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt @@ -6,25 +6,29 @@ package software.amazon.smithy.rust.codegen.client.smithy.protocols import org.junit.jupiter.api.Test -import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.rust.codegen.client.testutil.clientIntegrationTest import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel -import software.amazon.smithy.rust.codegen.core.util.lookup +import software.amazon.smithy.rust.codegen.core.testutil.testModule +import software.amazon.smithy.rust.codegen.core.testutil.tokioTest +import software.amazon.smithy.rust.codegen.core.util.letIf class AwsQueryCompatibleTest { - @Test - fun `aws-query-compatible json with aws query error should allow for retrieving error code and type from custom header`() { - val model = - """ + companion object { + const val prologue = """ namespace test use aws.protocols#awsJson1_0 use aws.protocols#awsQueryCompatible use aws.protocols#awsQueryError + """ - @awsQueryCompatible - @awsJson1_0 + const val awsjson10Trait = "@awsJson1_0" + const val awsQueryCompatibleTrait = "@awsQueryCompatible" + + fun testService(withAwsQueryError: Boolean = true) = + """ service TestService { version: "2023-02-20", operations: [SomeOperation] @@ -40,28 +44,37 @@ class AwsQueryCompatibleTest { a: String, b: Integer } - - @awsQueryError( - code: "InvalidThing", - httpResponseCode: 400, - ) - @error("client") - structure InvalidThingException { - message: String + """.letIf(withAwsQueryError) { + it + + """ + @awsQueryError( + code: "InvalidThing", + httpResponseCode: 400, + ) + """ + }.let { + it + + """ + @error("client") + structure InvalidThingException { + message: String + } + """ } - """.asSmithyModel() + } + @Test + fun `aws-query-compatible json with aws query error should allow for retrieving error code and type from custom header`() { + val model = + (prologue + awsQueryCompatibleTrait + awsjson10Trait + testService()).asSmithyModel( + smithyVersion = "2", + ) clientIntegrationTest(model) { context, rustCrate -> - val operation: OperationShape = context.model.lookup("test#SomeOperation") - rustCrate.withModule(context.symbolProvider.moduleForShape(operation)) { - rustTemplate( - """ - ##[cfg(test)] - ##[#{tokio}::test] - async fn should_parse_code_and_type_fields() { - use aws_smithy_types::body::SdkBody; - - let response = |_: http::Request| { + rustCrate.testModule { + tokioTest("should_parse_code_and_type_fields") { + rustTemplate( + """ + let response = |_: http::Request<#{SdkBody}>| { http::Response::builder() .header( "x-amzn-query-error", @@ -69,7 +82,7 @@ class AwsQueryCompatibleTest { ) .status(400) .body( - SdkBody::from( + #{SdkBody}::from( r##"{ "__type": "com.amazonaws.sqs##QueueDoesNotExist", "message": "Some user-visible message" @@ -86,17 +99,18 @@ class AwsQueryCompatibleTest { ); let error = dbg!(client.some_operation().send().await).err().unwrap().into_service_error(); assert_eq!( - Some("AWS.SimpleQueueService.NonExistentQueue"), + #{Some}("AWS.SimpleQueueService.NonExistentQueue"), error.meta().code(), ); - assert_eq!(Some("Sender"), error.meta().extra("type")); - } - """, - "infallible_client_fn" to - CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) - .toType().resolve("client::http::test_util::infallible_client_fn"), - "tokio" to CargoDependency.Tokio.toType(), - ) + assert_eq!(#{Some}("Sender"), error.meta().extra("type")); + """, + *RuntimeType.preludeScope, + "SdkBody" to RuntimeType.sdkBody(context.runtimeConfig), + "infallible_client_fn" to + CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) + .toType().resolve("client::http::test_util::infallible_client_fn"), + ) + } } } } @@ -104,50 +118,19 @@ class AwsQueryCompatibleTest { @Test fun `aws-query-compatible json without aws query error should allow for retrieving error code from payload`() { val model = - """ - namespace test - use aws.protocols#awsJson1_0 - use aws.protocols#awsQueryCompatible - - @awsQueryCompatible - @awsJson1_0 - service TestService { - version: "2023-02-20", - operations: [SomeOperation] - } - - operation SomeOperation { - input: SomeOperationInputOutput, - output: SomeOperationInputOutput, - errors: [InvalidThingException], - } - - structure SomeOperationInputOutput { - a: String, - b: Integer - } - - @error("client") - structure InvalidThingException { - message: String - } - """.asSmithyModel() - + (prologue + awsQueryCompatibleTrait + awsjson10Trait + testService(withAwsQueryError = false)).asSmithyModel( + smithyVersion = "2", + ) clientIntegrationTest(model) { context, rustCrate -> - val operation: OperationShape = context.model.lookup("test#SomeOperation") - rustCrate.withModule(context.symbolProvider.moduleForShape(operation)) { - rustTemplate( - """ - ##[cfg(test)] - ##[#{tokio}::test] - async fn should_parse_code_from_payload() { - use aws_smithy_types::body::SdkBody; - - let response = |_: http::Request| { + rustCrate.testModule { + tokioTest("should_parse_code_from_payload") { + rustTemplate( + """ + let response = |_: http::Request<#{SdkBody}>| { http::Response::builder() .status(400) .body( - SdkBody::from( + #{SdkBody}::from( r##"{ "__type": "com.amazonaws.sqs##QueueDoesNotExist", "message": "Some user-visible message" @@ -163,15 +146,45 @@ class AwsQueryCompatibleTest { .build() ); let error = dbg!(client.some_operation().send().await).err().unwrap().into_service_error(); - assert_eq!(Some("QueueDoesNotExist"), error.meta().code()); - assert_eq!(None, error.meta().extra("type")); - } - """, - "infallible_client_fn" to - CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) - .toType().resolve("client::http::test_util::infallible_client_fn"), - "tokio" to CargoDependency.Tokio.toType(), - ) + assert_eq!(#{Some}("QueueDoesNotExist"), error.meta().code()); + assert_eq!(#{None}, error.meta().extra("type")); + """, + *RuntimeType.preludeScope, + "SdkBody" to RuntimeType.sdkBody(context.runtimeConfig), + "infallible_client_fn" to + CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) + .toType().resolve("client::http::test_util::infallible_client_fn"), + ) + } + } + } + } + + @Test + fun `request header should include x-amzn-query-mode when the service has the awsQueryCompatible trait`() { + val model = + (prologue + awsQueryCompatibleTrait + awsjson10Trait + testService()).asSmithyModel( + smithyVersion = "2", + ) + clientIntegrationTest(model) { context, rustCrate -> + rustCrate.testModule { + tokioTest("test_request_header_should_include_x_amzn_query_mode") { + rustTemplate( + """ + let (http_client, rx) = #{capture_request}(#{None}); + let config = crate::Config::builder() + .http_client(http_client) + .endpoint_url("http://localhost:1234/SomeOperation") + .build(); + let client = crate::Client::from_conf(config); + let _ = dbg!(client.some_operation().send().await); + let request = rx.expect_request(); + assert_eq!("true", request.headers().get("x-amzn-query-mode").unwrap()); + """, + *RuntimeType.preludeScope, + "capture_request" to RuntimeType.captureRequest(context.runtimeConfig), + ) + } } } } diff --git a/codegen-core/common-test-models/aws-json-query-compat.smithy b/codegen-core/common-test-models/aws-json-query-compat.smithy index b3e1cf0375..49cf71934d 100644 --- a/codegen-core/common-test-models/aws-json-query-compat.smithy +++ b/codegen-core/common-test-models/aws-json-query-compat.smithy @@ -24,8 +24,10 @@ service QueryCompatService { params: { message: "hello!" }, - headers: { "x-amz-target": "QueryCompatService.Operation"} - + headers: { + "x-amz-target": "QueryCompatService.Operation", + "x-amzn-query-mode": "true", + } } ]) operation Operation { diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt index 4cc4a2fa14..79c962a001 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt @@ -97,5 +97,8 @@ class AwsQueryCompatible( awsJson.parseEventStreamErrorMetadata(operationShape) override fun additionalRequestHeaders(operationShape: OperationShape): List> = - listOf("x-amz-target" to "${codegenContext.serviceShape.id.name}.${operationShape.id.name}") + listOf( + "x-amz-target" to "${codegenContext.serviceShape.id.name}.${operationShape.id.name}", + "x-amzn-query-mode" to "true", + ) } From 42751e5dbf4d51c06c085e4193bf013a7333a6f5 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Mon, 21 Oct 2024 09:47:11 -0400 Subject: [PATCH 5/5] fix default credential chain not respecting endpoint URL overrides (#3873) ## Motivation and Context https://github.com/awslabs/aws-sdk-rust/issues/1193 ## Description This PR fixes a customer reported bug where the default chain doesn't respect `AWS_ENDPOINT_URL`/`AWS_ENDPOINT_URL_` environment variables or the equivalents in AWS shared config (`~/.aws/config`). This fix is a little nuanced and frankly gross but there isn't a better option that I can see right now that isn't way more invasive. The crux of the issue is that when we implemented support for this feature ([1](https://github.com/smithy-lang/smithy-rs/pull/3568), [2](https://github.com/smithy-lang/smithy-rs/pull/3493), [3](https://github.com/smithy-lang/smithy-rs/pull/3488)) we really only made it work for clients created via [`ConfigLoader::load()`](https://github.com/smithy-lang/smithy-rs/blob/release-2024-10-09/aws/rust-runtime/aws-config/src/lib.rs#L871). Internally the default chain credential provider constructs `STS` and `SSO` clients but it does so using [`ProviderConfig`](https://github.com/smithy-lang/smithy-rs/blob/release-2024-10-09/aws/rust-runtime/aws-config/src/provider_config.rs#L36) by mapping this to `SdkConfig` via [`ProviderConfig::client_config()`](https://github.com/smithy-lang/smithy-rs/blob/release-2024-10-09/aws/rust-runtime/aws-config/src/provider_config.rs#L199). This conversion is used in several places and it doesn't take any of the required logic into account to setup [`EnvServiceConfig`](https://github.com/smithy-lang/smithy-rs/blob/release-2024-10-09/aws/rust-runtime/aws-config/src/lib.rs#L859-L862) which is what generated SDK's ultimately use to figure out the endpoint URL from either environment/profile ([example client](https://github.com/awslabs/aws-sdk-rust/blob/release-2024-10-09/sdk/sts/src/config.rs#L1214-L1221) which ultimately ends up in `EnvServiceConfig` [here](https://github.com/smithy-lang/smithy-rs/blob/release-2024-10-09/aws/rust-runtime/aws-config/src/env_service_config.rs#L18)). The fix applied here is nuanced in that we update the conversion to provide a `EnvServiceConfig` but it relies on the profile to have been parsed already or else you'll get an empty/default profile. This generally works for the profile provider since the first thing we do is load the profile but in isolation it may not work as expected. I've added tests for STS to cover all cases but SSO credentials and token providers do NOT currently respect shared config endpoint URL keys. Fixing this is possible but involved since we require an `async` context to ensure a profile is loaded already and in many places where we construct `SdkConfig` from `ProviderConfig` we are in non async function. ## Testing Tested repro + additional integration tests ## Future This does _not_ fix https://github.com/awslabs/aws-sdk-rust/issues/1194 which was discovered as a bug/gap. Fixing it would be outside the scope of this PR. SSO/token provider is instantiated sometimes before we have parsed a profile. This PR definitely fixes the STS provider for all configuration scenarios but the SSO related client usage may still have some edge cases when configured via profiles since we often instantiate them before parsing a profile. When we surveyed other SDKs there were several that failed to respect these variables and haven't received issues around this which leads me to believe this isn't likely a problem in practice (most likely due to SSO being used in local development most often where redirecting that endpoint doesn't make much sense anyway). ## Checklist - [X] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --- .changelog/1728582276.md | 12 + aws/rust-runtime/Cargo.lock | 18 +- aws/rust-runtime/aws-config/Cargo.lock | 20 +- aws/rust-runtime/aws-config/Cargo.toml | 2 +- .../aws-config/src/profile/credentials.rs | 16 +- .../aws-config/src/provider_config.rs | 14 ++ .../env.json | 4 + .../fs/home/.aws/config | 7 + .../fs/home/.aws/credentials | 3 + .../http-traffic.json | 107 ++++++++ .../test-case.json | 12 + .../env.json | 3 + .../fs/home/.aws/config | 8 + .../fs/home/.aws/credentials | 3 + .../http-traffic.json | 107 ++++++++ .../test-case.json | 12 + .../env.json | 4 + .../fs/home/.aws/config | 7 + .../fs/home/.aws/credentials | 3 + .../http-traffic.json | 107 ++++++++ .../test-case.json | 12 + .../env.json | 3 + .../fs/home/.aws/config | 12 + .../fs/home/.aws/credentials | 3 + .../http-traffic.json | 107 ++++++++ .../test-case.json | 12 + .../sso_override_global_env_url/env.json | 4 + .../fs/home/.aws/config | 9 + .../fs/home/.aws/credentials | 0 ...6fceca75e456f25e7e99531e2425c6c1de443.json | 10 + .../http-traffic.json | 92 +++++++ .../test-case.json | 12 + aws/sdk/Cargo.lock | 232 +++++++++--------- rust-runtime/Cargo.lock | 110 ++++----- 34 files changed, 892 insertions(+), 195 deletions(-) create mode 100644 .changelog/1728582276.md create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/env.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/config create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/credentials create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/http-traffic.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/test-case.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/env.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/config create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/credentials create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/http-traffic.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/test-case.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/env.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/config create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/credentials create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/http-traffic.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/test-case.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/env.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/config create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/credentials create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/http-traffic.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/test-case.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/env.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/config create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/credentials create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/sso/cache/34c6fceca75e456f25e7e99531e2425c6c1de443.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/http-traffic.json create mode 100644 aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/test-case.json diff --git a/.changelog/1728582276.md b/.changelog/1728582276.md new file mode 100644 index 0000000000..b36731712a --- /dev/null +++ b/.changelog/1728582276.md @@ -0,0 +1,12 @@ +--- +applies_to: +- aws-sdk-rust +authors: +- aajtodd +references: +- aws-sdk-rust#1193 +breaking: false +new_feature: false +bug_fix: true +--- +Fix default credential provider chain not respecting endpoint URL overrides from environment diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 1cd58e0136..02a722c5bf 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -332,7 +332,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.7" +version = "1.2.8" dependencies = [ "base64-simd", "bytes", @@ -1218,9 +1218,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libfuzzer-sys" @@ -1568,9 +1568,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "itoa", "memchr", @@ -2394,9 +2394,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 5a1aa2a578..29f46d6c3b 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -45,7 +45,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.8" +version = "1.5.9" dependencies = [ "aws-credential-types", "aws-runtime", @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.7" +version = "1.2.8" dependencies = [ "base64-simd", "bytes", @@ -861,9 +861,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "lock_api" @@ -1104,9 +1104,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -1349,9 +1349,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "indexmap", "itoa", @@ -1740,9 +1740,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" diff --git a/aws/rust-runtime/aws-config/Cargo.toml b/aws/rust-runtime/aws-config/Cargo.toml index a583475971..d8ed49845a 100644 --- a/aws/rust-runtime/aws-config/Cargo.toml +++ b/aws/rust-runtime/aws-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-config" -version = "1.5.8" +version = "1.5.9" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", diff --git a/aws/rust-runtime/aws-config/src/profile/credentials.rs b/aws/rust-runtime/aws-config/src/profile/credentials.rs index f4247531bd..3e61d2abca 100644 --- a/aws/rust-runtime/aws-config/src/profile/credentials.rs +++ b/aws/rust-runtime/aws-config/src/profile/credentials.rs @@ -33,7 +33,6 @@ use aws_credential_types::{ Credentials, }; use aws_smithy_types::error::display::DisplayErrorContext; -use aws_types::SdkConfig; use std::borrow::Cow; use std::collections::HashMap; use std::error::Error; @@ -142,7 +141,6 @@ pub struct ProfileFileCredentialsProvider { #[derive(Debug)] struct Config { factory: exec::named::NamedProviderFactory, - sdk_config: SdkConfig, provider_config: ProviderConfig, } @@ -493,7 +491,6 @@ impl Builder { ProfileFileCredentialsProvider { config: Arc::new(Config { factory, - sdk_config: conf.client_config(), provider_config: conf, }), inner_provider: ErrorTakingOnceCell::new(), @@ -542,9 +539,13 @@ impl ChainProvider { return Err(CredentialsError::provider_error(e)); } }; + + // we want to create `SdkConfig` _after_ we have resolved the profile or else + // we won't get things like `service_config()` set appropriately. + let sdk_config = config.provider_config.client_config(); for provider in chain.chain().iter() { let next_creds = provider - .credentials(creds, &config.sdk_config) + .credentials(creds, &sdk_config) .instrument(tracing::debug_span!("load_assume_role", provider = ?provider)) .await; match next_creds { @@ -609,7 +610,14 @@ mod test { #[cfg(feature = "sso")] make_test!(sso_credentials); #[cfg(feature = "sso")] + make_test!(sso_override_global_env_url); + #[cfg(feature = "sso")] make_test!(sso_token); + + make_test!(assume_role_override_global_env_url); + make_test!(assume_role_override_service_env_url); + make_test!(assume_role_override_global_profile_url); + make_test!(assume_role_override_service_profile_url); } #[cfg(all(test, feature = "sso"))] diff --git a/aws/rust-runtime/aws-config/src/provider_config.rs b/aws/rust-runtime/aws-config/src/provider_config.rs index 569af53fcb..bf86ae12ec 100644 --- a/aws/rust-runtime/aws-config/src/provider_config.rs +++ b/aws/rust-runtime/aws-config/src/provider_config.rs @@ -5,6 +5,7 @@ //! Configuration Options for Credential Providers +use crate::env_service_config::EnvServiceConfig; use crate::profile; #[allow(deprecated)] use crate::profile::profile_file::ProfileFiles; @@ -196,13 +197,26 @@ impl ProviderConfig { Self::without_region().load_default_region().await } + /// Attempt to get a representation of `SdkConfig` from this `ProviderConfig`. + /// + /// + /// **WARN**: Some options (e.g. `service_config`) can only be set if the profile has been + /// parsed already (e.g. by calling [`ProviderConfig::profile()`]). This is an + /// imperfect mapping and should be used sparingly. pub(crate) fn client_config(&self) -> SdkConfig { + let profiles = self.parsed_profile.get().and_then(|v| v.as_ref().ok()); + let service_config = EnvServiceConfig { + env: self.env(), + env_config_sections: profiles.cloned().unwrap_or_default(), + }; + let mut builder = SdkConfig::builder() .retry_config(RetryConfig::standard()) .region(self.region()) .time_source(self.time_source()) .use_fips(self.use_fips().unwrap_or_default()) .use_dual_stack(self.use_dual_stack().unwrap_or_default()) + .service_config(service_config) .behavior_version(crate::BehaviorVersion::latest()); builder.set_http_client(self.http_client.clone()); builder.set_sleep_impl(self.sleep_impl.clone()); diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/env.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/env.json new file mode 100644 index 0000000000..806fe9c81c --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/env.json @@ -0,0 +1,4 @@ +{ + "HOME": "/home", + "AWS_ENDPOINT_URL": "http://aws.global-env-override" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/config b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/config new file mode 100644 index 0000000000..a7e5ed5815 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/config @@ -0,0 +1,7 @@ +[default] +region = us-east-1 +role_arn = arn:aws:iam::123456789:role/integration-test +source_profile = base + +[profile base] +region = us-east-1 diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/credentials b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/credentials new file mode 100644 index 0000000000..1cab6a6ca2 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/fs/home/.aws/credentials @@ -0,0 +1,3 @@ +[base] +aws_access_key_id = AKIAFAKE +aws_secret_access_key = FAKE diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/http-traffic.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/http-traffic.json new file mode 100644 index 0000000000..b567876d56 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/http-traffic.json @@ -0,0 +1,107 @@ +{ + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "http://aws.global-env-override", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "authorization": [ + "AWS4-HMAC-SHA256 Credential=AKIAFAKE/20210810/us-east-1/sts/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-user-agent, Signature=cd5cb2aa1d20717ca17692bcbda711797ae9eb8bb1130690b021b3952b7ae56e" + ], + "user-agent": [ + "aws-sdk-rust/0.1.0 os/macos lang/rust/1.55.0-nightly" + ], + "content-length": [ + "146" + ], + "x-amz-date": [ + "20210810T003833Z" + ], + "host": [ + "aws.global-env-override" + ], + "x-amz-user-agent": [ + "aws-sdk-rust/0.1.0 api/sts/0.0.14-alpha os/macos lang/rust/1.55.0-nightly" + ] + }, + "method": "POST" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "Action=AssumeRole&Version=2011-06-15&RoleArn=arn%3Aaws%3Aiam%3A%3A123456789%3Arole%2Fintegration-test&RoleSessionName=assume-role-provider-session" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "version": "HTTP/1.1", + "headers": { + "date": [ + "Thu, 05 Aug 2021 18:58:02 GMT" + ], + "content-length": [ + "1491" + ], + "content-type": [ + "text/xml" + ], + "x-amzn-requestid": [ + "c2e971c2-702d-4124-9b1f-1670febbea18" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "\n \n \n AROARABCDEFGHIJKLMNOP:assume-role-provider-session\n arn:aws:sts::123456789012:assumed-role/integration-test/assume-role-provider-session\n \n \n ASIARTESTID\n TESTSECRETKEY\n TESTSESSIONTOKEN\n 2021-08-05T19:58:02Z\n \n \n \n c2e971c2-702d-4124-9b1f-1670febbea18\n \n\n" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ], + "docs": "standard request / response with STS", + "version": "V0" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/test-case.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/test-case.json new file mode 100644 index 0000000000..9436c463e5 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_env_url/test-case.json @@ -0,0 +1,12 @@ +{ + "name": "assume-role-override-global-env-url", + "docs": "override AWS_ENDPOINT_URL via environment", + "result": { + "Ok": { + "access_key_id": "ASIARTESTID", + "secret_access_key": "TESTSECRETKEY", + "session_token": "TESTSESSIONTOKEN", + "expiry": 1628193482 + } + } +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/env.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/env.json new file mode 100644 index 0000000000..55fcfbeb05 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/env.json @@ -0,0 +1,3 @@ +{ + "HOME": "/home" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/config b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/config new file mode 100644 index 0000000000..a00d07b3b5 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/config @@ -0,0 +1,8 @@ +[default] +region = us-east-1 +role_arn = arn:aws:iam::123456789:role/integration-test +source_profile = base +endpoint_url = http://aws.global-profile-override + +[profile base] +region = us-east-1 diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/credentials b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/credentials new file mode 100644 index 0000000000..1cab6a6ca2 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/fs/home/.aws/credentials @@ -0,0 +1,3 @@ +[base] +aws_access_key_id = AKIAFAKE +aws_secret_access_key = FAKE diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/http-traffic.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/http-traffic.json new file mode 100644 index 0000000000..44fe3946c1 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/http-traffic.json @@ -0,0 +1,107 @@ +{ + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "http://aws.global-profile-override", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "authorization": [ + "AWS4-HMAC-SHA256 Credential=AKIAFAKE/20210810/us-east-1/sts/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-user-agent, Signature=cd5cb2aa1d20717ca17692bcbda711797ae9eb8bb1130690b021b3952b7ae56e" + ], + "user-agent": [ + "aws-sdk-rust/0.1.0 os/macos lang/rust/1.55.0-nightly" + ], + "content-length": [ + "146" + ], + "x-amz-date": [ + "20210810T003833Z" + ], + "host": [ + "aws.global-profile-override" + ], + "x-amz-user-agent": [ + "aws-sdk-rust/0.1.0 api/sts/0.0.14-alpha os/macos lang/rust/1.55.0-nightly" + ] + }, + "method": "POST" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "Action=AssumeRole&Version=2011-06-15&RoleArn=arn%3Aaws%3Aiam%3A%3A123456789%3Arole%2Fintegration-test&RoleSessionName=assume-role-provider-session" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "version": "HTTP/1.1", + "headers": { + "date": [ + "Thu, 05 Aug 2021 18:58:02 GMT" + ], + "content-length": [ + "1491" + ], + "content-type": [ + "text/xml" + ], + "x-amzn-requestid": [ + "c2e971c2-702d-4124-9b1f-1670febbea18" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "\n \n \n AROARABCDEFGHIJKLMNOP:assume-role-provider-session\n arn:aws:sts::123456789012:assumed-role/integration-test/assume-role-provider-session\n \n \n ASIARTESTID\n TESTSECRETKEY\n TESTSESSIONTOKEN\n 2021-08-05T19:58:02Z\n \n \n \n c2e971c2-702d-4124-9b1f-1670febbea18\n \n\n" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ], + "docs": "standard request / response with STS", + "version": "V0" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/test-case.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/test-case.json new file mode 100644 index 0000000000..613cbd0e11 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_global_profile_url/test-case.json @@ -0,0 +1,12 @@ +{ + "name": "assume-role-override-global-profile-url", + "docs": "override endpoint_url via profile", + "result": { + "Ok": { + "access_key_id": "ASIARTESTID", + "secret_access_key": "TESTSECRETKEY", + "session_token": "TESTSESSIONTOKEN", + "expiry": 1628193482 + } + } +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/env.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/env.json new file mode 100644 index 0000000000..dfb5bc9648 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/env.json @@ -0,0 +1,4 @@ +{ + "HOME": "/home", + "AWS_ENDPOINT_URL_STS": "http://aws.sts-env-override" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/config b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/config new file mode 100644 index 0000000000..a7e5ed5815 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/config @@ -0,0 +1,7 @@ +[default] +region = us-east-1 +role_arn = arn:aws:iam::123456789:role/integration-test +source_profile = base + +[profile base] +region = us-east-1 diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/credentials b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/credentials new file mode 100644 index 0000000000..1cab6a6ca2 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/fs/home/.aws/credentials @@ -0,0 +1,3 @@ +[base] +aws_access_key_id = AKIAFAKE +aws_secret_access_key = FAKE diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/http-traffic.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/http-traffic.json new file mode 100644 index 0000000000..1bb9861932 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/http-traffic.json @@ -0,0 +1,107 @@ +{ + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "http://aws.sts-env-override", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "authorization": [ + "AWS4-HMAC-SHA256 Credential=AKIAFAKE/20210810/us-east-1/sts/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-user-agent, Signature=cd5cb2aa1d20717ca17692bcbda711797ae9eb8bb1130690b021b3952b7ae56e" + ], + "user-agent": [ + "aws-sdk-rust/0.1.0 os/macos lang/rust/1.55.0-nightly" + ], + "content-length": [ + "146" + ], + "x-amz-date": [ + "20210810T003833Z" + ], + "host": [ + "aws.sts-env-override" + ], + "x-amz-user-agent": [ + "aws-sdk-rust/0.1.0 api/sts/0.0.14-alpha os/macos lang/rust/1.55.0-nightly" + ] + }, + "method": "POST" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "Action=AssumeRole&Version=2011-06-15&RoleArn=arn%3Aaws%3Aiam%3A%3A123456789%3Arole%2Fintegration-test&RoleSessionName=assume-role-provider-session" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "version": "HTTP/1.1", + "headers": { + "date": [ + "Thu, 05 Aug 2021 18:58:02 GMT" + ], + "content-length": [ + "1491" + ], + "content-type": [ + "text/xml" + ], + "x-amzn-requestid": [ + "c2e971c2-702d-4124-9b1f-1670febbea18" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "\n \n \n AROARABCDEFGHIJKLMNOP:assume-role-provider-session\n arn:aws:sts::123456789012:assumed-role/integration-test/assume-role-provider-session\n \n \n ASIARTESTID\n TESTSECRETKEY\n TESTSESSIONTOKEN\n 2021-08-05T19:58:02Z\n \n \n \n c2e971c2-702d-4124-9b1f-1670febbea18\n \n\n" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ], + "docs": "standard request / response with STS", + "version": "V0" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/test-case.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/test-case.json new file mode 100644 index 0000000000..93a3f234c0 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_env_url/test-case.json @@ -0,0 +1,12 @@ +{ + "name": "assume-role-override-service-env-url", + "docs": "override AWS_ENDPOINT_URL_STS via environment", + "result": { + "Ok": { + "access_key_id": "ASIARTESTID", + "secret_access_key": "TESTSECRETKEY", + "session_token": "TESTSESSIONTOKEN", + "expiry": 1628193482 + } + } +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/env.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/env.json new file mode 100644 index 0000000000..55fcfbeb05 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/env.json @@ -0,0 +1,3 @@ +{ + "HOME": "/home" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/config b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/config new file mode 100644 index 0000000000..8b102c3b81 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/config @@ -0,0 +1,12 @@ +[default] +region = us-east-1 +role_arn = arn:aws:iam::123456789:role/integration-test +source_profile = base +services = test-urls + +[services test-urls] +sts = + endpoint_url = http://aws.service-profile-override + +[profile base] +region = us-east-1 diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/credentials b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/credentials new file mode 100644 index 0000000000..1cab6a6ca2 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/fs/home/.aws/credentials @@ -0,0 +1,3 @@ +[base] +aws_access_key_id = AKIAFAKE +aws_secret_access_key = FAKE diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/http-traffic.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/http-traffic.json new file mode 100644 index 0000000000..3c813a1a29 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/http-traffic.json @@ -0,0 +1,107 @@ +{ + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "http://aws.service-profile-override", + "headers": { + "content-type": [ + "application/x-www-form-urlencoded" + ], + "authorization": [ + "AWS4-HMAC-SHA256 Credential=AKIAFAKE/20210810/us-east-1/sts/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-user-agent, Signature=cd5cb2aa1d20717ca17692bcbda711797ae9eb8bb1130690b021b3952b7ae56e" + ], + "user-agent": [ + "aws-sdk-rust/0.1.0 os/macos lang/rust/1.55.0-nightly" + ], + "content-length": [ + "146" + ], + "x-amz-date": [ + "20210810T003833Z" + ], + "host": [ + "http://aws.service-profile-override" + ], + "x-amz-user-agent": [ + "aws-sdk-rust/0.1.0 api/sts/0.0.14-alpha os/macos lang/rust/1.55.0-nightly" + ] + }, + "method": "POST" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "Action=AssumeRole&Version=2011-06-15&RoleArn=arn%3Aaws%3Aiam%3A%3A123456789%3Arole%2Fintegration-test&RoleSessionName=assume-role-provider-session" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "version": "HTTP/1.1", + "headers": { + "date": [ + "Thu, 05 Aug 2021 18:58:02 GMT" + ], + "content-length": [ + "1491" + ], + "content-type": [ + "text/xml" + ], + "x-amzn-requestid": [ + "c2e971c2-702d-4124-9b1f-1670febbea18" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "\n \n \n AROARABCDEFGHIJKLMNOP:assume-role-provider-session\n arn:aws:sts::123456789012:assumed-role/integration-test/assume-role-provider-session\n \n \n ASIARTESTID\n TESTSECRETKEY\n TESTSESSIONTOKEN\n 2021-08-05T19:58:02Z\n \n \n \n c2e971c2-702d-4124-9b1f-1670febbea18\n \n\n" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ], + "docs": "standard request / response with STS", + "version": "V0" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/test-case.json b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/test-case.json new file mode 100644 index 0000000000..f157b15efb --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/assume_role_override_service_profile_url/test-case.json @@ -0,0 +1,12 @@ +{ + "name": "assume-role-override-service-profile-url", + "docs": "override endpoint_url via services section", + "result": { + "Ok": { + "access_key_id": "ASIARTESTID", + "secret_access_key": "TESTSECRETKEY", + "session_token": "TESTSESSIONTOKEN", + "expiry": 1628193482 + } + } +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/env.json b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/env.json new file mode 100644 index 0000000000..806fe9c81c --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/env.json @@ -0,0 +1,4 @@ +{ + "HOME": "/home", + "AWS_ENDPOINT_URL": "http://aws.global-env-override" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/config b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/config new file mode 100644 index 0000000000..91939db925 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/config @@ -0,0 +1,9 @@ +[profile default] +sso_session = dev +sso_account_id = 012345678901 +sso_role_name = SampleRole +region = us-east-1 + +[sso-session dev] +sso_region = us-east-1 +sso_start_url = https://d-abc123.awsapps.com/start diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/credentials b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/credentials new file mode 100644 index 0000000000..e69de29bb2 diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/sso/cache/34c6fceca75e456f25e7e99531e2425c6c1de443.json b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/sso/cache/34c6fceca75e456f25e7e99531e2425c6c1de443.json new file mode 100644 index 0000000000..06853e98f9 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/fs/home/.aws/sso/cache/34c6fceca75e456f25e7e99531e2425c6c1de443.json @@ -0,0 +1,10 @@ +{ + "accessToken": "secret-access-token", + "expiresAt": "2199-11-14T04:05:45Z", + "refreshToken": "secret-refresh-token", + "clientId": "ABCDEFG323242423121312312312312312", + "clientSecret": "ABCDE123", + "registrationExpiresAt": "2199-03-06T19:53:17Z", + "region": "us-east-1", + "startUrl": "https://d-abc123.awsapps.com/start" +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/http-traffic.json b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/http-traffic.json new file mode 100644 index 0000000000..ae5f568852 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/http-traffic.json @@ -0,0 +1,92 @@ +{ + "docs": "test case using sso credentials", + "version": "V0", + "events": [ + { + "connection_id": 0, + "action": { + "Request": { + "request": { + "uri": "http://aws.global-env-override/federation/credentials?role_name=SampleRole&account_id=012345678901", + "headers": { + "x-amz-sso_bearer_token": [ + "secret-access-token" + ], + "host": [ + "aws.global-env-override" + ] + }, + "method": "GET" + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "" + }, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Request" + } + } + }, + { + "connection_id": 0, + "action": { + "Response": { + "response": { + "Ok": { + "status": 200, + "version": "HTTP/1.1", + "headers": { + "date": [ + "Thu, 05 Aug 2021 18:58:02 GMT" + ], + "content-length": [ + "1491" + ], + "content-type": [ + "text/xml" + ], + "x-amzn-requestid": [ + "c2e971c2-702d-4124-9b1f-1670febbea18" + ] + } + } + } + } + } + }, + { + "connection_id": 0, + "action": { + "Data": { + "data": { + "Utf8": "{\"roleCredentials\":{\"accessKeyId\":\"ASIARTESTID\",\"secretAccessKey\":\"TESTSECRETKEY\",\"sessionToken\":\"TESTSESSIONTOKEN\",\"expiration\": 1651516560000}}" + }, + "direction": "Response" + } + } + }, + { + "connection_id": 0, + "action": { + "Eof": { + "ok": true, + "direction": "Response" + } + } + } + ] +} diff --git a/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/test-case.json b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/test-case.json new file mode 100644 index 0000000000..0837eef8d0 --- /dev/null +++ b/aws/rust-runtime/aws-config/test-data/profile-provider/sso_override_global_env_url/test-case.json @@ -0,0 +1,12 @@ +{ + "name": "sso_override_global_env_url", + "docs": "sso_credentials loads SSO credentials with global endpoint URL override from environment", + "result": { + "Ok": { + "access_key_id": "ASIARTESTID", + "secret_access_key": "TESTSECRETKEY", + "session_token": "TESTSESSIONTOKEN", + "expiry": 1651516560 + } + } +} diff --git a/aws/sdk/Cargo.lock b/aws/sdk/Cargo.lock index 4898abb11b..7f10b770f7 100644 --- a/aws/sdk/Cargo.lock +++ b/aws/sdk/Cargo.lock @@ -329,7 +329,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.8" +version = "1.5.9" dependencies = [ "aws-credential-types 1.2.1", "aws-runtime 1.4.3", @@ -341,7 +341,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "fastrand 2.0.2", @@ -368,7 +368,7 @@ dependencies = [ "async-trait", "aws-smithy-async 1.2.1", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "tokio", "zeroize", ] @@ -381,7 +381,7 @@ checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "zeroize", ] @@ -449,14 +449,14 @@ version = "1.4.3" dependencies = [ "arbitrary", "aws-credential-types 1.2.1", - "aws-sigv4 1.2.4", + "aws-sigv4 1.2.5", "aws-smithy-async 1.2.1", "aws-smithy-eventstream 0.60.5", "aws-smithy-http 0.60.11", "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "bytes-utils", @@ -488,13 +488,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a10d5c055aa540164d9561a0e2e74ad30f0dcf7393c3a92f6733ddf9c5762468" dependencies = [ "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-sigv4 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-sigv4 1.2.4", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "aws-types 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", "fastrand 2.0.2", @@ -524,7 +524,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "http 0.2.12", @@ -547,7 +547,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "fastrand 2.0.2", @@ -573,7 +573,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "http 0.2.12", @@ -597,7 +597,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "criterion", @@ -626,7 +626,7 @@ dependencies = [ "aws-smithy-query", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "fastrand 2.0.2", @@ -652,7 +652,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "fastrand 2.0.2", @@ -670,14 +670,14 @@ dependencies = [ "aws-config", "aws-credential-types 1.2.1", "aws-runtime 1.4.3", - "aws-sigv4 1.2.4", + "aws-sigv4 1.2.5", "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-util", @@ -708,7 +708,7 @@ dependencies = [ "aws-smithy-query", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "futures-util", @@ -734,7 +734,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-util", @@ -761,7 +761,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-util", @@ -781,14 +781,14 @@ dependencies = [ "aws-config", "aws-credential-types 1.2.1", "aws-runtime 1.4.3", - "aws-sigv4 1.2.4", + "aws-sigv4 1.2.5", "aws-smithy-async 1.2.1", "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-util", @@ -816,7 +816,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-util", @@ -841,7 +841,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "http 0.2.12", @@ -861,9 +861,9 @@ dependencies = [ "aws-config", "aws-credential-types 1.2.1", "aws-runtime 1.4.3", - "aws-sigv4 1.2.4", + "aws-sigv4 1.2.5", "aws-smithy-async 1.2.1", - "aws-smithy-checksums 0.60.12", + "aws-smithy-checksums 0.60.13", "aws-smithy-eventstream 0.60.5", "aws-smithy-experimental", "aws-smithy-http 0.60.11", @@ -871,7 +871,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "bytes", @@ -904,22 +904,22 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash", "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-runtime 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-sigv4 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-sigv4 1.2.4", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-checksums 0.60.12 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-checksums 0.60.12", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", "aws-types 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bytes", @@ -950,7 +950,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "fastrand 2.0.2", @@ -977,7 +977,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "http 0.2.12", @@ -998,7 +998,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "http 0.2.12", @@ -1021,7 +1021,7 @@ dependencies = [ "aws-smithy-query", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "aws-types 1.3.3", "futures-util", @@ -1047,7 +1047,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "fastrand 2.0.2", @@ -1073,7 +1073,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "fastrand 2.0.2", @@ -1092,7 +1092,7 @@ dependencies = [ "aws-config", "aws-credential-types 1.2.1", "aws-runtime 1.4.3", - "aws-sigv4 1.2.4", + "aws-sigv4 1.2.5", "aws-smithy-async 1.2.1", "aws-smithy-eventstream 0.60.5", "aws-smithy-http 0.60.11", @@ -1100,7 +1100,7 @@ dependencies = [ "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-types 1.3.3", "bytes", "futures-core", @@ -1123,32 +1123,25 @@ version = "0.60.3" [[package]] name = "aws-sigv4" version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8db6904450bafe7473c6ca9123f88cc11089e41a025408f992db4e22d3be68" dependencies = [ - "aws-credential-types 1.2.1", - "aws-smithy-eventstream 0.60.5", - "aws-smithy-http 0.60.11", - "aws-smithy-runtime-api 1.7.2", + "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7", "bytes", - "criterion", "crypto-bigint 0.5.5", "form_urlencoded", "hex", - "hex-literal", "hmac", "http 0.2.12", "http 1.1.0", - "httparse", - "libfuzzer-sys", "once_cell", "p256", "percent-encoding", - "pretty_assertions", - "proptest", "ring", - "serde", - "serde_derive", - "serde_json", "sha2", "subtle", "time", @@ -1158,26 +1151,33 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8db6904450bafe7473c6ca9123f88cc11089e41a025408f992db4e22d3be68" +version = "1.2.5" dependencies = [ - "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-credential-types 1.2.1", + "aws-smithy-eventstream 0.60.5", + "aws-smithy-http 0.60.11", + "aws-smithy-runtime-api 1.7.2", + "aws-smithy-types 1.2.8", "bytes", + "criterion", "crypto-bigint 0.5.5", "form_urlencoded", "hex", + "hex-literal", "hmac", "http 0.2.12", "http 1.1.0", + "httparse", + "libfuzzer-sys", "once_cell", "p256", "percent-encoding", + "pretty_assertions", + "proptest", "ring", + "serde", + "serde_derive", + "serde_json", "sha2", "subtle", "time", @@ -1211,7 +1211,7 @@ dependencies = [ name = "aws-smithy-cbor" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "criterion", "minicbor", ] @@ -1219,11 +1219,12 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" version = "0.60.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" dependencies = [ - "aws-smithy-http 0.60.11", + "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.7", "bytes", - "bytes-utils", "crc32c", "crc32fast", "hex", @@ -1231,23 +1232,19 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", - "pretty_assertions", "sha1", "sha2", - "tokio", "tracing", - "tracing-test", ] [[package]] name = "aws-smithy-checksums" -version = "0.60.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" +version = "0.60.13" dependencies = [ - "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-http 0.60.11", + "aws-smithy-types 1.2.8", "bytes", + "bytes-utils", "crc32c", "crc32fast", "hex", @@ -1255,9 +1252,12 @@ dependencies = [ "http-body 0.4.6", "md-5", "pin-project-lite", + "pretty_assertions", "sha1", "sha2", + "tokio", "tracing", + "tracing-test", ] [[package]] @@ -1269,7 +1269,7 @@ name = "aws-smithy-compression" version = "0.0.2" dependencies = [ "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "flate2", @@ -1290,7 +1290,7 @@ name = "aws-smithy-eventstream" version = "0.60.5" dependencies = [ "arbitrary", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "crc32fast", @@ -1303,7 +1303,7 @@ version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef7d0a272725f87e51ba2bf89f8c21e4df61b9e49ae1ac367a6d69916ef7c90" dependencies = [ - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "crc32fast", ] @@ -1315,7 +1315,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "h2 0.4.6", "http 1.1.0", "hyper 1.5.0", @@ -1323,7 +1323,7 @@ dependencies = [ "hyper-util", "once_cell", "pin-project-lite", - "rustls 0.23.14", + "rustls 0.23.15", "tokio", "tower", "tracing", @@ -1336,7 +1336,7 @@ dependencies = [ "async-stream", "aws-smithy-eventstream 0.60.5", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "futures-core", @@ -1361,7 +1361,7 @@ checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" dependencies = [ "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "bytes-utils", "futures-core", @@ -1386,7 +1386,7 @@ version = "0.60.3" name = "aws-smithy-json" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "proptest", "serde_json", ] @@ -1397,16 +1397,16 @@ version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", ] [[package]] name = "aws-smithy-mocks-experimental" version = "0.2.1" dependencies = [ - "aws-sdk-s3 1.56.0", + "aws-sdk-s3 1.57.0", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "tokio", ] @@ -1450,7 +1450,7 @@ dependencies = [ name = "aws-smithy-query" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "urlencoding", ] @@ -1464,7 +1464,7 @@ dependencies = [ "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-protocol-test 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "fastrand 2.0.2", "h2 0.3.26", @@ -1495,7 +1495,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "fastrand 2.0.2", "futures-util", @@ -1526,7 +1526,7 @@ name = "aws-smithy-runtime-api" version = "1.7.2" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "http 0.2.12", "http 1.1.0", @@ -1544,7 +1544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96" dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "http 0.2.12", "http 1.1.0", @@ -1557,60 +1557,60 @@ dependencies = [ [[package]] name = "aws-smithy-types" version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" dependencies = [ - "base64 0.13.1", "base64-simd", "bytes", "bytes-utils", - "ciborium", - "criterion", "futures-core", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", - "hyper 0.14.31", "itoa", - "lazy_static", "num-integer", "pin-project-lite", "pin-utils", - "proptest", - "rand", "ryu", "serde", - "serde_json", - "tempfile", "time", "tokio", - "tokio-stream", "tokio-util", ] [[package]] name = "aws-smithy-types" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +version = "1.2.8" dependencies = [ + "base64 0.13.1", "base64-simd", "bytes", "bytes-utils", + "ciborium", + "criterion", "futures-core", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", + "hyper 0.14.31", "itoa", + "lazy_static", "num-integer", "pin-project-lite", "pin-utils", + "proptest", + "rand", "ryu", "serde", + "serde_json", + "tempfile", "time", "tokio", + "tokio-stream", "tokio-util", ] @@ -1619,7 +1619,7 @@ name = "aws-smithy-types-convert" version = "0.60.8" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "chrono", "futures-core", "time", @@ -1631,7 +1631,7 @@ version = "0.1.3" dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "http 1.1.0", "tracing", @@ -1665,7 +1665,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "http 0.2.12", "hyper-rustls 0.24.2", "rustc_version", @@ -1684,7 +1684,7 @@ dependencies = [ "aws-credential-types 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "rustc_version", "tracing", ] @@ -2781,7 +2781,7 @@ dependencies = [ "http 1.1.0", "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -2925,9 +2925,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libfuzzer-sys" @@ -3385,9 +3385,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -3642,9 +3642,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "once_cell", @@ -3849,9 +3849,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "indexmap", "itoa", @@ -4156,7 +4156,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -4399,9 +4399,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index c84b962516..05473a0a76 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -146,7 +146,7 @@ checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "zeroize", ] @@ -206,7 +206,7 @@ dependencies = [ "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "aws-types", "bytes", "fastrand", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.56.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecd672c8d4265fd4fbecacd4a479180e616881bbe639250cf81ddb604e4c301" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash", "aws-credential-types", @@ -236,7 +236,7 @@ dependencies = [ "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime 1.7.2", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "aws-smithy-xml 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", "aws-types", "bytes", @@ -264,7 +264,7 @@ dependencies = [ "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "crypto-bigint 0.5.5", "form_urlencoded", @@ -309,7 +309,7 @@ dependencies = [ name = "aws-smithy-cbor" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "criterion", "minicbor", ] @@ -321,7 +321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598b1689d001c4d4dc3cb386adb07d37786783aee3ac4b324bcadac116bf3d23" dependencies = [ "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "crc32c", "crc32fast", @@ -340,7 +340,7 @@ name = "aws-smithy-checksums" version = "0.60.13" dependencies = [ "aws-smithy-http 0.60.11", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "crc32c", @@ -367,7 +367,7 @@ name = "aws-smithy-compression" version = "0.0.2" dependencies = [ "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "flate2", @@ -388,7 +388,7 @@ name = "aws-smithy-eventstream" version = "0.60.5" dependencies = [ "arbitrary", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "crc32fast", @@ -401,7 +401,7 @@ version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef7d0a272725f87e51ba2bf89f8c21e4df61b9e49ae1ac367a6d69916ef7c90" dependencies = [ - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "crc32fast", ] @@ -413,7 +413,7 @@ dependencies = [ "aws-smithy-async 1.2.1", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "h2 0.4.6", "http 1.1.0", "hyper 1.5.0", @@ -421,7 +421,7 @@ dependencies = [ "hyper-util", "once_cell", "pin-project-lite", - "rustls 0.23.14", + "rustls 0.23.15", "tokio", "tower", "tracing", @@ -434,7 +434,7 @@ dependencies = [ "async-stream", "aws-smithy-eventstream 0.60.5", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "bytes-utils", "futures-core", @@ -459,7 +459,7 @@ checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" dependencies = [ "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "bytes-utils", "futures-core", @@ -484,7 +484,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.60.7", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "bytes", "futures-util", @@ -514,7 +514,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-http-server", "aws-smithy-json 0.60.7", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "bytes", "futures", @@ -554,7 +554,7 @@ version = "0.60.3" name = "aws-smithy-json" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "proptest", "serde_json", ] @@ -565,7 +565,7 @@ version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", ] [[package]] @@ -574,7 +574,7 @@ version = "0.2.1" dependencies = [ "aws-sdk-s3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "tokio", ] @@ -618,7 +618,7 @@ dependencies = [ name = "aws-smithy-query" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "urlencoding", ] @@ -632,7 +632,7 @@ dependencies = [ "aws-smithy-http 0.60.11 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-protocol-test 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "fastrand", "h2 0.3.26", @@ -663,7 +663,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-protocol-test 0.63.0", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "fastrand", "futures-util", @@ -694,7 +694,7 @@ name = "aws-smithy-runtime-api" version = "1.7.2" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "http 0.2.12", "http 1.1.0", @@ -712,7 +712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96" dependencies = [ "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "bytes", "http 0.2.12", "http 1.1.0", @@ -725,60 +725,60 @@ dependencies = [ [[package]] name = "aws-smithy-types" version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" dependencies = [ - "base64 0.13.1", "base64-simd", "bytes", "bytes-utils", - "ciborium", - "criterion", "futures-core", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", - "hyper 0.14.31", "itoa", - "lazy_static", "num-integer", "pin-project-lite", "pin-utils", - "proptest", - "rand", "ryu", "serde", - "serde_json", - "tempfile", "time", "tokio", - "tokio-stream", "tokio-util", ] [[package]] name = "aws-smithy-types" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +version = "1.2.8" dependencies = [ + "base64 0.13.1", "base64-simd", "bytes", "bytes-utils", + "ciborium", + "criterion", "futures-core", "http 0.2.12", "http 1.1.0", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", + "hyper 0.14.31", "itoa", + "lazy_static", "num-integer", "pin-project-lite", "pin-utils", + "proptest", + "rand", "ryu", "serde", + "serde_json", + "tempfile", "time", "tokio", + "tokio-stream", "tokio-util", ] @@ -787,7 +787,7 @@ name = "aws-smithy-types-convert" version = "0.60.8" dependencies = [ "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "chrono", "futures-core", "time", @@ -799,7 +799,7 @@ version = "0.1.3" dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "bytes", "http 1.1.0", "tracing", @@ -834,7 +834,7 @@ dependencies = [ "aws-credential-types", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-runtime-api 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.7", "rustc_version", "tracing", ] @@ -1921,7 +1921,7 @@ dependencies = [ "http 1.1.0", "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -1995,7 +1995,7 @@ dependencies = [ "aws-smithy-json 0.60.7", "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.2", - "aws-smithy-types 1.2.7", + "aws-smithy-types 1.2.8", "aws-smithy-xml 0.60.9", "bytes", "fastrand", @@ -2146,9 +2146,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libloading" @@ -2598,9 +2598,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -2967,9 +2967,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "once_cell", @@ -3174,9 +3174,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "indexmap 2.6.0", "itoa", @@ -3534,7 +3534,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -3820,9 +3820,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand",