AWS SDK

AWS SDK

rev. a562638cb954071808c8908a73292885a41137c0 (ignoring whitespace)

Files changed:

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

@@ -1,1 +146,146 @@
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
features = ["event-stream"]
   24     24   
version = "1.5.9"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28         -
version = "1.2.5"
          28  +
version = "1.3.0"
   29     29   
   30     30   
[dependencies.aws-smithy-eventstream]
   31     31   
path = "../aws-smithy-eventstream"
   32     32   
version = "0.60.9"
   33     33   
   34     34   
[dependencies.aws-smithy-http]
   35     35   
path = "../aws-smithy-http"
   36     36   
features = ["event-stream"]
   37     37   
version = "0.62.1"
   38     38   
   39     39   
[dependencies.aws-smithy-json]
   40     40   
path = "../aws-smithy-json"
   41     41   
version = "0.61.4"
   42     42   
   43     43   
[dependencies.aws-smithy-runtime]
   44     44   
path = "../aws-smithy-runtime"
   45     45   
features = ["client"]
   46         -
version = "1.8.4"
          46  +
version = "1.8.5"
   47     47   
   48     48   
[dependencies.aws-smithy-runtime-api]
   49     49   
path = "../aws-smithy-runtime-api"
   50     50   
features = ["client", "http-02x"]
   51         -
version = "1.8.3"
          51  +
version = "1.8.4"
   52     52   
   53     53   
[dependencies.aws-smithy-types]
   54     54   
path = "../aws-smithy-types"
   55     55   
version = "1.3.2"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59         -
version = "1.3.7"
          59  +
version = "1.3.8"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.regex-lite]
   71     71   
version = "0.1.5"
   72     72   
   73     73   
[dependencies.tracing]
   74     74   
version = "0.1"
   75     75   
[dev-dependencies.aws-config]
   76     76   
path = "../aws-config"
   77         -
version = "1.8.2"
          77  +
version = "1.8.3"
   78     78   
   79     79   
[dev-dependencies.aws-credential-types]
   80     80   
path = "../aws-credential-types"
   81     81   
features = ["test-util"]
   82     82   
version = "1.2.3"
   83     83   
   84     84   
[dev-dependencies.aws-runtime]
   85     85   
path = "../aws-runtime"
   86     86   
features = ["test-util"]
   87     87   
version = "1.5.9"
   88     88   
   89     89   
[dev-dependencies.aws-smithy-async]
   90     90   
path = "../aws-smithy-async"
   91     91   
features = ["test-util"]
   92         -
version = "1.2.5"
          92  +
version = "1.3.0"
   93     93   
   94     94   
[dev-dependencies.aws-smithy-eventstream]
   95     95   
path = "../aws-smithy-eventstream"
   96     96   
features = ["test-util"]
   97     97   
version = "0.60.9"
   98     98   
   99     99   
[dev-dependencies.aws-smithy-http-client]
  100    100   
path = "../aws-smithy-http-client"
  101    101   
features = ["test-util", "wire-mock"]
  102    102   
version = "1.0.6"
  103    103   
  104    104   
[dev-dependencies.aws-smithy-protocol-test]
  105    105   
path = "../aws-smithy-protocol-test"
  106    106   
version = "0.63.4"
  107    107   
  108    108   
[dev-dependencies.aws-smithy-runtime]
  109    109   
path = "../aws-smithy-runtime"
  110    110   
features = ["test-util"]
  111         -
version = "1.8.4"
         111  +
version = "1.8.5"
  112    112   
  113    113   
[dev-dependencies.aws-smithy-runtime-api]
  114    114   
path = "../aws-smithy-runtime-api"
  115    115   
features = ["test-util"]
  116         -
version = "1.8.3"
         116  +
version = "1.8.4"
  117    117   
  118    118   
[dev-dependencies.aws-smithy-types]
  119    119   
path = "../aws-smithy-types"
  120    120   
features = ["test-util"]
  121    121   
version = "1.3.2"
  122    122   
  123    123   
[dev-dependencies.futures-util]
  124    124   
version = "0.3.25"
  125    125   
features = ["alloc"]
  126    126   
default-features = false

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

@@ -36,36 +95,99 @@
   56     56   
    }
   57     57   
    /// Return the auth schemes configured on this service config
   58     58   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     59   
        self.runtime_components.auth_schemes()
   60     60   
    }
   61     61   
   62     62   
    /// Return the auth scheme resolver configured on this service config
   63     63   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   64     64   
        self.runtime_components.auth_scheme_option_resolver()
   65     65   
    }
          66  +
    /// Returns the configured auth scheme preference
          67  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          68  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          69  +
    }
   66     70   
    /// Returns the endpoint resolver.
   67     71   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   68     72   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   69     73   
    }
   70     74   
    /// Return a reference to the retry configuration contained in this config, if any.
   71     75   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   72     76   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   73     77   
    }
   74     78   
   75     79   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -149,153 +208,213 @@
  169    173   
    ///
  170    174   
    pub fn new() -> Self {
  171    175   
        Self::default()
  172    176   
    }
  173    177   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  174    178   
    /// but not those in runtime components.
  175    179   
    #[allow(unused)]
  176    180   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  177    181   
        let mut builder = Self::new();
  178    182   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         183  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  179    184   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  180    185   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  181    186   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  182    187   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  183    188   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  184    189   
        builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0));
  185    190   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  186    191   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  187    192   
        builder
  188    193   
    }
@@ -414,419 +473,535 @@
  434    439   
  435    440   
    /// Set the auth scheme resolver for the builder
  436    441   
    ///
  437    442   
    /// # Examples
  438    443   
    /// See an example for [`Self::auth_scheme_resolver`].
  439    444   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  440    445   
        self.runtime_components
  441    446   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  442    447   
        self
  443    448   
    }
         449  +
    /// Set the auth scheme preference for an auth scheme resolver
         450  +
    /// (typically the default auth scheme resolver).
         451  +
    ///
         452  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         453  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         454  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         455  +
    ///
         456  +
    /// The preference list is intended as a hint rather than a strict override.
         457  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         458  +
    ///
         459  +
    /// # Examples
         460  +
    ///
         461  +
    /// ```no_run
         462  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         463  +
    /// let config = aws_sdk_cloudwatchlogs::Config::builder()
         464  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         465  +
    ///     // ...
         466  +
    ///     .build();
         467  +
    /// let client = aws_sdk_cloudwatchlogs::Client::from_conf(config);
         468  +
    /// ```
         469  +
         470  +
    pub fn auth_scheme_preference(
         471  +
        mut self,
         472  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         473  +
    ) -> Self {
         474  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         475  +
        self
         476  +
    }
         477  +
         478  +
    /// Set the auth scheme preference for an auth scheme resolver
         479  +
    /// (typically the default auth scheme resolver).
         480  +
    ///
         481  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         482  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         483  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         484  +
    ///
         485  +
    /// The preference list is intended as a hint rather than a strict override.
         486  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         487  +
    ///
         488  +
    /// # Examples
         489  +
    ///
         490  +
    /// ```no_run
         491  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         492  +
    /// let config = aws_sdk_cloudwatchlogs::Config::builder()
         493  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         494  +
    ///     // ...
         495  +
    ///     .build();
         496  +
    /// let client = aws_sdk_cloudwatchlogs::Client::from_conf(config);
         497  +
    /// ```
         498  +
         499  +
    pub fn set_auth_scheme_preference(
         500  +
        &mut self,
         501  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         502  +
    ) -> &mut Self {
         503  +
        self.config.store_or_unset(preference);
         504  +
        self
         505  +
    }
  444    506   
    /// Sets the endpoint resolver to use when making requests.
  445    507   
    ///
  446    508   
    ///
  447    509   
    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
  448    510   
    /// rules for `aws_sdk_cloudwatchlogs`.
  449    511   
    ///
  450    512   
    ///
  451    513   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  452    514   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  453    515   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
@@ -1281,1343 +1341,1413 @@
 1301   1363   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1302   1364   
        let config = {
 1303   1365   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Logs_20140328");
 1304   1366   
            cfg.store_put(crate::idempotency_token::default_provider());
 1305   1367   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1306   1368   
            ::std::option::Option::Some(cfg.freeze())
 1307   1369   
        };
 1308   1370   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1309   1371   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1310   1372   
            use crate::config::auth::ResolveAuthScheme;
        1373  +
            if let Some(preference) = _service_config
        1374  +
                .config
        1375  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1376  +
                .cloned()
        1377  +
            {
        1378  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1379  +
                    .with_auth_scheme_preference(preference)
        1380  +
                    .into_shared_resolver()
        1381  +
            } else {
 1311   1382   
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1383  +
            }
 1312   1384   
        }));
 1313   1385   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1314   1386   
            use crate::config::endpoint::ResolveEndpoint;
 1315   1387   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1316   1388   
        }));
 1317   1389   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1318   1390   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1319   1391   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1320   1392   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1321   1393   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1407,1479 +1466,1539 @@
 1427   1499   
            );
 1428   1500   
        }
 1429   1501   
        // resiliency
 1430   1502   
        builder.set_retry_config(input.retry_config().cloned());
 1431   1503   
        builder.set_timeout_config(input.timeout_config().cloned());
 1432   1504   
        builder.set_sleep_impl(input.sleep_impl());
 1433   1505   
 1434   1506   
        builder.set_http_client(input.http_client());
 1435   1507   
        builder.set_time_source(input.time_source());
 1436   1508   
        builder.set_behavior_version(input.behavior_version());
        1509  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1437   1510   
        // setting `None` here removes the default
 1438   1511   
        if let Some(config) = input.stalled_stream_protection() {
 1439   1512   
            builder.set_stalled_stream_protection(Some(config));
 1440   1513   
        }
 1441   1514   
 1442   1515   
        if let Some(cache) = input.identity_cache() {
 1443   1516   
            builder.set_identity_cache(cache);
 1444   1517   
        }
 1445   1518   
        builder.set_app_name(input.app_name().cloned());
 1446   1519   

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/config/auth.rs

@@ -18,18 +113,143 @@
   38     38   
        }
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
/// The default auth scheme resolver
   43     43   
#[derive(Debug)]
   44     44   
#[allow(dead_code)]
   45     45   
pub struct DefaultAuthSchemeResolver {
   46     46   
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
   47     47   
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
    preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
   48     49   
}
   49     50   
   50     51   
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
   51     52   
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
   52     53   
// of the `Default` trait may appear as if it could be derived automatically.
   53     54   
// However, that is not the case in production.
   54     55   
#[allow(clippy::derivable_impls)]
   55     56   
impl Default for DefaultAuthSchemeResolver {
   56     57   
    fn default() -> Self {
   57     58   
        Self {
   58     59   
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   59     60   
                .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   60     61   
                .build()
   61     62   
                .expect("required fields set")],
   62     63   
            operation_overrides: ::std::collections::HashMap::new(),
          64  +
            preference: ::std::option::Option::None,
   63     65   
        }
   64     66   
    }
   65     67   
}
   66     68   
   67     69   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   68     70   
    fn resolve_auth_scheme<'a>(
   69     71   
        &'a self,
   70     72   
        params: &'a crate::config::auth::Params,
   71     73   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   72     74   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   73     75   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   74     76   
        let operation_name = params.operation_name();
   75     77   
   76     78   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   77     79   
            Some(overrides) => overrides,
   78     80   
            None => &self.service_defaults,
   79     81   
        };
   80     82   
   81     83   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
   82     84   
   83         -
        _fut
          85  +
        match &self.preference {
          86  +
            ::std::option::Option::Some(preference) => {
          87  +
                _fut.map_ok({
          88  +
                    // maps auth scheme ID to the index in the preference list
          89  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
          90  +
                    move |auth_scheme_options| {
          91  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
          92  +
                            .into_iter()
          93  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
          94  +
          95  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
          96  +
                        preferred.extend(non_preferred);
          97  +
                        preferred
          98  +
                    }
          99  +
                })
         100  +
            }
         101  +
            ::std::option::Option::None => _fut,
         102  +
        }
         103  +
    }
         104  +
}
         105  +
         106  +
impl DefaultAuthSchemeResolver {
         107  +
    /// Set auth scheme preference to the default auth scheme resolver
         108  +
    pub fn with_auth_scheme_preference(
         109  +
        mut self,
         110  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         111  +
    ) -> Self {
         112  +
        self.preference = ::std::option::Option::Some(preference.into());
         113  +
        self
   84    114   
    }
   85    115   
}
   86    116   
   87    117   
/// Configuration parameters for resolving the correct auth scheme
   88    118   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   89    119   
pub struct Params {
   90    120   
    operation_name: ::std::borrow::Cow<'static, str>,
   91    121   
}
   92    122   
impl Params {
   93    123   
    /// Create a builder for [`Params`]

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

@@ -1,1 +135,135 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.5.9"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27         -
version = "1.2.5"
          27  +
version = "1.3.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http]
   30     30   
path = "../aws-smithy-http"
   31     31   
version = "0.62.1"
   32     32   
   33     33   
[dependencies.aws-smithy-json]
   34     34   
path = "../aws-smithy-json"
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client", "http-auth"]
   40         -
version = "1.8.4"
          40  +
version = "1.8.5"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x", "http-auth"]
   45         -
version = "1.8.3"
          45  +
version = "1.8.4"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53         -
version = "1.3.7"
          53  +
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.aws-config]
   70     70   
path = "../aws-config"
   71         -
version = "1.8.2"
          71  +
version = "1.8.3"
   72     72   
   73     73   
[dev-dependencies.aws-credential-types]
   74     74   
path = "../aws-credential-types"
   75     75   
features = ["test-util"]
   76     76   
version = "1.2.3"
   77     77   
   78     78   
[dev-dependencies.aws-runtime]
   79     79   
path = "../aws-runtime"
   80     80   
features = ["test-util"]
   81     81   
version = "1.5.9"
   82     82   
   83     83   
[dev-dependencies.aws-smithy-async]
   84     84   
path = "../aws-smithy-async"
   85     85   
features = ["test-util"]
   86         -
version = "1.2.5"
          86  +
version = "1.3.0"
   87     87   
   88     88   
[dev-dependencies.aws-smithy-http-client]
   89     89   
path = "../aws-smithy-http-client"
   90     90   
features = ["test-util", "wire-mock"]
   91     91   
version = "1.0.6"
   92     92   
   93     93   
[dev-dependencies.aws-smithy-protocol-test]
   94     94   
path = "../aws-smithy-protocol-test"
   95     95   
version = "0.63.4"
   96     96   
   97     97   
[dev-dependencies.aws-smithy-runtime]
   98     98   
path = "../aws-smithy-runtime"
   99     99   
features = ["test-util"]
  100         -
version = "1.8.4"
         100  +
version = "1.8.5"
  101    101   
  102    102   
[dev-dependencies.aws-smithy-runtime-api]
  103    103   
path = "../aws-smithy-runtime-api"
  104    104   
features = ["test-util"]
  105         -
version = "1.8.3"
         105  +
version = "1.8.4"
  106    106   
  107    107   
[dev-dependencies.aws-smithy-types]
  108    108   
path = "../aws-smithy-types"
  109    109   
features = ["test-util"]
  110    110   
version = "1.3.2"
  111    111   
  112    112   
[dev-dependencies.futures-util]
  113    113   
version = "0.3.25"
  114    114   
features = ["alloc"]
  115    115   
default-features = false

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

@@ -36,36 +95,99 @@
   56     56   
    }
   57     57   
    /// Return the auth schemes configured on this service config
   58     58   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     59   
        self.runtime_components.auth_schemes()
   60     60   
    }
   61     61   
   62     62   
    /// Return the auth scheme resolver configured on this service config
   63     63   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   64     64   
        self.runtime_components.auth_scheme_option_resolver()
   65     65   
    }
          66  +
    /// Returns the configured auth scheme preference
          67  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          68  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          69  +
    }
   66     70   
    /// Returns the endpoint resolver.
   67     71   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   68     72   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   69     73   
    }
   70     74   
    /// Return a reference to the retry configuration contained in this config, if any.
   71     75   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   72     76   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   73     77   
    }
   74     78   
   75     79   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -135,139 +194,199 @@
  155    159   
    ///
  156    160   
    pub fn new() -> Self {
  157    161   
        Self::default()
  158    162   
    }
  159    163   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  160    164   
    /// but not those in runtime components.
  161    165   
    #[allow(unused)]
  162    166   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  163    167   
        let mut builder = Self::new();
  164    168   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         169  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  165    170   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  166    171   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  167    172   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  168    173   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  169    174   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  170    175   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  171    176   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  172    177   
        builder
  173    178   
    }
  174    179   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
@@ -414,419 +473,535 @@
  434    439   
  435    440   
    /// Set the auth scheme resolver for the builder
  436    441   
    ///
  437    442   
    /// # Examples
  438    443   
    /// See an example for [`Self::auth_scheme_resolver`].
  439    444   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  440    445   
        self.runtime_components
  441    446   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  442    447   
        self
  443    448   
    }
         449  +
    /// Set the auth scheme preference for an auth scheme resolver
         450  +
    /// (typically the default auth scheme resolver).
         451  +
    ///
         452  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         453  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         454  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         455  +
    ///
         456  +
    /// The preference list is intended as a hint rather than a strict override.
         457  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         458  +
    ///
         459  +
    /// # Examples
         460  +
    ///
         461  +
    /// ```no_run
         462  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         463  +
    /// let config = aws_sdk_codecatalyst::Config::builder()
         464  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         465  +
    ///     // ...
         466  +
    ///     .build();
         467  +
    /// let client = aws_sdk_codecatalyst::Client::from_conf(config);
         468  +
    /// ```
         469  +
         470  +
    pub fn auth_scheme_preference(
         471  +
        mut self,
         472  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         473  +
    ) -> Self {
         474  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         475  +
        self
         476  +
    }
         477  +
         478  +
    /// Set the auth scheme preference for an auth scheme resolver
         479  +
    /// (typically the default auth scheme resolver).
         480  +
    ///
         481  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         482  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         483  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         484  +
    ///
         485  +
    /// The preference list is intended as a hint rather than a strict override.
         486  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         487  +
    ///
         488  +
    /// # Examples
         489  +
    ///
         490  +
    /// ```no_run
         491  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         492  +
    /// let config = aws_sdk_codecatalyst::Config::builder()
         493  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         494  +
    ///     // ...
         495  +
    ///     .build();
         496  +
    /// let client = aws_sdk_codecatalyst::Client::from_conf(config);
         497  +
    /// ```
         498  +
         499  +
    pub fn set_auth_scheme_preference(
         500  +
        &mut self,
         501  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         502  +
    ) -> &mut Self {
         503  +
        self.config.store_or_unset(preference);
         504  +
        self
         505  +
    }
  444    506   
    /// Sets the endpoint resolver to use when making requests.
  445    507   
    ///
  446    508   
    ///
  447    509   
    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
  448    510   
    /// rules for `aws_sdk_codecatalyst`.
  449    511   
    ///
  450    512   
    ///
  451    513   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  452    514   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  453    515   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
@@ -1282,1344 +1342,1414 @@
 1302   1364   
            cfg.store_put(crate::idempotency_token::default_provider());
 1303   1365   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1304   1366   
            ::std::option::Option::Some(cfg.freeze())
 1305   1367   
        };
 1306   1368   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1307   1369   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1308   1370   
            ::aws_smithy_runtime::client::auth::http::BearerAuthScheme::new(),
 1309   1371   
        ));
 1310   1372   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1311   1373   
            use crate::config::auth::ResolveAuthScheme;
        1374  +
            if let Some(preference) = _service_config
        1375  +
                .config
        1376  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1377  +
                .cloned()
        1378  +
            {
        1379  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1380  +
                    .with_auth_scheme_preference(preference)
        1381  +
                    .into_shared_resolver()
        1382  +
            } else {
 1312   1383   
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1384  +
            }
 1313   1385   
        }));
 1314   1386   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1315   1387   
            use crate::config::endpoint::ResolveEndpoint;
 1316   1388   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1317   1389   
        }));
 1318   1390   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1319   1391   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1320   1392   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1321   1393   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1322   1394   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1395,1467 +1454,1527 @@
 1415   1487   
            );
 1416   1488   
        }
 1417   1489   
        // resiliency
 1418   1490   
        builder.set_retry_config(input.retry_config().cloned());
 1419   1491   
        builder.set_timeout_config(input.timeout_config().cloned());
 1420   1492   
        builder.set_sleep_impl(input.sleep_impl());
 1421   1493   
 1422   1494   
        builder.set_http_client(input.http_client());
 1423   1495   
        builder.set_time_source(input.time_source());
 1424   1496   
        builder.set_behavior_version(input.behavior_version());
        1497  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1425   1498   
        // setting `None` here removes the default
 1426   1499   
        if let Some(config) = input.stalled_stream_protection() {
 1427   1500   
            builder.set_stalled_stream_protection(Some(config));
 1428   1501   
        }
 1429   1502   
 1430   1503   
        if let Some(cache) = input.identity_cache() {
 1431   1504   
            builder.set_identity_cache(cache);
 1432   1505   
        }
 1433   1506   
        builder.set_token_provider(input.token_provider());
 1434   1507   
        builder.set_app_name(input.app_name().cloned());

tmp-codegen-diff/aws-sdk/sdk/codecatalyst/src/config/auth.rs

@@ -18,18 +113,143 @@
   38     38   
        }
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
/// The default auth scheme resolver
   43     43   
#[derive(Debug)]
   44     44   
#[allow(dead_code)]
   45     45   
pub struct DefaultAuthSchemeResolver {
   46     46   
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
   47     47   
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
    preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
   48     49   
}
   49     50   
   50     51   
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
   51     52   
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
   52     53   
// of the `Default` trait may appear as if it could be derived automatically.
   53     54   
// However, that is not the case in production.
   54     55   
#[allow(clippy::derivable_impls)]
   55     56   
impl Default for DefaultAuthSchemeResolver {
   56     57   
    fn default() -> Self {
   57     58   
        Self {
   58     59   
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   59     60   
                .scheme_id(::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID)
   60     61   
                .build()
   61     62   
                .expect("required fields set")],
   62     63   
            operation_overrides: ::std::collections::HashMap::new(),
          64  +
            preference: ::std::option::Option::None,
   63     65   
        }
   64     66   
    }
   65     67   
}
   66     68   
   67     69   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   68     70   
    fn resolve_auth_scheme<'a>(
   69     71   
        &'a self,
   70     72   
        params: &'a crate::config::auth::Params,
   71     73   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   72     74   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   73     75   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   74     76   
        let operation_name = params.operation_name();
   75     77   
   76     78   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   77     79   
            Some(overrides) => overrides,
   78     80   
            None => &self.service_defaults,
   79     81   
        };
   80     82   
   81     83   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
   82     84   
   83         -
        _fut
          85  +
        match &self.preference {
          86  +
            ::std::option::Option::Some(preference) => {
          87  +
                _fut.map_ok({
          88  +
                    // maps auth scheme ID to the index in the preference list
          89  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
          90  +
                    move |auth_scheme_options| {
          91  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
          92  +
                            .into_iter()
          93  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
          94  +
          95  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
          96  +
                        preferred.extend(non_preferred);
          97  +
                        preferred
          98  +
                    }
          99  +
                })
         100  +
            }
         101  +
            ::std::option::Option::None => _fut,
         102  +
        }
         103  +
    }
         104  +
}
         105  +
         106  +
impl DefaultAuthSchemeResolver {
         107  +
    /// Set auth scheme preference to the default auth scheme resolver
         108  +
    pub fn with_auth_scheme_preference(
         109  +
        mut self,
         110  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         111  +
    ) -> Self {
         112  +
        self.preference = ::std::option::Option::Some(preference.into());
         113  +
        self
   84    114   
    }
   85    115   
}
   86    116   
   87    117   
/// Configuration parameters for resolving the correct auth scheme
   88    118   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   89    119   
pub struct Params {
   90    120   
    operation_name: ::std::borrow::Cow<'static, str>,
   91    121   
}
   92    122   
impl Params {
   93    123   
    /// Create a builder for [`Params`]

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

@@ -1,1 +89,89 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.5.9"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27         -
version = "1.2.5"
          27  +
version = "1.3.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http]
   30     30   
path = "../aws-smithy-http"
   31     31   
version = "0.62.1"
   32     32   
   33     33   
[dependencies.aws-smithy-json]
   34     34   
path = "../aws-smithy-json"
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40         -
version = "1.8.4"
          40  +
version = "1.8.5"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.3"
          45  +
version = "1.8.4"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53         -
version = "1.3.7"
          53  +
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.aws-config]
   70     70   
path = "../aws-config"
   71         -
version = "1.8.2"
          71  +
version = "1.8.3"
   72     72   
   73     73   
[dev-dependencies.aws-credential-types]
   74     74   
path = "../aws-credential-types"
   75     75   
features = ["test-util"]
   76     76   
version = "1.2.3"
   77     77   
   78     78   
[dev-dependencies.tokio]
   79     79   
version = "1.23.1"
   80     80   
features = ["macros", "test-util", "rt-multi-thread"]
   81     81   

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

@@ -36,36 +95,99 @@
   56     56   
    }
   57     57   
    /// Return the auth schemes configured on this service config
   58     58   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     59   
        self.runtime_components.auth_schemes()
   60     60   
    }
   61     61   
   62     62   
    /// Return the auth scheme resolver configured on this service config
   63     63   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   64     64   
        self.runtime_components.auth_scheme_option_resolver()
   65     65   
    }
          66  +
    /// Returns the configured auth scheme preference
          67  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          68  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          69  +
    }
   66     70   
    /// Returns the endpoint resolver.
   67     71   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   68     72   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   69     73   
    }
   70     74   
    /// Return a reference to the retry configuration contained in this config, if any.
   71     75   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   72     76   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   73     77   
    }
   74     78   
   75     79   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -149,153 +208,213 @@
  169    173   
    ///
  170    174   
    pub fn new() -> Self {
  171    175   
        Self::default()
  172    176   
    }
  173    177   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  174    178   
    /// but not those in runtime components.
  175    179   
    #[allow(unused)]
  176    180   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  177    181   
        let mut builder = Self::new();
  178    182   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         183  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  179    184   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  180    185   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  181    186   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  182    187   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  183    188   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  184    189   
        builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0));
  185    190   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  186    191   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  187    192   
        builder
  188    193   
    }
@@ -398,403 +457,519 @@
  418    423   
  419    424   
    /// Set the auth scheme resolver for the builder
  420    425   
    ///
  421    426   
    /// # Examples
  422    427   
    /// See an example for [`Self::auth_scheme_resolver`].
  423    428   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  424    429   
        self.runtime_components
  425    430   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  426    431   
        self
  427    432   
    }
         433  +
    /// Set the auth scheme preference for an auth scheme resolver
         434  +
    /// (typically the default auth scheme resolver).
         435  +
    ///
         436  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         437  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         438  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         439  +
    ///
         440  +
    /// The preference list is intended as a hint rather than a strict override.
         441  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         442  +
    ///
         443  +
    /// # Examples
         444  +
    ///
         445  +
    /// ```no_run
         446  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         447  +
    /// let config = aws_sdk_config::Config::builder()
         448  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         449  +
    ///     // ...
         450  +
    ///     .build();
         451  +
    /// let client = aws_sdk_config::Client::from_conf(config);
         452  +
    /// ```
         453  +
         454  +
    pub fn auth_scheme_preference(
         455  +
        mut self,
         456  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         457  +
    ) -> Self {
         458  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         459  +
        self
         460  +
    }
         461  +
         462  +
    /// Set the auth scheme preference for an auth scheme resolver
         463  +
    /// (typically the default auth scheme resolver).
         464  +
    ///
         465  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         466  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         467  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         468  +
    ///
         469  +
    /// The preference list is intended as a hint rather than a strict override.
         470  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         471  +
    ///
         472  +
    /// # Examples
         473  +
    ///
         474  +
    /// ```no_run
         475  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         476  +
    /// let config = aws_sdk_config::Config::builder()
         477  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         478  +
    ///     // ...
         479  +
    ///     .build();
         480  +
    /// let client = aws_sdk_config::Client::from_conf(config);
         481  +
    /// ```
         482  +
         483  +
    pub fn set_auth_scheme_preference(
         484  +
        &mut self,
         485  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         486  +
    ) -> &mut Self {
         487  +
        self.config.store_or_unset(preference);
         488  +
        self
         489  +
    }
  428    490   
    /// Sets the endpoint resolver to use when making requests.
  429    491   
    ///
  430    492   
    ///
  431    493   
    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
  432    494   
    /// rules for `aws_sdk_config`.
  433    495   
    ///
  434    496   
    ///
  435    497   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  436    498   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  437    499   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
@@ -1263,1325 +1323,1395 @@
 1283   1345   
impl ServiceRuntimePlugin {
 1284   1346   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1285   1347   
        let config = {
 1286   1348   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StarlingDoveService");
 1287   1349   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1288   1350   
            ::std::option::Option::Some(cfg.freeze())
 1289   1351   
        };
 1290   1352   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1291   1353   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1292   1354   
            use crate::config::auth::ResolveAuthScheme;
        1355  +
            if let Some(preference) = _service_config
        1356  +
                .config
        1357  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1358  +
                .cloned()
        1359  +
            {
        1360  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1361  +
                    .with_auth_scheme_preference(preference)
        1362  +
                    .into_shared_resolver()
        1363  +
            } else {
 1293   1364   
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1365  +
            }
 1294   1366   
        }));
 1295   1367   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1296   1368   
            use crate::config::endpoint::ResolveEndpoint;
 1297   1369   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1298   1370   
        }));
 1299   1371   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1300   1372   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1301   1373   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1302   1374   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1303   1375   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1389,1461 +1448,1521 @@
 1409   1481   
            );
 1410   1482   
        }
 1411   1483   
        // resiliency
 1412   1484   
        builder.set_retry_config(input.retry_config().cloned());
 1413   1485   
        builder.set_timeout_config(input.timeout_config().cloned());
 1414   1486   
        builder.set_sleep_impl(input.sleep_impl());
 1415   1487   
 1416   1488   
        builder.set_http_client(input.http_client());
 1417   1489   
        builder.set_time_source(input.time_source());
 1418   1490   
        builder.set_behavior_version(input.behavior_version());
        1491  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1419   1492   
        // setting `None` here removes the default
 1420   1493   
        if let Some(config) = input.stalled_stream_protection() {
 1421   1494   
            builder.set_stalled_stream_protection(Some(config));
 1422   1495   
        }
 1423   1496   
 1424   1497   
        if let Some(cache) = input.identity_cache() {
 1425   1498   
            builder.set_identity_cache(cache);
 1426   1499   
        }
 1427   1500   
        builder.set_app_name(input.app_name().cloned());
 1428   1501   

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

@@ -18,18 +113,143 @@
   38     38   
        }
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
/// The default auth scheme resolver
   43     43   
#[derive(Debug)]
   44     44   
#[allow(dead_code)]
   45     45   
pub struct DefaultAuthSchemeResolver {
   46     46   
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
   47     47   
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
    preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
   48     49   
}
   49     50   
   50     51   
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
   51     52   
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
   52     53   
// of the `Default` trait may appear as if it could be derived automatically.
   53     54   
// However, that is not the case in production.
   54     55   
#[allow(clippy::derivable_impls)]
   55     56   
impl Default for DefaultAuthSchemeResolver {
   56     57   
    fn default() -> Self {
   57     58   
        Self {
   58     59   
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   59     60   
                .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   60     61   
                .build()
   61     62   
                .expect("required fields set")],
   62     63   
            operation_overrides: ::std::collections::HashMap::new(),
          64  +
            preference: ::std::option::Option::None,
   63     65   
        }
   64     66   
    }
   65     67   
}
   66     68   
   67     69   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   68     70   
    fn resolve_auth_scheme<'a>(
   69     71   
        &'a self,
   70     72   
        params: &'a crate::config::auth::Params,
   71     73   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   72     74   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   73     75   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   74     76   
        let operation_name = params.operation_name();
   75     77   
   76     78   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   77     79   
            Some(overrides) => overrides,
   78     80   
            None => &self.service_defaults,
   79     81   
        };
   80     82   
   81     83   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
   82     84   
   83         -
        _fut
          85  +
        match &self.preference {
          86  +
            ::std::option::Option::Some(preference) => {
          87  +
                _fut.map_ok({
          88  +
                    // maps auth scheme ID to the index in the preference list
          89  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
          90  +
                    move |auth_scheme_options| {
          91  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
          92  +
                            .into_iter()
          93  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
          94  +
          95  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
          96  +
                        preferred.extend(non_preferred);
          97  +
                        preferred
          98  +
                    }
          99  +
                })
         100  +
            }
         101  +
            ::std::option::Option::None => _fut,
         102  +
        }
         103  +
    }
         104  +
}
         105  +
         106  +
impl DefaultAuthSchemeResolver {
         107  +
    /// Set auth scheme preference to the default auth scheme resolver
         108  +
    pub fn with_auth_scheme_preference(
         109  +
        mut self,
         110  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         111  +
    ) -> Self {
         112  +
        self.preference = ::std::option::Option::Some(preference.into());
         113  +
        self
   84    114   
    }
   85    115   
}
   86    116   
   87    117   
/// Configuration parameters for resolving the correct auth scheme
   88    118   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   89    119   
pub struct Params {
   90    120   
    operation_name: ::std::borrow::Cow<'static, str>,
   91    121   
}
   92    122   
impl Params {
   93    123   
    /// Create a builder for [`Params`]

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

@@ -1,1 +138,138 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.5.9"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27         -
version = "1.2.5"
          27  +
version = "1.3.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http]
   30     30   
path = "../aws-smithy-http"
   31     31   
version = "0.62.1"
   32     32   
   33     33   
[dependencies.aws-smithy-json]
   34     34   
path = "../aws-smithy-json"
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40         -
version = "1.8.4"
          40  +
version = "1.8.5"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.3"
          45  +
version = "1.8.4"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53         -
version = "1.3.7"
          53  +
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.approx]
   70     70   
version = "0.5.1"
   71     71   
   72     72   
[dev-dependencies.aws-config]
   73     73   
path = "../aws-config"
   74         -
version = "1.8.2"
          74  +
version = "1.8.3"
   75     75   
   76     76   
[dev-dependencies.aws-credential-types]
   77     77   
path = "../aws-credential-types"
   78     78   
features = ["test-util"]
   79     79   
version = "1.2.3"
   80     80   
   81     81   
[dev-dependencies.aws-runtime]
   82     82   
path = "../aws-runtime"
   83     83   
features = ["test-util"]
   84     84   
version = "1.5.9"
   85     85   
   86     86   
[dev-dependencies.aws-smithy-async]
   87     87   
path = "../aws-smithy-async"
   88     88   
features = ["test-util"]
   89         -
version = "1.2.5"
          89  +
version = "1.3.0"
   90     90   
   91     91   
[dev-dependencies.aws-smithy-http-client]
   92     92   
path = "../aws-smithy-http-client"
   93     93   
features = ["test-util", "wire-mock"]
   94     94   
version = "1.0.6"
   95     95   
   96     96   
[dev-dependencies.aws-smithy-protocol-test]
   97     97   
path = "../aws-smithy-protocol-test"
   98     98   
version = "0.63.4"
   99     99   
  100    100   
[dev-dependencies.aws-smithy-runtime]
  101    101   
path = "../aws-smithy-runtime"
  102    102   
features = ["test-util"]
  103         -
version = "1.8.4"
         103  +
version = "1.8.5"
  104    104   
  105    105   
[dev-dependencies.aws-smithy-runtime-api]
  106    106   
path = "../aws-smithy-runtime-api"
  107    107   
features = ["test-util"]
  108         -
version = "1.8.3"
         108  +
version = "1.8.4"
  109    109   
  110    110   
[dev-dependencies.aws-smithy-types]
  111    111   
path = "../aws-smithy-types"
  112    112   
features = ["test-util"]
  113    113   
version = "1.3.2"
  114    114   
  115    115   
[dev-dependencies.criterion]
  116    116   
version = "0.5.0"
  117    117   
  118    118   
[dev-dependencies.futures-util]

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

@@ -36,36 +95,99 @@
   56     56   
    }
   57     57   
    /// Return the auth schemes configured on this service config
   58     58   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     59   
        self.runtime_components.auth_schemes()
   60     60   
    }
   61     61   
   62     62   
    /// Return the auth scheme resolver configured on this service config
   63     63   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   64     64   
        self.runtime_components.auth_scheme_option_resolver()
   65     65   
    }
          66  +
    /// Returns the configured auth scheme preference
          67  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          68  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          69  +
    }
   66     70   
    /// Returns the endpoint resolver.
   67     71   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   68     72   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   69     73   
    }
   70     74   
    /// Return a reference to the retry configuration contained in this config, if any.
   71     75   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   72     76   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   73     77   
    }
   74     78   
   75     79   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -149,153 +208,213 @@
  169    173   
    ///
  170    174   
    pub fn new() -> Self {
  171    175   
        Self::default()
  172    176   
    }
  173    177   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  174    178   
    /// but not those in runtime components.
  175    179   
    #[allow(unused)]
  176    180   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  177    181   
        let mut builder = Self::new();
  178    182   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         183  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  179    184   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  180    185   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  181    186   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  182    187   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  183    188   
        builder.set_account_id_endpoint_mode(config_bag.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned());
  184    189   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  185    190   
        builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0));
  186    191   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  187    192   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  188    193   
        builder
@@ -415,420 +474,536 @@
  435    440   
  436    441   
    /// Set the auth scheme resolver for the builder
  437    442   
    ///
  438    443   
    /// # Examples
  439    444   
    /// See an example for [`Self::auth_scheme_resolver`].
  440    445   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  441    446   
        self.runtime_components
  442    447   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  443    448   
        self
  444    449   
    }
         450  +
    /// Set the auth scheme preference for an auth scheme resolver
         451  +
    /// (typically the default auth scheme resolver).
         452  +
    ///
         453  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         454  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         455  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         456  +
    ///
         457  +
    /// The preference list is intended as a hint rather than a strict override.
         458  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         459  +
    ///
         460  +
    /// # Examples
         461  +
    ///
         462  +
    /// ```no_run
         463  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         464  +
    /// let config = aws_sdk_dynamodb::Config::builder()
         465  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         466  +
    ///     // ...
         467  +
    ///     .build();
         468  +
    /// let client = aws_sdk_dynamodb::Client::from_conf(config);
         469  +
    /// ```
         470  +
         471  +
    pub fn auth_scheme_preference(
         472  +
        mut self,
         473  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         474  +
    ) -> Self {
         475  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         476  +
        self
         477  +
    }
         478  +
         479  +
    /// Set the auth scheme preference for an auth scheme resolver
         480  +
    /// (typically the default auth scheme resolver).
         481  +
    ///
         482  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         483  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         484  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         485  +
    ///
         486  +
    /// The preference list is intended as a hint rather than a strict override.
         487  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         488  +
    ///
         489  +
    /// # Examples
         490  +
    ///
         491  +
    /// ```no_run
         492  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         493  +
    /// let config = aws_sdk_dynamodb::Config::builder()
         494  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         495  +
    ///     // ...
         496  +
    ///     .build();
         497  +
    /// let client = aws_sdk_dynamodb::Client::from_conf(config);
         498  +
    /// ```
         499  +
         500  +
    pub fn set_auth_scheme_preference(
         501  +
        &mut self,
         502  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         503  +
    ) -> &mut Self {
         504  +
        self.config.store_or_unset(preference);
         505  +
        self
         506  +
    }
  445    507   
    /// Sets the endpoint resolver to use when making requests.
  446    508   
    ///
  447    509   
    ///
  448    510   
    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
  449    511   
    /// rules for `aws_sdk_dynamodb`.
  450    512   
    ///
  451    513   
    ///
  452    514   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  453    515   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  454    516   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
@@ -1295,1357 +1355,1427 @@
 1315   1377   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1316   1378   
        let config = {
 1317   1379   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DynamoDB_20120810");
 1318   1380   
            cfg.store_put(crate::idempotency_token::default_provider());
 1319   1381   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1320   1382   
            ::std::option::Option::Some(cfg.freeze())
 1321   1383   
        };
 1322   1384   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1323   1385   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1324   1386   
            use crate::config::auth::ResolveAuthScheme;
        1387  +
            if let Some(preference) = _service_config
        1388  +
                .config
        1389  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1390  +
                .cloned()
        1391  +
            {
        1392  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1393  +
                    .with_auth_scheme_preference(preference)
        1394  +
                    .into_shared_resolver()
        1395  +
            } else {
 1325   1396   
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1397  +
            }
 1326   1398   
        }));
 1327   1399   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1328   1400   
            use crate::config::endpoint::ResolveEndpoint;
 1329   1401   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1330   1402   
        }));
 1331   1403   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1332   1404   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1333   1405   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1334   1406   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1335   1407   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1422,1494 +1481,1554 @@
 1442   1514   
        }
 1443   1515   
        builder.set_account_id_endpoint_mode(input.account_id_endpoint_mode().cloned());
 1444   1516   
        // resiliency
 1445   1517   
        builder.set_retry_config(input.retry_config().cloned());
 1446   1518   
        builder.set_timeout_config(input.timeout_config().cloned());
 1447   1519   
        builder.set_sleep_impl(input.sleep_impl());
 1448   1520   
 1449   1521   
        builder.set_http_client(input.http_client());
 1450   1522   
        builder.set_time_source(input.time_source());
 1451   1523   
        builder.set_behavior_version(input.behavior_version());
        1524  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1452   1525   
        // setting `None` here removes the default
 1453   1526   
        if let Some(config) = input.stalled_stream_protection() {
 1454   1527   
            builder.set_stalled_stream_protection(Some(config));
 1455   1528   
        }
 1456   1529   
 1457   1530   
        if let Some(cache) = input.identity_cache() {
 1458   1531   
            builder.set_identity_cache(cache);
 1459   1532   
        }
 1460   1533   
        builder.set_app_name(input.app_name().cloned());
 1461   1534   

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/config/auth.rs

@@ -18,18 +113,143 @@
   38     38   
        }
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
/// The default auth scheme resolver
   43     43   
#[derive(Debug)]
   44     44   
#[allow(dead_code)]
   45     45   
pub struct DefaultAuthSchemeResolver {
   46     46   
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
   47     47   
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
    preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
   48     49   
}
   49     50   
   50     51   
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
   51     52   
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
   52     53   
// of the `Default` trait may appear as if it could be derived automatically.
   53     54   
// However, that is not the case in production.
   54     55   
#[allow(clippy::derivable_impls)]
   55     56   
impl Default for DefaultAuthSchemeResolver {
   56     57   
    fn default() -> Self {
   57     58   
        Self {
   58     59   
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   59     60   
                .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   60     61   
                .build()
   61     62   
                .expect("required fields set")],
   62     63   
            operation_overrides: ::std::collections::HashMap::new(),
          64  +
            preference: ::std::option::Option::None,
   63     65   
        }
   64     66   
    }
   65     67   
}
   66     68   
   67     69   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   68     70   
    fn resolve_auth_scheme<'a>(
   69     71   
        &'a self,
   70     72   
        params: &'a crate::config::auth::Params,
   71     73   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   72     74   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   73     75   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   74     76   
        let operation_name = params.operation_name();
   75     77   
   76     78   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   77     79   
            Some(overrides) => overrides,
   78     80   
            None => &self.service_defaults,
   79     81   
        };
   80     82   
   81     83   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
   82     84   
   83         -
        _fut
          85  +
        match &self.preference {
          86  +
            ::std::option::Option::Some(preference) => {
          87  +
                _fut.map_ok({
          88  +
                    // maps auth scheme ID to the index in the preference list
          89  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
          90  +
                    move |auth_scheme_options| {
          91  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
          92  +
                            .into_iter()
          93  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
          94  +
          95  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
          96  +
                        preferred.extend(non_preferred);
          97  +
                        preferred
          98  +
                    }
          99  +
                })
         100  +
            }
         101  +
            ::std::option::Option::None => _fut,
         102  +
        }
         103  +
    }
         104  +
}
         105  +
         106  +
impl DefaultAuthSchemeResolver {
         107  +
    /// Set auth scheme preference to the default auth scheme resolver
         108  +
    pub fn with_auth_scheme_preference(
         109  +
        mut self,
         110  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         111  +
    ) -> Self {
         112  +
        self.preference = ::std::option::Option::Some(preference.into());
         113  +
        self
   84    114   
    }
   85    115   
}
   86    116   
   87    117   
/// Configuration parameters for resolving the correct auth scheme
   88    118   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   89    119   
pub struct Params {
   90    120   
    operation_name: ::std::borrow::Cow<'static, str>,
   91    121   
}
   92    122   
impl Params {
   93    123   
    /// Create a builder for [`Params`]

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

@@ -1,1 +140,140 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.5.9"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27         -
version = "1.2.5"
          27  +
version = "1.3.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http]
   30     30   
path = "../aws-smithy-http"
   31     31   
version = "0.62.1"
   32     32   
   33     33   
[dependencies.aws-smithy-json]
   34     34   
path = "../aws-smithy-json"
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-query]
   38     38   
path = "../aws-smithy-query"
   39     39   
version = "0.60.7"
   40     40   
   41     41   
[dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44         -
version = "1.8.4"
          44  +
version = "1.8.5"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime-api]
   47     47   
path = "../aws-smithy-runtime-api"
   48     48   
features = ["client", "http-02x"]
   49         -
version = "1.8.3"
          49  +
version = "1.8.4"
   50     50   
   51     51   
[dependencies.aws-smithy-types]
   52     52   
path = "../aws-smithy-types"
   53     53   
version = "1.3.2"
   54     54   
   55     55   
[dependencies.aws-smithy-xml]
   56     56   
path = "../aws-smithy-xml"
   57     57   
version = "0.60.10"
   58     58   
   59     59   
[dependencies.aws-types]
   60     60   
path = "../aws-types"
   61         -
version = "1.3.7"
          61  +
version = "1.3.8"
   62     62   
   63     63   
[dependencies.fastrand]
   64     64   
version = "2.0.0"
   65     65   
   66     66   
[dependencies.http]
   67     67   
version = "0.2.9"
   68     68   
   69     69   
[dependencies.regex-lite]
   70     70   
version = "0.1.5"
   71     71   
   72     72   
[dependencies.tracing]
   73     73   
version = "0.1"
   74     74   
[dev-dependencies.aws-config]
   75     75   
path = "../aws-config"
   76         -
version = "1.8.2"
          76  +
version = "1.8.3"
   77     77   
   78     78   
[dev-dependencies.aws-credential-types]
   79     79   
path = "../aws-credential-types"
   80     80   
features = ["test-util"]
   81     81   
version = "1.2.3"
   82     82   
   83     83   
[dev-dependencies.aws-runtime]
   84     84   
path = "../aws-runtime"
   85     85   
features = ["test-util"]
   86     86   
version = "1.5.9"
   87     87   
   88     88   
[dev-dependencies.aws-smithy-async]
   89     89   
path = "../aws-smithy-async"
   90     90   
features = ["test-util"]
   91         -
version = "1.2.5"
          91  +
version = "1.3.0"
   92     92   
   93     93   
[dev-dependencies.aws-smithy-http-client]
   94     94   
path = "../aws-smithy-http-client"
   95     95   
features = ["test-util", "wire-mock"]
   96     96   
version = "1.0.6"
   97     97   
   98     98   
[dev-dependencies.aws-smithy-protocol-test]
   99     99   
path = "../aws-smithy-protocol-test"
  100    100   
version = "0.63.4"
  101    101   
  102    102   
[dev-dependencies.aws-smithy-runtime]
  103    103   
path = "../aws-smithy-runtime"
  104    104   
features = ["test-util"]
  105         -
version = "1.8.4"
         105  +
version = "1.8.5"
  106    106   
  107    107   
[dev-dependencies.aws-smithy-runtime-api]
  108    108   
path = "../aws-smithy-runtime-api"
  109    109   
features = ["test-util"]
  110         -
version = "1.8.3"
         110  +
version = "1.8.4"
  111    111   
  112    112   
[dev-dependencies.aws-smithy-types]
  113    113   
path = "../aws-smithy-types"
  114    114   
features = ["test-util"]
  115    115   
version = "1.3.2"
  116    116   
  117    117   
[dev-dependencies.futures-util]
  118    118   
version = "0.3.25"
  119    119   
features = ["alloc"]
  120    120   
default-features = false

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

@@ -36,36 +95,99 @@
   56     56   
    }
   57     57   
    /// Return the auth schemes configured on this service config
   58     58   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     59   
        self.runtime_components.auth_schemes()
   60     60   
    }
   61     61   
   62     62   
    /// Return the auth scheme resolver configured on this service config
   63     63   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   64     64   
        self.runtime_components.auth_scheme_option_resolver()
   65     65   
    }
          66  +
    /// Returns the configured auth scheme preference
          67  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          68  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          69  +
    }
   66     70   
    /// Returns the endpoint resolver.
   67     71   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   68     72   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   69     73   
    }
   70     74   
    /// Return a reference to the retry configuration contained in this config, if any.
   71     75   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   72     76   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   73     77   
    }
   74     78   
   75     79   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -149,153 +208,213 @@
  169    173   
    ///
  170    174   
    pub fn new() -> Self {
  171    175   
        Self::default()
  172    176   
    }
  173    177   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  174    178   
    /// but not those in runtime components.
  175    179   
    #[allow(unused)]
  176    180   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  177    181   
        let mut builder = Self::new();
  178    182   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         183  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  179    184   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  180    185   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  181    186   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  182    187   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  183    188   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  184    189   
        builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0));
  185    190   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  186    191   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  187    192   
        builder
  188    193   
    }
@@ -414,419 +473,535 @@
  434    439   
  435    440   
    /// Set the auth scheme resolver for the builder
  436    441   
    ///
  437    442   
    /// # Examples
  438    443   
    /// See an example for [`Self::auth_scheme_resolver`].
  439    444   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  440    445   
        self.runtime_components
  441    446   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  442    447   
        self
  443    448   
    }
         449  +
    /// Set the auth scheme preference for an auth scheme resolver
         450  +
    /// (typically the default auth scheme resolver).
         451  +
    ///
         452  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         453  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         454  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         455  +
    ///
         456  +
    /// The preference list is intended as a hint rather than a strict override.
         457  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         458  +
    ///
         459  +
    /// # Examples
         460  +
    ///
         461  +
    /// ```no_run
         462  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         463  +
    /// let config = aws_sdk_ec2::Config::builder()
         464  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         465  +
    ///     // ...
         466  +
    ///     .build();
         467  +
    /// let client = aws_sdk_ec2::Client::from_conf(config);
         468  +
    /// ```
         469  +
         470  +
    pub fn auth_scheme_preference(
         471  +
        mut self,
         472  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         473  +
    ) -> Self {
         474  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         475  +
        self
         476  +
    }
         477  +
         478  +
    /// Set the auth scheme preference for an auth scheme resolver
         479  +
    /// (typically the default auth scheme resolver).
         480  +
    ///
         481  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         482  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         483  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         484  +
    ///
         485  +
    /// The preference list is intended as a hint rather than a strict override.
         486  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         487  +
    ///
         488  +
    /// # Examples
         489  +
    ///
         490  +
    /// ```no_run
         491  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         492  +
    /// let config = aws_sdk_ec2::Config::builder()
         493  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         494  +
    ///     // ...
         495  +
    ///     .build();
         496  +
    /// let client = aws_sdk_ec2::Client::from_conf(config);
         497  +
    /// ```
         498  +
         499  +
    pub fn set_auth_scheme_preference(
         500  +
        &mut self,
         501  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         502  +
    ) -> &mut Self {
         503  +
        self.config.store_or_unset(preference);
         504  +
        self
         505  +
    }
  444    506   
    /// Sets the endpoint resolver to use when making requests.
  445    507   
    ///
  446    508   
    ///
  447    509   
    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
  448    510   
    /// rules for `aws_sdk_ec2`.
  449    511   
    ///
  450    512   
    ///
  451    513   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  452    514   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  453    515   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
@@ -1281,1343 +1341,1413 @@
 1301   1363   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1302   1364   
        let config = {
 1303   1365   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonEC2");
 1304   1366   
            cfg.store_put(crate::idempotency_token::default_provider());
 1305   1367   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1306   1368   
            ::std::option::Option::Some(cfg.freeze())
 1307   1369   
        };
 1308   1370   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1309   1371   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1310   1372   
            use crate::config::auth::ResolveAuthScheme;
        1373  +
            if let Some(preference) = _service_config
        1374  +
                .config
        1375  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1376  +
                .cloned()
        1377  +
            {
        1378  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1379  +
                    .with_auth_scheme_preference(preference)
        1380  +
                    .into_shared_resolver()
        1381  +
            } else {
 1311   1382   
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1383  +
            }
 1312   1384   
        }));
 1313   1385   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1314   1386   
            use crate::config::endpoint::ResolveEndpoint;
 1315   1387   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1316   1388   
        }));
 1317   1389   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1318   1390   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1319   1391   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1320   1392   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1321   1393   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1407,1479 +1466,1539 @@
 1427   1499   
            );
 1428   1500   
        }
 1429   1501   
        // resiliency
 1430   1502   
        builder.set_retry_config(input.retry_config().cloned());
 1431   1503   
        builder.set_timeout_config(input.timeout_config().cloned());
 1432   1504   
        builder.set_sleep_impl(input.sleep_impl());
 1433   1505   
 1434   1506   
        builder.set_http_client(input.http_client());
 1435   1507   
        builder.set_time_source(input.time_source());
 1436   1508   
        builder.set_behavior_version(input.behavior_version());
        1509  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1437   1510   
        // setting `None` here removes the default
 1438   1511   
        if let Some(config) = input.stalled_stream_protection() {
 1439   1512   
            builder.set_stalled_stream_protection(Some(config));
 1440   1513   
        }
 1441   1514   
 1442   1515   
        if let Some(cache) = input.identity_cache() {
 1443   1516   
            builder.set_identity_cache(cache);
 1444   1517   
        }
 1445   1518   
        builder.set_app_name(input.app_name().cloned());
 1446   1519   

tmp-codegen-diff/aws-sdk/sdk/ec2/src/config/auth.rs

@@ -18,18 +113,143 @@
   38     38   
        }
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
/// The default auth scheme resolver
   43     43   
#[derive(Debug)]
   44     44   
#[allow(dead_code)]
   45     45   
pub struct DefaultAuthSchemeResolver {
   46     46   
    service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>,
   47     47   
    operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>,
          48  +
    preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
   48     49   
}
   49     50   
   50     51   
// TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed.
   51     52   
// When generating code for tests (e.g., `codegen-client-test`), this manual implementation
   52     53   
// of the `Default` trait may appear as if it could be derived automatically.
   53     54   
// However, that is not the case in production.
   54     55   
#[allow(clippy::derivable_impls)]
   55     56   
impl Default for DefaultAuthSchemeResolver {
   56     57   
    fn default() -> Self {
   57     58   
        Self {
   58     59   
            service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   59     60   
                .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   60     61   
                .build()
   61     62   
                .expect("required fields set")],
   62     63   
            operation_overrides: ::std::collections::HashMap::new(),
          64  +
            preference: ::std::option::Option::None,
   63     65   
        }
   64     66   
    }
   65     67   
}
   66     68   
   67     69   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   68     70   
    fn resolve_auth_scheme<'a>(
   69     71   
        &'a self,
   70     72   
        params: &'a crate::config::auth::Params,
   71     73   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   72     74   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   73     75   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   74     76   
        let operation_name = params.operation_name();
   75     77   
   76     78   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   77     79   
            Some(overrides) => overrides,
   78     80   
            None => &self.service_defaults,
   79     81   
        };
   80     82   
   81     83   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
   82     84   
   83         -
        _fut
          85  +
        match &self.preference {
          86  +
            ::std::option::Option::Some(preference) => {
          87  +
                _fut.map_ok({
          88  +
                    // maps auth scheme ID to the index in the preference list
          89  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
          90  +
                    move |auth_scheme_options| {
          91  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
          92  +
                            .into_iter()
          93  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
          94  +
          95  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
          96  +
                        preferred.extend(non_preferred);
          97  +
                        preferred
          98  +
                    }
          99  +
                })
         100  +
            }
         101  +
            ::std::option::Option::None => _fut,
         102  +
        }
         103  +
    }
         104  +
}
         105  +
         106  +
impl DefaultAuthSchemeResolver {
         107  +
    /// Set auth scheme preference to the default auth scheme resolver
         108  +
    pub fn with_auth_scheme_preference(
         109  +
        mut self,
         110  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         111  +
    ) -> Self {
         112  +
        self.preference = ::std::option::Option::Some(preference.into());
         113  +
        self
   84    114   
    }
   85    115   
}
   86    116   
   87    117   
/// Configuration parameters for resolving the correct auth scheme
   88    118   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   89    119   
pub struct Params {
   90    120   
    operation_name: ::std::borrow::Cow<'static, str>,
   91    121   
}
   92    122   
impl Params {
   93    123   
    /// Create a builder for [`Params`]

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

@@ -1,1 +89,89 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.3"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.5.9"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27         -
version = "1.2.5"
          27  +
version = "1.3.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http]
   30     30   
path = "../aws-smithy-http"
   31     31   
version = "0.62.1"
   32     32   
   33     33   
[dependencies.aws-smithy-json]
   34     34   
path = "../aws-smithy-json"
   35     35   
version = "0.61.4"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime]
   38     38   
path = "../aws-smithy-runtime"
   39     39   
features = ["client"]
   40         -
version = "1.8.4"
          40  +
version = "1.8.5"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime-api]
   43     43   
path = "../aws-smithy-runtime-api"
   44     44   
features = ["client", "http-02x"]
   45         -
version = "1.8.3"
          45  +
version = "1.8.4"
   46     46   
   47     47   
[dependencies.aws-smithy-types]
   48     48   
path = "../aws-smithy-types"
   49     49   
version = "1.3.2"
   50     50   
   51     51   
[dependencies.aws-types]
   52     52   
path = "../aws-types"
   53         -
version = "1.3.7"
          53  +
version = "1.3.8"
   54     54   
   55     55   
[dependencies.bytes]
   56     56   
version = "1.4.0"
   57     57   
   58     58   
[dependencies.fastrand]
   59     59   
version = "2.0.0"
   60     60   
   61     61   
[dependencies.http]
   62     62   
version = "0.2.9"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.aws-config]
   70     70   
path = "../aws-config"
   71         -
version = "1.8.2"
          71  +
version = "1.8.3"
   72     72   
   73     73   
[dev-dependencies.aws-credential-types]
   74     74   
path = "../aws-credential-types"
   75     75   
features = ["test-util"]
   76     76   
version = "1.2.3"
   77     77   
   78     78   
[dev-dependencies.tokio]
   79     79   
version = "1.23.1"
   80     80   
features = ["macros", "test-util", "rt-multi-thread"]
   81     81