AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-credential-types/src/credentials_impl.rs

@@ -1,1 +166,133 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6         -
use aws_smithy_types::config_bag::Layer;
    7      6   
use aws_smithy_types::date_time::Format;
    8         -
use aws_smithy_types::type_erasure::TypeErasedBox;
    9         -
use std::any::{Any, TypeId};
   10         -
use std::collections::HashMap;
   11      7   
use std::fmt;
   12      8   
use std::fmt::{Debug, Formatter};
   13      9   
use std::sync::Arc;
   14     10   
use std::time::{SystemTime, UNIX_EPOCH};
   15     11   
use zeroize::Zeroizing;
   16     12   
   17     13   
use aws_smithy_runtime_api::client::identity::Identity;
   18     14   
   19     15   
use crate::attributes::AccountId;
   20         -
use crate::credential_feature::AwsCredentialFeature;
   21     16   
   22     17   
/// AWS SDK Credentials
   23     18   
///
   24     19   
/// An opaque struct representing credentials that may be used in an AWS SDK, modeled on
   25     20   
/// the [CRT credentials implementation](https://github.com/awslabs/aws-c-auth/blob/main/source/credentials.c).
   26     21   
///
   27     22   
/// When `Credentials` is dropped, its contents are zeroed in memory. Credentials uses an interior Arc to ensure
   28     23   
/// that even when cloned, credentials don't exist in multiple memory locations.
   29         -
pub struct Credentials(Arc<Inner>, HashMap<TypeId, TypeErasedBox>);
   30         -
   31         -
impl Clone for Credentials {
   32         -
    fn clone(&self) -> Self {
   33         -
        let mut new_map = HashMap::with_capacity(self.1.len());
   34         -
        for (k, v) in &self.1 {
   35         -
            new_map.insert(
   36         -
                *k,
   37         -
                v.try_clone()
   38         -
                    .expect("values are guaranteed to implement `Clone` via `set_property`"),
   39         -
            );
   40         -
        }
   41         -
        Self(self.0.clone(), new_map)
   42         -
    }
   43         -
}
   44         -
   45         -
impl PartialEq for Credentials {
   46         -
    #[inline] // specified in the output of cargo expand of the original `#[derive(PartialEq)]`
   47         -
    fn eq(&self, other: &Credentials) -> bool {
   48         -
        self.0 == other.0
   49         -
    }
   50         -
}
   51         -
   52         -
impl Eq for Credentials {}
          24  +
#[derive(Clone, Eq, PartialEq)]
          25  +
pub struct Credentials(Arc<Inner>);
   53     26   
   54     27   
#[derive(Clone, Eq, PartialEq)]
   55     28   
struct Inner {
   56     29   
    access_key_id: Zeroizing<String>,
   57     30   
    secret_access_key: Zeroizing<String>,
   58     31   
    session_token: Zeroizing<Option<String>>,
   59     32   
   60     33   
    /// Credential Expiry
   61     34   
    ///
   62     35   
    /// A SystemTime at which the credentials should no longer be used because they have expired.
   63     36   
    /// The primary purpose of this value is to allow credentials to communicate to the caching
   64     37   
    /// provider when they need to be refreshed.
   65     38   
    ///
   66     39   
    /// If these credentials never expire, this value will be set to `None`
   67     40   
    expires_after: Option<SystemTime>,
   68     41   
   69     42   
    // Optional piece of data to support account-based endpoints.
   70     43   
    // https://docs.aws.amazon.com/sdkref/latest/guide/feature-account-endpoints.html
   71     44   
    account_id: Option<AccountId>,
   72     45   
   73     46   
    provider_name: &'static str,
   74     47   
}
   75     48   
   76     49   
impl Debug for Credentials {
   77     50   
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
   78     51   
        let mut creds = f.debug_struct("Credentials");
   79     52   
        creds
   80     53   
            .field("provider_name", &self.0.provider_name)
   81     54   
            .field("access_key_id", &self.0.access_key_id.as_str())
   82     55   
            .field("secret_access_key", &"** redacted **");
   83     56   
        if let Some(expiry) = self.expiry() {
   84     57   
            if let Some(formatted) = expiry.duration_since(UNIX_EPOCH).ok().and_then(|dur| {
   85     58   
                aws_smithy_types::DateTime::from_secs(dur.as_secs() as _)
   86     59   
                    .fmt(Format::DateTime)
   87     60   
                    .ok()
   88     61   
            }) {
   89     62   
                creds.field("expires_after", &formatted);
   90     63   
            } else {
   91     64   
                creds.field("expires_after", &expiry);
   92     65   
            }
   93     66   
        } else {
   94     67   
            creds.field("expires_after", &"never");
   95     68   
        }
   96     69   
        if let Some(account_id) = &self.0.account_id {
   97     70   
            creds.field("account_id", &account_id.as_str());
   98     71   
        }
   99         -
        for (i, prop) in self.1.values().enumerate() {
  100         -
            creds.field(&format!("property_{i}"), prop);
  101         -
        }
  102     72   
        creds.finish()
  103     73   
    }
  104     74   
}
  105     75   
  106     76   
#[cfg(feature = "hardcoded-credentials")]
  107     77   
const STATIC_CREDENTIALS: &str = "Static";
  108     78   
  109     79   
impl Credentials {
  110     80   
    /// Returns builder for `Credentials`.
  111     81   
    pub fn builder() -> CredentialsBuilder {
  112     82   
        CredentialsBuilder::default()
  113     83   
    }
  114     84   
  115     85   
    /// Creates `Credentials`.
  116     86   
    ///
  117     87   
    /// This is intended to be used from a custom credentials provider implementation.
  118     88   
    /// It is __NOT__ secure to hardcode credentials into your application.
  119     89   
    pub fn new(
  120     90   
        access_key_id: impl Into<String>,
  121     91   
        secret_access_key: impl Into<String>,
  122     92   
        session_token: Option<String>,
  123     93   
        expires_after: Option<SystemTime>,
  124     94   
        provider_name: &'static str,
  125     95   
    ) -> Self {
  126         -
        Credentials(
  127         -
            Arc::new(Inner {
          96  +
        Credentials(Arc::new(Inner {
  128     97   
            access_key_id: Zeroizing::new(access_key_id.into()),
  129     98   
            secret_access_key: Zeroizing::new(secret_access_key.into()),
  130     99   
            session_token: Zeroizing::new(session_token),
  131    100   
            expires_after,
  132    101   
            account_id: None,
  133    102   
            provider_name,
  134         -
            }),
  135         -
            HashMap::new(),
  136         -
        )
         103  +
        }))
  137    104   
    }
  138    105   
  139    106   
    /// Creates `Credentials` from hardcoded access key, secret key, and session token.
  140    107   
    ///
  141    108   
    /// _Note: In general, you should prefer to use the credential providers that come
  142    109   
    /// with the AWS SDK to get credentials. It is __NOT__ secure to hardcode credentials
  143    110   
    /// into your application. If you're writing a custom credentials provider, then
  144    111   
    /// use [`Credentials::new`] instead of this._
  145    112   
    ///
  146    113   
    /// This function requires the `hardcoded-credentials` feature to be enabled.
@@ -194,161 +289,220 @@
  214    181   
  215    182   
    /// Returns the account ID.
  216    183   
    pub fn account_id(&self) -> Option<&AccountId> {
  217    184   
        self.0.account_id.as_ref()
  218    185   
    }
  219    186   
  220    187   
    /// Returns the session token.
  221    188   
    pub fn session_token(&self) -> Option<&str> {
  222    189   
        self.0.session_token.as_deref()
  223    190   
    }
  224         -
  225         -
    /// Set arbitrary property for `Credentials`
  226         -
    #[doc(hidden)]
  227         -
    pub fn set_property<T: Any + Clone + Debug + Send + Sync + 'static>(&mut self, prop: T) {
  228         -
        self.1
  229         -
            .insert(TypeId::of::<T>(), TypeErasedBox::new_with_clone(prop));
  230         -
    }
  231         -
  232         -
    /// Returns arbitrary property associated with this `Credentials`.
  233         -
    #[doc(hidden)]
  234         -
    pub fn get_property<T: Any + Debug + Send + Sync + 'static>(&self) -> Option<&T> {
  235         -
        self.1
  236         -
            .get(&TypeId::of::<T>())
  237         -
            .and_then(|b| b.downcast_ref())
  238         -
    }
  239         -
  240         -
    /// Attempts to retrieve a mutable reference to property of a given type `T`.
  241         -
    #[doc(hidden)]
  242         -
    pub fn get_property_mut<T: Any + Debug + Send + Sync + 'static>(&mut self) -> Option<&mut T> {
  243         -
        self.1
  244         -
            .get_mut(&TypeId::of::<T>())
  245         -
            .and_then(|b| b.downcast_mut())
  246         -
    }
  247         -
  248         -
    /// Returns a mutable reference to `T` if it is stored in the property, otherwise returns the
  249         -
    /// [`Default`] implementation of `T`.
  250         -
    #[doc(hidden)]
  251         -
    pub fn get_property_mut_or_default<T: Any + Clone + Debug + Default + Send + Sync + 'static>(
  252         -
        &mut self,
  253         -
    ) -> &mut T {
  254         -
        self.1
  255         -
            .entry(TypeId::of::<T>())
  256         -
            .or_insert_with(|| TypeErasedBox::new_with_clone(T::default()))
  257         -
            .downcast_mut()
  258         -
            .expect("typechecked")
  259         -
    }
  260    191   
}
  261    192   
  262    193   
/// Builder for [`Credentials`]
  263    194   
///
  264    195   
/// Similar to [`Credentials::new`], the use of the builder is intended for a custom credentials provider implementation.
  265    196   
/// It is __NOT__ secure to hardcode credentials into your application.
  266    197   
#[derive(Default, Clone)]
  267    198   
#[allow(missing_debug_implementations)] // for security reasons, and we can add manual `impl Debug` just like `Credentials`, if needed.
  268    199   
pub struct CredentialsBuilder {
  269    200   
    access_key_id: Option<Zeroizing<String>>,
@@ -301,232 +488,362 @@
  321    252   
    }
  322    253   
  323    254   
    /// Set provider name for the builder.
  324    255   
    pub fn provider_name(mut self, provider_name: &'static str) -> Self {
  325    256   
        self.provider_name = Some(provider_name);
  326    257   
        self
  327    258   
    }
  328    259   
  329    260   
    /// Build [`Credentials`] from the builder.
  330    261   
    pub fn build(self) -> Credentials {
  331         -
        Credentials(
  332         -
            Arc::new(Inner {
         262  +
        Credentials(Arc::new(Inner {
  333    263   
            access_key_id: self
  334    264   
                .access_key_id
  335    265   
                .expect("required field `access_key_id` missing"),
  336    266   
            secret_access_key: self
  337    267   
                .secret_access_key
  338    268   
                .expect("required field `secret_access_key` missing"),
  339    269   
            session_token: self.session_token,
  340    270   
            expires_after: self.expires_after,
  341    271   
            account_id: self.account_id,
  342    272   
            provider_name: self
  343    273   
                .provider_name
  344    274   
                .expect("required field `provider_name` missing"),
  345         -
            }),
  346         -
            HashMap::new(),
  347         -
        )
         275  +
        }))
  348    276   
    }
  349    277   
}
  350    278   
  351    279   
#[cfg(feature = "test-util")]
  352    280   
impl Credentials {
  353    281   
    /// Creates a test `Credentials` with no session token.
  354    282   
    pub fn for_tests() -> Self {
  355    283   
        Self::new(
  356    284   
            "ANOTREAL",
  357    285   
            "notrealrnrELgWzOk3IfjzDKtFBhDby",
  358    286   
            None,
  359    287   
            None,
  360    288   
            "test",
  361    289   
        )
  362    290   
    }
  363    291   
  364    292   
    /// Creates a test `Credentials` that include a session token.
  365    293   
    pub fn for_tests_with_session_token() -> Self {
  366    294   
        Self::new(
  367    295   
            "ANOTREAL",
  368    296   
            "notrealrnrELgWzOk3IfjzDKtFBhDby",
  369    297   
            Some("notarealsessiontoken".to_string()),
  370    298   
            None,
  371    299   
            "test",
  372    300   
        )
  373    301   
    }
  374    302   
}
  375    303   
  376    304   
#[cfg(feature = "test-util")]
  377    305   
impl CredentialsBuilder {
  378    306   
    /// Creates a test `CredentialsBuilder` with the required fields:
  379    307   
    /// `access_key_id`, `secret_access_key`, and `provider_name`.
  380    308   
    pub fn for_tests() -> Self {
  381    309   
        CredentialsBuilder::default()
  382    310   
            .access_key_id("ANOTREAL")
  383    311   
            .secret_access_key("notrealrnrELgWzOk3IfjzDKtFBhDby")
  384    312   
            .provider_name("test")
  385    313   
    }
  386    314   
}
  387    315   
  388    316   
impl From<Credentials> for Identity {
  389    317   
    fn from(val: Credentials) -> Self {
  390    318   
        let expiry = val.expiry();
  391    319   
        let mut builder = if let Some(account_id) = val.account_id() {
  392         -
            Identity::builder().property(account_id.clone())
         320  +
            Identity::builder().property(account_id.clone()).data(val)
  393    321   
        } else {
  394         -
            Identity::builder()
         322  +
            Identity::builder().data(val)
  395    323   
        };
  396         -
  397    324   
        builder.set_expiration(expiry);
  398         -
  399         -
        if let Some(features) = val.get_property::<Vec<AwsCredentialFeature>>().cloned() {
  400         -
            let mut layer = Layer::new("IdentityResolutionFeatureIdTracking");
  401         -
            for feat in features {
  402         -
                layer.store_append(feat);
  403         -
            }
  404         -
            builder.set_property(layer.freeze());
  405         -
        }
  406         -
  407         -
        builder.data(val).build().expect("set required fields")
         325  +
        builder.build().expect("set required fields")
  408    326   
    }
  409    327   
}
  410    328   
  411    329   
#[cfg(test)]
  412    330   
mod test {
  413    331   
    use crate::Credentials;
  414    332   
    use std::time::{Duration, UNIX_EPOCH};
  415    333   
  416         -
    #[cfg(feature = "test-util")]
  417         -
    use crate::credential_feature::AwsCredentialFeature;
  418         -
  419    334   
    #[test]
  420    335   
    fn debug_impl() {
  421    336   
        let creds = Credentials::new(
  422    337   
            "akid",
  423    338   
            "secret",
  424    339   
            Some("token".into()),
  425    340   
            Some(UNIX_EPOCH + Duration::from_secs(1234567890)),
  426    341   
            "debug tester",
  427    342   
        );
  428    343   
        assert_eq!(
  429    344   
            format!("{:?}", creds),
  430    345   
            r#"Credentials { provider_name: "debug tester", access_key_id: "akid", secret_access_key: "** redacted **", expires_after: "2009-02-13T23:31:30Z" }"#
  431    346   
        );
  432    347   
  433    348   
        // with account ID
  434    349   
        let creds = Credentials::builder()
  435    350   
            .access_key_id("akid")
  436    351   
            .secret_access_key("secret")
  437    352   
            .session_token("token")
  438    353   
            .expiry(UNIX_EPOCH + Duration::from_secs(1234567890))
  439    354   
            .account_id("012345678901")
  440    355   
            .provider_name("debug tester")
  441    356   
            .build();
  442    357   
        assert_eq!(
  443    358   
            format!("{:?}", creds),
  444    359   
            r#"Credentials { provider_name: "debug tester", access_key_id: "akid", secret_access_key: "** redacted **", expires_after: "2009-02-13T23:31:30Z", account_id: "012345678901" }"#
  445    360   
        );
  446    361   
    }
  447         -
  448         -
    #[cfg(feature = "test-util")]
  449         -
    #[test]
  450         -
    fn equality_ignores_properties() {
  451         -
        #[derive(Clone, Debug)]
  452         -
        struct Foo;
  453         -
        let mut creds1 = Credentials::for_tests_with_session_token();
  454         -
        creds1.set_property(AwsCredentialFeature::CredentialsCode);
  455         -
  456         -
        let mut creds2 = Credentials::for_tests_with_session_token();
  457         -
        creds2.set_property(Foo);
  458         -
  459         -
        assert_eq!(creds1, creds2)
  460         -
    }
  461         -
  462         -
    #[cfg(feature = "test-util")]
  463         -
    #[test]
  464         -
    fn identity_inherits_feature_properties() {
  465         -
        use aws_smithy_runtime_api::client::identity::Identity;
  466         -
        use aws_smithy_types::config_bag::FrozenLayer;
  467         -
  468         -
        let mut creds = Credentials::for_tests_with_session_token();
  469         -
        let mut feature_props = vec![
  470         -
            AwsCredentialFeature::CredentialsCode,
  471         -
            AwsCredentialFeature::CredentialsStsSessionToken,
  472         -
        ];
  473         -
        creds.set_property(feature_props.clone());
  474         -
  475         -
        let identity = Identity::from(creds);
  476         -
  477         -
        let maybe_props = identity
  478         -
            .property::<FrozenLayer>()
  479         -
            .unwrap()
  480         -
            .load::<AwsCredentialFeature>()
  481         -
            .cloned()
  482         -
            .collect::<Vec<AwsCredentialFeature>>();
  483         -
  484         -
        // The props get reversed when being popped out of the StoreAppend
  485         -
        feature_props.reverse();
  486         -
        assert_eq!(maybe_props, feature_props)
  487         -
    }
  488    362   
}

tmp-codegen-diff/aws-sdk/sdk/aws-credential-types/src/lib.rs

@@ -1,1 +39,37 @@
   14     14   
#![allow(clippy::derive_partial_eq_without_eq)]
   15     15   
#![warn(
   16     16   
    missing_debug_implementations,
   17     17   
    missing_docs,
   18     18   
    rust_2018_idioms,
   19     19   
    rustdoc::missing_crate_level_docs,
   20     20   
    unreachable_pub
   21     21   
)]
   22     22   
   23     23   
pub mod attributes;
   24         -
#[doc(hidden)]
   25         -
pub mod credential_feature;
   26     24   
pub mod credential_fn;
   27     25   
mod credentials_impl;
   28     26   
pub mod provider;
   29     27   
pub mod token_fn;
   30     28   
   31     29   
pub use credentials_impl::{Credentials, CredentialsBuilder};
   32     30   
   33     31   
/// AWS Access Token
   34     32   
///
   35     33   
/// This access token type is used to authenticate to AWS services that use HTTP Bearer

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

@@ -1,1 +0,18 @@
    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   
[dependencies.aws-runtime]
   16     16   
path = "../aws-runtime"
   17     17   
features = ["http-02x"]
   18         -
version = "1.5.10"
          18  +
version = "1.5.9"

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

@@ -1,1 +144,144 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-runtime"
    4         -
version = "1.5.10"
           4  +
version = "1.5.9"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
    6      6   
description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly."
    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   
event-stream = ["dep:aws-smithy-eventstream", "aws-sigv4/sign-eventstream"]
   21     21   
http-02x = []
   22     22   
http-1x = ["dep:http-1x", "dep:http-body-1x"]
   23     23   
test-util = ["dep:regex-lite"]
   24     24   
sigv4a = ["aws-sigv4/sigv4a"]
   25     25   
   26     26   
[dependencies]
   27     27   
bytes = "1.10.0"
   28     28   
fastrand = "2.3.0"
   29     29   
percent-encoding = "2.3.1"
   30     30   
pin-project-lite = "0.2.14"
   31     31   
tracing = "0.1.40"
   32     32   
   33     33   
[dependencies.aws-credential-types]
   34     34   
path = "../aws-credential-types"
   35         -
version = "1.2.5"
          35  +
version = "1.2.4"
   36     36   
   37     37   
[dependencies.aws-sigv4]
   38     38   
path = "../aws-sigv4"
   39     39   
features = ["http0-compat"]
   40     40   
version = "1.3.4"
   41     41   
   42     42   
[dependencies.aws-smithy-async]
   43     43   
path = "../aws-smithy-async"
   44     44   
version = "1.2.5"
   45     45   
   46     46   
[dependencies.aws-smithy-eventstream]
   47     47   
path = "../aws-smithy-eventstream"
   48     48   
optional = true
   49     49   
version = "0.60.10"
   50     50   
   51     51   
[dependencies.aws-smithy-http]
   52     52   
path = "../aws-smithy-http"
   53     53   
version = "0.62.3"
   54     54   
   55     55   
[dependencies.aws-smithy-runtime]
   56     56   
path = "../aws-smithy-runtime"
   57     57   
features = ["client"]
   58         -
version = "1.8.6"
          58  +
version = "1.8.5"
   59     59   
   60     60   
[dependencies.aws-smithy-runtime-api]
   61     61   
path = "../aws-smithy-runtime-api"
   62     62   
features = ["client"]
   63         -
version = "1.8.7"
          63  +
version = "1.8.5"
   64     64   
   65     65   
[dependencies.aws-smithy-types]
   66     66   
path = "../aws-smithy-types"
   67     67   
version = "1.3.2"
   68     68   
   69     69   
[dependencies.aws-types]
   70     70   
path = "../aws-types"
   71     71   
version = "1.3.8"
   72     72   
   73     73   
[dependencies.http-02x]
   74     74   
package = "http"
   75     75   
version = "0.2.9"
   76     76   
   77     77   
[dependencies.http-body-04x]
   78     78   
package = "http-body"
   79     79   
version = "0.4.5"
   80     80   
   81     81   
[dependencies.http-1x]
   82     82   
package = "http"
   83     83   
version = "1.1.0"
   84     84   
optional = true
   85     85   
   86     86   
[dependencies.http-body-1x]
   87     87   
package = "http-body"
   88     88   
version = "1.0.0"
   89     89   
optional = true
   90     90   
   91     91   
[dependencies.regex-lite]
   92     92   
version = "0.1.5"
   93     93   
optional = true
   94     94   
   95     95   
[dependencies.uuid]
   96     96   
version = "1"
   97     97   
   98     98   
[dev-dependencies]
   99     99   
arbitrary = "1.3"
  100    100   
bytes-utils = "0.1.2"
  101    101   
convert_case = "0.6.0"
  102    102   
proptest = "1.2"
  103    103   
serde_json = "1"
  104    104   
tracing-test = "0.2.4"
  105    105   
  106    106   
[dev-dependencies.aws-credential-types]
  107    107   
path = "../aws-credential-types"
  108    108   
features = ["test-util"]
  109         -
version = "1.2.5"
         109  +
version = "1.2.4"
  110    110   
  111    111   
[dev-dependencies.aws-smithy-async]
  112    112   
path = "../aws-smithy-async"
  113    113   
features = ["test-util"]
  114    114   
version = "1.2.5"
  115    115   
  116    116   
[dev-dependencies.aws-smithy-protocol-test]
  117    117   
path = "../aws-smithy-protocol-test"
  118    118   
version = "0.63.4"
  119    119   
  120    120   
[dev-dependencies.aws-smithy-runtime-api]
  121    121   
path = "../aws-smithy-runtime-api"
  122    122   
features = ["test-util"]
  123         -
version = "1.8.7"
         123  +
version = "1.8.5"
  124    124   
  125    125   
[dev-dependencies.aws-smithy-types]
  126    126   
path = "../aws-smithy-types"
  127    127   
features = ["test-util"]
  128    128   
version = "1.3.2"
  129    129   
  130    130   
[dev-dependencies.futures-util]
  131    131   
version = "0.3.29"
  132    132   
default-features = false
  133    133   

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/sdk_feature.rs

@@ -1,1 +25,18 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6         -
/// Note: This code originally lived in the `aws-runtime` crate. It was moved here to avoid circular dependencies
    7         -
/// This module is re-exported in `aws-runtime`, and so even though this is a pre-1.0 crate, this module should not
    8         -
/// have any breaking changes
    9      6   
use aws_smithy_types::config_bag::{Storable, StoreAppend};
   10      7   
   11      8   
/// IDs for the features that may be used in the AWS SDK
   12      9   
#[non_exhaustive]
   13     10   
#[derive(Clone, Debug, Eq, PartialEq)]
   14     11   
pub enum AwsSdkFeature {
   15     12   
    /// Indicates that an operation was called by the S3 Transfer Manager
   16     13   
    S3Transfer,
   17         -
    /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 device code grant
   18         -
    SsoLoginDevice,
   19         -
    /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 authorization code grant
   20         -
    SsoLoginAuth,
   21     14   
}
   22     15   
   23     16   
impl Storable for AwsSdkFeature {
   24     17   
    type Storer = StoreAppend<Self>;
   25     18   
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/interceptor.rs

@@ -1,1 +41,40 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
use std::borrow::Cow;
    7      7   
use std::fmt;
    8      8   
    9      9   
use http_02x::header::{HeaderName, HeaderValue, InvalidHeaderValue, USER_AGENT};
   10     10   
   11         -
use aws_credential_types::credential_feature::AwsCredentialFeature;
   12     11   
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
   13     12   
use aws_smithy_runtime_api::box_error::BoxError;
   14     13   
use aws_smithy_runtime_api::client::http::HttpClient;
   15     14   
use aws_smithy_runtime_api::client::interceptors::context::{
   16     15   
    BeforeTransmitInterceptorContextMut, BeforeTransmitInterceptorContextRef,
   17     16   
};
   18     17   
use aws_smithy_runtime_api::client::interceptors::Intercept;
   19     18   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   20     19   
use aws_smithy_types::config_bag::ConfigBag;
   21     20   
use aws_types::app_name::AppName;
@@ -120,119 +186,178 @@
  140    139   
                .map(|m| ua.add_business_metric(m));
  141    140   
        }
  142    141   
  143    142   
        let aws_sdk_features = cfg.load::<AwsSdkFeature>();
  144    143   
        for aws_sdk_feature in aws_sdk_features {
  145    144   
            aws_sdk_feature
  146    145   
                .provide_business_metric()
  147    146   
                .map(|m| ua.add_business_metric(m));
  148    147   
        }
  149    148   
  150         -
        let aws_credential_features = cfg.load::<AwsCredentialFeature>();
  151         -
        for aws_credential_feature in aws_credential_features {
  152         -
            aws_credential_feature
  153         -
                .provide_business_metric()
  154         -
                .map(|m| ua.add_business_metric(m));
  155         -
        }
  156         -
  157    149   
        let maybe_connector_metadata = runtime_components
  158    150   
            .http_client()
  159    151   
            .and_then(|c| c.connector_metadata());
  160    152   
        if let Some(connector_metadata) = maybe_connector_metadata {
  161    153   
            let am = AdditionalMetadata::new(Cow::Owned(connector_metadata.to_string()))?;
  162    154   
            ua.add_additional_metadata(am);
  163    155   
        }
  164    156   
  165    157   
        let headers = context.request_mut().headers_mut();
  166    158   
        let (user_agent, x_amz_user_agent) = header_values(&ua)?;

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/metrics.rs

@@ -1,1 +37,36 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
use crate::sdk_feature::AwsSdkFeature;
    7         -
use aws_credential_types::credential_feature::AwsCredentialFeature;
    8      7   
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
    9      8   
use std::borrow::Cow;
   10      9   
use std::collections::HashMap;
   11     10   
use std::fmt;
   12     11   
use std::sync::LazyLock;
   13     12   
   14     13   
const MAX_COMMA_SEPARATED_METRICS_VALUES_LENGTH: usize = 1024;
   15     14   
#[allow(dead_code)]
   16     15   
const MAX_METRICS_ID_NUMBER: usize = 350;
   17     16   
@@ -110,109 +296,221 @@
  130    129   
    Sigv4aSigning,
  131    130   
    ResolvedAccountId,
  132    131   
    FlexibleChecksumsReqCrc32,
  133    132   
    FlexibleChecksumsReqCrc32c,
  134    133   
    FlexibleChecksumsReqCrc64,
  135    134   
    FlexibleChecksumsReqSha1,
  136    135   
    FlexibleChecksumsReqSha256,
  137    136   
    FlexibleChecksumsReqWhenSupported,
  138    137   
    FlexibleChecksumsReqWhenRequired,
  139    138   
    FlexibleChecksumsResWhenSupported,
  140         -
    FlexibleChecksumsResWhenRequired,
  141         -
    DdbMapper,
  142         -
    CredentialsCode,
  143         -
    CredentialsJvmSystemProperties,
  144         -
    CredentialsEnvVars,
  145         -
    CredentialsEnvVarsStsWebIdToken,
  146         -
    CredentialsStsAssumeRole,
  147         -
    CredentialsStsAssumeRoleSaml,
  148         -
    CredentialsStsAssumeRoleWebId,
  149         -
    CredentialsStsFederationToken,
  150         -
    CredentialsStsSessionToken,
  151         -
    CredentialsProfile,
  152         -
    CredentialsProfileSourceProfile,
  153         -
    CredentialsProfileNamedProvider,
  154         -
    CredentialsProfileStsWebIdToken,
  155         -
    CredentialsProfileSso,
  156         -
    CredentialsSso,
  157         -
    CredentialsProfileSsoLegacy,
  158         -
    CredentialsSsoLegacy,
  159         -
    CredentialsProfileProcess,
  160         -
    CredentialsProcess,
  161         -
    CredentialsBoto2ConfigFile,
  162         -
    CredentialsAwsSdkStore,
  163         -
    CredentialsHttp,
  164         -
    CredentialsImds,
  165         -
    SsoLoginDevice,
  166         -
    SsoLoginAuth,
  167         -
    BearerServiceEnvVars
         139  +
    FlexibleChecksumsResWhenRequired
  168    140   
);
  169    141   
  170    142   
pub(crate) trait ProvideBusinessMetric {
  171    143   
    fn provide_business_metric(&self) -> Option<BusinessMetric>;
  172    144   
}
  173    145   
  174    146   
impl ProvideBusinessMetric for SmithySdkFeature {
  175    147   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  176    148   
        use SmithySdkFeature::*;
  177    149   
        match self {
  178    150   
            Waiter => Some(BusinessMetric::Waiter),
  179    151   
            Paginator => Some(BusinessMetric::Paginator),
  180    152   
            GzipRequestCompression => Some(BusinessMetric::GzipRequestCompression),
  181    153   
            ProtocolRpcV2Cbor => Some(BusinessMetric::ProtocolRpcV2Cbor),
  182    154   
            RetryModeStandard => Some(BusinessMetric::RetryModeStandard),
  183    155   
            RetryModeAdaptive => Some(BusinessMetric::RetryModeAdaptive),
  184    156   
            FlexibleChecksumsReqCrc32 => Some(BusinessMetric::FlexibleChecksumsReqCrc32),
  185    157   
            FlexibleChecksumsReqCrc32c => Some(BusinessMetric::FlexibleChecksumsReqCrc32c),
  186    158   
            FlexibleChecksumsReqCrc64 => Some(BusinessMetric::FlexibleChecksumsReqCrc64),
  187    159   
            FlexibleChecksumsReqSha1 => Some(BusinessMetric::FlexibleChecksumsReqSha1),
  188    160   
            FlexibleChecksumsReqSha256 => Some(BusinessMetric::FlexibleChecksumsReqSha256),
  189    161   
            FlexibleChecksumsReqWhenSupported => {
  190    162   
                Some(BusinessMetric::FlexibleChecksumsReqWhenSupported)
  191    163   
            }
  192    164   
            FlexibleChecksumsReqWhenRequired => {
  193    165   
                Some(BusinessMetric::FlexibleChecksumsReqWhenRequired)
  194    166   
            }
  195    167   
            FlexibleChecksumsResWhenSupported => {
  196    168   
                Some(BusinessMetric::FlexibleChecksumsResWhenSupported)
  197    169   
            }
  198    170   
            FlexibleChecksumsResWhenRequired => {
  199    171   
                Some(BusinessMetric::FlexibleChecksumsResWhenRequired)
  200    172   
            }
  201    173   
            otherwise => {
  202    174   
                // This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate
  203    175   
                // while continuing to use an outdated version of an SDK crate or the `aws-runtime`
  204    176   
                // crate.
  205    177   
                tracing::warn!(
  206    178   
                    "Attempted to provide `BusinessMetric` for `{otherwise:?}`, which is not recognized in the current version of the `aws-runtime` crate. \
  207    179   
                    Consider upgrading to the latest version to ensure that all tracked features are properly reported in your metrics."
  208    180   
                );
  209    181   
                None
  210    182   
            }
  211    183   
        }
  212    184   
    }
  213    185   
}
  214    186   
  215    187   
impl ProvideBusinessMetric for AwsSdkFeature {
  216    188   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  217    189   
        use AwsSdkFeature::*;
  218    190   
        match self {
  219    191   
            S3Transfer => Some(BusinessMetric::S3Transfer),
  220         -
            SsoLoginDevice => Some(BusinessMetric::SsoLoginDevice),
  221         -
            SsoLoginAuth => Some(BusinessMetric::SsoLoginAuth),
  222         -
        }
  223         -
    }
  224         -
}
  225         -
  226         -
impl ProvideBusinessMetric for AwsCredentialFeature {
  227         -
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  228         -
        use AwsCredentialFeature::*;
  229         -
        match self {
  230         -
            CredentialsCode => Some(BusinessMetric::CredentialsCode),
  231         -
            CredentialsEnvVars => Some(BusinessMetric::CredentialsEnvVars),
  232         -
            CredentialsEnvVarsStsWebIdToken => {
  233         -
                Some(BusinessMetric::CredentialsEnvVarsStsWebIdToken)
  234         -
            }
  235         -
            CredentialsStsAssumeRole => Some(BusinessMetric::CredentialsStsAssumeRole),
  236         -
            CredentialsStsAssumeRoleSaml => Some(BusinessMetric::CredentialsStsAssumeRoleSaml),
  237         -
            CredentialsStsAssumeRoleWebId => Some(BusinessMetric::CredentialsStsAssumeRoleWebId),
  238         -
            CredentialsStsFederationToken => Some(BusinessMetric::CredentialsStsFederationToken),
  239         -
            CredentialsStsSessionToken => Some(BusinessMetric::CredentialsStsSessionToken),
  240         -
            CredentialsProfile => Some(BusinessMetric::CredentialsProfile),
  241         -
            CredentialsProfileSourceProfile => {
  242         -
                Some(BusinessMetric::CredentialsProfileSourceProfile)
  243         -
            }
  244         -
            CredentialsProfileNamedProvider => {
  245         -
                Some(BusinessMetric::CredentialsProfileNamedProvider)
  246         -
            }
  247         -
            CredentialsProfileStsWebIdToken => {
  248         -
                Some(BusinessMetric::CredentialsProfileStsWebIdToken)
  249         -
            }
  250         -
            CredentialsProfileSso => Some(BusinessMetric::CredentialsProfileSso),
  251         -
            CredentialsSso => Some(BusinessMetric::CredentialsSso),
  252         -
            CredentialsProfileProcess => Some(BusinessMetric::CredentialsProfileProcess),
  253         -
            CredentialsProcess => Some(BusinessMetric::CredentialsProcess),
  254         -
            CredentialsHttp => Some(BusinessMetric::CredentialsHttp),
  255         -
            CredentialsImds => Some(BusinessMetric::CredentialsImds),
  256         -
            BearerServiceEnvVars => Some(BusinessMetric::BearerServiceEnvVars),
  257         -
            otherwise => {
  258         -
                // This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate
  259         -
                // while continuing to use an outdated version of an SDK crate or the `aws-credential-types`
  260         -
                // crate.
  261         -
                tracing::warn!(
  262         -
                    "Attempted to provide `BusinessMetric` for `{otherwise:?}`, which is not recognized in the current version of the `aws-runtime` crate. \
  263         -
                    Consider upgrading to the latest version to ensure that all tracked features are properly reported in your metrics."
  264         -
                );
  265         -
                None
  266         -
            }
  267    192   
        }
  268    193   
    }
  269    194   
}
  270    195   
  271    196   
#[derive(Clone, Debug, Default)]
  272    197   
pub(super) struct BusinessMetrics(Vec<BusinessMetric>);
  273    198   
  274    199   
impl BusinessMetrics {
  275    200   
    pub(super) fn push(&mut self, metric: BusinessMetric) {
  276    201   
        self.0.push(metric);
@@ -315,240 +375,332 @@
  335    260   
                    .as_str()
  336    261   
                    .from_case(Case::Pascal)
  337    262   
                    .with_boundaries(&[Boundary::DigitUpper, Boundary::LowerUpper])
  338    263   
                    .to_case(Case::ScreamingSnake),
  339    264   
            )
  340    265   
        }
  341    266   
    }
  342    267   
  343    268   
    #[test]
  344    269   
    fn feature_id_to_metric_value() {
  345         -
        const EXPECTED: &str = include_str!("test_data/feature_id_to_metric_value.json");
         270  +
        const EXPECTED: &str = r#"
         271  +
{
         272  +
  "RESOURCE_MODEL": "A",
         273  +
  "WAITER": "B",
         274  +
  "PAGINATOR": "C",
         275  +
  "RETRY_MODE_LEGACY": "D",
         276  +
  "RETRY_MODE_STANDARD": "E",
         277  +
  "RETRY_MODE_ADAPTIVE": "F",
         278  +
  "S3_TRANSFER": "G",
         279  +
  "S3_CRYPTO_V1N": "H",
         280  +
  "S3_CRYPTO_V2": "I",
         281  +
  "S3_EXPRESS_BUCKET": "J",
         282  +
  "S3_ACCESS_GRANTS": "K",
         283  +
  "GZIP_REQUEST_COMPRESSION": "L",
         284  +
  "PROTOCOL_RPC_V2_CBOR": "M",
         285  +
  "ENDPOINT_OVERRIDE": "N",
         286  +
  "ACCOUNT_ID_ENDPOINT": "O",
         287  +
  "ACCOUNT_ID_MODE_PREFERRED": "P",
         288  +
  "ACCOUNT_ID_MODE_DISABLED": "Q",
         289  +
  "ACCOUNT_ID_MODE_REQUIRED": "R",
         290  +
  "SIGV4A_SIGNING": "S",
         291  +
  "RESOLVED_ACCOUNT_ID": "T",
         292  +
  "FLEXIBLE_CHECKSUMS_REQ_CRC32" : "U",
         293  +
  "FLEXIBLE_CHECKSUMS_REQ_CRC32C" : "V",
         294  +
  "FLEXIBLE_CHECKSUMS_REQ_CRC64" : "W",
         295  +
  "FLEXIBLE_CHECKSUMS_REQ_SHA1" : "X",
         296  +
  "FLEXIBLE_CHECKSUMS_REQ_SHA256" : "Y",
         297  +
  "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED" : "Z",
         298  +
  "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED" : "a",
         299  +
  "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED" : "b",
         300  +
  "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED" : "c"
         301  +
}
         302  +
        "#;
  346    303   
  347    304   
        let expected: HashMap<&str, &str> = serde_json::from_str(EXPECTED).unwrap();
  348    305   
        assert_eq!(expected.len(), FEATURE_ID_TO_METRIC_VALUE.len());
  349    306   
  350    307   
        for (feature_id, metric_value) in &*FEATURE_ID_TO_METRIC_VALUE {
  351    308   
            let expected = expected.get(format!("{feature_id}").as_str());
  352    309   
            assert_eq!(
  353    310   
                expected.unwrap_or_else(|| panic!("Expected {feature_id} to have value `{metric_value}` but it was `{expected:?}` instead.")),
  354    311   
                metric_value,
  355    312   
            );

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/test_data/feature_id_to_metric_value.json

@@ -1,0 +58,0 @@
    1         -
{
    2         -
  "RESOURCE_MODEL": "A",
    3         -
  "WAITER": "B",
    4         -
  "PAGINATOR": "C",
    5         -
  "RETRY_MODE_LEGACY": "D",
    6         -
  "RETRY_MODE_STANDARD": "E",
    7         -
  "RETRY_MODE_ADAPTIVE": "F",
    8         -
  "S3_TRANSFER": "G",
    9         -
  "S3_CRYPTO_V1N": "H",
   10         -
  "S3_CRYPTO_V2": "I",
   11         -
  "S3_EXPRESS_BUCKET": "J",
   12         -
  "S3_ACCESS_GRANTS": "K",
   13         -
  "GZIP_REQUEST_COMPRESSION": "L",
   14         -
  "PROTOCOL_RPC_V2_CBOR": "M",
   15         -
  "ENDPOINT_OVERRIDE": "N",
   16         -
  "ACCOUNT_ID_ENDPOINT": "O",
   17         -
  "ACCOUNT_ID_MODE_PREFERRED": "P",
   18         -
  "ACCOUNT_ID_MODE_DISABLED": "Q",
   19         -
  "ACCOUNT_ID_MODE_REQUIRED": "R",
   20         -
  "SIGV4A_SIGNING": "S",
   21         -
  "RESOLVED_ACCOUNT_ID": "T",
   22         -
  "FLEXIBLE_CHECKSUMS_REQ_CRC32": "U",
   23         -
  "FLEXIBLE_CHECKSUMS_REQ_CRC32C": "V",
   24         -
  "FLEXIBLE_CHECKSUMS_REQ_CRC64": "W",
   25         -
  "FLEXIBLE_CHECKSUMS_REQ_SHA1": "X",
   26         -
  "FLEXIBLE_CHECKSUMS_REQ_SHA256": "Y",
   27         -
  "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED": "Z",
   28         -
  "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED": "a",
   29         -
  "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED": "b",
   30         -
  "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED": "c",
   31         -
  "DDB_MAPPER": "d",
   32         -
  "CREDENTIALS_CODE": "e",
   33         -
  "CREDENTIALS_JVM_SYSTEM_PROPERTIES": "f",
   34         -
  "CREDENTIALS_ENV_VARS": "g",
   35         -
  "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN": "h",
   36         -
  "CREDENTIALS_STS_ASSUME_ROLE": "i",
   37         -
  "CREDENTIALS_STS_ASSUME_ROLE_SAML": "j",
   38         -
  "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID": "k",
   39         -
  "CREDENTIALS_STS_FEDERATION_TOKEN": "l",
   40         -
  "CREDENTIALS_STS_SESSION_TOKEN": "m",
   41         -
  "CREDENTIALS_PROFILE": "n",
   42         -
  "CREDENTIALS_PROFILE_SOURCE_PROFILE": "o",
   43         -
  "CREDENTIALS_PROFILE_NAMED_PROVIDER": "p",
   44         -
  "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN": "q",
   45         -
  "CREDENTIALS_PROFILE_SSO": "r",
   46         -
  "CREDENTIALS_SSO": "s",
   47         -
  "CREDENTIALS_PROFILE_SSO_LEGACY": "t",
   48         -
  "CREDENTIALS_SSO_LEGACY": "u",
   49         -
  "CREDENTIALS_PROFILE_PROCESS": "v",
   50         -
  "CREDENTIALS_PROCESS": "w",
   51         -
  "CREDENTIALS_BOTO2_CONFIG_FILE": "x",
   52         -
  "CREDENTIALS_AWS_SDK_STORE": "y",
   53         -
  "CREDENTIALS_HTTP": "z",
   54         -
  "CREDENTIALS_IMDS": "0",
   55         -
  "SSO_LOGIN_DEVICE": "1",
   56         -
  "SSO_LOGIN_AUTH": "2",
   57         -
  "BEARER_SERVICE_ENV_VARS": "3"
   58         -
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/test_util.rs

@@ -1,1 +92,70 @@
    5      5   
    6      6   
//! Utilities for testing the User-Agent header
    7      7   
    8      8   
use regex_lite::Regex;
    9      9   
use std::sync::LazyLock;
   10     10   
   11     11   
// regular expression pattern for base64 numeric values
   12     12   
#[allow(dead_code)]
   13     13   
static RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"m/([A-Za-z0-9+/=_,-]+)").unwrap());
   14     14   
   15         -
/// Helper function to check metric values in user agent
   16         -
fn check_ua_metric_values(user_agent: &str, values: &[&str], should_contain: bool) {
          15  +
/// Asserts `user_agent` contains all metric values `values`
          16  +
///
          17  +
/// Refer to the end of the parent module file `user_agent.rs` for the complete ABNF specification
          18  +
/// of `business-metrics`.
          19  +
pub fn assert_ua_contains_metric_values(user_agent: &str, values: &[&str]) {
   17     20   
    match extract_ua_values(user_agent) {
   18     21   
        Some(metrics) => {
   19         -
            let mut problematic_values = vec![];
          22  +
            let mut missed = vec![];
   20     23   
   21     24   
            for value in values.iter() {
   22         -
                let contains = metrics.contains(value);
   23         -
                if (should_contain && !contains) || (!should_contain && contains) {
   24         -
                    problematic_values.push(value);
          25  +
                if !metrics.contains(value) {
          26  +
                    missed.push(value);
   25     27   
                }
   26     28   
            }
   27         -
   28         -
            if !problematic_values.is_empty() {
   29         -
                if should_contain {
   30         -
                    panic!("metric values {problematic_values:?} not found in `{user_agent}`");
   31         -
                } else {
   32         -
                    panic!(
   33         -
                        "metric values {problematic_values:?} unexpectedly found in `{user_agent}`"
          29  +
            assert!(
          30  +
                missed.is_empty(),
          31  +
                "{}",
          32  +
                format!("metric values {missed:?} not found in `{user_agent}`")
   34     33   
            );
   35     34   
        }
   36         -
            }
   37         -
        }
   38     35   
        None => {
   39         -
            if should_contain {
   40         -
                panic!("the pattern for business-metrics `m/(metric_id) *(comma metric_id)` not found in `{user_agent}`");
   41         -
            }
   42         -
            // For "does not contain", no metrics pattern means the assertion passes
          36  +
            panic!("{}", format!("the pattern for business-metrics `m/(metric_id) *(comma metric_id)` not found in `{user_agent}`"))
   43     37   
        }
   44     38   
    }
   45     39   
}
   46     40   
   47         -
/// Asserts `user_agent` contains all metric values `values`
   48         -
///
   49         -
/// Refer to the end of the parent module file `user_agent.rs` for the complete ABNF specification
   50         -
/// of `business-metrics`.
   51         -
pub fn assert_ua_contains_metric_values(user_agent: &str, values: &[&str]) {
   52         -
    check_ua_metric_values(user_agent, values, true);
   53         -
}
   54         -
   55         -
/// Asserts `user_agent` does NOT contain any of the metric values `values`
   56         -
///
   57         -
/// Refer to the end of the parent module file `user_agent.rs` for the complete ABNF specification
   58         -
/// of `business-metrics`.
   59         -
pub fn assert_ua_does_not_contain_metric_values(user_agent: &str, values: &[&str]) {
   60         -
    check_ua_metric_values(user_agent, values, false);
   61         -
}
   62         -
   63     41   
/// Extract the metric values from the `user_agent` string
   64     42   
pub fn extract_ua_values(user_agent: &str) -> Option<Vec<&str>> {
   65     43   
    RE.find(user_agent).map(|matched| {
   66     44   
        matched
   67     45   
            .as_str()
   68     46   
            .strip_prefix("m/")
   69     47   
            .expect("prefix `m/` is guaranteed to exist by regex match")
   70     48   
            .split(',')
   71     49   
            .collect()
   72     50   
    })

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

@@ -17,17 +130,130 @@
   37     37   
[dependencies]
   38     38   
bytes = "1.10.0"
   39     39   
hex = "0.4.3"
   40     40   
hmac = "0.12"
   41     41   
sha2 = "0.10"
   42     42   
time = "0.3.5"
   43     43   
tracing = "0.1.40"
   44     44   
   45     45   
[dependencies.aws-credential-types]
   46     46   
path = "../aws-credential-types"
   47         -
version = "1.2.5"
          47  +
version = "1.2.4"
   48     48   
   49     49   
[dependencies.aws-smithy-eventstream]
   50     50   
path = "../aws-smithy-eventstream"
   51     51   
optional = true
   52     52   
version = "0.60.10"
   53     53   
   54     54   
[dependencies.aws-smithy-http]
   55     55   
path = "../aws-smithy-http"
   56     56   
version = "0.62.3"
   57     57   
   58     58   
[dependencies.aws-smithy-runtime-api]
   59     59   
path = "../aws-smithy-runtime-api"
   60     60   
features = ["client"]
   61         -
version = "1.8.7"
          61  +
version = "1.8.5"
   62     62   
   63     63   
[dependencies.aws-smithy-types]
   64     64   
path = "../aws-smithy-types"
   65     65   
version = "1.3.2"
   66     66   
   67     67   
[dependencies.form_urlencoded]
   68     68   
version = "1.2.1"
   69     69   
optional = true
   70     70   
   71     71   
[dependencies.http0]
   72     72   
version = "0.2.9"
   73     73   
optional = true
   74     74   
package = "http"
   75     75   
   76     76   
[dependencies.http]
   77     77   
version = "1.1.0"
   78     78   
optional = true
   79     79   
   80     80   
[dependencies.p256]
   81     81   
version = "0.11"
   82     82   
features = ["ecdsa"]
   83     83   
optional = true
   84     84   
   85     85   
[dependencies.percent-encoding]
   86     86   
version = "2.3.1"
   87     87   
optional = true
   88     88   
   89     89   
[dependencies.ring]
   90     90   
version = "0.17.5"
   91     91   
optional = true
   92     92   
   93     93   
[dependencies.crypto-bigint]
   94     94   
version = "0.5.4"
   95     95   
optional = true
   96     96   
   97     97   
[dependencies.subtle]
   98     98   
version = "2.5.0"
   99     99   
optional = true
  100    100   
  101    101   
[dependencies.zeroize]
  102    102   
version = "^1.7.0"
  103    103   
optional = true
  104    104   
  105    105   
[dev-dependencies]
  106    106   
bytes = "1"
  107    107   
hex-literal = "0.4.1"
  108    108   
httparse = "1.10.1"
  109    109   
pretty_assertions = "1.3"
  110    110   
proptest = "1.2"
  111    111   
serde = "1.0.180"
  112    112   
serde_derive = "1.0.180"
  113    113   
serde_json = "1.0.104"
  114    114   
criterion = "0.5"
  115    115   
  116    116   
[dev-dependencies.aws-credential-types]
  117    117   
path = "../aws-credential-types"
  118    118   
features = ["test-util", "hardcoded-credentials"]
  119         -
version = "1.2.5"
         119  +
version = "1.2.4"
  120    120   
  121    121   
[dev-dependencies.aws-smithy-runtime-api]
  122    122   
path = "../aws-smithy-runtime-api"
  123    123   
features = ["client", "test-util"]
  124         -
version = "1.8.7"
         124  +
version = "1.8.5"
  125    125   
  126    126   
[dev-dependencies.time]
  127    127   
version = "0.3.5"
  128    128   
features = ["parsing"]
  129    129   
[target."cfg(not(any(target_arch = \"powerpc\", target_arch = \"powerpc64\")))".dev-dependencies]
  130    130   
ring = "0.17.5"

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

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-checksums"
    4         -
version = "0.63.6"
           4  +
version = "0.63.5"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "Checksum calculation and verification callbacks"
    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"]

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

@@ -3,3 +63,63 @@
   23     23   
futures-util = "0.3"
   24     24   
pin-project-lite = "0.2.14"
   25     25   
tracing = "0.1.40"
   26     26   
   27     27   
[dependencies.aws-smithy-types]
   28     28   
path = "../aws-smithy-types"
   29     29   
version = "1.3.2"
   30     30   
   31     31   
[dependencies.aws-smithy-runtime-api]
   32     32   
path = "../aws-smithy-runtime-api"
   33         -
version = "1.8.7"
          33  +
version = "1.8.5"
   34     34   
   35     35   
[dependencies.http-0-2]
   36     36   
package = "http"
   37     37   
version = "0.2.9"
   38     38   
optional = true
   39     39   
   40     40   
[dependencies.http-1-0]
   41     41   
package = "http"
   42     42   
version = "1"
   43     43   
optional = true

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

@@ -32,32 +92,92 @@
   52     52   
pin-project-lite = "0.2.14"
   53     53   
tracing = "0.1.40"
   54     54   
   55     55   
[dependencies.aws-smithy-async]
   56     56   
path = "../aws-smithy-async"
   57     57   
version = "1.2.5"
   58     58   
   59     59   
[dependencies.aws-smithy-runtime-api]
   60     60   
path = "../aws-smithy-runtime-api"
   61     61   
features = ["client"]
   62         -
version = "1.8.7"
          62  +
version = "1.8.5"
   63     63   
   64     64   
[dependencies.aws-smithy-types]
   65     65   
path = "../aws-smithy-types"
   66     66   
version = "1.3.2"
   67     67   
   68     68   
[dependencies.aws-smithy-protocol-test]
   69     69   
path = "../aws-smithy-protocol-test"
   70     70   
optional = true
   71     71   
version = "0.63.4"
   72     72   
@@ -171,171 +221,221 @@
  191    191   
tokio-rustls = "0.26.1"
  192    192   
  193    193   
[dev-dependencies.aws-smithy-async]
  194    194   
path = "../aws-smithy-async"
  195    195   
features = ["rt-tokio", "test-util"]
  196    196   
version = "1.2.5"
  197    197   
  198    198   
[dev-dependencies.aws-smithy-runtime-api]
  199    199   
path = "../aws-smithy-runtime-api"
  200    200   
features = ["test-util"]
  201         -
version = "1.8.7"
         201  +
version = "1.8.5"
  202    202   
  203    203   
[dev-dependencies.aws-smithy-types]
  204    204   
path = "../aws-smithy-types"
  205    205   
features = ["http-body-0-4-x", "test-util"]
  206    206   
version = "1.3.2"
  207    207   
  208    208   
[dev-dependencies.http-body-util]
  209    209   
version = "0.1.2"
  210    210   
  211    211   
[dev-dependencies.hyper-util]

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

@@ -7,7 +67,67 @@
   27     27   
futures-core = "0.3.31"
   28     28   
   29     29   
[dependencies.aws-smithy-eventstream]
   30     30   
path = "../aws-smithy-eventstream"
   31     31   
optional = true
   32     32   
version = "0.60.10"
   33     33   
   34     34   
[dependencies.aws-smithy-runtime-api]
   35     35   
path = "../aws-smithy-runtime-api"
   36     36   
features = ["client", "http-02x"]
   37         -
version = "1.8.7"
          37  +
version = "1.8.5"
   38     38   
   39     39   
[dependencies.aws-smithy-types]
   40     40   
path = "../aws-smithy-types"
   41     41   
features = ["byte-stream-poll-next", "http-body-0-4-x"]
   42     42   
version = "1.3.2"
   43     43   
   44     44   
[dependencies.http-02x]
   45     45   
package = "http"
   46     46   
version = "0.2.9"
   47     47   

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.7"
          26  +
version = "1.8.5"
   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.7"
          26  +
version = "1.8.5"
   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     39   
version = "1.2.5"
   40     40   
   41     41   
[dev-dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44         -
version = "1.8.6"
          44  +
version = "1.8.5"