AWS SDK

AWS SDK

rev. a562638cb954071808c8908a73292885a41137c0

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks-experimental/Cargo.toml

@@ -1,1 +29,29 @@
   16     16   
targets = ["x86_64-unknown-linux-gnu"]
   17     17   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   18     18   
rustdoc-args = ["--cfg", "docsrs"]
   19     19   
[dependencies.aws-smithy-types]
   20     20   
path = "../aws-smithy-types"
   21     21   
version = "1.3.2"
   22     22   
   23     23   
[dependencies.aws-smithy-runtime-api]
   24     24   
path = "../aws-smithy-runtime-api"
   25     25   
features = ["client", "http-02x"]
   26         -
version = "1.8.3"
          26  +
version = "1.8.4"
   27     27   
[dev-dependencies.tokio]
   28     28   
version = "1"
   29     29   
features = ["full"]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks/Cargo.toml

@@ -1,1 +0,44 @@
   16     16   
[dependencies]
   17     17   
http = "1"
   18     18   
   19     19   
[dependencies.aws-smithy-types]
   20     20   
path = "../aws-smithy-types"
   21     21   
version = "1.3.2"
   22     22   
   23     23   
[dependencies.aws-smithy-runtime-api]
   24     24   
path = "../aws-smithy-runtime-api"
   25     25   
features = ["client", "http-1x"]
   26         -
version = "1.8.3"
          26  +
version = "1.8.4"
   27     27   
   28     28   
[dependencies.aws-smithy-http-client]
   29     29   
path = "../aws-smithy-http-client"
   30     30   
features = ["test-util"]
   31     31   
version = "1.0.6"
   32     32   
[dev-dependencies.tokio]
   33     33   
version = "1"
   34     34   
features = ["full"]
   35     35   
   36     36   
[dev-dependencies.aws-smithy-async]
   37     37   
path = "../aws-smithy-async"
   38     38   
features = ["rt-tokio"]
   39         -
version = "1.2.5"
          39  +
version = "1.3.0"
   40     40   
   41     41   
[dev-dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44         -
version = "1.8.4"
          44  +
version = "1.8.5"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-observability/Cargo.toml

@@ -1,1 +20,20 @@
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/awslabs/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
[dependencies.aws-smithy-runtime-api]
   16     16   
path = "../aws-smithy-runtime-api"
   17         -
version = "1.8.3"
          17  +
version = "1.8.4"
   18     18   
   19     19   
[dev-dependencies]
   20     20   
serial_test = "3.1.1"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-protocol-test/Cargo.toml

@@ -1,1 +0,31 @@
   21     21   
http = "0.2.9"
   22     22   
pretty_assertions = "1.3"
   23     23   
regex-lite = "0.1.5"
   24     24   
roxmltree = "0.14.1"
   25     25   
serde_json = "1.0.128"
   26     26   
thiserror = "2"
   27     27   
   28     28   
[dependencies.aws-smithy-runtime-api]
   29     29   
path = "../aws-smithy-runtime-api"
   30     30   
features = ["client"]
   31         -
version = "1.8.3"
          31  +
version = "1.8.4"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime-api/Cargo.toml

@@ -1,1 +61,61 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-runtime-api"
    4         -
version = "1.8.3"
           4  +
version = "1.8.4"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "Smithy runtime types."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
   16     16   
[package.metadata.smithy-rs-release-tooling]
   17     17   
stable = true
   18     18   
   19     19   
[features]
   20     20   
default = []
   21     21   
client = []
   22     22   
http-auth = ["dep:zeroize"]
   23     23   
test-util = ["aws-smithy-types/test-util", "http-1x"]
   24     24   
http-02x = []
   25     25   
http-1x = []
   26     26   
   27     27   
[dependencies]
   28     28   
bytes = "1.10.0"
   29     29   
pin-project-lite = "0.2.14"
   30     30   
tracing = "0.1.40"
   31     31   
   32     32   
[dependencies.aws-smithy-async]
   33     33   
path = "../aws-smithy-async"
   34         -
version = "1.2.5"
          34  +
version = "1.3.0"
   35     35   
   36     36   
[dependencies.aws-smithy-types]
   37     37   
path = "../aws-smithy-types"
   38     38   
version = "1.3.2"
   39     39   
   40     40   
[dependencies.http-02x]
   41     41   
package = "http"
   42     42   
version = "0.2.9"
   43     43   
   44     44   
[dependencies.http-1x]

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

@@ -1,1 +48,48 @@
    8      8   
use crate::box_error::BoxError;
    9      9   
use crate::client::identity::{Identity, SharedIdentityResolver};
   10     10   
use crate::client::orchestrator::HttpRequest;
   11     11   
use crate::client::runtime_components::sealed::ValidateConfig;
   12     12   
use crate::client::runtime_components::{GetIdentityResolver, RuntimeComponents};
   13     13   
use crate::impl_shared_conversions;
   14     14   
use aws_smithy_types::config_bag::{ConfigBag, FrozenLayer, Storable, StoreReplace};
   15     15   
use aws_smithy_types::type_erasure::TypeErasedBox;
   16     16   
use aws_smithy_types::Document;
   17     17   
use std::borrow::Cow;
   18         -
use std::fmt;
          18  +
use std::fmt::{self, Debug};
   19     19   
use std::sync::Arc;
   20     20   
   21     21   
/// Auth schemes for the HTTP `Authorization` header.
   22     22   
#[cfg(feature = "http-auth")]
   23     23   
pub mod http;
   24     24   
   25     25   
/// Static auth scheme option resolver.
   26     26   
pub mod static_resolver;
   27     27   
   28     28   
/// The output type from the [`ResolveAuthSchemeOptions::resolve_auth_scheme_options_v2`]
@@ -198,198 +257,276 @@
  218    218   
  219    219   
impl Storable for AuthSchemeOptionResolverParams {
  220    220   
    type Storer = StoreReplace<Self>;
  221    221   
}
  222    222   
  223    223   
new_type_future! {
  224    224   
    #[doc = "Future for [`ResolveAuthSchemeOptions::resolve_auth_scheme_options_v2`]."]
  225    225   
    pub struct AuthSchemeOptionsFuture<'a, Vec<AuthSchemeOption>, BoxError>;
  226    226   
}
  227    227   
         228  +
// Currently, we don't add `map_ok` to the `new_type_future` macro in general.
         229  +
// It's specifically used for `AuthSchemeOptionsFuture`, but we can expand it later if needed.
         230  +
impl<'a> AuthSchemeOptionsFuture<'a> {
         231  +
    /// Transforms the `Ok` variant inside this `AuthSchemeOptionsFuture` by applying the provided function.
         232  +
    ///
         233  +
    /// This method maps over the `Ok` variant of the `Result` wrapped by the future,
         234  +
    /// applying `map_fn` to the contained `Vec<AuthSchemeOption>`.
         235  +
    ///
         236  +
    /// The transformation is applied regardless of whether the future's value is already
         237  +
    /// available (`Now`) or will be computed asynchronously (`Later`).
         238  +
    pub fn map_ok<F>(self, f: F) -> AuthSchemeOptionsFuture<'a>
         239  +
    where
         240  +
        F: FnOnce(Vec<AuthSchemeOption>) -> Vec<AuthSchemeOption> + Send + 'a,
         241  +
    {
         242  +
        let inner = self.inner.map_boxed(|result| result.map(f));
         243  +
        Self { inner }
         244  +
    }
         245  +
}
         246  +
  228    247   
/// Resolver for auth scheme options.
  229    248   
///
  230    249   
/// The orchestrator needs to select an auth scheme to sign requests with, and potentially
  231    250   
/// from several different available auth schemes. Smithy models have a number of ways
  232    251   
/// to specify which operations can use which auth schemes under which conditions, as
  233    252   
/// documented in the [Smithy spec](https://smithy.io/2.0/spec/authentication-traits.html).
  234    253   
///
  235    254   
/// The orchestrator uses the auth scheme option resolver runtime component to resolve
  236    255   
/// an ordered list of options that are available to choose from for a given request.
  237    256   
/// This resolver can be a simple static list, such as with the
@@ -393,412 +0,546 @@
  413    432   
    fn from(value: Option<&'a Document>) -> Self {
  414    433   
        Self(value)
  415    434   
    }
  416    435   
}
  417    436   
  418    437   
impl<'a> From<&'a Document> for AuthSchemeEndpointConfig<'a> {
  419    438   
    fn from(value: &'a Document) -> Self {
  420    439   
        Self(Some(value))
  421    440   
    }
  422    441   
}
         442  +
         443  +
/// An ordered list of [AuthSchemeId]s
         444  +
///
         445  +
/// Can be used to reorder already-resolved auth schemes by an auth scheme resolver.
         446  +
/// This list is intended as a hint rather than a strict override;
         447  +
/// any schemes not present in the resolved auth schemes will be ignored.
         448  +
#[derive(Clone, Debug, Default, Eq, PartialEq)]
         449  +
pub struct AuthSchemePreference {
         450  +
    preference_list: Vec<AuthSchemeId>,
         451  +
}
         452  +
         453  +
impl Storable for AuthSchemePreference {
         454  +
    type Storer = StoreReplace<Self>;
         455  +
}
         456  +
         457  +
impl IntoIterator for AuthSchemePreference {
         458  +
    type Item = AuthSchemeId;
         459  +
    type IntoIter = std::vec::IntoIter<Self::Item>;
         460  +
         461  +
    fn into_iter(self) -> Self::IntoIter {
         462  +
        self.preference_list.into_iter()
         463  +
    }
         464  +
}
         465  +
         466  +
impl<T> From<T> for AuthSchemePreference
         467  +
where
         468  +
    T: AsRef<[AuthSchemeId]>,
         469  +
{
         470  +
    fn from(slice: T) -> Self {
         471  +
        AuthSchemePreference {
         472  +
            preference_list: slice.as_ref().to_vec(),
         473  +
        }
         474  +
    }
         475  +
}
         476  +
         477  +
#[cfg(test)]
         478  +
mod tests {
         479  +
    use super::*;
         480  +
         481  +
    #[tokio::test]
         482  +
    async fn test_map_ok_now_variant() {
         483  +
        let input = ["sigv4", "http"]
         484  +
            .map(|s| AuthSchemeOption::from(AuthSchemeId::from(s)))
         485  +
            .to_vec();
         486  +
        let fut = AuthSchemeOptionsFuture::ready(Ok(input));
         487  +
         488  +
        let mapped = fut.map_ok(|opts| {
         489  +
            opts.into_iter()
         490  +
                .filter(|opt| opt.scheme_id().inner() != "http")
         491  +
                .collect()
         492  +
        });
         493  +
         494  +
        let result = mapped.await;
         495  +
        assert!(result.is_ok());
         496  +
        let vec = result.unwrap();
         497  +
        assert_eq!(1, vec.len());
         498  +
        assert_eq!("sigv4", vec[0].scheme_id().inner());
         499  +
    }
         500  +
         501  +
    #[tokio::test]
         502  +
    async fn test_map_ok_now_variant_error_no_op() {
         503  +
        let fut = AuthSchemeOptionsFuture::ready(Err(BoxError::from("oops")));
         504  +
         505  +
        let mapped = fut.map_ok(|opts| opts); // no-op
         506  +
         507  +
        let result = mapped.await;
         508  +
        assert!(result.is_err());
         509  +
        assert_eq!(result.unwrap_err().to_string(), "oops");
         510  +
    }
         511  +
         512  +
    #[tokio::test]
         513  +
    async fn test_map_ok_later_variant() {
         514  +
        let input = ["foo", "bar"]
         515  +
            .map(|s| AuthSchemeOption::from(AuthSchemeId::from(s)))
         516  +
            .to_vec();
         517  +
        let fut = AuthSchemeOptionsFuture::new(async move { Ok(input) });
         518  +
         519  +
        let mapped = fut.map_ok(|opts| {
         520  +
            opts.into_iter()
         521  +
                .map(|mut opt| {
         522  +
                    opt.scheme_id =
         523  +
                        AuthSchemeId::from(Cow::Owned(opt.scheme_id().inner().to_uppercase()));
         524  +
                    opt
         525  +
                })
         526  +
                .collect()
         527  +
        });
         528  +
         529  +
        let result = mapped.await;
         530  +
        assert!(result.is_ok());
         531  +
        let vec = result.unwrap();
         532  +
        assert_eq!(vec[0].scheme_id().inner(), "FOO");
         533  +
        assert_eq!(vec[1].scheme_id().inner(), "BAR");
         534  +
    }
         535  +
         536  +
    #[tokio::test]
         537  +
    async fn test_map_ok_later_variant_error_no_op() {
         538  +
        let fut = AuthSchemeOptionsFuture::new(async move { Err(BoxError::from("later fail")) });
         539  +
         540  +
        let mapped = fut.map_ok(|opts| opts); // no-op
         541  +
         542  +
        let result = mapped.await;
         543  +
        assert!(result.is_err());
         544  +
        assert_eq!(result.unwrap_err().to_string(), "later fail");
         545  +
    }
         546  +
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/Cargo.toml

@@ -1,1 +123,123 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-runtime"
    4         -
version = "1.8.4"
           4  +
version = "1.8.5"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "The new smithy runtime crate"
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
   16     16   
[package.metadata.smithy-rs-release-tooling]
   17     17   
stable = true
   18     18   
[package.metadata.cargo-udeps.ignore]
   19     19   
normal = ["aws-smithy-http"]
   20     20   
   21     21   
[features]
   22     22   
client = ["aws-smithy-runtime-api/client", "aws-smithy-types/http-body-1-x"]
   23     23   
http-auth = ["aws-smithy-runtime-api/http-auth"]
   24     24   
connector-hyper-0-14-x = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/hyper-014"]
   25     25   
tls-rustls = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/legacy-rustls-ring", "connector-hyper-0-14-x"]
   26     26   
default-https-client = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/rustls-aws-lc"]
   27     27   
rt-tokio = ["tokio/rt"]
   28     28   
test-util = ["aws-smithy-runtime-api/test-util", "dep:tracing-subscriber", "aws-smithy-http-client/test-util", "legacy-test-util"]
   29     29   
legacy-test-util = ["aws-smithy-runtime-api/test-util", "dep:tracing-subscriber", "aws-smithy-http-client/test-util", "connector-hyper-0-14-x", "aws-smithy-http-client/legacy-test-util"]
   30     30   
wire-mock = ["legacy-test-util", "aws-smithy-http-client/wire-mock"]
   31     31   
   32     32   
[dependencies]
   33     33   
bytes = "1.10.0"
   34     34   
fastrand = "2.3.0"
   35     35   
pin-project-lite = "0.2.14"
   36     36   
pin-utils = "0.1.0"
   37     37   
tracing = "0.1.40"
   38     38   
   39     39   
[dependencies.aws-smithy-async]
   40     40   
path = "../aws-smithy-async"
   41         -
version = "1.2.5"
          41  +
version = "1.3.0"
   42     42   
   43     43   
[dependencies.aws-smithy-http]
   44     44   
path = "../aws-smithy-http"
   45     45   
version = "0.62.1"
   46     46   
   47     47   
[dependencies.aws-smithy-observability]
   48     48   
path = "../aws-smithy-observability"
   49     49   
version = "0.1.3"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53         -
version = "1.8.3"
          53  +
version = "1.8.4"
   54     54   
   55     55   
[dependencies.aws-smithy-types]
   56     56   
path = "../aws-smithy-types"
   57     57   
features = ["http-body-0-4-x"]
   58     58   
version = "1.3.2"
   59     59   
   60     60   
[dependencies.aws-smithy-http-client]
   61     61   
path = "../aws-smithy-http-client"
   62     62   
optional = true
   63     63   
version = "1.0.6"
   64     64   
   65     65   
[dependencies.http-02x]
   66     66   
package = "http"
   67     67   
version = "0.2.9"
   68     68   
   69     69   
[dependencies.http-1x]
   70     70   
package = "http"
   71     71   
version = "1"
   72     72   
   73     73   
[dependencies.http-body-04x]
   74     74   
package = "http-body"
   75     75   
version = "0.4.5"
   76     76   
   77     77   
[dependencies.http-body-1x]
   78     78   
package = "http-body"
   79     79   
version = "1"
   80     80   
   81     81   
[dependencies.tokio]
   82     82   
version = "1.40.0"
   83     83   
features = []
   84     84   
   85     85   
[dependencies.tracing-subscriber]
   86     86   
version = "0.3.16"
   87     87   
optional = true
   88     88   
features = ["env-filter", "fmt", "json"]
   89     89   
   90     90   
[dev-dependencies]
   91     91   
approx = "0.5.1"
   92     92   
fastrand = "2.3.0"
   93     93   
futures-util = "0.3.29"
   94     94   
pretty_assertions = "1.4.0"
   95     95   
tracing-test = "0.2.1"
   96     96   
   97     97   
[dev-dependencies.aws-smithy-async]
   98     98   
path = "../aws-smithy-async"
   99     99   
features = ["rt-tokio", "test-util"]
  100         -
version = "1.2.5"
         100  +
version = "1.3.0"
  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.tokio]
  113    113   
version = "1.25"
  114    114   
features = ["macros", "rt", "rt-multi-thread", "test-util", "full"]
  115    115   

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-runtime/src/client/orchestrator/auth.rs

@@ -858,858 +888,1002 @@
  878    878   
                ExploreResult::MissingEndpointConfig,
  879    879   
            );
  880    880   
        }
  881    881   
        let err = NoMatchingAuthSchemeError(list).to_string();
  882    882   
        if !err.contains(
  883    883   
            "Note: there were other auth schemes that were evaluated that weren't listed here",
  884    884   
        ) {
  885    885   
            panic!("The error should indicate that the explored list was truncated.");
  886    886   
        }
  887    887   
    }
         888  +
         889  +
    #[cfg(feature = "http-auth")]
         890  +
    #[tokio::test]
         891  +
    async fn test_resolve_identity() {
         892  +
        use crate::client::auth::http::{ApiKeyAuthScheme, ApiKeyLocation, BasicAuthScheme};
         893  +
        use aws_smithy_runtime_api::client::auth::http::{
         894  +
            HTTP_API_KEY_AUTH_SCHEME_ID, HTTP_BASIC_AUTH_SCHEME_ID,
         895  +
        };
         896  +
        use aws_smithy_runtime_api::client::identity::http::Token;
         897  +
        use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
         898  +
         899  +
        #[derive(Debug)]
         900  +
        struct Cache;
         901  +
        impl ResolveCachedIdentity for Cache {
         902  +
            fn resolve_cached_identity<'a>(
         903  +
                &'a self,
         904  +
                identity_resolver: SharedIdentityResolver,
         905  +
                rc: &'a RuntimeComponents,
         906  +
                cfg: &'a ConfigBag,
         907  +
            ) -> IdentityFuture<'a> {
         908  +
                IdentityFuture::new(
         909  +
                    async move { identity_resolver.resolve_identity(rc, cfg).await },
         910  +
                )
         911  +
            }
         912  +
        }
         913  +
         914  +
        let mut layer = Layer::new("test");
         915  +
        layer.store_put(AuthSchemeAndEndpointOrchestrationV2);
         916  +
        layer.store_put(AuthSchemeOptionResolverParams::new("doesntmatter"));
         917  +
        let mut cfg = ConfigBag::of_layers(vec![layer]);
         918  +
         919  +
        let runtime_components_builder = RuntimeComponentsBuilder::for_tests()
         920  +
            .with_auth_scheme(SharedAuthScheme::new(BasicAuthScheme::new()))
         921  +
            .with_auth_scheme(SharedAuthScheme::new(ApiKeyAuthScheme::new(
         922  +
                "result:",
         923  +
                ApiKeyLocation::Header,
         924  +
                "Authorization",
         925  +
            )))
         926  +
            .with_auth_scheme_option_resolver(Some(SharedAuthSchemeOptionResolver::new(
         927  +
                StaticAuthSchemeOptionResolver::new(vec![
         928  +
                    HTTP_BASIC_AUTH_SCHEME_ID,
         929  +
                    HTTP_API_KEY_AUTH_SCHEME_ID,
         930  +
                ]),
         931  +
            )))
         932  +
            .with_identity_cache(Some(Cache));
         933  +
         934  +
        struct TestCase {
         935  +
            builder_updater: Box<dyn Fn(RuntimeComponentsBuilder) -> RuntimeComponents>,
         936  +
            resolved_auth_scheme: AuthSchemeId,
         937  +
            should_error: bool,
         938  +
        }
         939  +
         940  +
        for test_case in [
         941  +
            TestCase {
         942  +
                builder_updater: Box::new(|rcb: RuntimeComponentsBuilder| {
         943  +
                    rcb.with_identity_resolver(
         944  +
                        HTTP_BASIC_AUTH_SCHEME_ID,
         945  +
                        SharedIdentityResolver::new(Token::new("basic", None)),
         946  +
                    )
         947  +
                    .with_identity_resolver(
         948  +
                        HTTP_API_KEY_AUTH_SCHEME_ID,
         949  +
                        SharedIdentityResolver::new(Token::new("api-key", None)),
         950  +
                    )
         951  +
                    .build()
         952  +
                    .unwrap()
         953  +
                }),
         954  +
                resolved_auth_scheme: HTTP_BASIC_AUTH_SCHEME_ID,
         955  +
                should_error: false,
         956  +
            },
         957  +
            TestCase {
         958  +
                builder_updater: Box::new(|rcb: RuntimeComponentsBuilder| {
         959  +
                    rcb.with_identity_resolver(
         960  +
                        HTTP_BASIC_AUTH_SCHEME_ID,
         961  +
                        SharedIdentityResolver::new(Token::new("basic", None)),
         962  +
                    )
         963  +
                    .build()
         964  +
                    .unwrap()
         965  +
                }),
         966  +
                resolved_auth_scheme: HTTP_BASIC_AUTH_SCHEME_ID,
         967  +
                should_error: false,
         968  +
            },
         969  +
            TestCase {
         970  +
                builder_updater: Box::new(|rcb: RuntimeComponentsBuilder| {
         971  +
                    rcb.with_identity_resolver(
         972  +
                        HTTP_API_KEY_AUTH_SCHEME_ID,
         973  +
                        SharedIdentityResolver::new(Token::new("api-key", None)),
         974  +
                    )
         975  +
                    .build()
         976  +
                    .unwrap()
         977  +
                }),
         978  +
                resolved_auth_scheme: HTTP_API_KEY_AUTH_SCHEME_ID,
         979  +
                should_error: false,
         980  +
            },
         981  +
            TestCase {
         982  +
                builder_updater: Box::new(|rcb: RuntimeComponentsBuilder| rcb.build().unwrap()),
         983  +
                resolved_auth_scheme: HTTP_API_KEY_AUTH_SCHEME_ID,
         984  +
                should_error: true,
         985  +
            },
         986  +
        ]
         987  +
        .into_iter()
         988  +
        {
         989  +
            let runtime_components =
         990  +
                (test_case.builder_updater)(runtime_components_builder.clone());
         991  +
            match resolve_identity(&runtime_components, &mut cfg).await {
         992  +
                Ok(resolved) => assert_eq!(test_case.resolved_auth_scheme, resolved.0),
         993  +
                Err(e) if test_case.should_error => {
         994  +
                    assert!(e.downcast_ref::<NoMatchingAuthSchemeError>().is_some());
         995  +
                }
         996  +
                _ => {
         997  +
                    panic!("`resolve_identity` returned an `Err` when no error was expected in the test.");
         998  +
                }
         999  +
            }
        1000  +
        }
        1001  +
    }
  888   1002   
}

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-types-convert/Cargo.toml

@@ -1,1 +42,42 @@
   18     18   
convert-time = ["aws-smithy-types", "time"]
   19     19   
convert-streams = ["aws-smithy-async", "futures-core"]
   20     20   
[dependencies.aws-smithy-types]
   21     21   
path = "../aws-smithy-types"
   22     22   
optional = true
   23     23   
version = "1.3.2"
   24     24   
   25     25   
[dependencies.aws-smithy-async]
   26     26   
path = "../aws-smithy-async"
   27     27   
optional = true
   28         -
version = "1.2.5"
          28  +
version = "1.3.0"
   29     29   
   30     30   
[dependencies.chrono]
   31     31   
version = "0.4.35"
   32     32   
optional = true
   33     33   
default-features = false
   34     34   
features = ["std"]
   35     35   
   36     36   
[dependencies.time]
   37     37   
version = "0.3.4"
   38     38   
optional = true

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-wasm/Cargo.toml

@@ -1,1 +33,33 @@
   15     15   
   16     16   
[dependencies]
   17     17   
bytes = "1.10.0"
   18     18   
http = "1.0.0"
   19     19   
tracing = "0.1.40"
   20     20   
wasi = "0.12.1"
   21     21   
   22     22   
[dependencies.aws-smithy-runtime-api]
   23     23   
path = "../aws-smithy-runtime-api"
   24     24   
features = ["http-1x"]
   25         -
version = "1.8.3"
          25  +
version = "1.8.4"
   26     26   
   27     27   
[dependencies.aws-smithy-http]
   28     28   
path = "../aws-smithy-http"
   29     29   
version = "0.62.1"
   30     30   
   31     31   
[dependencies.aws-smithy-types]
   32     32   
path = "../aws-smithy-types"
   33     33   
version = "1.3.2"

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

@@ -1,1 +69,69 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-types"
    4         -
version = "1.3.7"
           4  +
version = "1.3.8"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
    6      6   
description = "Cross-service types for the AWS SDK."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]
   15     15   
   16     16   
[package.metadata.smithy-rs-release-tooling]
   17     17   
stable = true
   18     18   
[package.metadata.cargo-udeps.ignore]
   19     19   
normal = ["aws-smithy-runtime", "hyper-rustls"]
   20     20   
   21     21   
[features]
   22     22   
examples = ["dep:hyper-rustls", "aws-smithy-runtime/client", "aws-smithy-runtime/connector-hyper-0-14-x", "aws-smithy-runtime/tls-rustls"]
   23     23   
   24     24   
[dependencies]
   25     25   
tracing = "0.1.40"
   26     26   
   27     27   
[dependencies.aws-credential-types]
   28     28   
path = "../aws-credential-types"
   29     29   
version = "1.2.3"
   30     30   
   31     31   
[dependencies.aws-smithy-async]
   32     32   
path = "../aws-smithy-async"
   33         -
version = "1.2.5"
          33  +
version = "1.3.0"
   34     34   
   35     35   
[dependencies.aws-smithy-types]
   36     36   
path = "../aws-smithy-types"
   37     37   
version = "1.3.2"
   38     38   
   39     39   
[dependencies.aws-smithy-runtime]
   40     40   
path = "../aws-smithy-runtime"
   41     41   
optional = true
   42         -
version = "1.8.4"
          42  +
version = "1.8.5"
   43     43   
   44     44   
[dependencies.aws-smithy-runtime-api]
   45     45   
path = "../aws-smithy-runtime-api"
   46     46   
features = ["client"]
   47         -
version = "1.8.3"
          47  +
version = "1.8.4"
   48     48   
   49     49   
[dependencies.hyper-rustls]
   50     50   
version = "0.24"
   51     51   
optional = true
   52     52   
features = ["rustls-native-certs", "http2", "webpki-roots"]
   53     53   
   54     54   
[dev-dependencies]
   55     55   
http = "0.2.4"
   56     56   
tempfile = "3.16.0"
   57     57   
tracing-test = "0.2.5"
   58     58   
   59     59   
[dev-dependencies.tokio]
   60     60   
version = "1"
   61     61   
features = ["rt", "macros"]
   62     62   
   63     63   
[dev-dependencies.aws-smithy-runtime-api]
   64     64   
path = "../aws-smithy-runtime-api"
   65     65   
features = ["http-02x"]
   66         -
version = "1.8.3"
          66  +
version = "1.8.4"
   67     67   
   68     68   
[build-dependencies]
   69     69   
rustc_version = "0.4.0"

tmp-codegen-diff/aws-sdk/sdk/aws-types/external-types.toml

@@ -1,1 +24,23 @@
    1      1   
allowed_external_types = [
    2         -
    "aws_credential_types::cache::CredentialsCache",
    3      2   
    "aws_credential_types::provider::credentials::SharedCredentialsProvider",
    4      3   
    "aws_credential_types::provider::token::SharedTokenProvider",
    5      4   
    "aws_smithy_async::rt::sleep::AsyncSleep",
    6      5   
    "aws_smithy_async::rt::sleep::SharedAsyncSleep",
    7      6   
    "aws_smithy_async::time::SharedTimeSource",
    8      7   
    "aws_smithy_async::time::TimeSource",
           8  +
    "aws_smithy_runtime_api::client::auth::AuthSchemePreference",
    9      9   
    "aws_smithy_runtime_api::client::behavior_version::BehaviorVersion",
   10     10   
    "aws_smithy_runtime_api::client::http::HttpClient",
   11     11   
    "aws_smithy_runtime_api::client::http::SharedHttpClient",
   12     12   
    "aws_smithy_runtime_api::client::identity::ResolveCachedIdentity",
   13     13   
    "aws_smithy_runtime_api::client::identity::SharedIdentityCache",
   14     14   
    "aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig",
   15     15   
    "aws_smithy_runtime_api::http::headers::Headers",
   16     16   
    "aws_smithy_types::checksum_config::ResponseChecksumValidation",
   17     17   
    "aws_smithy_types::checksum_config::RequestChecksumCalculation",
   18     18   
    "aws_smithy_types::config_bag::storable::Storable",
   19     19   
    "aws_smithy_types::config_bag::storable::StoreReplace",
   20         -
    "aws_smithy_types::config_bag::storable::Storer",
   21     20   
    "aws_smithy_types::error::metadata::Builder",
   22     21   
    "aws_smithy_types::retry::RetryConfig",
   23     22   
    "aws_smithy_types::timeout::TimeoutConfig",
   24     23   
]

tmp-codegen-diff/aws-sdk/sdk/aws-types/src/sdk_config.rs

@@ -1,1 +52,53 @@
   13     13   
use crate::docs_for;
   14     14   
use crate::endpoint_config::AccountIdEndpointMode;
   15     15   
use crate::origin::Origin;
   16     16   
use crate::region::Region;
   17     17   
use crate::service_config::LoadServiceConfig;
   18     18   
use aws_credential_types::provider::token::SharedTokenProvider;
   19     19   
pub use aws_credential_types::provider::SharedCredentialsProvider;
   20     20   
use aws_smithy_async::rt::sleep::AsyncSleep;
   21     21   
pub use aws_smithy_async::rt::sleep::SharedAsyncSleep;
   22     22   
pub use aws_smithy_async::time::{SharedTimeSource, TimeSource};
          23  +
use aws_smithy_runtime_api::client::auth::AuthSchemePreference;
   23     24   
use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
   24     25   
use aws_smithy_runtime_api::client::http::HttpClient;
   25     26   
pub use aws_smithy_runtime_api::client::http::SharedHttpClient;
   26     27   
use aws_smithy_runtime_api::client::identity::{ResolveCachedIdentity, SharedIdentityCache};
   27     28   
pub use aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
   28     29   
use aws_smithy_runtime_api::shared::IntoShared;
   29     30   
pub use aws_smithy_types::checksum_config::{
   30     31   
    RequestChecksumCalculation, ResponseChecksumValidation,
   31     32   
};
   32     33   
pub use aws_smithy_types::retry::RetryConfig;
@@ -54,55 +152,166 @@
   74     75   
        (account_id_endpoint_mode) => {
   75     76   
"Controls the account ID-based routing behavior.
   76     77   
   77     78   
By default, the routing behavior is set to `preferred`.
   78     79   
Customers can adjust this setting to other values to switch between different routing patterns or temporarily disable the feature.
   79     80   
   80     81   
See the developer guide on [account-based endpoints](https://docs.aws.amazon.com/sdkref/latest/guide/feature-account-endpoints.html)
   81     82   
for more information.
   82     83   
   83     84   
For services that do not use the account-based endpoints, this setting does nothing.
          85  +
" };
          86  +
        (auth_scheme_preference) => {
          87  +
"Set the auth scheme preference for an auth scheme resolver
          88  +
(typically the default auth scheme resolver).
          89  +
          90  +
Each operation has a predefined order of auth schemes, as determined by the service,
          91  +
for auth scheme resolution. By using the auth scheme preference, customers
          92  +
can reorder the schemes resolved by the auth scheme resolver.
          93  +
          94  +
The preference list is intended as a hint rather than a strict override.
          95  +
Any schemes not present in the originally resolved auth schemes will be ignored.
   84     96   
" };
   85     97   
    }
   86     98   
}
   87     99   
   88    100   
/// AWS Shared Configuration
   89    101   
#[derive(Debug, Clone)]
   90    102   
pub struct SdkConfig {
   91    103   
    app_name: Option<AppName>,
         104  +
    auth_scheme_preference: Option<AuthSchemePreference>,
   92    105   
    identity_cache: Option<SharedIdentityCache>,
   93    106   
    credentials_provider: Option<SharedCredentialsProvider>,
   94    107   
    token_provider: Option<SharedTokenProvider>,
   95    108   
    region: Option<Region>,
   96    109   
    account_id_endpoint_mode: Option<AccountIdEndpointMode>,
   97    110   
    endpoint_url: Option<String>,
   98    111   
    retry_config: Option<RetryConfig>,
   99    112   
    sleep_impl: Option<SharedAsyncSleep>,
  100    113   
    time_source: Option<SharedTimeSource>,
  101    114   
    timeout_config: Option<TimeoutConfig>,
  102    115   
    stalled_stream_protection_config: Option<StalledStreamProtectionConfig>,
  103    116   
    http_client: Option<SharedHttpClient>,
  104    117   
    use_fips: Option<bool>,
  105    118   
    use_dual_stack: Option<bool>,
  106    119   
    behavior_version: Option<BehaviorVersion>,
  107    120   
    service_config: Option<Arc<dyn LoadServiceConfig>>,
  108    121   
    config_origins: HashMap<&'static str, Origin>,
  109    122   
    disable_request_compression: Option<bool>,
  110    123   
    request_min_compression_size_bytes: Option<u32>,
  111    124   
    request_checksum_calculation: Option<RequestChecksumCalculation>,
  112    125   
    response_checksum_validation: Option<ResponseChecksumValidation>,
  113    126   
}
  114    127   
  115    128   
/// Builder for AWS Shared Configuration
  116    129   
///
  117    130   
/// _Important:_ Using the `aws-config` crate to configure the SDK is preferred to invoking this
  118    131   
/// builder directly. Using this builder directly won't pull in any AWS recommended default
  119    132   
/// configuration values.
  120    133   
#[derive(Debug, Default)]
  121    134   
pub struct Builder {
  122    135   
    app_name: Option<AppName>,
         136  +
    auth_scheme_preference: Option<AuthSchemePreference>,
  123    137   
    identity_cache: Option<SharedIdentityCache>,
  124    138   
    credentials_provider: Option<SharedCredentialsProvider>,
  125    139   
    token_provider: Option<SharedTokenProvider>,
  126    140   
    region: Option<Region>,
  127    141   
    account_id_endpoint_mode: Option<AccountIdEndpointMode>,
  128    142   
    endpoint_url: Option<String>,
  129    143   
    retry_config: Option<RetryConfig>,
  130    144   
    sleep_impl: Option<SharedAsyncSleep>,
  131    145   
    time_source: Option<SharedTimeSource>,
  132    146   
    timeout_config: Option<TimeoutConfig>,
@@ -750,764 +821,854 @@
  770    784   
    /// `SdkConfig` and provides access to config defined in the environment
  771    785   
    /// which would otherwise be inaccessible.
  772    786   
    pub fn set_service_config(
  773    787   
        &mut self,
  774    788   
        service_config: Option<impl LoadServiceConfig + 'static>,
  775    789   
    ) -> &mut Self {
  776    790   
        self.service_config = service_config.map(|it| Arc::new(it) as Arc<dyn LoadServiceConfig>);
  777    791   
        self
  778    792   
    }
  779    793   
         794  +
    #[doc = docs_for!(auth_scheme_preference)]
         795  +
    pub fn auth_scheme_preference(
         796  +
        mut self,
         797  +
        auth_scheme_preference: impl Into<AuthSchemePreference>,
         798  +
    ) -> Self {
         799  +
        self.set_auth_scheme_preference(Some(auth_scheme_preference));
         800  +
        self
         801  +
    }
         802  +
         803  +
    #[doc = docs_for!(auth_scheme_preference)]
         804  +
    pub fn set_auth_scheme_preference(
         805  +
        &mut self,
         806  +
        auth_scheme_preference: Option<impl Into<AuthSchemePreference>>,
         807  +
    ) -> &mut Self {
         808  +
        self.auth_scheme_preference = auth_scheme_preference.map(|pref| pref.into());
         809  +
        self
         810  +
    }
         811  +
  780    812   
    /// Set the origin of a setting.
  781    813   
    ///
  782    814   
    /// This is used internally to understand how to merge config structs while
  783    815   
    /// respecting precedence of origins.
  784    816   
    pub fn insert_origin(&mut self, setting: &'static str, origin: Origin) {
  785    817   
        self.config_origins.insert(setting, origin);
  786    818   
    }
  787    819   
  788    820   
    /// Build a [`SdkConfig`] from this builder.
  789    821   
    pub fn build(self) -> SdkConfig {
  790    822   
        SdkConfig {
  791    823   
            app_name: self.app_name,
         824  +
            auth_scheme_preference: self.auth_scheme_preference,
  792    825   
            identity_cache: self.identity_cache,
  793    826   
            credentials_provider: self.credentials_provider,
  794    827   
            token_provider: self.token_provider,
  795    828   
            region: self.region,
  796    829   
            account_id_endpoint_mode: self.account_id_endpoint_mode,
  797    830   
            endpoint_url: self.endpoint_url,
  798    831   
            retry_config: self.retry_config,
  799    832   
            sleep_impl: self.sleep_impl,
  800    833   
            timeout_config: self.timeout_config,
  801    834   
            http_client: self.http_client,
@@ -869,902 +928,966 @@
  889    922   
    /// Configured region
  890    923   
    pub fn region(&self) -> Option<&Region> {
  891    924   
        self.region.as_ref()
  892    925   
    }
  893    926   
  894    927   
    /// Configured account ID endpoint mode
  895    928   
    pub fn account_id_endpoint_mode(&self) -> Option<&AccountIdEndpointMode> {
  896    929   
        self.account_id_endpoint_mode.as_ref()
  897    930   
    }
  898    931   
         932  +
    /// Configured auth scheme preference
         933  +
    pub fn auth_scheme_preference(&self) -> Option<&AuthSchemePreference> {
         934  +
        self.auth_scheme_preference.as_ref()
         935  +
    }
         936  +
  899    937   
    /// Configured endpoint URL
  900    938   
    pub fn endpoint_url(&self) -> Option<&str> {
  901    939   
        self.endpoint_url.as_deref()
  902    940   
    }
  903    941   
  904    942   
    /// Configured retry config
  905    943   
    pub fn retry_config(&self) -> Option<&RetryConfig> {
  906    944   
        self.retry_config.as_ref()
  907    945   
    }
  908    946   
@@ -993,1031 +1046,1085 @@
 1013   1051   
        self.config_origins
 1014   1052   
            .get(setting)
 1015   1053   
            .cloned()
 1016   1054   
            .unwrap_or_default()
 1017   1055   
    }
 1018   1056   
 1019   1057   
    /// Convert this [`SdkConfig`] back to a builder to enable modification
 1020   1058   
    pub fn into_builder(self) -> Builder {
 1021   1059   
        Builder {
 1022   1060   
            app_name: self.app_name,
        1061  +
            auth_scheme_preference: self.auth_scheme_preference,
 1023   1062   
            identity_cache: self.identity_cache,
 1024   1063   
            credentials_provider: self.credentials_provider,
 1025   1064   
            token_provider: self.token_provider,
 1026   1065   
            region: self.region,
 1027   1066   
            account_id_endpoint_mode: self.account_id_endpoint_mode,
 1028   1067   
            endpoint_url: self.endpoint_url,
 1029   1068   
            retry_config: self.retry_config,
 1030   1069   
            sleep_impl: self.sleep_impl,
 1031   1070   
            time_source: self.time_source,
 1032   1071   
            timeout_config: self.timeout_config,

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

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/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_bedrockruntime::Config::builder()
         448  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         449  +
    ///     // ...
         450  +
    ///     .build();
         451  +
    /// let client = aws_sdk_bedrockruntime::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_bedrockruntime::Config::builder()
         477  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         478  +
    ///     // ...
         479  +
    ///     .build();
         480  +
    /// let client = aws_sdk_bedrockruntime::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_bedrockruntime`.
  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("AmazonBedrockFrontendService");
 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/bedrockruntime/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`]