AWS SDK

AWS SDK

rev. 26348e85a655bb8d96eb82126ccc9fe49fd2bbfc

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-config/Cargo.toml

@@ -1,1 +59,59 @@
   15     15   
rustdoc-args = ["--cfg", "docsrs"]
   16     16   
   17     17   
[package.metadata.smithy-rs-release-tooling]
   18     18   
stable = true
   19     19   
[package.metadata.cargo-udeps.ignore]
   20     20   
normal = ["proc-macro2"]
   21     21   
   22     22   
[features]
   23     23   
behavior-version-latest = []
   24     24   
credentials-process = ["tokio/process"]
   25         -
default = ["default-http-connector", "rt-tokio", "credentials-process", "sso"]
          25  +
default = ["default-https-client", "rt-tokio", "credentials-process", "sso"]
   26     26   
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/rt"]
   27         -
client-hyper = ["aws-smithy-runtime/default-http-connector"]
          27  +
client-hyper = ["aws-smithy-runtime/default-https-client"]
   28     28   
rustls = ["client-hyper"]
   29         -
default-http-connector = ["aws-smithy-runtime/default-http-connector"]
          29  +
default-https-client = ["aws-smithy-runtime/default-https-client"]
   30     30   
sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:ring", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"]
   31     31   
test-util = ["aws-runtime/test-util"]
   32     32   
allow-compilation = []
   33     33   
   34     34   
[dependencies]
   35     35   
bytes = "1.1.0"
   36     36   
http = "1"
   37     37   
url = "2.5.4"
   38     38   
fastrand = "2.0.0"
   39     39   
@@ -109,109 +161,161 @@
  129    129   
features = ["rt-tokio", "test-util"]
  130    130   
version = "1.2.5"
  131    131   
  132    132   
[dev-dependencies.aws-smithy-runtime]
  133    133   
path = "../aws-smithy-runtime"
  134    134   
features = ["client", "test-util"]
  135    135   
version = "1.8.0"
  136    136   
  137    137   
[dev-dependencies.aws-smithy-http-client]
  138    138   
path = "../aws-smithy-http-client"
  139         -
features = ["hyper-1", "test-util"]
         139  +
features = ["default-client", "test-util"]
  140    140   
version = "1.0.0"
  141    141   
  142    142   
[dev-dependencies.aws-smithy-runtime-api]
  143    143   
path = "../aws-smithy-runtime-api"
  144    144   
features = ["test-util"]
  145    145   
version = "1.7.4"
  146    146   
  147    147   
[dev-dependencies.futures-util]
  148    148   
version = "0.3.29"
  149    149   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/default_provider/credentials.rs

@@ -1,1 +47,47 @@
    7      7   
    8      8   
use aws_credential_types::provider::{self, future, ProvideCredentials};
    9      9   
use aws_credential_types::Credentials;
   10     10   
use tracing::Instrument;
   11     11   
   12     12   
use crate::environment::credentials::EnvironmentVariableCredentialsProvider;
   13     13   
use crate::meta::credentials::CredentialsProviderChain;
   14     14   
use crate::meta::region::ProvideRegion;
   15     15   
use crate::provider_config::ProviderConfig;
   16     16   
   17         -
#[cfg(any(feature = "default-http-connector", feature = "rustls"))]
          17  +
#[cfg(any(feature = "default-https-client", feature = "rustls"))]
   18     18   
/// Default Credentials Provider chain
   19     19   
///
   20     20   
/// The region from the default region provider will be used
   21     21   
pub async fn default_provider() -> impl ProvideCredentials {
   22     22   
    DefaultCredentialsChain::builder().build().await
   23     23   
}
   24     24   
   25     25   
/// Default AWS Credential Provider Chain
   26     26   
///
   27     27   
/// Resolution order:
@@ -143,143 +203,203 @@
  163    163   
    /// Override the configuration used for this provider
  164    164   
    pub fn configure(mut self, config: ProviderConfig) -> Self {
  165    165   
        self.region_chain = self.region_chain.configure(&config);
  166    166   
        self.conf = Some(config);
  167    167   
        self
  168    168   
    }
  169    169   
  170    170   
    /// Creates a `DefaultCredentialsChain`
  171    171   
    ///
  172    172   
    /// ## Panics
  173         -
    /// This function will panic if no connector has been set or the `default-http-connector`
         173  +
    /// This function will panic if no connector has been set or the `default-https-client`
  174    174   
    /// feature has been disabled.
  175    175   
    pub async fn build(self) -> DefaultCredentialsChain {
  176    176   
        let region = match self.region_override {
  177    177   
            Some(provider) => provider.region().await,
  178    178   
            None => self.region_chain.build().region().await,
  179    179   
        };
  180    180   
  181    181   
        let conf = self.conf.unwrap_or_default().with_region(region);
  182    182   
  183    183   
        let env_provider = EnvironmentVariableCredentialsProvider::new_with_env(conf.env());

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/imds/client.rs

@@ -957,957 +1017,1017 @@
  977    977   
        ]);
  978    978   
        let err = client.get("/latest/metadata").await.expect_err("no token");
  979    979   
        assert_full_error_contains!(err, "invalid UTF-8");
  980    980   
        http_client.assert_requests_match(&[]);
  981    981   
    }
  982    982   
  983    983   
    // TODO(https://github.com/awslabs/aws-sdk-rust/issues/1117) This test is ignored on Windows because it uses Unix-style paths
  984    984   
    #[cfg_attr(windows, ignore)]
  985    985   
    /// Verify that the end-to-end real client has a 1-second connect timeout
  986    986   
    #[tokio::test]
  987         -
    #[cfg(feature = "default-http-connector")]
         987  +
    #[cfg(feature = "default-https-client")]
  988    988   
    async fn one_second_connect_timeout() {
  989    989   
        use crate::imds::client::ImdsError;
  990    990   
        use aws_smithy_types::error::display::DisplayErrorContext;
  991    991   
        use std::time::SystemTime;
  992    992   
  993    993   
        let client = Client::builder()
  994    994   
            // 240.* can never be resolved
  995    995   
            .endpoint("http://240.0.0.0")
  996    996   
            .expect("valid uri")
  997    997   
            .build();

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/imds/credentials.rs

@@ -391,391 +491,491 @@
  411    411   
            .build();
  412    412   
        let creds = provider.provide_credentials().await.expect("valid creds");
  413    413   
        assert!(creds.expiry().unwrap() > time_of_request_to_fetch_credentials);
  414    414   
        http_client.assert_requests_match(&[]);
  415    415   
  416    416   
        // We should inform customers that expired credentials are being used for stability.
  417    417   
        assert!(logs_contain(WARNING_FOR_EXTENDING_CREDENTIALS_EXPIRY));
  418    418   
    }
  419    419   
  420    420   
    #[tokio::test]
  421         -
    #[cfg(feature = "default-http-connector")]
         421  +
    #[cfg(feature = "default-https-client")]
  422    422   
    async fn read_timeout_during_credentials_refresh_should_yield_last_retrieved_credentials() {
  423    423   
        let client = crate::imds::Client::builder()
  424    424   
            // 240.* can never be resolved
  425    425   
            .endpoint("http://240.0.0.0")
  426    426   
            .unwrap()
  427    427   
            .build();
  428    428   
        let expected = aws_credential_types::Credentials::for_tests();
  429    429   
        let provider = ImdsCredentialsProvider::builder()
  430    430   
            .imds_client(client)
  431    431   
            // seed fallback credentials for testing
  432    432   
            .last_retrieved_credentials(expected.clone())
  433    433   
            .build();
  434    434   
        let actual = provider.provide_credentials().await;
  435    435   
        assert_eq!(actual.unwrap(), expected);
  436    436   
    }
  437    437   
  438    438   
    #[tokio::test]
  439         -
    #[cfg(feature = "default-http-connector")]
         439  +
    #[cfg(feature = "default-https-client")]
  440    440   
    async fn read_timeout_during_credentials_refresh_should_error_without_last_retrieved_credentials(
  441    441   
    ) {
  442    442   
        let client = crate::imds::Client::builder()
  443    443   
            // 240.* can never be resolved
  444    444   
            .endpoint("http://240.0.0.0")
  445    445   
            .unwrap()
  446    446   
            .build();
  447    447   
        let provider = ImdsCredentialsProvider::builder()
  448    448   
            .imds_client(client)
  449    449   
            // no fallback credentials provided
  450    450   
            .build();
  451    451   
        let actual = provider.provide_credentials().await;
  452    452   
        assert!(
  453    453   
            matches!(actual, Err(CredentialsError::CredentialsNotLoaded(_))),
  454    454   
            "\nexpected: Err(CredentialsError::CredentialsNotLoaded(_))\nactual: {actual:?}"
  455    455   
        );
  456    456   
    }
  457    457   
  458    458   
    // TODO(https://github.com/awslabs/aws-sdk-rust/issues/1117) This test is ignored on Windows because it uses Unix-style paths
  459    459   
    #[cfg_attr(windows, ignore)]
  460    460   
    #[tokio::test]
  461         -
    #[cfg(feature = "default-http-connector")]
         461  +
    #[cfg(feature = "default-https-client")]
  462    462   
    async fn external_timeout_during_credentials_refresh_should_yield_last_retrieved_credentials() {
  463    463   
        use aws_smithy_async::rt::sleep::AsyncSleep;
  464    464   
        let client = crate::imds::Client::builder()
  465    465   
            // 240.* can never be resolved
  466    466   
            .endpoint("http://240.0.0.0")
  467    467   
            .unwrap()
  468    468   
            .build();
  469    469   
        let expected = aws_credential_types::Credentials::for_tests();
  470    470   
        let provider = ImdsCredentialsProvider::builder()
  471    471   
            .imds_client(client)

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

@@ -864,864 +923,924 @@
  884    884   
                }
  885    885   
            };
  886    886   
  887    887   
            builder.set_endpoint_url(endpoint_url);
  888    888   
            builder.set_behavior_version(self.behavior_version);
  889    889   
            builder.set_http_client(self.http_client);
  890    890   
            builder.set_app_name(app_name);
  891    891   
  892    892   
            let identity_cache = match self.identity_cache {
  893    893   
                None => match self.behavior_version {
         894  +
                    #[allow(deprecated)]
  894    895   
                    Some(bv) if bv.is_at_least(BehaviorVersion::v2024_03_28()) => {
  895    896   
                        Some(IdentityCache::lazy().build())
  896    897   
                    }
  897    898   
                    _ => None,
  898    899   
                },
  899    900   
                Some(user_cache) => Some(user_cache),
  900    901   
            };
  901    902   
  902    903   
            let request_checksum_calculation =
  903    904   
                if let Some(request_checksum_calculation) = self.request_checksum_calculation {
@@ -1108,1109 +1186,1187 @@
 1128   1129   
            assert_eq!(None, conf.request_min_compression_size_bytes());
 1129   1130   
        }
 1130   1131   
 1131   1132   
        #[tokio::test]
 1132   1133   
        async fn app_name() {
 1133   1134   
            let app_name = AppName::new("my-app-name").unwrap();
 1134   1135   
            let conf = base_conf().app_name(app_name.clone()).load().await;
 1135   1136   
            assert_eq!(Some(&app_name), conf.app_name());
 1136   1137   
        }
 1137   1138   
 1138         -
        #[cfg(feature = "default-http-connector")]
        1139  +
        #[cfg(feature = "default-https-client")]
 1139   1140   
        #[tokio::test]
 1140   1141   
        async fn disable_default_credentials() {
 1141   1142   
            let config = defaults(BehaviorVersion::latest())
 1142   1143   
                .no_credentials()
 1143   1144   
                .load()
 1144   1145   
                .await;
 1145   1146   
            assert!(config.credentials_provider().is_none());
 1146   1147   
        }
 1147   1148   
 1148         -
        #[cfg(feature = "default-http-connector")]
        1149  +
        #[cfg(feature = "default-https-client")]
 1149   1150   
        #[tokio::test]
 1150   1151   
        async fn identity_cache_defaulted() {
 1151   1152   
            let config = defaults(BehaviorVersion::latest()).load().await;
 1152   1153   
 1153   1154   
            assert!(config.identity_cache().is_some());
 1154   1155   
        }
 1155   1156   
 1156         -
        #[cfg(feature = "default-http-connector")]
        1157  +
        #[cfg(feature = "default-https-client")]
 1157   1158   
        #[allow(deprecated)]
 1158   1159   
        #[tokio::test]
 1159   1160   
        async fn identity_cache_old_behavior_version() {
 1160   1161   
            let config = defaults(BehaviorVersion::v2023_11_09()).load().await;
 1161   1162   
 1162   1163   
            assert!(config.identity_cache().is_none());
 1163   1164   
        }
 1164   1165   
 1165   1166   
        #[tokio::test]
 1166   1167   
        async fn connector_is_shared() {

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/meta/credentials/chain.rs

@@ -46,46 +115,115 @@
   66     66   
    pub fn or_else(
   67     67   
        mut self,
   68     68   
        name: impl Into<Cow<'static, str>>,
   69     69   
        provider: impl ProvideCredentials + 'static,
   70     70   
    ) -> Self {
   71     71   
        self.providers.push((name.into(), Box::new(provider)));
   72     72   
        self
   73     73   
    }
   74     74   
   75     75   
    /// Add a fallback to the default provider chain
   76         -
    #[cfg(any(feature = "default-http-connector", feature = "rustls"))]
          76  +
    #[cfg(any(feature = "default-https-client", feature = "rustls"))]
   77     77   
    pub async fn or_default_provider(self) -> Self {
   78     78   
        self.or_else(
   79     79   
            "DefaultProviderChain",
   80     80   
            crate::default_provider::credentials::default_provider().await,
   81     81   
        )
   82     82   
    }
   83     83   
   84     84   
    /// Creates a credential provider chain that starts with the default provider
   85         -
    #[cfg(any(feature = "default-http-connector", feature = "rustls"))]
          85  +
    #[cfg(any(feature = "default-https-client", feature = "rustls"))]
   86     86   
    pub async fn default_provider() -> Self {
   87     87   
        Self::first_try(
   88     88   
            "DefaultProviderChain",
   89     89   
            crate::default_provider::credentials::default_provider().await,
   90     90   
        )
   91     91   
    }
   92     92   
   93     93   
    async fn credentials(&self) -> provider::Result {
   94     94   
        for (name, provider) in &self.providers {
   95     95   
            let span = tracing::debug_span!("load_credentials", provider = %name);

tmp-codegen-diff/aws-sdk/sdk/aws-config/src/profile/credentials.rs

@@ -64,64 +124,124 @@
   84     84   
///     async fn load_credentials(&self) -> provider::Result {
   85     85   
///         todo!()
   86     86   
///     }
   87     87   
/// }
   88     88   
///
   89     89   
/// impl ProvideCredentials for MyCustomProvider {
   90     90   
///   fn provide_credentials<'a>(&'a self) -> future::ProvideCredentials where Self: 'a {
   91     91   
///         future::ProvideCredentials::new(self.load_credentials())
   92     92   
///     }
   93     93   
/// }
   94         -
/// # if cfg!(feature = "default-http-connector") {
          94  +
/// # if cfg!(feature = "default-https-client") {
   95     95   
/// let provider = ProfileFileCredentialsProvider::builder()
   96     96   
///     .with_custom_provider("Custom", MyCustomProvider)
   97     97   
///     .build();
   98     98   
/// }
   99     99   
/// ```
  100    100   
///
  101    101   
/// ### Assume role credentials from a source profile
  102    102   
/// ```ini
  103    103   
/// [default]
  104    104   
/// role_arn = arn:aws:iam::123456789:role/RoleA

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

@@ -101,101 +161,161 @@
  121    121   
    ///
  122    122   
    /// Using this option means that you may need to set a region manually.
  123    123   
    ///
  124    124   
    /// This constructor will use a default value for the HTTPS connector and Sleep implementation
  125    125   
    /// when they are enabled as crate features which is usually the correct option. To construct
  126    126   
    /// a `ProviderConfig` without these fields set, use [`ProviderConfig::empty`].
  127    127   
    ///
  128    128   
    ///
  129    129   
    /// # Examples
  130    130   
    /// ```no_run
  131         -
    /// # #[cfg(feature = "default-http-connector")]
         131  +
    /// # #[cfg(feature = "default-https-client")]
  132    132   
    /// # fn example() {
  133    133   
    /// use aws_config::provider_config::ProviderConfig;
  134    134   
    /// use aws_sdk_sts::config::Region;
  135    135   
    /// use aws_config::web_identity_token::WebIdentityTokenCredentialsProvider;
  136    136   
    /// let conf = ProviderConfig::without_region().with_region(Some(Region::new("us-east-1")));
  137    137   
    ///
  138    138   
    /// let credential_provider = WebIdentityTokenCredentialsProvider::builder().configure(&conf).build();
  139    139   
    /// # }
  140    140   
    /// ```
  141    141   
    pub fn without_region() -> Self {

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

@@ -291,291 +351,351 @@
  311    311   
    pub(crate) fn provider_config(&self) -> &ProviderConfig {
  312    312   
        &self.provider_config
  313    313   
    }
  314    314   
}
  315    315   
  316    316   
impl<O, E> TestEnvironment<O, E>
  317    317   
where
  318    318   
    O: for<'a> Deserialize<'a> + Secrets + PartialEq + Debug,
  319    319   
    E: Error,
  320    320   
{
  321         -
    #[cfg(feature = "default-http-connector")]
         321  +
    #[cfg(feature = "default-https-client")]
  322    322   
    #[allow(unused)]
  323    323   
    /// Record a test case from live (remote) HTTPS traffic
  324    324   
    ///
  325    325   
    /// The `default_connector()` from the crate will be used
  326    326   
    pub(crate) async fn execute_from_live_traffic(&self) {
  327    327   
        // swap out the connector generated from `http-traffic.json` for a real connector:
  328    328   
  329    329   
        use std::error::Error;
  330    330   
        let live_connector = aws_smithy_http_client::default_connector(
  331    331   
            &Default::default(),

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-http-client/Cargo.toml

@@ -1,1 +73,73 @@
   19     19   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
   20     20   
description = "HTTP client abstractions for generated smithy clients"
   21     21   
version = "1.0.0"
   22     22   
license = "Apache-2.0"
   23     23   
edition = "2021"
   24     24   
repository = "https://github.com/smithy-lang/smithy-rs"
   25     25   
[package.metadata.smithy-rs-release-tooling]
   26     26   
stable = true
   27     27   
[package.metadata.docs.rs]
   28     28   
all-features = false
   29         -
features = ["hyper-1 ", "wire-mock", "test-util", "rustls-ring", "rustls-aws-lc"]
          29  +
features = ["default-client ", "wire-mock", "test-util", "rustls-ring", "rustls-aws-lc"]
   30     30   
targets = ["x86_64-unknown-linux-gnu"]
   31     31   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   32     32   
rustdoc-args = ["--cfg", "docsrs"]
   33     33   
   34     34   
[features]
   35     35   
hyper-014 = ["aws-smithy-runtime-api/http-02x", "aws-smithy-types/http-body-0-4-x", "dep:http-02x", "dep:http-body-04x", "dep:hyper-0-14"]
   36         -
hyper-1 = ["aws-smithy-runtime-api/http-1x", "aws-smithy-types/http-body-1-x", "dep:hyper", "dep:hyper-util", "hyper-util?/client-legacy", "dep:http-1x", "dep:tower"]
   37         -
wire-mock = ["test-util", "hyper-1", "hyper-util?/server", "hyper-util?/server-auto", "hyper-util?/service", "hyper-util?/server-graceful", "tokio/macros", "dep:http-body-util"]
          36  +
default-client = ["aws-smithy-runtime-api/http-1x", "aws-smithy-types/http-body-1-x", "dep:hyper", "dep:hyper-util", "hyper-util?/client-legacy", "dep:http-1x", "dep:tower"]
          37  +
wire-mock = ["test-util", "default-client", "hyper-util?/server", "hyper-util?/server-auto", "hyper-util?/service", "hyper-util?/server-graceful", "tokio/macros", "dep:http-body-util"]
   38     38   
test-util = ["dep:aws-smithy-protocol-test", "dep:serde", "dep:serde_json", "dep:indexmap", "dep:bytes", "dep:http-1x", "aws-smithy-runtime-api/http-1x", "dep:http-body-1x", "aws-smithy-types/http-body-1-x"]
   39     39   
legacy-test-util = ["test-util", "dep:http-02x", "aws-smithy-runtime-api/http-02x", "aws-smithy-types/http-body-0-4-x"]
   40     40   
legacy-rustls-ring = ["dep:legacy-hyper-rustls", "dep:legacy-rustls", "hyper-014"]
   41         -
rustls-ring = ["dep:rustls", "rustls?/ring", "dep:hyper-rustls", "hyper-1"]
   42         -
rustls-aws-lc = ["dep:rustls", "rustls?/aws_lc_rs", "dep:hyper-rustls", "hyper-1"]
   43         -
rustls-aws-lc-fips = ["dep:rustls", "rustls?/fips", "dep:hyper-rustls", "hyper-1"]
          41  +
rustls-ring = ["dep:rustls", "rustls?/ring", "dep:hyper-rustls", "default-client"]
          42  +
rustls-aws-lc = ["dep:rustls", "rustls?/aws_lc_rs", "dep:hyper-rustls", "default-client"]
          43  +
rustls-aws-lc-fips = ["dep:rustls", "rustls?/fips", "dep:hyper-rustls", "default-client"]
   44     44   
   45     45   
[dependencies]
   46     46   
once_cell = "1.20.1"
   47     47   
pin-project-lite = "0.2.14"
   48     48   
tracing = "0.1"
   49     49   
   50     50   
[dependencies.aws-smithy-async]
   51     51   
path = "../aws-smithy-async"
   52     52   
version = "1.2.5"
   53     53   

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-http-client/src/lib.rs

@@ -1,1 +71,74 @@
    4      4   
 */
    5      5   
    6      6   
/* Automatically managed default lints */
    7      7   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
    8      8   
/* End of automatically managed default lints */
    9      9   
   10     10   
//! HTTP client implementation for smithy-rs generated code.
   11     11   
//!
   12     12   
//! # Crate Features
   13     13   
//!
   14         -
//! - `default-tls`: Enable default TLS provider (used by `default_client()` to provide a default configured HTTPS client)
          14  +
//! - `default-client`: Enable default HTTP client implementation (based on hyper 1.x).
          15  +
//! - `rustls-ring`: Enable TLS provider based on `rustls` using `ring` as the crypto provider
          16  +
//! - `rustls-aws-lc`: Enable TLS provider based on `rustls` using `aws-lc` as the crypto provider
          17  +
//! - `rustls-aws-lc-fips`: Same as `rustls-aws-lc` feature but using a FIPS compliant version of `aws-lc`
   15     18   
//! - `hyper-014`: (Deprecated) HTTP client implementation based on hyper-0.14.x.
   16     19   
//! - `test-util`: Enables utilities for unit tests. DO NOT ENABLE IN PRODUCTION.
   17     20   
   18     21   
#![warn(
   19     22   
    missing_docs,
   20     23   
    rustdoc::missing_crate_level_docs,
   21     24   
    unreachable_pub,
   22     25   
    rust_2018_idioms
   23     26   
)]
   24     27   
#![cfg_attr(docsrs, feature(doc_cfg))]
   25     28   
   26     29   
// ideally hyper_014 would just be exposed as is but due to
   27     30   
// https://github.com/rust-lang/rust/issues/47238 we get clippy warnings we can't suppress
   28     31   
#[cfg(feature = "hyper-014")]
   29     32   
pub(crate) mod hyper_legacy;
   30     33   
   31     34   
/// Legacy HTTP and TLS connectors that use hyper 0.14.x and rustls.
   32     35   
#[cfg(feature = "hyper-014")]
   33     36   
#[deprecated = "hyper 0.14.x support is deprecated, please migrate to 1.x client"]
   34     37   
pub mod hyper_014 {
   35     38   
    pub use crate::hyper_legacy::*;
   36     39   
}
   37     40   
   38     41   
/// Default HTTP and TLS connectors
   39         -
#[cfg(feature = "hyper-1")]
          42  +
#[cfg(feature = "default-client")]
   40     43   
pub(crate) mod client;
   41         -
#[cfg(feature = "hyper-1")]
          44  +
#[cfg(feature = "default-client")]
   42     45   
pub use client::{default_client, default_connector, tls, Builder, Connector, ConnectorBuilder};
   43     46   
   44     47   
#[cfg(feature = "test-util")]
   45     48   
pub mod test_util;
   46     49   
   47     50   
#[allow(unused_macros, unused_imports)]
   48     51   
#[macro_use]
   49     52   
pub(crate) mod cfg {
   50     53   
    /// Any TLS provider enabled
   51     54   
    macro_rules! cfg_tls {

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-http-client/src/test_util.rs

@@ -1,1 +67,67 @@
    5      5   
    6      6   
//! Various fake/mock clients for testing.
    7      7   
//!
    8      8   
//! Each test client is useful for different test use cases:
    9      9   
//! - [`capture_request()`]: If you don't care what the response is, but just want to
   10     10   
//! check that the serialized request is what you expect, then use `capture_request`.
   11     11   
//! Or, alternatively, if you don't care what the request is, but want to always
   12     12   
//! respond with a given response, then capture request can also be useful since
   13     13   
//! you can optionally give it a response to return.
   14     14   
#![cfg_attr(
   15         -
    feature = "hyper-1",
          15  +
    feature = "default-client",
   16     16   
    doc = "- [`dvr`]: If you want to record real-world traffic and then replay it later, then DVR's"
   17     17   
)]
   18     18   
//! [`RecordingClient`](dvr::RecordingClient) and [`ReplayingClient`](dvr::ReplayingClient)
   19     19   
//! can accomplish this, and the recorded traffic can be saved to JSON and checked in. Note: if
   20     20   
//! the traffic recording has sensitive information in it, such as signatures or authorization,
   21     21   
//! you will need to manually scrub this out if you intend to store the recording alongside
   22     22   
//! your tests.
   23     23   
//! - [`StaticReplayClient`]: If you want to have a set list of requests and their responses in a test,
   24     24   
//! then the static replay client will be useful. On construction, it takes a list of request/response
   25     25   
//! pairs that represent each expected request and the response for that test. At the end of the test,
   26     26   
//! you can ask the client to verify that the requests matched the expectations.
   27     27   
//! - [`infallible_client_fn`]: Allows you to create a client from an infallible function
   28     28   
//! that takes a request and returns a response.
   29     29   
//! - [`NeverClient`]: Useful for testing timeouts, where you want the client to never respond.
   30     30   
//!
   31     31   
#![cfg_attr(
   32         -
    any(feature = "hyper-014", feature = "hyper-1"),
          32  +
    any(feature = "hyper-014", feature = "default-client"),
   33     33   
    doc = "
   34     34   
There is also the [`NeverTcpConnector`], which makes it easy to test connect/read timeouts.
   35     35   
   36     36   
Finally, for socket-level mocking, see the [`wire`] module.
   37     37   
"
   38     38   
)]
   39     39   
   40     40   
mod capture_request;
   41     41   
pub use capture_request::{capture_request, CaptureRequestHandler, CaptureRequestReceiver};
   42     42   
   43     43   
#[cfg(feature = "legacy-test-util")]
   44     44   
pub use capture_request::legacy_capture_request;
   45     45   
   46     46   
pub mod dvr;
   47     47   
   48     48   
mod replay;
   49     49   
pub use replay::{ReplayEvent, StaticReplayClient};
   50     50   
   51     51   
mod infallible;
   52     52   
pub use infallible::infallible_client_fn;
   53     53   
   54     54   
// infallible based on http_02x stack had to be duplicated to avoid breaking API changes
   55     55   
#[allow(missing_docs)]
   56     56   
#[cfg(feature = "legacy-test-util")]
   57     57   
pub mod legacy_infallible;
   58     58   
   59     59   
mod never;
   60     60   
pub use never::NeverClient;
   61     61   
   62         -
#[cfg(any(feature = "hyper-014", feature = "hyper-1"))]
          62  +
#[cfg(any(feature = "hyper-014", feature = "default-client"))]
   63     63   
pub use never::NeverTcpConnector;
   64     64   
   65     65   
mod body;
   66         -
#[cfg(all(feature = "hyper-1", feature = "wire-mock"))]
          66  +
#[cfg(all(feature = "default-client", feature = "wire-mock"))]
   67     67   
pub mod wire;

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-http-client/src/test_util/never.rs

@@ -35,35 +130,130 @@
   55     55   
        self.clone().into_shared()
   56     56   
    }
   57     57   
   58     58   
    fn connector_metadata(&self) -> Option<ConnectorMetadata> {
   59     59   
        Some(ConnectorMetadata::new("never-client", None))
   60     60   
    }
   61     61   
}
   62     62   
   63     63   
/// A TCP connector that never connects.
   64     64   
// In the future, this can be available for multiple hyper version feature flags, with the impls gated between individual features
   65         -
#[cfg(any(feature = "hyper-014", feature = "hyper-1"))]
          65  +
#[cfg(any(feature = "hyper-014", feature = "default-client"))]
   66     66   
#[derive(Clone, Debug, Default)]
   67     67   
pub struct NeverTcpConnector;
   68     68   
   69         -
#[cfg(any(feature = "hyper-014", feature = "hyper-1"))]
          69  +
#[cfg(any(feature = "hyper-014", feature = "default-client"))]
   70     70   
impl NeverTcpConnector {
   71     71   
    /// Creates a new `NeverTcpConnector`.
   72     72   
    pub fn new() -> Self {
   73     73   
        Self
   74     74   
    }
   75     75   
}
   76     76   
   77     77   
#[cfg(feature = "hyper-014")]
   78     78   
impl hyper_0_14::service::Service<http_02x::Uri> for NeverTcpConnector {
   79     79   
    type Response = hyper_014_support::NeverTcpConnection;
   80     80   
    type Error = aws_smithy_runtime_api::box_error::BoxError;
   81     81   
    type Future = std::pin::Pin<
   82     82   
        Box<dyn std::future::Future<Output = Result<Self::Response, Self::Error>> + Send + Sync>,
   83     83   
    >;
   84     84   
   85     85   
    fn poll_ready(
   86     86   
        &mut self,
   87     87   
        _: &mut std::task::Context<'_>,
   88     88   
    ) -> std::task::Poll<Result<(), Self::Error>> {
   89     89   
        std::task::Poll::Ready(Ok(()))
   90     90   
    }
   91     91   
   92     92   
    fn call(&mut self, _: http_02x::Uri) -> Self::Future {
   93     93   
        Box::pin(async {
   94     94   
            Never::new().await;
   95     95   
            unreachable!()
   96     96   
        })
   97     97   
    }
   98     98   
}
   99     99   
  100         -
#[cfg(feature = "hyper-1")]
         100  +
#[cfg(feature = "default-client")]
  101    101   
mod hyper1_support {
  102    102   
    use super::NeverTcpConnector;
  103    103   
    use aws_smithy_async::future::never::Never;
  104    104   
    use aws_smithy_runtime_api::client::http::SharedHttpClient;
  105    105   
    use aws_smithy_runtime_api::client::result::ConnectorError;
  106    106   
    use http_1x::Uri;
  107    107   
    use hyper_util::rt::TokioIo;
  108    108   
    use std::future::Future;
  109    109   
    use std::pin::Pin;
  110    110   
    use std::task::{Context, Poll};
@@ -193,193 +246,246 @@
  213    213   
            &components,
  214    214   
        );
  215    215   
  216    216   
        let err = http_connector
  217    217   
            .call(HttpRequest::get("http://fakeuri.com").unwrap())
  218    218   
            .await
  219    219   
            .expect_err("it should time out");
  220    220   
        assert!(dbg!(err).is_timeout());
  221    221   
    }
  222    222   
  223         -
    #[cfg(feature = "hyper-1")]
         223  +
    #[cfg(feature = "default-client")]
  224    224   
    #[tokio::test]
  225    225   
    async fn never_tcp_connector_plugs_into_hyper_1() {
  226    226   
        use super::NeverTcpConnector;
  227    227   
        let client = NeverTcpConnector::new().into_client();
  228    228   
        let components = RuntimeComponentsBuilder::for_tests()
  229    229   
            .with_sleep_impl(Some(TokioSleep::new()))
  230    230   
            .with_time_source(Some(SystemTimeSource::new()))
  231    231   
            .build()
  232    232   
            .unwrap();
  233    233   
        let http_connector = client.http_connector(

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-http-client/tests/smoke_test_clients.rs

@@ -27,27 +93,86 @@
   47     47   
#[tokio::test]
   48     48   
async fn aws_lc_client() {
   49     49   
    let client = Builder::new()
   50     50   
        .tls_provider(tls::Provider::Rustls(
   51     51   
            tls::rustls_provider::CryptoMode::AwsLc,
   52     52   
        ))
   53     53   
        .build_https();
   54     54   
    smoke_test_client(&client).await.unwrap();
   55     55   
}
   56     56   
   57         -
#[cfg(feature = "default-tls")]
   58         -
#[tokio::test]
   59         -
async fn default_tls_client() {
   60         -
    let client = aws_smithy_http_client::default_client().expect("default TLS client created");
   61         -
    smoke_test_client(&client).await.unwrap();
   62         -
}
   63         -
   64     57   
#[cfg(feature = "rustls-ring")]
   65     58   
#[tokio::test]
   66     59   
async fn custom_dns_client() {
   67     60   
    use std::sync::atomic::{AtomicUsize, Ordering};
   68     61   
    #[derive(Debug, Clone)]
   69     62   
    struct PassThroughResolver {
   70     63   
        inner: GaiResolver,
   71     64   
        count: Arc<AtomicUsize>,
   72     65   
    }
   73     66   
    impl ResolveDns for PassThroughResolver {

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/src/client/behavior_version.rs

@@ -1,1 +91,116 @@
   13     13   
#[derive(Copy, Clone, PartialEq)]
   14     14   
pub struct BehaviorVersion {
   15     15   
    inner: Inner,
   16     16   
}
   17     17   
   18     18   
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
   19     19   
enum Inner {
   20     20   
    // IMPORTANT: Order matters here for the `Ord` derive. Newer versions go to the bottom.
   21     21   
    V2023_11_09,
   22     22   
    V2024_03_28,
          23  +
    V2025_01_17,
   23     24   
}
   24     25   
   25     26   
impl BehaviorVersion {
   26     27   
    /// This method will always return the latest major version.
   27     28   
    ///
   28     29   
    /// This is the recommend choice for customers who aren't reliant on extremely specific behavior
   29     30   
    /// characteristics. For example, if you are writing a CLI app, the latest behavior major
   30     31   
    /// version is probably the best setting for you.
   31     32   
    ///
   32     33   
    /// If, however, you're writing a service that is very latency sensitive, or that has written
   33     34   
    /// code to tune Rust SDK behaviors, consider pinning to a specific major version.
   34     35   
    ///
   35         -
    /// The latest version is currently [`BehaviorVersion::v2024_03_28`]
          36  +
    /// The latest version is currently [`BehaviorVersion::v2025_01_17`]
   36     37   
    pub fn latest() -> Self {
   37         -
        Self::v2024_03_28()
          38  +
        Self::v2025_01_17()
          39  +
    }
          40  +
          41  +
    /// Behavior version for January 17th, 2025
          42  +
    ///
          43  +
    /// This version updates the default HTTP client and TLS stack. SDKs shipped with
          44  +
    /// a pre 1.x version of hyper and rustls originally. This behavior version updates
          45  +
    /// the HTTP+TLS stack to maintained versions.
          46  +
    ///
          47  +
    /// <div class="warning">
          48  +
    /// NOTE: In a future release behavior versions prior to this will require enabling
          49  +
    /// feature flags manually to keep the legacy Hyper stack as the default. Specifically the
          50  +
    /// `aws-smithy-runtime/tls-rustls` feature flag combined with an older behavior version.
          51  +
    /// </div>
          52  +
    pub fn v2025_01_17() -> Self {
          53  +
        Self {
          54  +
            inner: Inner::V2025_01_17,
          55  +
        }
   38     56   
    }
   39     57   
   40     58   
    /// Behavior version for March 28th, 2024.
   41     59   
    ///
   42     60   
    /// This version enables stalled stream protection for uploads (request bodies) by default.
   43     61   
    ///
   44     62   
    /// When a new behavior major version is released, this method will be deprecated.
          63  +
    #[deprecated(
          64  +
        since = "1.8.0",
          65  +
        note = "Superseded by v2025_01_17, which updates the default HTTPS client stack."
          66  +
    )]
   45     67   
    pub fn v2024_03_28() -> Self {
   46     68   
        Self {
   47     69   
            inner: Inner::V2024_03_28,
   48     70   
        }
   49     71   
    }
   50     72   
   51     73   
    /// Behavior version for November 9th, 2023.
   52     74   
    #[deprecated(
   53     75   
        since = "1.4.0",
   54         -
        note = "Superceded by v2024_03_28, which enabled stalled stream protection for uploads (request bodies) by default."
          76  +
        note = "Superseded by v2024_03_28, which enabled stalled stream protection for uploads (request bodies) by default."
   55     77   
    )]
   56     78   
    pub fn v2023_11_09() -> Self {
   57     79   
        Self {
   58     80   
            inner: Inner::V2023_11_09,
   59     81   
        }
   60     82   
    }
   61     83   
   62     84   
    /// True if this version is newer or equal to the given `other` version.
   63     85   
    pub fn is_at_least(&self, other: BehaviorVersion) -> bool {
   64     86   
        self.inner >= other.inner
   65     87   
    }
   66     88   
}
   67     89   
   68     90   
impl std::fmt::Debug for BehaviorVersion {
   69     91   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   70     92   
        f.debug_tuple("BehaviorVersion").field(&self.inner).finish()
   71     93   
    }
   72     94   
}
   73     95   
   74     96   
#[cfg(test)]
   75     97   
mod tests {
   76     98   
    use super::*;
   77     99   
   78    100   
    #[test]
   79    101   
    #[allow(deprecated)]
   80    102   
    fn version_comparison() {
   81    103   
        assert!(BehaviorVersion::latest() == BehaviorVersion::latest());
   82    104   
        assert!(BehaviorVersion::v2023_11_09() == BehaviorVersion::v2023_11_09());
   83    105   
        assert!(BehaviorVersion::v2024_03_28() != BehaviorVersion::v2023_11_09());
         106  +
        assert!(BehaviorVersion::v2025_01_17() != BehaviorVersion::v2024_03_28());
   84    107   
        assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::latest()));
   85    108   
        assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2023_11_09()));
   86    109   
        assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2024_03_28()));
         110  +
        assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2025_01_17()));
   87    111   
        assert!(!BehaviorVersion::v2023_11_09().is_at_least(BehaviorVersion::v2024_03_28()));
   88    112   
        assert!(Inner::V2024_03_28 > Inner::V2023_11_09);
   89    113   
        assert!(Inner::V2023_11_09 < Inner::V2024_03_28);
         114  +
        assert!(Inner::V2024_03_28 < Inner::V2025_01_17);
   90    115   
    }
   91    116   
}