AWS SDK

AWS SDK

rev. 2d483a0880c30683858329fc8411e9f9282de633

Files changed:

tmp-codegen-diff/aws-sdk/sdk/polly/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/qldbsession/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"]
   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.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/qldbsession/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_qldbsession::Config::builder()
         448  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         449  +
    ///     // ...
         450  +
    ///     .build();
         451  +
    /// let client = aws_sdk_qldbsession::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_qldbsession::Config::builder()
         477  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         478  +
    ///     // ...
         479  +
    ///     .build();
         480  +
    /// let client = aws_sdk_qldbsession::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_qldbsession`.
  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("QLDBSession");
 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;
 1293         -
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        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 {
        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/qldbsession/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/route53/Cargo.toml

@@ -1,1 +102,102 @@
   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-smithy-xml]
   52     52   
path = "../aws-smithy-xml"
   53     53   
version = "0.60.10"
   54     54   
   55     55   
[dependencies.aws-types]
   56     56   
path = "../aws-types"
   57         -
version = "1.3.7"
          57  +
version = "1.3.8"
   58     58   
   59     59   
[dependencies.fastrand]
   60     60   
version = "2.0.0"
   61     61   
   62     62   
[dependencies.http]
   63     63   
version = "0.2.9"
   64     64   
   65     65   
[dependencies.regex-lite]
   66     66   
version = "0.1.5"
   67     67   
   68     68   
[dependencies.tracing]
   69     69   
version = "0.1"
   70     70   
[dev-dependencies.aws-config]
   71     71   
path = "../aws-config"
   72         -
version = "1.8.2"
          72  +
version = "1.8.3"
   73     73   
   74     74   
[dev-dependencies.aws-credential-types]
   75     75   
path = "../aws-credential-types"
   76     76   
features = ["test-util"]
   77     77   
version = "1.2.3"
   78     78   
   79     79   
[dev-dependencies.aws-smithy-http-client]
   80     80   
path = "../aws-smithy-http-client"
   81     81   
features = ["test-util"]
   82     82   
version = "1.0.6"

tmp-codegen-diff/aws-sdk/sdk/route53/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_route53::Config::builder()
         448  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         449  +
    ///     // ...
         450  +
    ///     .build();
         451  +
    /// let client = aws_sdk_route53::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_route53::Config::builder()
         477  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         478  +
    ///     // ...
         479  +
    ///     .build();
         480  +
    /// let client = aws_sdk_route53::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_route53`.
  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("AWSDnsV20130401");
 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;
 1293         -
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        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 {
        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/route53/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/s3/Cargo.toml

@@ -2,2 +196,196 @@
   22     22   
path = "../aws-runtime"
   23     23   
features = ["event-stream", "http-02x"]
   24     24   
version = "1.5.9"
   25     25   
   26     26   
[dependencies.aws-sigv4]
   27     27   
path = "../aws-sigv4"
   28     28   
version = "1.3.3"
   29     29   
   30     30   
[dependencies.aws-smithy-async]
   31     31   
path = "../aws-smithy-async"
   32         -
version = "1.2.5"
          32  +
version = "1.3.0"
   33     33   
   34     34   
[dependencies.aws-smithy-checksums]
   35     35   
path = "../aws-smithy-checksums"
   36     36   
version = "0.63.4"
   37     37   
   38     38   
[dependencies.aws-smithy-eventstream]
   39     39   
path = "../aws-smithy-eventstream"
   40     40   
version = "0.60.9"
   41     41   
   42     42   
[dependencies.aws-smithy-http]
   43     43   
path = "../aws-smithy-http"
   44     44   
features = ["event-stream"]
   45     45   
version = "0.62.1"
   46     46   
   47     47   
[dependencies.aws-smithy-json]
   48     48   
path = "../aws-smithy-json"
   49     49   
version = "0.61.4"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime]
   52     52   
path = "../aws-smithy-runtime"
   53     53   
features = ["client"]
   54         -
version = "1.8.4"
          54  +
version = "1.8.5"
   55     55   
   56     56   
[dependencies.aws-smithy-runtime-api]
   57     57   
path = "../aws-smithy-runtime-api"
   58     58   
features = ["client", "http-02x"]
   59         -
version = "1.8.3"
          59  +
version = "1.8.4"
   60     60   
   61     61   
[dependencies.aws-smithy-types]
   62     62   
path = "../aws-smithy-types"
   63     63   
version = "1.3.2"
   64     64   
   65     65   
[dependencies.aws-smithy-xml]
   66     66   
path = "../aws-smithy-xml"
   67     67   
version = "0.60.10"
   68     68   
   69     69   
[dependencies.aws-types]
   70     70   
path = "../aws-types"
   71         -
version = "1.3.7"
          71  +
version = "1.3.8"
   72     72   
   73     73   
[dependencies.bytes]
   74     74   
version = "1.4.0"
   75     75   
   76     76   
[dependencies.fastrand]
   77     77   
version = "2.0.0"
   78     78   
   79     79   
[dependencies.hex]
   80     80   
version = "0.4.3"
   81     81   
   82     82   
[dependencies.hmac]
   83     83   
version = "0.12"
   84     84   
   85     85   
[dependencies.http]
   86     86   
version = "0.2.9"
   87     87   
   88     88   
[dependencies.http-1x]
   89     89   
version = "1"
   90     90   
package = "http"
   91     91   
   92     92   
[dependencies.http-body]
   93     93   
version = "0.4.4"
   94     94   
   95     95   
[dependencies.http-body-1x]
   96     96   
version = "1"
   97     97   
optional = true
   98     98   
package = "http-body"
   99     99   
  100    100   
[dependencies.lru]
  101    101   
version = "0.12.2"
  102    102   
  103    103   
[dependencies.percent-encoding]
  104    104   
version = "2.0.0"
  105    105   
  106    106   
[dependencies.regex-lite]
  107    107   
version = "0.1.5"
  108    108   
  109    109   
[dependencies.sha2]
  110    110   
version = "0.10"
  111    111   
  112    112   
[dependencies.tracing]
  113    113   
version = "0.1"
  114    114   
  115    115   
[dependencies.url]
  116    116   
version = "2.3.1"
  117    117   
[dev-dependencies.async-std]
  118    118   
version = "1.12.0"
  119    119   
  120    120   
[dev-dependencies.aws-config]
  121    121   
path = "../aws-config"
  122    122   
features = ["behavior-version-latest"]
  123         -
version = "1.8.2"
         123  +
version = "1.8.3"
  124    124   
  125    125   
[dev-dependencies.aws-credential-types]
  126    126   
path = "../aws-credential-types"
  127    127   
features = ["test-util"]
  128    128   
version = "1.2.3"
  129    129   
  130    130   
[dev-dependencies.aws-runtime]
  131    131   
path = "../aws-runtime"
  132    132   
features = ["test-util"]
  133    133   
version = "1.5.9"
  134    134   
  135    135   
[dev-dependencies.aws-smithy-async]
  136    136   
path = "../aws-smithy-async"
  137    137   
features = ["test-util"]
  138         -
version = "1.2.5"
         138  +
version = "1.3.0"
  139    139   
  140    140   
[dev-dependencies.aws-smithy-eventstream]
  141    141   
path = "../aws-smithy-eventstream"
  142    142   
features = ["test-util"]
  143    143   
version = "0.60.9"
  144    144   
  145    145   
[dev-dependencies.aws-smithy-http-client]
  146    146   
path = "../aws-smithy-http-client"
  147    147   
features = ["test-util", "wire-mock", "rustls-ring"]
  148    148   
version = "1.0.6"
  149    149   
  150    150   
[dev-dependencies.aws-smithy-mocks]
  151    151   
path = "../aws-smithy-mocks"
  152    152   
version = "0.1.1"
  153    153   
  154    154   
[dev-dependencies.aws-smithy-protocol-test]
  155    155   
path = "../aws-smithy-protocol-test"
  156    156   
version = "0.63.4"
  157    157   
  158    158   
[dev-dependencies.aws-smithy-runtime]
  159    159   
path = "../aws-smithy-runtime"
  160    160   
features = ["test-util"]
  161         -
version = "1.8.4"
         161  +
version = "1.8.5"
  162    162   
  163    163   
[dev-dependencies.aws-smithy-runtime-api]
  164    164   
path = "../aws-smithy-runtime-api"
  165    165   
features = ["test-util", "client", "http-02x"]
  166         -
version = "1.8.3"
         166  +
version = "1.8.4"
  167    167   
  168    168   
[dev-dependencies.aws-smithy-types]
  169    169   
path = "../aws-smithy-types"
  170    170   
features = ["test-util"]
  171    171   
version = "1.3.2"
  172    172   
  173    173   
[dev-dependencies.bytes-utils]
  174    174   
version = "0.1.0"
  175    175   
  176    176   
[dev-dependencies.futures-util]

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

@@ -37,37 +96,100 @@
   57     57   
    }
   58     58   
    /// Return the auth schemes configured on this service config
   59     59   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   60     60   
        self.runtime_components.auth_schemes()
   61     61   
    }
   62     62   
   63     63   
    /// Return the auth scheme resolver configured on this service config
   64     64   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   65     65   
        self.runtime_components.auth_scheme_option_resolver()
   66     66   
    }
          67  +
    /// Returns the configured auth scheme preference
          68  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          69  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          70  +
    }
   67     71   
   68     72   
    /// Returns the endpoint resolver.
   69     73   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   70     74   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   71     75   
    }
   72     76   
    /// Return a reference to the retry configuration contained in this config, if any.
   73     77   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   74     78   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   75     79   
    }
   76     80   
@@ -159,163 +218,223 @@
  179    183   
    ///
  180    184   
    pub fn new() -> Self {
  181    185   
        Self::default()
  182    186   
    }
  183    187   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  184    188   
    /// but not those in runtime components.
  185    189   
    #[allow(unused)]
  186    190   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  187    191   
        let mut builder = Self::new();
  188    192   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         193  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  189    194   
        builder.set_force_path_style(config_bag.load::<crate::config::ForcePathStyle>().map(|ty| ty.0));
  190    195   
  191    196   
        builder.set_use_arn_region(config_bag.load::<crate::config::UseArnRegion>().map(|ty| ty.0));
  192    197   
  193    198   
        builder.set_disable_multi_region_access_points(config_bag.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0));
  194    199   
  195    200   
        builder.set_accelerate(config_bag.load::<crate::config::Accelerate>().map(|ty| ty.0));
  196    201   
  197    202   
        builder.set_disable_s3_express_session_auth(config_bag.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0));
  198    203   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
@@ -419,424 +478,540 @@
  439    444   
  440    445   
    /// Set the auth scheme resolver for the builder
  441    446   
    ///
  442    447   
    /// # Examples
  443    448   
    /// See an example for [`Self::auth_scheme_resolver`].
  444    449   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  445    450   
        self.runtime_components
  446    451   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  447    452   
        self
  448    453   
    }
         454  +
    /// Set the auth scheme preference for an auth scheme resolver
         455  +
    /// (typically the default auth scheme resolver).
         456  +
    ///
         457  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         458  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         459  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         460  +
    ///
         461  +
    /// The preference list is intended as a hint rather than a strict override.
         462  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         463  +
    ///
         464  +
    /// # Examples
         465  +
    ///
         466  +
    /// ```no_run
         467  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         468  +
    /// let config = aws_sdk_s3::Config::builder()
         469  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         470  +
    ///     // ...
         471  +
    ///     .build();
         472  +
    /// let client = aws_sdk_s3::Client::from_conf(config);
         473  +
    /// ```
         474  +
         475  +
    pub fn auth_scheme_preference(
         476  +
        mut self,
         477  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         478  +
    ) -> Self {
         479  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         480  +
        self
         481  +
    }
         482  +
         483  +
    /// Set the auth scheme preference for an auth scheme resolver
         484  +
    /// (typically the default auth scheme resolver).
         485  +
    ///
         486  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         487  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         488  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         489  +
    ///
         490  +
    /// The preference list is intended as a hint rather than a strict override.
         491  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         492  +
    ///
         493  +
    /// # Examples
         494  +
    ///
         495  +
    /// ```no_run
         496  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         497  +
    /// let config = aws_sdk_s3::Config::builder()
         498  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         499  +
    ///     // ...
         500  +
    ///     .build();
         501  +
    /// let client = aws_sdk_s3::Client::from_conf(config);
         502  +
    /// ```
         503  +
         504  +
    pub fn set_auth_scheme_preference(
         505  +
        &mut self,
         506  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         507  +
    ) -> &mut Self {
         508  +
        self.config.store_or_unset(preference);
         509  +
        self
         510  +
    }
  449    511   
    /// Forces this client to use path-style addressing for buckets.
  450    512   
    pub fn force_path_style(mut self, force_path_style: impl Into<bool>) -> Self {
  451    513   
        self.set_force_path_style(Some(force_path_style.into()));
  452    514   
        self
  453    515   
    }
  454    516   
    /// Forces this client to use path-style addressing for buckets.
  455    517   
    pub fn set_force_path_style(&mut self, force_path_style: Option<bool>) -> &mut Self {
  456    518   
        self.config.store_or_unset(force_path_style.map(crate::config::ForcePathStyle));
  457    519   
        self
  458    520   
    }
@@ -1392,1454 +1452,1524 @@
 1412   1474   
impl ServiceRuntimePlugin {
 1413   1475   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1414   1476   
        let config = {
 1415   1477   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonS3");
 1416   1478   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1417   1479   
            ::std::option::Option::Some(cfg.freeze())
 1418   1480   
        };
 1419   1481   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1420   1482   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1421   1483   
            use crate::config::auth::ResolveAuthScheme;
 1422         -
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1484  +
            if let Some(preference) = _service_config
        1485  +
                .config
        1486  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1487  +
                .cloned()
        1488  +
            {
        1489  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1490  +
                    .with_auth_scheme_preference(preference)
        1491  +
                    .into_shared_resolver()
        1492  +
            } else {
        1493  +
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1494  +
            }
 1423   1495   
        }));
 1424   1496   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1425   1497   
            use crate::config::endpoint::ResolveEndpoint;
 1426   1498   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1427   1499   
        }));
 1428   1500   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1429   1501   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1430   1502   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1431   1503   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1432   1504   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1529,1601 +1588,1661 @@
 1549   1621   
            );
 1550   1622   
        }
 1551   1623   
        // resiliency
 1552   1624   
        builder.set_retry_config(input.retry_config().cloned());
 1553   1625   
        builder.set_timeout_config(input.timeout_config().cloned());
 1554   1626   
        builder.set_sleep_impl(input.sleep_impl());
 1555   1627   
 1556   1628   
        builder.set_http_client(input.http_client());
 1557   1629   
        builder.set_time_source(input.time_source());
 1558   1630   
        builder.set_behavior_version(input.behavior_version());
        1631  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1559   1632   
        // setting `None` here removes the default
 1560   1633   
        if let Some(config) = input.stalled_stream_protection() {
 1561   1634   
            builder.set_stalled_stream_protection(Some(config));
 1562   1635   
        }
 1563   1636   
 1564   1637   
        if let Some(cache) = input.identity_cache() {
 1565   1638   
            builder.set_identity_cache(cache);
 1566   1639   
        }
 1567   1640   
        builder.set_disable_s3_express_session_auth(input.service_config().and_then(|conf| {
 1568   1641   
            let str_config = conf.load_config(service_config_key(

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

@@ -18,18 +139,169 @@
   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![
   59     60   
                ::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   60     61   
                    .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   61     62   
                    .build()
   62     63   
                    .expect("required fields set"),
   63     64   
                #[cfg(feature = "sigv4a")]
   64     65   
                {
   65     66   
                    ::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   66     67   
                        .scheme_id(::aws_runtime::auth::sigv4a::SCHEME_ID)
   67     68   
                        .build()
   68     69   
                        .expect("required fields set")
   69     70   
                },
   70     71   
                ::aws_smithy_runtime_api::client::auth::AuthSchemeOption::from(::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID),
   71     72   
            ],
   72     73   
            operation_overrides: [(
   73     74   
                "WriteGetObjectResponse",
   74     75   
                vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder()
   75     76   
                    .scheme_id(::aws_runtime::auth::sigv4::SCHEME_ID)
   76     77   
                    .properties({
   77     78   
                        let mut layer = ::aws_smithy_types::config_bag::Layer::new("WriteGetObjectResponseAuthOptionProperties");
   78     79   
                        layer.store_put(::aws_runtime::auth::PayloadSigningOverride::unsigned_payload());
   79     80   
                        layer.freeze()
   80     81   
                    })
   81     82   
                    .build()
   82     83   
                    .expect("required fields set")],
   83     84   
            )]
   84     85   
            .into(),
          86  +
            preference: ::std::option::Option::None,
   85     87   
        }
   86     88   
    }
   87     89   
}
   88     90   
   89     91   
impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver {
   90     92   
    fn resolve_auth_scheme<'a>(
   91     93   
        &'a self,
   92     94   
        params: &'a crate::config::auth::Params,
   93     95   
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
   94     96   
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
   95     97   
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
   96     98   
        let operation_name = params.operation_name();
   97     99   
   98    100   
        let modeled_auth_options = match self.operation_overrides.get(operation_name) {
   99    101   
            Some(overrides) => overrides,
  100    102   
            None => &self.service_defaults,
  101    103   
        };
  102    104   
  103    105   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone()));
  104    106   
  105    107   
        let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::new(async move {
  106    108   
            crate::endpoint_auth::resolve_endpoint_based_auth_scheme_options(modeled_auth_options, _cfg, _runtime_components).await
  107    109   
        });
  108    110   
  109         -
        _fut
         111  +
        match &self.preference {
         112  +
            ::std::option::Option::Some(preference) => {
         113  +
                _fut.map_ok({
         114  +
                    // maps auth scheme ID to the index in the preference list
         115  +
                    let preference_map: ::std::collections::HashMap<_, _> = preference.clone().into_iter().enumerate().map(|(i, s)| (s, i)).collect();
         116  +
                    move |auth_scheme_options| {
         117  +
                        let (mut preferred, non_preferred): (::std::vec::Vec<_>, ::std::vec::Vec<_>) = auth_scheme_options
         118  +
                            .into_iter()
         119  +
                            .partition(|auth_scheme_option| preference_map.contains_key(auth_scheme_option.scheme_id()));
         120  +
         121  +
                        preferred.sort_by_key(|opt| preference_map.get(opt.scheme_id()).expect("guaranteed by `partition`"));
         122  +
                        preferred.extend(non_preferred);
         123  +
                        preferred
         124  +
                    }
         125  +
                })
         126  +
            }
         127  +
            ::std::option::Option::None => _fut,
         128  +
        }
         129  +
    }
         130  +
}
         131  +
         132  +
impl DefaultAuthSchemeResolver {
         133  +
    /// Set auth scheme preference to the default auth scheme resolver
         134  +
    pub fn with_auth_scheme_preference(
         135  +
        mut self,
         136  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         137  +
    ) -> Self {
         138  +
        self.preference = ::std::option::Option::Some(preference.into());
         139  +
        self
  110    140   
    }
  111    141   
}
  112    142   
  113    143   
/// Configuration parameters for resolving the correct auth scheme
  114    144   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  115    145   
pub struct Params {
  116    146   
    operation_name: ::std::borrow::Cow<'static, str>,
  117    147   
}
  118    148   
impl Params {
  119    149   
    /// Create a builder for [`Params`]

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

@@ -0,1 +0,34 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_config::Region;
           7  +
use aws_sdk_s3::Client;
           8  +
use aws_smithy_http_client::test_util::capture_request;
           9  +
          10  +
#[tracing_test::traced_test]
          11  +
#[tokio::test]
          12  +
async fn auth_scheme_preference_should_take_the_highest_priority() {
          13  +
    let (http_client, _) = capture_request(None);
          14  +
    let config = aws_config::from_env()
          15  +
        .http_client(http_client)
          16  +
        .region(Region::new("us-east-2"))
          17  +
        // Explicitly set a preference that favors `sigv4`, otherwise `sigv4a`
          18  +
        // would normally be resolved based on the endpoint authSchemes property.
          19  +
        .auth_scheme_preference([aws_runtime::auth::sigv4::SCHEME_ID])
          20  +
        .load()
          21  +
        .await;
          22  +
          23  +
    let client = Client::new(&config);
          24  +
    let _ = client
          25  +
        .get_object()
          26  +
        .bucket("arn:aws:s3::123456789012:accesspoint/mfzwi23gnjvgw.mrap")
          27  +
        .key("doesnotmatter")
          28  +
        .send()
          29  +
        .await;
          30  +
          31  +
    assert!(logs_contain(
          32  +
        "resolving identity scheme_id=AuthSchemeId { scheme_id: \"sigv4\" }"
          33  +
    ));
          34  +
}

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

@@ -1,1 +142,142 @@
   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-smithy-xml]
   52     52   
path = "../aws-smithy-xml"
   53     53   
version = "0.60.10"
   54     54   
   55     55   
[dependencies.aws-types]
   56     56   
path = "../aws-types"
   57         -
version = "1.3.7"
          57  +
version = "1.3.8"
   58     58   
   59     59   
[dependencies.fastrand]
   60     60   
version = "2.0.0"
   61     61   
   62     62   
[dependencies.http]
   63     63   
version = "0.2.9"
   64     64   
   65     65   
[dependencies.md-5]
   66     66   
version = "0.10.0"
   67     67   
   68     68   
[dependencies.regex-lite]
   69     69   
version = "0.1.5"
   70     70   
   71     71   
[dependencies.tracing]
   72     72   
version = "0.1"
   73     73   
   74     74   
[dependencies.url]
   75     75   
version = "2.3.1"
   76     76   
[dev-dependencies.aws-config]
   77     77   
path = "../aws-config"
   78         -
version = "1.8.2"
          78  +
version = "1.8.3"
   79     79   
   80     80   
[dev-dependencies.aws-credential-types]
   81     81   
path = "../aws-credential-types"
   82     82   
features = ["test-util"]
   83     83   
version = "1.2.3"
   84     84   
   85     85   
[dev-dependencies.aws-runtime]
   86     86   
path = "../aws-runtime"
   87     87   
features = ["test-util"]
   88     88   
version = "1.5.9"
   89     89   
   90     90   
[dev-dependencies.aws-smithy-async]
   91     91   
path = "../aws-smithy-async"
   92     92   
features = ["test-util"]
   93         -
version = "1.2.5"
          93  +
version = "1.3.0"
   94     94   
   95     95   
[dev-dependencies.aws-smithy-http-client]
   96     96   
path = "../aws-smithy-http-client"
   97     97   
features = ["test-util", "wire-mock"]
   98     98   
version = "1.0.6"
   99     99   
  100    100   
[dev-dependencies.aws-smithy-protocol-test]
  101    101   
path = "../aws-smithy-protocol-test"
  102    102   
version = "0.63.4"
  103    103   
  104    104   
[dev-dependencies.aws-smithy-runtime]
  105    105   
path = "../aws-smithy-runtime"
  106    106   
features = ["test-util"]
  107         -
version = "1.8.4"
         107  +
version = "1.8.5"
  108    108   
  109    109   
[dev-dependencies.aws-smithy-runtime-api]
  110    110   
path = "../aws-smithy-runtime-api"
  111    111   
features = ["test-util"]
  112         -
version = "1.8.3"
         112  +
version = "1.8.4"
  113    113   
  114    114   
[dev-dependencies.aws-smithy-types]
  115    115   
path = "../aws-smithy-types"
  116    116   
features = ["test-util"]
  117    117   
version = "1.3.2"
  118    118   
  119    119   
[dev-dependencies.futures-util]
  120    120   
version = "0.3.25"
  121    121   
features = ["alloc"]
  122    122   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/s3control/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_use_arn_region(config_bag.load::<crate::config::UseArnRegion>().map(|ty| ty.0));
  180    185   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  181    186   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  182    187   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  183    188   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().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_s3control::Config::builder()
         465  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         466  +
    ///     // ...
         467  +
    ///     .build();
         468  +
    /// let client = aws_sdk_s3control::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_s3control::Config::builder()
         494  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         495  +
    ///     // ...
         496  +
    ///     .build();
         497  +
    /// let client = aws_sdk_s3control::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   
    /// Enables this client to use an ARN's region when constructing an endpoint instead of the client's configured region.
  446    508   
    pub fn use_arn_region(mut self, use_arn_region: impl Into<bool>) -> Self {
  447    509   
        self.set_use_arn_region(Some(use_arn_region.into()));
  448    510   
        self
  449    511   
    }
  450    512   
    /// Enables this client to use an ARN's region when constructing an endpoint instead of the client's configured region.
  451    513   
    pub fn set_use_arn_region(&mut self, use_arn_region: Option<bool>) -> &mut Self {
  452    514   
        self.config.store_or_unset(use_arn_region.map(crate::config::UseArnRegion));
  453    515   
        self
  454    516   
    }
@@ -1292,1354 +1352,1424 @@
 1312   1374   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1313   1375   
        let config = {
 1314   1376   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSS3ControlServiceV20180820");
 1315   1377   
            cfg.store_put(crate::idempotency_token::default_provider());
 1316   1378   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1317   1379   
            ::std::option::Option::Some(cfg.freeze())
 1318   1380   
        };
 1319   1381   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1320   1382   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1321   1383   
            use crate::config::auth::ResolveAuthScheme;
 1322         -
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1384  +
            if let Some(preference) = _service_config
        1385  +
                .config
        1386  +
                .load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
        1387  +
                .cloned()
        1388  +
            {
        1389  +
                crate::config::auth::DefaultAuthSchemeResolver::default()
        1390  +
                    .with_auth_scheme_preference(preference)
        1391  +
                    .into_shared_resolver()
        1392  +
            } else {
        1393  +
                crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        1394  +
            }
 1323   1395   
        }));
 1324   1396   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1325   1397   
            use crate::config::endpoint::ResolveEndpoint;
 1326   1398   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1327   1399   
        }));
 1328   1400   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1329   1401   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1330   1402   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1331   1403   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1332   1404   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
@@ -1418,1490 +1477,1550 @@
 1438   1510   
            );
 1439   1511   
        }
 1440   1512   
        // resiliency
 1441   1513   
        builder.set_retry_config(input.retry_config().cloned());
 1442   1514   
        builder.set_timeout_config(input.timeout_config().cloned());
 1443   1515   
        builder.set_sleep_impl(input.sleep_impl());
 1444   1516   
 1445   1517   
        builder.set_http_client(input.http_client());
 1446   1518   
        builder.set_time_source(input.time_source());
 1447   1519   
        builder.set_behavior_version(input.behavior_version());
        1520  +
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
 1448   1521   
        // setting `None` here removes the default
 1449   1522   
        if let Some(config) = input.stalled_stream_protection() {
 1450   1523   
            builder.set_stalled_stream_protection(Some(config));
 1451   1524   
        }
 1452   1525   
 1453   1526   
        if let Some(cache) = input.identity_cache() {
 1454   1527   
            builder.set_identity_cache(cache);
 1455   1528   
        }
 1456   1529   
        builder.set_app_name(input.app_name().cloned());
 1457   1530   

tmp-codegen-diff/aws-sdk/sdk/s3control/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/sso/Cargo.toml

@@ -1,1 +83,83 @@
   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   

tmp-codegen-diff/aws-sdk/sdk/sso/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_sso::Config::builder()
         448  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         449  +
    ///     // ...
         450  +
    ///     .build();
         451  +
    /// let client = aws_sdk_sso::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_sso::Config::builder()
         477  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         478  +
    ///     // ...
         479  +
    ///     .build();
         480  +
    /// let client = aws_sdk_sso::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_sso`.
  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("SWBPortalService");
 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;
 1293         -
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
        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 {
        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