AWS SDK

AWS SDK

rev. daaaaae30b6928be97b33eccac35ffadde7c457d

Files changed:

tmp-codegen-diff/aws-sdk/sdk/route53/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-route53";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/s3/src/config.rs

@@ -1615,1615 +1674,1675 @@
 1635   1635   
    };
 1636   1636   
 1637   1637   
    let scope = "aws-sdk-s3";
 1638   1638   
 1639   1639   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1640   1640   
                        // defaults
 1641   1641   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1642   1642   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1643   1643   
                                .with_retry_partition_name(default_retry_partition)
 1644   1644   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1645  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1645   1646   
                        ))
 1646   1647   
                        // user config
 1647   1648   
                        .with_client_plugin(
 1648   1649   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1649   1650   
                                .with_config(config.config.clone())
 1650   1651   
                                .with_runtime_components(config.runtime_components.clone())
 1651   1652   
                        )
 1652   1653   
                        // codegen config
 1653   1654   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1654   1655   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/s3/tests/token_bucket_time_source.rs

@@ -0,1 +0,83 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
#![cfg(feature = "test-util")]
           7  +
           8  +
use aws_sdk_s3::{config::Region, Client, Config};
           9  +
use aws_smithy_async::test_util::ManualTimeSource;
          10  +
use aws_smithy_async::time::SharedTimeSource;
          11  +
use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient};
          12  +
use aws_smithy_runtime::client::retries::TokenBucket;
          13  +
use aws_smithy_runtime_api::box_error::BoxError;
          14  +
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
          15  +
use aws_smithy_runtime_api::client::interceptors::Intercept;
          16  +
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
          17  +
use aws_smithy_types::body::SdkBody;
          18  +
use aws_smithy_types::config_bag::ConfigBag;
          19  +
use std::sync::LazyLock;
          20  +
use std::time::{Duration, SystemTime, UNIX_EPOCH};
          21  +
          22  +
static THE_TIME: LazyLock<SystemTime> =
          23  +
    LazyLock::new(|| UNIX_EPOCH + Duration::from_secs(12344321));
          24  +
          25  +
#[derive(Debug)]
          26  +
struct TimeSourceValidationInterceptor;
          27  +
          28  +
impl Intercept for TimeSourceValidationInterceptor {
          29  +
    fn name(&self) -> &'static str {
          30  +
        "TimeSourceValidationInterceptor"
          31  +
    }
          32  +
          33  +
    fn modify_before_transmit(
          34  +
        &self,
          35  +
        _context: &mut BeforeTransmitInterceptorContextMut<'_>,
          36  +
        _runtime_components: &RuntimeComponents,
          37  +
        cfg: &mut ConfigBag,
          38  +
    ) -> Result<(), BoxError> {
          39  +
        if let Some(token_bucket) = cfg.load::<TokenBucket>() {
          40  +
            let token_bucket_time_source = token_bucket.time_source();
          41  +
            let token_time = token_bucket_time_source.now();
          42  +
          43  +
            assert_eq!(
          44  +
                *THE_TIME, token_time,
          45  +
                "Token source should match the configured time source"
          46  +
            );
          47  +
        }
          48  +
        Ok(())
          49  +
    }
          50  +
}
          51  +
          52  +
#[tokio::test]
          53  +
async fn test_token_bucket_gets_time_source_from_config() {
          54  +
    let time_source = ManualTimeSource::new(*THE_TIME);
          55  +
    let shared_time_source = SharedTimeSource::new(time_source);
          56  +
          57  +
    let http_client = StaticReplayClient::new(vec![ReplayEvent::new(
          58  +
        http_1x::Request::builder()
          59  +
            .uri("https://www.doesntmatter.com")
          60  +
            .body(SdkBody::empty())
          61  +
            .unwrap(),
          62  +
        http_1x::Response::builder()
          63  +
            .status(200)
          64  +
            .body(SdkBody::from("<ListBucketResult></ListBucketResult>"))
          65  +
            .unwrap(),
          66  +
    )]);
          67  +
          68  +
    let config = Config::builder()
          69  +
        .region(Region::new("us-east-1"))
          70  +
        .http_client(http_client)
          71  +
        .time_source(shared_time_source)
          72  +
        .interceptor(TimeSourceValidationInterceptor)
          73  +
        .build();
          74  +
          75  +
    let client = Client::from_conf(config);
          76  +
          77  +
    let _result = client
          78  +
        .list_objects_v2()
          79  +
        .bucket("test-bucket")
          80  +
        .send()
          81  +
        .await
          82  +
        .unwrap();
          83  +
}

tmp-codegen-diff/aws-sdk/sdk/s3control/src/config.rs

@@ -1476,1476 +1535,1536 @@
 1496   1496   
    };
 1497   1497   
 1498   1498   
    let scope = "aws-sdk-s3control";
 1499   1499   
 1500   1500   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1501   1501   
                        // defaults
 1502   1502   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1503   1503   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1504   1504   
                                .with_retry_partition_name(default_retry_partition)
 1505   1505   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1506  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1506   1507   
                        ))
 1507   1508   
                        // user config
 1508   1509   
                        .with_client_plugin(
 1509   1510   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1510   1511   
                                .with_config(config.config.clone())
 1511   1512   
                                .with_runtime_components(config.runtime_components.clone())
 1512   1513   
                        )
 1513   1514   
                        // codegen config
 1514   1515   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1515   1516   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/signin/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-signin";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/sso/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-sso";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-ssooidc";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/sts/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-sts";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/timestreamquery/src/config.rs

@@ -1465,1465 +1524,1525 @@
 1485   1485   
    };
 1486   1486   
 1487   1487   
    let scope = "aws-sdk-timestreamquery";
 1488   1488   
 1489   1489   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1490   1490   
                        // defaults
 1491   1491   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1492   1492   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1493   1493   
                                .with_retry_partition_name(default_retry_partition)
 1494   1494   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1495  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1495   1496   
                        ))
 1496   1497   
                        // user config
 1497   1498   
                        .with_client_plugin(
 1498   1499   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1499   1500   
                                .with_config(config.config.clone())
 1500   1501   
                                .with_runtime_components(config.runtime_components.clone())
 1501   1502   
                        )
 1502   1503   
                        // codegen config
 1503   1504   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1504   1505   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/timestreamwrite/src/config.rs

@@ -1465,1465 +1524,1525 @@
 1485   1485   
    };
 1486   1486   
 1487   1487   
    let scope = "aws-sdk-timestreamwrite";
 1488   1488   
 1489   1489   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1490   1490   
                        // defaults
 1491   1491   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1492   1492   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1493   1493   
                                .with_retry_partition_name(default_retry_partition)
 1494   1494   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1495  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1495   1496   
                        ))
 1496   1497   
                        // user config
 1497   1498   
                        .with_client_plugin(
 1498   1499   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1499   1500   
                                .with_config(config.config.clone())
 1500   1501   
                                .with_runtime_components(config.runtime_components.clone())
 1501   1502   
                        )
 1502   1503   
                        // codegen config
 1503   1504   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1504   1505   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())

tmp-codegen-diff/aws-sdk/sdk/transcribestreaming/src/config.rs

@@ -1447,1447 +1506,1507 @@
 1467   1467   
    };
 1468   1468   
 1469   1469   
    let scope = "aws-sdk-transcribestreaming";
 1470   1470   
 1471   1471   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1472   1472   
                        // defaults
 1473   1473   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1474   1474   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1475   1475   
                                .with_retry_partition_name(default_retry_partition)
 1476   1476   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
        1477  +
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1477   1478   
                        ))
 1478   1479   
                        // user config
 1479   1480   
                        .with_client_plugin(
 1480   1481   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1481   1482   
                                .with_config(config.config.clone())
 1482   1483   
                                .with_runtime_components(config.runtime_components.clone())
 1483   1484   
                        )
 1484   1485   
                        // codegen config
 1485   1486   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1486   1487   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())