diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 5841caf232..0eaa3e5a74 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -138,7 +138,7 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.5.1" +version = "1.5.2" dependencies = [ "arbitrary", "aws-credential-types", @@ -220,7 +220,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.2" +version = "1.2.3" dependencies = [ "futures-util", "pin-project-lite", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.5" +version = "1.7.6" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -332,7 +332,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.10" +version = "1.2.11" dependencies = [ "base64-simd", "bytes", diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index f31a921e10..2723f5bc73 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -89,7 +89,7 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.5.1" +version = "1.5.0" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.2" +version = "1.2.1" dependencies = [ "futures-util", "pin-project-lite", diff --git a/aws/rust-runtime/aws-runtime/Cargo.toml b/aws/rust-runtime/aws-runtime/Cargo.toml index a9117d34f9..f9ac90dcf8 100644 --- a/aws/rust-runtime/aws-runtime/Cargo.toml +++ b/aws/rust-runtime/aws-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-runtime" -version = "1.5.1" +version = "1.5.2" authors = ["AWS Rust SDK Team "] description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly." edition = "2021" diff --git a/aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs b/aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs index be10fe7be4..c667bc7645 100644 --- a/aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs +++ b/aws/rust-runtime/aws-runtime/src/user_agent/metrics.rs @@ -127,7 +127,16 @@ iterable_enum!( AccountIdModeDisabled, AccountIdModeRequired, Sigv4aSigning, - ResolvedAccountId + ResolvedAccountId, + FlexibleChecksumsReqCrc32, + FlexibleChecksumsReqCrc32c, + FlexibleChecksumsReqCrc64, + FlexibleChecksumsReqSha1, + FlexibleChecksumsReqSha256, + FlexibleChecksumsReqWhenSupported, + FlexibleChecksumsReqWhenRequired, + FlexibleChecksumsResWhenSupported, + FlexibleChecksumsResWhenRequired ); pub(crate) trait ProvideBusinessMetric { @@ -142,6 +151,25 @@ impl ProvideBusinessMetric for SmithySdkFeature { Paginator => Some(BusinessMetric::Paginator), GzipRequestCompression => Some(BusinessMetric::GzipRequestCompression), ProtocolRpcV2Cbor => Some(BusinessMetric::ProtocolRpcV2Cbor), + RetryModeStandard => Some(BusinessMetric::RetryModeStandard), + RetryModeAdaptive => Some(BusinessMetric::RetryModeAdaptive), + FlexibleChecksumsReqCrc32 => Some(BusinessMetric::FlexibleChecksumsReqCrc32), + FlexibleChecksumsReqCrc32c => Some(BusinessMetric::FlexibleChecksumsReqCrc32c), + FlexibleChecksumsReqCrc64 => Some(BusinessMetric::FlexibleChecksumsReqCrc64), + FlexibleChecksumsReqSha1 => Some(BusinessMetric::FlexibleChecksumsReqSha1), + FlexibleChecksumsReqSha256 => Some(BusinessMetric::FlexibleChecksumsReqSha256), + FlexibleChecksumsReqWhenSupported => { + Some(BusinessMetric::FlexibleChecksumsReqWhenSupported) + } + FlexibleChecksumsReqWhenRequired => { + Some(BusinessMetric::FlexibleChecksumsReqWhenRequired) + } + FlexibleChecksumsResWhenSupported => { + Some(BusinessMetric::FlexibleChecksumsResWhenSupported) + } + FlexibleChecksumsResWhenRequired => { + Some(BusinessMetric::FlexibleChecksumsResWhenRequired) + } otherwise => { // This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate // while continuing to use an outdated version of an SDK crate or the `aws-runtime` @@ -260,7 +288,16 @@ mod tests { "ACCOUNT_ID_MODE_DISABLED": "Q", "ACCOUNT_ID_MODE_REQUIRED": "R", "SIGV4A_SIGNING": "S", - "RESOLVED_ACCOUNT_ID": "T" + "RESOLVED_ACCOUNT_ID": "T", + "FLEXIBLE_CHECKSUMS_REQ_CRC32" : "U", + "FLEXIBLE_CHECKSUMS_REQ_CRC32C" : "V", + "FLEXIBLE_CHECKSUMS_REQ_CRC64" : "W", + "FLEXIBLE_CHECKSUMS_REQ_SHA1" : "X", + "FLEXIBLE_CHECKSUMS_REQ_SHA256" : "Y", + "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED" : "Z", + "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED" : "a", + "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED" : "b", + "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED" : "c" } "#; @@ -268,8 +305,9 @@ mod tests { assert_eq!(expected.len(), FEATURE_ID_TO_METRIC_VALUE.len()); for (feature_id, metric_value) in &*FEATURE_ID_TO_METRIC_VALUE { + let expected = expected.get(format!("{feature_id}").as_str()); assert_eq!( - expected.get(format!("{feature_id}").as_str()).unwrap(), + expected.expect(&format!("Expected {feature_id} to have value `{metric_value}` but it was `{expected:?}` instead.")), metric_value, ); } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt index 2794fc0295..da5c2ac7bf 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt @@ -39,6 +39,7 @@ internal fun RuntimeConfig.awsInlineableHttpRequestChecksum() = CargoDependency.smithyHttp(this), CargoDependency.smithyRuntimeApiClient(this), CargoDependency.smithyTypes(this), + CargoDependency.TempFile, ), ) diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/UserAgentDecoratorTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/UserAgentDecoratorTest.kt index dbc30c940f..78c93af19e 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/UserAgentDecoratorTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/UserAgentDecoratorTest.kt @@ -7,6 +7,7 @@ package software.amazon.smithy.rustsdk import org.junit.jupiter.api.Test import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency +import software.amazon.smithy.rust.codegen.core.rustlang.rust 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.smithy.RuntimeType.Companion.preludeScope @@ -176,9 +177,7 @@ class UserAgentDecoratorTest { val moduleName = ctx.moduleUseName() rustTemplate( """ - use $moduleName::config::{ - Region, - }; + use $moduleName::config::Region; use $moduleName::{Client, Config}; let (http_client, rcvr) = #{capture_request}(#{None}); @@ -197,7 +196,126 @@ class UserAgentDecoratorTest { #{assert_ua_contains_metric_values}(user_agent, &["M"]); """, *preludeScope, - "assert_ua_contains_metric_values" to AwsRuntimeType.awsRuntimeTestUtil(rc).resolve("user_agent::test_util::assert_ua_contains_metric_values"), + "assert_ua_contains_metric_values" to + AwsRuntimeType.awsRuntimeTestUtil(rc) + .resolve("user_agent::test_util::assert_ua_contains_metric_values"), + "capture_request" to RuntimeType.captureRequest(rc), + "disable_interceptor" to + RuntimeType.smithyRuntimeApiClient(rc) + .resolve("client::interceptors::disable_interceptor"), + "UserAgentInterceptor" to + AwsRuntimeType.awsRuntime(rc) + .resolve("user_agent::UserAgentInterceptor"), + ) + } + } + } + } + + @Test + fun `it emits business metrics for retry modes`() { + val model = + """ + namespace test + + use aws.auth#sigv4 + use aws.api#service + use aws.protocols#restJson1 + use smithy.rules#endpointRuleSet + + @auth([sigv4]) + @sigv4(name: "dontcare") + @endpointRuleSet({ + "version": "1.0", + "rules": [{ "type": "endpoint", "conditions": [], "endpoint": { "url": "https://example.com" } }], + "parameters": {} + }) + @service(sdkId: "dontcare") + @restJson1 + service TestService { version: "2023-01-01", operations: [SomeOperation] } + + @http(uri: "/SomeOperation", method: "GET") + @optionalAuth + operation SomeOperation { + input: SomeInput, + output: SomeOutput + } + + @input + structure SomeInput {} + + @output + structure SomeOutput {} + """.asSmithyModel() + + awsSdkIntegrationTest(model) { ctx, rustCrate -> + rustCrate.integrationTest("retry_mode_feature_tracker") { + val rc = ctx.runtimeConfig + val moduleName = ctx.moduleUseName() + + rust( + """ + use $moduleName::config::{Region, retry::RetryConfig}; + use $moduleName::{Client, Config}; + """, + ) + + tokioTest("should_emit_metric_in_user_agent_standard_mode") { + rustTemplate( + """ + let (http_client, rcvr) = #{capture_request}(#{None}); + let config = Config::builder() + .region(Region::new("us-east-1")) + .http_client(http_client.clone()) + .retry_config(RetryConfig::standard()) + .with_test_defaults() + .build(); + let client = Client::from_conf(config); + let _ = client.some_operation().send().await; + let expected_req = rcvr.expect_request(); + let user_agent = expected_req + .headers() + .get("x-amz-user-agent") + .unwrap(); + #{assert_ua_contains_metric_values}(user_agent, &["E"]); + """, + *preludeScope, + "assert_ua_contains_metric_values" to + AwsRuntimeType.awsRuntimeTestUtil(rc) + .resolve("user_agent::test_util::assert_ua_contains_metric_values"), + "capture_request" to RuntimeType.captureRequest(rc), + "disable_interceptor" to + RuntimeType.smithyRuntimeApiClient(rc) + .resolve("client::interceptors::disable_interceptor"), + "UserAgentInterceptor" to + AwsRuntimeType.awsRuntime(rc) + .resolve("user_agent::UserAgentInterceptor"), + ) + } + + tokioTest("should_emit_metric_in_user_agent_adaptive_mode") { + rustTemplate( + """ + let (http_client, rcvr) = #{capture_request}(#{None}); + let config = Config::builder() + .region(Region::new("us-east-1")) + .http_client(http_client.clone()) + .retry_config(RetryConfig::adaptive()) + .with_test_defaults() + .build(); + let client = Client::from_conf(config); + let _ = client.some_operation().send().await; + let expected_req = rcvr.expect_request(); + let user_agent = expected_req + .headers() + .get("x-amz-user-agent") + .unwrap(); + #{assert_ua_contains_metric_values}(user_agent, &["F"]); + """, + *preludeScope, + "assert_ua_contains_metric_values" to + AwsRuntimeType.awsRuntimeTestUtil(rc) + .resolve("user_agent::test_util::assert_ua_contains_metric_values"), "capture_request" to RuntimeType.captureRequest(rc), "disable_interceptor" to RuntimeType.smithyRuntimeApiClient(rc) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/RetryModeFeatureTrackerRuntimePluginCustomization.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/RetryModeFeatureTrackerRuntimePluginCustomization.kt new file mode 100644 index 0000000000..db02fba95d --- /dev/null +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/RetryModeFeatureTrackerRuntimePluginCustomization.kt @@ -0,0 +1,38 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.rust.codegen.client.smithy.customizations + +import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext +import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization +import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginSection +import software.amazon.smithy.rust.codegen.core.rustlang.InlineDependency +import software.amazon.smithy.rust.codegen.core.rustlang.Writable +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.rustlang.writable +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType + +class RetryModeFeatureTrackerRuntimePluginCustomization(codegenContext: ClientCodegenContext) : + ServiceRuntimePluginCustomization() { + private val runtimeConfig = codegenContext.runtimeConfig + + override fun section(section: ServiceRuntimePluginSection): Writable = + writable { + when (section) { + is ServiceRuntimePluginSection.RegisterRuntimeComponents -> { + section.registerInterceptor(this) { + rust( + "#T::new()", + RuntimeType.forInlineDependency( + InlineDependency.sdkFeatureTracker(runtimeConfig), + ).resolve("retry_mode::RetryModeFeatureTrackerInterceptor"), + ) + } + } + + else -> emptySection + } + } +} diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/RequiredCustomizations.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/RequiredCustomizations.kt index a16f878002..3c11c75011 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/RequiredCustomizations.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/RequiredCustomizations.kt @@ -19,6 +19,7 @@ import software.amazon.smithy.rust.codegen.client.smithy.customizations.Resilien import software.amazon.smithy.rust.codegen.client.smithy.customizations.RetryClassifierConfigCustomization import software.amazon.smithy.rust.codegen.client.smithy.customizations.RetryClassifierOperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.customizations.RetryClassifierServiceRuntimePluginCustomization +import software.amazon.smithy.rust.codegen.client.smithy.customizations.RetryModeFeatureTrackerRuntimePluginCustomization import software.amazon.smithy.rust.codegen.client.smithy.customizations.TimeSourceCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCustomization import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization @@ -134,5 +135,6 @@ class RequiredCustomizations : ClientCodegenDecorator { ): List = baseCustomizations + ConnectionPoisoningRuntimePluginCustomization(codegenContext) + - RetryClassifierServiceRuntimePluginCustomization(codegenContext) + RetryClassifierServiceRuntimePluginCustomization(codegenContext) + + RetryModeFeatureTrackerRuntimePluginCustomization(codegenContext) } diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index 6a4c1a8870..abcb4268ca 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -182,16 +182,16 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.4.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ac934720fbb46206292d2c75b57e67acfc56fe7dfd34fb9a02334af08409ea" +checksum = "a10d5c055aa540164d9561a0e2e74ad30f0dcf7393c3a92f6733ddf9c5762468" dependencies = [ "aws-credential-types", "aws-sigv4", "aws-smithy-async 1.2.1", "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.4 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.9", "aws-types", @@ -208,9 +208,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.65.0" +version = "1.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3ba2c5c0f2618937ce3d4a5ad574b86775576fa24006bcb3128c6e2cbf3c34e" +checksum = "35fe5e7f71b1cc6274e905d3bcc7daf94099ac2d4cba83447ffb959b5b27b3c1" dependencies = [ "aws-credential-types", "aws-runtime", @@ -219,8 +219,8 @@ dependencies = [ "aws-smithy-checksums 0.60.13 (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-json 0.61.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-json 0.60.7", + "aws-smithy-runtime 1.7.3", "aws-smithy-runtime-api 1.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-types 1.2.9", "aws-smithy-xml 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.6" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3820e0c08d0737872ff3c7c1f21ebbb6693d832312d6152bf18ef50a5471c2" +checksum = "5619742a0d8f253be760bfbb8e8e8368c69e3587e4637af5754e488a611499b1" dependencies = [ "aws-credential-types", "aws-smithy-eventstream 0.60.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -282,7 +282,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.2" +version = "1.2.3" dependencies = [ "futures-util", "pin-project-lite", @@ -295,7 +295,7 @@ dependencies = [ name = "aws-smithy-cbor" version = "0.60.8" dependencies = [ - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "criterion", "minicbor", ] @@ -305,7 +305,7 @@ name = "aws-smithy-checksums" version = "0.60.13" dependencies = [ "aws-smithy-http 0.60.11", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "bytes", "bytes-utils", "crc32c", @@ -353,7 +353,7 @@ name = "aws-smithy-compression" version = "0.0.2" dependencies = [ "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "bytes", "bytes-utils", "flate2", @@ -374,7 +374,7 @@ name = "aws-smithy-eventstream" version = "0.60.5" dependencies = [ "arbitrary", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "bytes", "bytes-utils", "crc32fast", @@ -396,10 +396,10 @@ dependencies = [ name = "aws-smithy-experimental" version = "0.1.5" dependencies = [ - "aws-smithy-async 1.2.2", - "aws-smithy-runtime 1.7.5", + "aws-smithy-async 1.2.3", + "aws-smithy-runtime 1.7.6", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "h2 0.4.7", "http 1.2.0", "hyper 1.5.1", @@ -420,7 +420,7 @@ dependencies = [ "async-stream", "aws-smithy-eventstream 0.60.5", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "bytes", "bytes-utils", "futures-core", @@ -470,7 +470,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-json 0.61.1", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "aws-smithy-xml 0.60.9", "bytes", "futures-util", @@ -500,7 +500,7 @@ dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-http-server", "aws-smithy-json 0.61.1", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "aws-smithy-xml 0.60.9", "bytes", "futures", @@ -538,20 +538,20 @@ version = "0.60.3" [[package]] name = "aws-smithy-json" -version = "0.61.1" +version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ - "aws-smithy-types 1.2.10", - "proptest", - "serde_json", + "aws-smithy-types 1.2.9", ] [[package]] name = "aws-smithy-json" version = "0.61.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4e69cc50921eb913c6b662f8d909131bb3e6ad6cb6090d3a39b66fc5c52095" dependencies = [ - "aws-smithy-types 1.2.9", + "aws-smithy-types 1.2.11", + "proptest", + "serde_json", ] [[package]] @@ -560,7 +560,7 @@ version = "0.2.1" dependencies = [ "aws-sdk-s3", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "tokio", ] @@ -604,26 +604,25 @@ dependencies = [ name = "aws-smithy-query" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "urlencoding", ] [[package]] name = "aws-smithy-runtime" -version = "1.7.4" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be28bd063fa91fd871d131fc8b68d7cd4c5fa0869bea68daca50dcb1cbd76be2" dependencies = [ - "approx", "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.11", - "aws-smithy-protocol-test 0.63.0", - "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "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.3 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.9", "bytes", "fastrand", - "futures-util", "h2 0.3.26", "http 0.2.12", - "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", "httparse", @@ -633,31 +632,30 @@ dependencies = [ "once_cell", "pin-project-lite", "pin-utils", - "pretty_assertions", "rustls 0.21.12", "serde", "serde_json", "tokio", "tracing", "tracing-subscriber", - "tracing-test", ] [[package]] name = "aws-smithy-runtime" -version = "1.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f20685047ca9d6f17b994a07f629c813f08b5bce65523e47124879e60103d45" +version = "1.7.6" dependencies = [ - "aws-smithy-async 1.2.1 (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-protocol-test 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.9", + "approx", + "aws-smithy-async 1.2.3", + "aws-smithy-http 0.60.11", + "aws-smithy-protocol-test 0.63.0", + "aws-smithy-runtime-api 1.7.3", + "aws-smithy-types 1.2.11", "bytes", "fastrand", + "futures-util", "h2 0.3.26", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", "httparse", @@ -667,20 +665,22 @@ dependencies = [ "once_cell", "pin-project-lite", "pin-utils", + "pretty_assertions", "rustls 0.21.12", "serde", "serde_json", "tokio", "tracing", "tracing-subscriber", + "tracing-test", ] [[package]] name = "aws-smithy-runtime-api" version = "1.7.3" dependencies = [ - "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.10", + "aws-smithy-async 1.2.3", + "aws-smithy-types 1.2.11", "bytes", "http 0.2.12", "http 1.2.0", @@ -697,7 +697,7 @@ version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92165296a47a812b267b4f41032ff8069ab7ff783696d217f0994a0d7ab585cd" dependencies = [ - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-async 1.2.1", "aws-smithy-types 1.2.9", "bytes", "http 0.2.12", @@ -736,7 +736,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.10" +version = "1.2.11" dependencies = [ "base64 0.13.1", "base64-simd", @@ -772,8 +772,8 @@ dependencies = [ name = "aws-smithy-types-convert" version = "0.60.8" dependencies = [ - "aws-smithy-async 1.2.1", - "aws-smithy-types 1.2.10", + "aws-smithy-async 1.2.3", + "aws-smithy-types 1.2.11", "chrono", "futures-core", "time", @@ -785,7 +785,7 @@ version = "0.1.3" dependencies = [ "aws-smithy-http 0.60.11", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "bytes", "http 1.2.0", "tracing", @@ -1022,9 +1022,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", @@ -1048,9 +1048,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "num-traits", ] @@ -1110,21 +1110,21 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" dependencies = [ "anstyle", - "clap_lex 0.7.4", + "clap_lex 0.7.3", ] [[package]] @@ -1138,9 +1138,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "cmake" @@ -1228,7 +1228,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.23", + "clap 4.5.22", "criterion-plot", "is-terminal", "itertools 0.10.5", @@ -1921,7 +1921,7 @@ dependencies = [ "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.1", + "tokio-rustls 0.26.0", "tower-service", ] @@ -1989,9 +1989,9 @@ dependencies = [ "aws-smithy-compression", "aws-smithy-http 0.60.11", "aws-smithy-json 0.61.1", - "aws-smithy-runtime 1.7.5", + "aws-smithy-runtime 1.7.6", "aws-smithy-runtime-api 1.7.3", - "aws-smithy-types 1.2.10", + "aws-smithy-types 1.2.11", "aws-smithy-xml 0.60.9", "bytes", "fastrand", @@ -2061,9 +2061,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ "once_cell", "wasm-bindgen", @@ -2143,9 +2143,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libloading" @@ -2932,15 +2932,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -3523,19 +3523,20 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls 0.23.19", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3557,9 +3558,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -3883,9 +3884,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -3894,12 +3895,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", + "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -3908,9 +3910,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3918,9 +3920,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", @@ -3931,15 +3933,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/rust-runtime/aws-smithy-async/Cargo.toml b/rust-runtime/aws-smithy-async/Cargo.toml index 053e8170ea..d7c9037eff 100644 --- a/rust-runtime/aws-smithy-async/Cargo.toml +++ b/rust-runtime/aws-smithy-async/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-async" -version = "1.2.2" +version = "1.2.3" authors = ["AWS Rust SDK Team ", "John DiSanti "] description = "Async runtime agnostic abstractions for smithy-rs." edition = "2021" diff --git a/rust-runtime/aws-smithy-runtime/Cargo.toml b/rust-runtime/aws-smithy-runtime/Cargo.toml index 29a6d2fa2c..71c3610648 100644 --- a/rust-runtime/aws-smithy-runtime/Cargo.toml +++ b/rust-runtime/aws-smithy-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-runtime" -version = "1.7.5" +version = "1.7.6" authors = ["AWS Rust SDK Team ", "Zelda Hessler "] description = "The new smithy runtime crate" edition = "2021" diff --git a/rust-runtime/aws-smithy-runtime/src/client/sdk_feature.rs b/rust-runtime/aws-smithy-runtime/src/client/sdk_feature.rs index 5a8ab95a13..254458dc91 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/sdk_feature.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/sdk_feature.rs @@ -12,6 +12,17 @@ pub enum SmithySdkFeature { Paginator, GzipRequestCompression, ProtocolRpcV2Cbor, + RetryModeStandard, + RetryModeAdaptive, + FlexibleChecksumsReqCrc32, + FlexibleChecksumsReqCrc32c, + FlexibleChecksumsReqCrc64, + FlexibleChecksumsReqSha1, + FlexibleChecksumsReqSha256, + FlexibleChecksumsReqWhenSupported, + FlexibleChecksumsReqWhenRequired, + FlexibleChecksumsResWhenSupported, + FlexibleChecksumsResWhenRequired, } impl Storable for SmithySdkFeature { diff --git a/rust-runtime/aws-smithy-types/Cargo.toml b/rust-runtime/aws-smithy-types/Cargo.toml index e6093486c7..2497213697 100644 --- a/rust-runtime/aws-smithy-types/Cargo.toml +++ b/rust-runtime/aws-smithy-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-types" -version = "1.2.10" +version = "1.2.11" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", diff --git a/rust-runtime/inlineable/src/sdk_feature_tracker.rs b/rust-runtime/inlineable/src/sdk_feature_tracker.rs index 2f36e121df..acc653842b 100644 --- a/rust-runtime/inlineable/src/sdk_feature_tracker.rs +++ b/rust-runtime/inlineable/src/sdk_feature_tracker.rs @@ -172,3 +172,49 @@ pub(crate) mod waiter { } } } + +#[allow(dead_code)] +pub(crate) mod retry_mode { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef; + use aws_smithy_runtime_api::client::interceptors::Intercept; + use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; + use aws_smithy_types::config_bag::ConfigBag; + use aws_smithy_types::retry::{RetryConfig, RetryMode}; + + #[derive(Debug)] + pub(crate) struct RetryModeFeatureTrackerInterceptor; + + impl RetryModeFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for RetryModeFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "RetryModeFeatureTrackerInterceptor" + } + + fn read_before_serialization( + &self, + _context: &BeforeSerializationInterceptorContextRef<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.load::() + .map(|retry_config| match retry_config.mode() { + RetryMode::Standard => SmithySdkFeature::RetryModeStandard, + RetryMode::Adaptive => SmithySdkFeature::RetryModeAdaptive, + _ => unreachable!("retry mode must be standard or adaptive"), + }) + .map(|feature| { + cfg.interceptor_state() + .store_append::(feature) + }); + + Ok(()) + } + } +}