AWS SDK

AWS SDK

rev. 98036c661a3227e41769d0c184ee5386a362365a

Files changed:

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

@@ -1,1 +45,45 @@
   12     12   
all-features = true
   13     13   
targets = ["x86_64-unknown-linux-gnu"]
   14     14   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   15     15   
rustdoc-args = ["--cfg", "docsrs"]
   16     16   
   17     17   
[dependencies]
   18     18   
http = "1.3.1"
   19     19   
   20     20   
[dependencies.aws-smithy-types]
   21     21   
path = "../aws-smithy-types"
   22         -
version = "1.4.7"
          22  +
version = "1.4.8"
   23     23   
   24     24   
[dependencies.aws-smithy-runtime-api]
   25     25   
path = "../aws-smithy-runtime-api"
   26     26   
features = ["client", "http-1x", "test-util"]
   27     27   
version = "1.12.0"
   28     28   
   29     29   
[dependencies.aws-smithy-http-client]
   30     30   
path = "../aws-smithy-http-client"
   31     31   
features = ["test-util"]
   32     32   
version = "1.1.12"

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

@@ -1,1 +0,23 @@
   13     13   
targets = ["x86_64-unknown-linux-gnu"]
   14     14   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   15     15   
rustdoc-args = ["--cfg", "docsrs"]
   16     16   
   17     17   
[dependencies]
   18     18   
urlencoding = "2.1"
   19     19   
   20     20   
[dependencies.aws-smithy-types]
   21     21   
path = "../aws-smithy-types"
   22     22   
features = ["http-body-1-x"]
   23         -
version = "1.4.7"
          23  +
version = "1.4.8"

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

@@ -14,14 +67,67 @@
   34     34   
path = "../aws-smithy-async"
   35     35   
version = "1.2.14"
   36     36   
   37     37   
[dependencies.aws-smithy-runtime-api-macros]
   38     38   
path = "../aws-smithy-runtime-api-macros"
   39     39   
version = "1.0.0"
   40     40   
   41     41   
[dependencies.aws-smithy-types]
   42     42   
path = "../aws-smithy-types"
   43     43   
features = ["http-body-1-x"]
   44         -
version = "1.4.7"
          44  +
version = "1.4.8"
   45     45   
   46     46   
[dependencies.http-02x]
   47     47   
package = "http"
   48     48   
version = "0.2.12"
   49     49   
   50     50   
[dependencies.http-1x]
   51     51   
package = "http"
   52     52   
version = "1.3.1"
   53     53   
   54     54   
[dependencies.tokio]

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

@@ -391,391 +473,512 @@
  411    411   
    ) -> Result<(), BoxError>;
  412    412   
}
  413    413   
  414    414   
/// Endpoint configuration for the selected auth scheme.
  415    415   
///
  416    416   
/// The configuration held by this struct originates from the endpoint rule set in the service model.
  417    417   
///
  418    418   
/// This struct gets added to the request state by the auth orchestrator.
  419    419   
#[non_exhaustive]
  420    420   
#[derive(Clone, Debug)]
  421         -
pub struct AuthSchemeEndpointConfig<'a>(Option<&'a Document>);
         421  +
pub struct AuthSchemeEndpointConfig<'a> {
         422  +
    inner: AuthSchemeEndpointConfigInner<'a>,
         423  +
}
         424  +
         425  +
#[derive(Clone, Debug)]
         426  +
enum AuthSchemeEndpointConfigInner<'a> {
         427  +
    Empty,
         428  +
    Typed(&'a aws_smithy_types::endpoint::EndpointAuthScheme),
         429  +
    Document(&'a Document),
         430  +
}
  422    431   
  423    432   
impl<'a> AuthSchemeEndpointConfig<'a> {
  424    433   
    /// Creates an empty [`AuthSchemeEndpointConfig`].
  425    434   
    pub fn empty() -> Self {
  426         -
        Self(None)
         435  +
        Self {
         436  +
            inner: AuthSchemeEndpointConfigInner::Empty,
         437  +
        }
         438  +
    }
         439  +
         440  +
    /// Creates from a typed [`EndpointAuthScheme`](aws_smithy_types::endpoint::EndpointAuthScheme).
         441  +
    pub fn from_typed(auth_scheme: &'a aws_smithy_types::endpoint::EndpointAuthScheme) -> Self {
         442  +
        Self {
         443  +
            inner: AuthSchemeEndpointConfigInner::Typed(auth_scheme),
         444  +
        }
  427    445   
    }
  428    446   
  429    447   
    /// Returns the endpoint configuration as a [`Document`].
  430    448   
    pub fn as_document(&self) -> Option<&'a Document> {
  431         -
        self.0
         449  +
        match &self.inner {
         450  +
            AuthSchemeEndpointConfigInner::Document(doc) => Some(doc),
         451  +
            _ => None,
         452  +
        }
         453  +
    }
         454  +
         455  +
    /// Gets a property value by name from the auth scheme config.
         456  +
    pub fn get(&self, key: &str) -> Option<&'a Document> {
         457  +
        match &self.inner {
         458  +
            AuthSchemeEndpointConfigInner::Typed(scheme) => scheme.get(key),
         459  +
            AuthSchemeEndpointConfigInner::Document(doc) => {
         460  +
                doc.as_object().and_then(|obj| obj.get(key))
         461  +
            }
         462  +
            AuthSchemeEndpointConfigInner::Empty => None,
         463  +
        }
  432    464   
    }
  433    465   
}
  434    466   
  435    467   
impl<'a> From<Option<&'a Document>> for AuthSchemeEndpointConfig<'a> {
  436    468   
    fn from(value: Option<&'a Document>) -> Self {
  437         -
        Self(value)
         469  +
        match value {
         470  +
            Some(doc) => Self {
         471  +
                inner: AuthSchemeEndpointConfigInner::Document(doc),
         472  +
            },
         473  +
            None => Self::empty(),
         474  +
        }
  438    475   
    }
  439    476   
}
  440    477   
  441    478   
impl<'a> From<&'a Document> for AuthSchemeEndpointConfig<'a> {
  442    479   
    fn from(value: &'a Document) -> Self {
  443         -
        Self(Some(value))
         480  +
        Self {
         481  +
            inner: AuthSchemeEndpointConfigInner::Document(value),
         482  +
        }
  444    483   
    }
  445    484   
}
  446    485   
  447    486   
/// An ordered list of [AuthSchemeId]s
  448    487   
///
  449    488   
/// Can be used to reorder already-resolved auth schemes by an auth scheme resolver.
  450    489   
/// This list is intended as a hint rather than a strict override;
  451    490   
/// any schemes not present in the resolved auth schemes will be ignored.
  452    491   
#[derive(Clone, Debug, Default, Eq, PartialEq)]
  453    492   
pub struct AuthSchemePreference {

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

@@ -30,30 +125,125 @@
   50     50   
path = "../aws-smithy-observability"
   51     51   
version = "0.2.6"
   52     52   
   53     53   
[dependencies.aws-smithy-runtime-api]
   54     54   
path = "../aws-smithy-runtime-api"
   55     55   
version = "1.12.0"
   56     56   
   57     57   
[dependencies.aws-smithy-types]
   58     58   
path = "../aws-smithy-types"
   59     59   
features = ["http-body-0-4-x"]
   60         -
version = "1.4.7"
          60  +
version = "1.4.8"
   61     61   
   62     62   
[dependencies.aws-smithy-http-client]
   63     63   
path = "../aws-smithy-http-client"
   64     64   
optional = true
   65     65   
version = "1.1.12"
   66     66   
   67     67   
[dependencies.http-02x]
   68     68   
package = "http"
   69     69   
version = "0.2.12"
   70     70   
   71     71   
[dependencies.http-1x]
   72     72   
package = "http"
   73     73   
version = "1.3.1"
   74     74   
   75     75   
[dependencies.http-body-04x]
   76     76   
package = "http-body"
   77     77   
version = "0.4.6"
   78     78   
   79     79   
[dependencies.http-body-1x]
   80     80   
package = "http-body"
   81     81   
version = "1.0.1"
   82     82   
   83     83   
[dependencies.tokio]
   84     84   
version = "1.49.0"
   85     85   
features = []
   86     86   
   87     87   
[dependencies.tracing-subscriber]
   88     88   
version = "0.3.22"
   89     89   
optional = true
   90     90   
features = ["env-filter", "fmt", "json"]
   91     91   
   92     92   
[dev-dependencies]
   93     93   
approx = "0.5.1"
   94     94   
fastrand = "2.3.0"
   95     95   
futures-util = "0.3.29"
   96     96   
pretty_assertions = "1.4.0"
   97     97   
tracing-test = "0.2.1"
   98     98   
   99     99   
[dev-dependencies.aws-smithy-async]
  100    100   
path = "../aws-smithy-async"
  101    101   
features = ["rt-tokio", "test-util"]
  102    102   
version = "1.2.14"
  103    103   
  104    104   
[dev-dependencies.aws-smithy-runtime-api]
  105    105   
path = "../aws-smithy-runtime-api"
  106    106   
features = ["test-util"]
  107    107   
version = "1.12.0"
  108    108   
  109    109   
[dev-dependencies.aws-smithy-types]
  110    110   
path = "../aws-smithy-types"
  111    111   
features = ["test-util"]
  112         -
version = "1.4.7"
         112  +
version = "1.4.8"
  113    113   
  114    114   
[dev-dependencies.tokio]
  115    115   
version = "1.49.0"
  116    116   
features = ["macros", "rt", "rt-multi-thread", "test-util", "full"]
  117    117   
  118    118   
[dev-dependencies.tracing-subscriber]
  119    119   
version = "0.3.22"
  120    120   
features = ["env-filter"]
  121    121   
  122    122   
[dev-dependencies.hyper_0_14]

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

@@ -316,316 +375,387 @@
  336    336   
  337    337   
fn extract_endpoint_auth_scheme_config<'a>(
  338    338   
    endpoint: &'a Endpoint,
  339    339   
    scheme_id: &AuthSchemeId,
  340    340   
) -> Result<AuthSchemeEndpointConfig<'a>, AuthOrchestrationError> {
  341    341   
    // TODO(P96049742): Endpoint config doesn't currently have a concept of optional auth or "no auth", so
  342    342   
    // we are short-circuiting lookup of endpoint auth scheme config if that is the selected scheme.
  343    343   
    if scheme_id == &NO_AUTH_SCHEME_ID {
  344    344   
        return Ok(AuthSchemeEndpointConfig::empty());
  345    345   
    }
         346  +
         347  +
    // Try typed auth schemes first (from BDD endpoint resolution)
         348  +
    let typed_schemes = endpoint.auth_schemes();
         349  +
    if !typed_schemes.is_empty() {
         350  +
        return typed_schemes
         351  +
            .iter()
         352  +
            .find(|scheme| scheme.name() == scheme_id.inner())
         353  +
            .map(AuthSchemeEndpointConfig::from_typed)
         354  +
            .ok_or(AuthOrchestrationError::MissingEndpointConfig);
         355  +
    }
         356  +
         357  +
    // Fall back to Document-based properties
  346    358   
    let auth_schemes = match endpoint.properties().get("authSchemes") {
  347    359   
        Some(Document::Array(schemes)) => schemes,
  348    360   
        // no auth schemes:
  349    361   
        None => return Ok(AuthSchemeEndpointConfig::empty()),
  350    362   
        _other => {
  351    363   
            return Err(AuthOrchestrationError::BadAuthSchemeEndpointConfig(
  352    364   
                "expected an array for `authSchemes` in endpoint config".into(),
  353    365   
            ))
  354    366   
        }
  355    367   
    };

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

@@ -1,1 +44,44 @@
   15     15   
rustdoc-args = ["--cfg", "docsrs"]
   16     16   
   17     17   
[features]
   18     18   
convert-chrono = ["aws-smithy-types", "chrono"]
   19     19   
convert-time = ["aws-smithy-types", "time"]
   20     20   
convert-streams = ["aws-smithy-async", "futures-core"]
   21     21   
[dependencies.aws-smithy-types]
   22     22   
path = "../aws-smithy-types"
   23     23   
features = ["http-body-1-x"]
   24     24   
optional = true
   25         -
version = "1.4.7"
          25  +
version = "1.4.8"
   26     26   
   27     27   
[dependencies.aws-smithy-async]
   28     28   
path = "../aws-smithy-async"
   29     29   
optional = true
   30     30   
version = "1.2.14"
   31     31   
   32     32   
[dependencies.chrono]
   33     33   
version = "0.4.35"
   34     34   
optional = true
   35     35   
default-features = false

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

@@ -1,1 +33,33 @@
    1      1   
[package]
    2      2   
name = "aws-smithy-types"
    3         -
version = "1.4.7"
           3  +
version = "1.4.8"
    4      4   
authors = [
    5      5   
    "AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
    6      6   
    "Russell Cohen <rcoh@amazon.com>",
    7      7   
]
    8      8   
description = "Types for smithy-rs codegen."
    9      9   
edition = "2021"
   10     10   
license = "Apache-2.0"
   11     11   
repository = "https://github.com/smithy-lang/smithy-rs"
   12     12   
rust-version = "1.91.1"
   13     13   

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

@@ -17,17 +50,50 @@
   37     37   
edition = "2021"
   38     38   
   39     39   
[package.metadata]
   40     40   
cargo-fuzz = true
   41     41   
   42     42   
[dependencies]
   43     43   
libfuzzer-sys = "=0.4.7"
   44     44   
   45     45   
[dependencies.aws-smithy-types]
   46     46   
path = ".."
   47         -
version = "1.4.7"
          47  +
version = "1.4.8"
   48     48   
   49     49   
[workspace]
   50     50   
members = ["."]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-types/src/endpoint.rs

@@ -1,1 +155,219 @@
    4      4   
 */
    5      5   
//! Smithy Endpoint Types
    6      6   
    7      7   
use crate::config_bag::{Storable, StoreReplace};
    8      8   
use crate::Document;
    9      9   
use std::borrow::Cow;
   10     10   
use std::collections::HashMap;
   11     11   
   12     12   
type MaybeStatic = Cow<'static, str>;
   13     13   
          14  +
/// An authentication scheme configuration for an endpoint.
          15  +
///
          16  +
/// This is a lightweight alternative to storing auth schemes as
          17  +
/// `Document::Object(HashMap<String, Document>)` in endpoint properties.
          18  +
/// Properties are stored in a flat `Vec` and looked up via linear scan,
          19  +
/// which is faster than HashMap for the typical 3-4 entries.
          20  +
#[derive(Debug, Clone, PartialEq)]
          21  +
pub struct EndpointAuthScheme {
          22  +
    name: MaybeStatic,
          23  +
    properties: Vec<(MaybeStatic, Document)>,
          24  +
}
          25  +
          26  +
impl EndpointAuthScheme {
          27  +
    /// Creates a new `EndpointAuthScheme` with pre-allocated capacity for properties.
          28  +
    pub fn with_capacity(name: impl Into<MaybeStatic>, capacity: usize) -> Self {
          29  +
        Self {
          30  +
            name: name.into(),
          31  +
            properties: Vec::with_capacity(capacity),
          32  +
        }
          33  +
    }
          34  +
          35  +
    /// Returns the auth scheme name (e.g., "sigv4", "sigv4a").
          36  +
    pub fn name(&self) -> &str {
          37  +
        &self.name
          38  +
    }
          39  +
          40  +
    /// Adds a property to this auth scheme. Chainable.
          41  +
    pub fn put(mut self, key: impl Into<MaybeStatic>, value: impl Into<Document>) -> Self {
          42  +
        self.properties.push((key.into(), value.into()));
          43  +
        self
          44  +
    }
          45  +
          46  +
    /// Gets a property value by name (linear scan).
          47  +
    pub fn get(&self, key: &str) -> Option<&Document> {
          48  +
        self.properties
          49  +
            .iter()
          50  +
            .find(|(k, _)| k.as_ref() == key)
          51  +
            .map(|(_, v)| v)
          52  +
    }
          53  +
          54  +
    /// Converts this auth scheme into a `Document` for backward compatibility.
          55  +
    pub fn as_document(&self) -> Document {
          56  +
        let mut map = HashMap::with_capacity(self.properties.len() + 1);
          57  +
        map.insert("name".to_string(), Document::String(self.name.to_string()));
          58  +
        for (k, v) in &self.properties {
          59  +
            map.insert(k.to_string(), v.clone());
          60  +
        }
          61  +
        Document::Object(map)
          62  +
    }
          63  +
}
          64  +
   14     65   
/* ANCHOR: endpoint */
   15     66   
/// Smithy Endpoint Type
   16     67   
///
   17     68   
/// Generally, this type should not be used from user code
   18     69   
#[derive(Debug, Clone, PartialEq)]
   19     70   
pub struct Endpoint {
   20     71   
    url: MaybeStatic,
   21     72   
    headers: HashMap<MaybeStatic, Vec<MaybeStatic>>,
   22     73   
    properties: HashMap<MaybeStatic, Document>,
          74  +
    auth_schemes: Vec<EndpointAuthScheme>,
   23     75   
}
   24     76   
   25     77   
/* ANCHOR_END: endpoint */
   26     78   
   27     79   
#[allow(unused)]
   28     80   
impl Endpoint {
   29     81   
    /// Returns the URL of this endpoint
   30     82   
    pub fn url(&self) -> &str {
   31     83   
        &self.url
   32     84   
    }
   33     85   
   34     86   
    /// Returns the headers associated with this endpoint
   35     87   
    pub fn headers(&self) -> impl Iterator<Item = (&str, impl Iterator<Item = &str>)> {
   36     88   
        self.headers
   37     89   
            .iter()
   38     90   
            .map(|(k, v)| (k.as_ref(), v.iter().map(|v| v.as_ref())))
   39     91   
    }
   40     92   
   41     93   
    /// Returns the properties associated with this endpoint
   42     94   
    pub fn properties(&self) -> &HashMap<Cow<'static, str>, Document> {
   43     95   
        &self.properties
   44     96   
    }
   45     97   
          98  +
    /// Returns the typed auth schemes associated with this endpoint
          99  +
    pub fn auth_schemes(&self) -> &[EndpointAuthScheme] {
         100  +
        &self.auth_schemes
         101  +
    }
         102  +
   46    103   
    /// Converts this endpoint back into a [`Builder`]
   47    104   
    pub fn into_builder(self) -> Builder {
   48    105   
        Builder { endpoint: self }
   49    106   
    }
   50    107   
   51    108   
    /// A builder for [`Endpoint`]
   52    109   
    pub fn builder() -> Builder {
   53    110   
        Builder::new()
   54    111   
    }
   55    112   
}
   56    113   
   57    114   
impl Storable for Endpoint {
   58    115   
    type Storer = StoreReplace<Self>;
   59    116   
}
   60    117   
   61    118   
#[derive(Debug, Clone)]
   62    119   
/// Builder for [`Endpoint`]
   63    120   
pub struct Builder {
   64    121   
    endpoint: Endpoint,
   65    122   
}
   66    123   
   67    124   
#[allow(unused)]
   68    125   
impl Builder {
   69    126   
    pub(crate) fn new() -> Self {
   70    127   
        Self {
   71    128   
            endpoint: Endpoint {
   72    129   
                url: Default::default(),
   73    130   
                headers: HashMap::new(),
   74    131   
                properties: HashMap::new(),
         132  +
                auth_schemes: Vec::new(),
   75    133   
            },
   76    134   
        }
   77    135   
    }
   78    136   
   79    137   
    /// Set the URL of the Endpoint
   80    138   
    ///
   81    139   
    /// # Examples
   82    140   
    /// ```rust
   83    141   
    /// use aws_smithy_types::endpoint::Endpoint;
   84    142   
    /// let endpoint = Endpoint::builder().url("https://www.example.com").build();
   85    143   
    /// ```
   86    144   
    pub fn url(mut self, url: impl Into<MaybeStatic>) -> Self {
   87    145   
        self.endpoint.url = url.into();
   88    146   
        self
   89    147   
    }
   90    148   
   91    149   
    /// Adds a header to the endpoint
   92    150   
    ///
   93    151   
    /// If there is already a header for this key, this header will be appended to that key
   94    152   
    ///
   95    153   
    /// # Examples
   96    154   
    /// ```rust
   97    155   
    /// use aws_smithy_types::endpoint::Endpoint;
   98    156   
    /// let endpoint = Endpoint::builder().url("https://www.example.com").header("x-my-header", "hello").build();
   99    157   
    /// ```
  100    158   
    pub fn header(mut self, name: impl Into<MaybeStatic>, value: impl Into<MaybeStatic>) -> Self {
  101    159   
        self.endpoint
  102    160   
            .headers
  103    161   
            .entry(name.into())
  104    162   
            .or_default()
  105    163   
            .push(value.into());
  106    164   
        self
  107    165   
    }
  108    166   
  109    167   
    /// Adds a property to the endpoint
  110    168   
    ///
  111    169   
    /// If there is already a property for this key, the existing property will be overwritten
  112    170   
    ///
  113    171   
    /// # Examples
  114    172   
    /// ```rust
  115    173   
    /// use aws_smithy_types::endpoint::Endpoint;
  116    174   
    /// let endpoint = Endpoint::builder()
  117    175   
    ///   .url("https://www.example.com")
  118    176   
    ///   .property("x-my-header", true)
  119    177   
    ///   .build();
  120    178   
    /// ```
  121    179   
    pub fn property(mut self, key: impl Into<MaybeStatic>, value: impl Into<Document>) -> Self {
  122    180   
        self.endpoint.properties.insert(key.into(), value.into());
  123    181   
        self
  124    182   
    }
  125    183   
         184  +
    /// Adds a typed auth scheme to the endpoint
         185  +
    pub fn auth_scheme(mut self, auth_scheme: EndpointAuthScheme) -> Self {
         186  +
        self.endpoint.auth_schemes.push(auth_scheme);
         187  +
        self
         188  +
    }
         189  +
  126    190   
    /// Constructs an [`Endpoint`] from this builder
  127    191   
    ///
  128    192   
    /// # Panics
  129    193   
    /// Panics if URL is unset or empty
  130    194   
    pub fn build(self) -> Endpoint {
  131    195   
        assert_ne!(self.endpoint.url(), "", "URL was unset");
  132    196   
        self.endpoint
  133    197   
    }
  134    198   
}
  135    199   

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

@@ -3,3 +37,37 @@
   23     23   
version = "1.2.14"
   24     24   
   25     25   
[dependencies.aws-smithy-runtime-api]
   26     26   
path = "../aws-smithy-runtime-api"
   27     27   
features = ["http-1x", "client"]
   28     28   
version = "1.12.0"
   29     29   
   30     30   
[dependencies.aws-smithy-types]
   31     31   
path = "../aws-smithy-types"
   32     32   
features = ["http-body-1-x"]
   33         -
version = "1.4.7"
          33  +
version = "1.4.8"
   34     34   
   35     35   
[dependencies.sync_wrapper]
   36     36   
version = "1"
   37     37   
features = ["futures"]

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

@@ -9,9 +69,69 @@
   29     29   
[dependencies.aws-credential-types]
   30     30   
path = "../aws-credential-types"
   31     31   
version = "1.2.14"
   32     32   
   33     33   
[dependencies.aws-smithy-async]
   34     34   
path = "../aws-smithy-async"
   35     35   
version = "1.2.14"
   36     36   
   37     37   
[dependencies.aws-smithy-types]
   38     38   
path = "../aws-smithy-types"
   39         -
version = "1.4.7"
          39  +
version = "1.4.8"
   40     40   
   41     41   
[dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
optional = true
   44     44   
version = "1.11.1"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime-api]
   47     47   
path = "../aws-smithy-runtime-api"
   48     48   
features = ["client"]
   49     49   
version = "1.12.0"

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

@@ -35,35 +95,95 @@
   55     55   
version = "1.11.1"
   56     56   
   57     57   
[dependencies.aws-smithy-runtime-api]
   58     58   
path = "../aws-smithy-runtime-api"
   59     59   
features = ["client", "http-1x", "http-auth"]
   60     60   
version = "1.12.0"
   61     61   
   62     62   
[dependencies.aws-smithy-types]
   63     63   
path = "../aws-smithy-types"
   64     64   
features = ["http-body-1-x"]
   65         -
version = "1.4.7"
          65  +
version = "1.4.8"
   66     66   
   67     67   
[dependencies.aws-types]
   68     68   
path = "../aws-types"
   69     69   
version = "1.3.15"
   70     70   
   71     71   
[dependencies.bytes]
   72     72   
version = "1.4.0"
   73     73   
   74     74   
[dependencies.fastrand]
   75     75   
version = "2.0.0"
@@ -108,108 +166,166 @@
  128    128   
version = "1.11.1"
  129    129   
  130    130   
[dev-dependencies.aws-smithy-runtime-api]
  131    131   
path = "../aws-smithy-runtime-api"
  132    132   
features = ["test-util"]
  133    133   
version = "1.12.0"
  134    134   
  135    135   
[dev-dependencies.aws-smithy-types]
  136    136   
path = "../aws-smithy-types"
  137    137   
features = ["http-body-1-x", "test-util"]
  138         -
version = "1.4.7"
         138  +
version = "1.4.8"
  139    139   
  140    140   
[dev-dependencies.futures-util]
  141    141   
version = "0.3.25"
  142    142   
features = ["alloc"]
  143    143   
default-features = false
  144    144   
  145    145   
[dev-dependencies.proptest]
  146    146   
version = "1"
  147    147   
  148    148   
[dev-dependencies.serde_json]

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/endpoint_lib/host.rs

@@ -1,1 +72,100 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 *  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 *  SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
use crate::endpoint_lib::diagnostic::DiagnosticCollector;
    8      8   
    9      9   
pub(crate) fn is_valid_host_label(label: &str, allow_dots: bool, e: &mut DiagnosticCollector) -> bool {
          10  +
    let bytes = label.as_bytes();
   10     11   
    if allow_dots {
   11         -
        for part in label.split('.') {
   12         -
            if !is_valid_host_label(part, false, e) {
   13         -
                return false;
          12  +
        let mut start = 0;
          13  +
        for i in 0..bytes.len() {
          14  +
            if bytes[i] == b'.' {
          15  +
                if !is_valid_segment(bytes, start, i, e) {
          16  +
                    return false;
          17  +
                }
          18  +
                start = i + 1;
   14     19   
            }
   15     20   
        }
   16         -
        true
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
   19         -
            e.report_error("host was too short or too long");
          23  +
        is_valid_segment(bytes, 0, bytes.len(), e)
          24  +
    }
          25  +
}
          26  +
          27  +
#[inline]
          28  +
fn is_valid_segment(bytes: &[u8], start: usize, end: usize, e: &mut DiagnosticCollector) -> bool {
          29  +
    let len = end - start;
          30  +
    if len == 0 || len > 63 {
          31  +
        e.report_error("host was too short or too long");
          32  +
        return false;
          33  +
    }
          34  +
    if bytes[start] == b'-' {
          35  +
        e.report_error("cannot start with `-`");
          36  +
        return false;
          37  +
    }
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
   20     40   
            return false;
   21     41   
        }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
   24         -
                e.report_error("cannot start with `-`");
   25         -
                false
   26         -
            }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
   29     42   
    }
          43  +
    true
   30     44   
}
   31     45   
   32     46   
#[cfg(all(test, feature = "gated-tests"))]
   33     47   
mod test {
   34     48   
    use proptest::proptest;
   35     49   
   36     50   
    fn is_valid_host_label(label: &str, allow_dots: bool) -> bool {
   37     51   
        super::is_valid_host_label(label, allow_dots, &mut DiagnosticCollector::new())
   38     52   
    }
   39     53   
   40     54   
    #[allow(clippy::bool_assert_comparison)]
   41     55   
    #[test]
   42     56   
    fn basic_cases() {
   43     57   
        assert_eq!(is_valid_host_label("", false), false);
   44     58   
        assert_eq!(is_valid_host_label("", true), false);
   45     59   
        assert_eq!(is_valid_host_label(".", true), false);
   46     60   
        assert_eq!(is_valid_host_label("a.b", true), true);
   47     61   
        assert_eq!(is_valid_host_label("a.b", false), false);
   48     62   
        assert_eq!(is_valid_host_label("a.b.", true), false);
   49     63   
        assert_eq!(is_valid_host_label("a.b.c", true), true);
   50     64   
        assert_eq!(is_valid_host_label("a_b", true), false);
   51     65   
        assert_eq!(is_valid_host_label(&"a".repeat(64), false), false);
   52     66   
        assert_eq!(is_valid_host_label(&format!("{}.{}", "a".repeat(63), "a".repeat(63)), true), true);
   53     67   
    }
   54     68   
   55     69   
    #[allow(clippy::bool_assert_comparison)]
   56     70   
    #[test]
   57     71   
    fn start_bounds() {
   58     72   
        assert_eq!(is_valid_host_label("-foo", false), false);
   59     73   
        assert_eq!(is_valid_host_label("-foo", true), false);
   60     74   
        assert_eq!(is_valid_host_label(".foo", true), false);
   61     75   
        assert_eq!(is_valid_host_label("a-b.foo", true), true);
   62     76   
    }
   63     77   
          78  +
    #[allow(clippy::bool_assert_comparison)]
          79  +
    #[test]
          80  +
    fn non_ascii_rejected() {
          81  +
        // DNS host labels only allow ASCII alphanumeric and hyphens (RFC 952/1123)
          82  +
        assert_eq!(is_valid_host_label("café", false), false);
          83  +
        assert_eq!(is_valid_host_label("bücher", false), false);
          84  +
        assert_eq!(is_valid_host_label("日本語", false), false);
          85  +
        assert_eq!(is_valid_host_label("a.café.b", true), false);
          86  +
        assert_eq!(is_valid_host_label("🚀rocket", false), false);
          87  +
        // ASCII is fine
          88  +
        assert_eq!(is_valid_host_label("abc123", false), true);
          89  +
        assert_eq!(is_valid_host_label("a-b-c", false), true);
          90  +
    }
          91  +
   64     92   
    use crate::endpoint_lib::diagnostic::DiagnosticCollector;
   65     93   
    use proptest::prelude::*;
   66     94   
    proptest! {
   67     95   
        #[test]
   68     96   
        fn no_panics(s in any::<String>(), dots in any::<bool>()) {
   69     97   
            is_valid_host_label(&s, dots);
   70     98   
        }
   71     99   
    }
   72    100   
}

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

@@ -31,31 +91,91 @@
   51     51   
version = "1.11.1"
   52     52   
   53     53   
[dependencies.aws-smithy-runtime-api]
   54     54   
path = "../aws-smithy-runtime-api"
   55     55   
features = ["client", "http-1x"]
   56     56   
version = "1.12.0"
   57     57   
   58     58   
[dependencies.aws-smithy-types]
   59     59   
path = "../aws-smithy-types"
   60     60   
features = ["http-body-1-x"]
   61         -
version = "1.4.7"
          61  +
version = "1.4.8"
   62     62   
   63     63   
[dependencies.aws-types]
   64     64   
path = "../aws-types"
   65     65   
version = "1.3.15"
   66     66   
   67     67   
[dependencies.bytes]
   68     68   
version = "1.4.0"
   69     69   
   70     70   
[dependencies.fastrand]
   71     71   
version = "2.0.0"
@@ -101,101 +159,159 @@
  121    121   
version = "1.11.1"
  122    122   
  123    123   
[dev-dependencies.aws-smithy-runtime-api]
  124    124   
path = "../aws-smithy-runtime-api"
  125    125   
features = ["test-util"]
  126    126   
version = "1.12.0"
  127    127   
  128    128   
[dev-dependencies.aws-smithy-types]
  129    129   
path = "../aws-smithy-types"
  130    130   
features = ["http-body-1-x", "test-util"]
  131         -
version = "1.4.7"
         131  +
version = "1.4.8"
  132    132   
  133    133   
[dev-dependencies.futures-util]
  134    134   
version = "0.3.25"
  135    135   
features = ["alloc"]
  136    136   
default-features = false
  137    137   
  138    138   
[dev-dependencies.proptest]
  139    139   
version = "1"
  140    140   
  141    141   
[dev-dependencies.serde_json]

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/endpoint_lib/host.rs

@@ -1,1 +72,100 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 *  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 *  SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
use crate::endpoint_lib::diagnostic::DiagnosticCollector;
    8      8   
    9      9   
pub(crate) fn is_valid_host_label(label: &str, allow_dots: bool, e: &mut DiagnosticCollector) -> bool {
          10  +
    let bytes = label.as_bytes();
   10     11   
    if allow_dots {
   11         -
        for part in label.split('.') {
   12         -
            if !is_valid_host_label(part, false, e) {
   13         -
                return false;
          12  +
        let mut start = 0;
          13  +
        for i in 0..bytes.len() {
          14  +
            if bytes[i] == b'.' {
          15  +
                if !is_valid_segment(bytes, start, i, e) {
          16  +
                    return false;
          17  +
                }
          18  +
                start = i + 1;
   14     19   
            }
   15     20   
        }
   16         -
        true
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
   19         -
            e.report_error("host was too short or too long");
          23  +
        is_valid_segment(bytes, 0, bytes.len(), e)
          24  +
    }
          25  +
}
          26  +
          27  +
#[inline]
          28  +
fn is_valid_segment(bytes: &[u8], start: usize, end: usize, e: &mut DiagnosticCollector) -> bool {
          29  +
    let len = end - start;
          30  +
    if len == 0 || len > 63 {
          31  +
        e.report_error("host was too short or too long");
          32  +
        return false;
          33  +
    }
          34  +
    if bytes[start] == b'-' {
          35  +
        e.report_error("cannot start with `-`");
          36  +
        return false;
          37  +
    }
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
   20     40   
            return false;
   21     41   
        }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
   24         -
                e.report_error("cannot start with `-`");
   25         -
                false
   26         -
            }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
   29     42   
    }
          43  +
    true
   30     44   
}
   31     45   
   32     46   
#[cfg(all(test, feature = "gated-tests"))]
   33     47   
mod test {
   34     48   
    use proptest::proptest;
   35     49   
   36     50   
    fn is_valid_host_label(label: &str, allow_dots: bool) -> bool {
   37     51   
        super::is_valid_host_label(label, allow_dots, &mut DiagnosticCollector::new())
   38     52   
    }
   39     53   
   40     54   
    #[allow(clippy::bool_assert_comparison)]
   41     55   
    #[test]
   42     56   
    fn basic_cases() {
   43     57   
        assert_eq!(is_valid_host_label("", false), false);
   44     58   
        assert_eq!(is_valid_host_label("", true), false);
   45     59   
        assert_eq!(is_valid_host_label(".", true), false);
   46     60   
        assert_eq!(is_valid_host_label("a.b", true), true);
   47     61   
        assert_eq!(is_valid_host_label("a.b", false), false);
   48     62   
        assert_eq!(is_valid_host_label("a.b.", true), false);
   49     63   
        assert_eq!(is_valid_host_label("a.b.c", true), true);
   50     64   
        assert_eq!(is_valid_host_label("a_b", true), false);
   51     65   
        assert_eq!(is_valid_host_label(&"a".repeat(64), false), false);
   52     66   
        assert_eq!(is_valid_host_label(&format!("{}.{}", "a".repeat(63), "a".repeat(63)), true), true);
   53     67   
    }
   54     68   
   55     69   
    #[allow(clippy::bool_assert_comparison)]
   56     70   
    #[test]
   57     71   
    fn start_bounds() {
   58     72   
        assert_eq!(is_valid_host_label("-foo", false), false);
   59     73   
        assert_eq!(is_valid_host_label("-foo", true), false);
   60     74   
        assert_eq!(is_valid_host_label(".foo", true), false);
   61     75   
        assert_eq!(is_valid_host_label("a-b.foo", true), true);
   62     76   
    }
   63     77   
          78  +
    #[allow(clippy::bool_assert_comparison)]
          79  +
    #[test]
          80  +
    fn non_ascii_rejected() {
          81  +
        // DNS host labels only allow ASCII alphanumeric and hyphens (RFC 952/1123)
          82  +
        assert_eq!(is_valid_host_label("café", false), false);
          83  +
        assert_eq!(is_valid_host_label("bücher", false), false);
          84  +
        assert_eq!(is_valid_host_label("日本語", false), false);
          85  +
        assert_eq!(is_valid_host_label("a.café.b", true), false);
          86  +
        assert_eq!(is_valid_host_label("🚀rocket", false), false);
          87  +
        // ASCII is fine
          88  +
        assert_eq!(is_valid_host_label("abc123", false), true);
          89  +
        assert_eq!(is_valid_host_label("a-b-c", false), true);
          90  +
    }
          91  +
   64     92   
    use crate::endpoint_lib::diagnostic::DiagnosticCollector;
   65     93   
    use proptest::prelude::*;
   66     94   
    proptest! {
   67     95   
        #[test]
   68     96   
        fn no_panics(s in any::<String>(), dots in any::<bool>()) {
   69     97   
            is_valid_host_label(&s, dots);
   70     98   
        }
   71     99   
    }
   72    100   
}