AWS SDK

AWS SDK

rev. 3aed9201e4bc5a8db4b84ecb152c7af544ace9ac (ignoring whitespace)

Files changed:

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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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

@@ -21,21 +159,159 @@
   41     41   
path = "../aws-smithy-json"
   42     42   
version = "0.62.5"
   43     43   
   44     44   
[dependencies.aws-smithy-observability]
   45     45   
path = "../aws-smithy-observability"
   46     46   
version = "0.2.6"
   47     47   
   48     48   
[dependencies.aws-smithy-runtime]
   49     49   
path = "../aws-smithy-runtime"
   50     50   
features = ["client"]
   51         -
version = "1.10.3"
          51  +
version = "1.10.4"
   52     52   
   53     53   
[dependencies.aws-smithy-runtime-api]
   54     54   
path = "../aws-smithy-runtime-api"
   55     55   
features = ["client", "http-1x"]
   56         -
version = "1.11.6"
          56  +
version = "1.11.7"
   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.4.0"
   66     66   
   67     67   
[dependencies.bytes]
   68     68   
version = "1.4.0"
   69     69   
   70     70   
[dependencies.fastrand]
   71     71   
version = "2.0.0"
   72     72   
   73     73   
[dependencies.http]
   74     74   
version = "0.2.9"
   75     75   
   76     76   
[dependencies.http-1x]
   77     77   
version = "1"
   78     78   
package = "http"
   79     79   
   80     80   
[dependencies.regex-lite]
   81     81   
version = "0.1.5"
   82     82   
   83     83   
[dependencies.tracing]
   84     84   
version = "0.1"
   85     85   
[dev-dependencies.aws-config]
   86     86   
path = "../aws-config"
   87     87   
version = "1.9.0"
   88     88   
   89     89   
[dev-dependencies.aws-credential-types]
   90     90   
path = "../aws-credential-types"
   91     91   
features = ["test-util"]
   92     92   
version = "1.2.14"
   93     93   
   94     94   
[dev-dependencies.aws-runtime]
   95     95   
path = "../aws-runtime"
   96     96   
features = ["test-util"]
   97     97   
version = "1.7.3"
   98     98   
   99     99   
[dev-dependencies.aws-smithy-async]
  100    100   
path = "../aws-smithy-async"
  101    101   
features = ["test-util"]
  102    102   
version = "1.2.14"
  103    103   
  104    104   
[dev-dependencies.aws-smithy-eventstream]
  105    105   
path = "../aws-smithy-eventstream"
  106    106   
features = ["test-util"]
  107    107   
version = "0.60.20"
  108    108   
  109    109   
[dev-dependencies.aws-smithy-http-client]
  110    110   
path = "../aws-smithy-http-client"
  111    111   
features = ["test-util", "wire-mock"]
  112    112   
version = "1.1.12"
  113    113   
  114    114   
[dev-dependencies.aws-smithy-protocol-test]
  115    115   
path = "../aws-smithy-protocol-test"
  116    116   
version = "0.63.14"
  117    117   
  118    118   
[dev-dependencies.aws-smithy-runtime]
  119    119   
path = "../aws-smithy-runtime"
  120    120   
features = ["test-util"]
  121         -
version = "1.10.3"
         121  +
version = "1.10.4"
  122    122   
  123    123   
[dev-dependencies.aws-smithy-runtime-api]
  124    124   
path = "../aws-smithy-runtime-api"
  125    125   
features = ["test-util"]
  126         -
version = "1.11.6"
         126  +
version = "1.11.7"
  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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/codecatalyst/Cargo.toml

@@ -15,15 +148,148 @@
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.62.5"
   37     37   
   38     38   
[dependencies.aws-smithy-observability]
   39     39   
path = "../aws-smithy-observability"
   40     40   
version = "0.2.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client", "http-auth"]
   45         -
version = "1.10.3"
          45  +
version = "1.10.4"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x", "http-auth"]
   50         -
version = "1.11.6"
          50  +
version = "1.11.7"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55         -
version = "1.4.7"
          55  +
version = "1.4.8"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59     59   
version = "1.4.0"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.aws-config]
   80     80   
path = "../aws-config"
   81     81   
version = "1.9.0"
   82     82   
   83     83   
[dev-dependencies.aws-credential-types]
   84     84   
path = "../aws-credential-types"
   85     85   
features = ["test-util"]
   86     86   
version = "1.2.14"
   87     87   
   88     88   
[dev-dependencies.aws-runtime]
   89     89   
path = "../aws-runtime"
   90     90   
features = ["test-util"]
   91     91   
version = "1.7.3"
   92     92   
   93     93   
[dev-dependencies.aws-smithy-async]
   94     94   
path = "../aws-smithy-async"
   95     95   
features = ["test-util"]
   96     96   
version = "1.2.14"
   97     97   
   98     98   
[dev-dependencies.aws-smithy-http-client]
   99     99   
path = "../aws-smithy-http-client"
  100    100   
features = ["test-util", "wire-mock"]
  101    101   
version = "1.1.12"
  102    102   
  103    103   
[dev-dependencies.aws-smithy-protocol-test]
  104    104   
path = "../aws-smithy-protocol-test"
  105    105   
version = "0.63.14"
  106    106   
  107    107   
[dev-dependencies.aws-smithy-runtime]
  108    108   
path = "../aws-smithy-runtime"
  109    109   
features = ["test-util"]
  110         -
version = "1.10.3"
         110  +
version = "1.10.4"
  111    111   
  112    112   
[dev-dependencies.aws-smithy-runtime-api]
  113    113   
path = "../aws-smithy-runtime-api"
  114    114   
features = ["test-util"]
  115         -
version = "1.11.6"
         115  +
version = "1.11.7"
  116    116   
  117    117   
[dev-dependencies.aws-smithy-types]
  118    118   
path = "../aws-smithy-types"
  119    119   
features = ["http-body-1-x", "test-util"]
  120         -
version = "1.4.7"
         120  +
version = "1.4.8"
  121    121   
  122    122   
[dev-dependencies.futures-util]
  123    123   
version = "0.3.25"
  124    124   
features = ["alloc"]
  125    125   
default-features = false
  126    126   
  127    127   
[dev-dependencies.proptest]
  128    128   
version = "1"
  129    129   
  130    130   
[dev-dependencies.serde_json]

tmp-codegen-diff/aws-sdk/sdk/codecatalyst/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/config/Cargo.toml

@@ -15,15 +85,85 @@
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.62.5"
   37     37   
   38     38   
[dependencies.aws-smithy-observability]
   39     39   
path = "../aws-smithy-observability"
   40     40   
version = "0.2.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client"]
   45         -
version = "1.10.3"
          45  +
version = "1.10.4"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50         -
version = "1.11.6"
          50  +
version = "1.11.7"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55         -
version = "1.4.7"
          55  +
version = "1.4.8"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59     59   
version = "1.4.0"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"

tmp-codegen-diff/aws-sdk/sdk/config/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/dynamodb/Cargo.toml

@@ -15,15 +153,153 @@
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.62.5"
   37     37   
   38     38   
[dependencies.aws-smithy-observability]
   39     39   
path = "../aws-smithy-observability"
   40     40   
version = "0.2.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client"]
   45         -
version = "1.10.3"
          45  +
version = "1.10.4"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50         -
version = "1.11.6"
          50  +
version = "1.11.7"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55         -
version = "1.4.7"
          55  +
version = "1.4.8"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59     59   
version = "1.4.0"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
   66     66   
   67     67   
[dependencies.http]
   68     68   
version = "0.2.9"
   69     69   
   70     70   
[dependencies.http-1x]
   71     71   
version = "1"
   72     72   
package = "http"
   73     73   
   74     74   
[dependencies.regex-lite]
   75     75   
version = "0.1.5"
   76     76   
   77     77   
[dependencies.tracing]
   78     78   
version = "0.1"
   79     79   
[dev-dependencies.approx]
   80     80   
version = "0.5.1"
   81     81   
   82     82   
[dev-dependencies.aws-config]
   83     83   
path = "../aws-config"
   84     84   
version = "1.9.0"
   85     85   
   86     86   
[dev-dependencies.aws-credential-types]
   87     87   
path = "../aws-credential-types"
   88     88   
features = ["test-util"]
   89     89   
version = "1.2.14"
   90     90   
   91     91   
[dev-dependencies.aws-runtime]
   92     92   
path = "../aws-runtime"
   93     93   
features = ["test-util"]
   94     94   
version = "1.7.3"
   95     95   
   96     96   
[dev-dependencies.aws-smithy-async]
   97     97   
path = "../aws-smithy-async"
   98     98   
features = ["test-util"]
   99     99   
version = "1.2.14"
  100    100   
  101    101   
[dev-dependencies.aws-smithy-http-client]
  102    102   
path = "../aws-smithy-http-client"
  103    103   
features = ["test-util", "wire-mock"]
  104    104   
version = "1.1.12"
  105    105   
  106    106   
[dev-dependencies.aws-smithy-protocol-test]
  107    107   
path = "../aws-smithy-protocol-test"
  108    108   
version = "0.63.14"
  109    109   
  110    110   
[dev-dependencies.aws-smithy-runtime]
  111    111   
path = "../aws-smithy-runtime"
  112    112   
features = ["test-util"]
  113         -
version = "1.10.3"
         113  +
version = "1.10.4"
  114    114   
  115    115   
[dev-dependencies.aws-smithy-runtime-api]
  116    116   
path = "../aws-smithy-runtime-api"
  117    117   
features = ["test-util"]
  118         -
version = "1.11.6"
         118  +
version = "1.11.7"
  119    119   
  120    120   
[dev-dependencies.aws-smithy-types]
  121    121   
path = "../aws-smithy-types"
  122    122   
features = ["http-body-1-x", "test-util"]
  123         -
version = "1.4.7"
         123  +
version = "1.4.8"
  124    124   
  125    125   
[dev-dependencies.criterion]
  126    126   
version = "0.5.0"
  127    127   
  128    128   
[dev-dependencies.futures-util]
  129    129   
version = "0.3.25"
  130    130   
features = ["alloc"]
  131    131   
default-features = false
  132    132   
  133    133   
[dev-dependencies.proptest]

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

@@ -35,35 +95,95 @@
   55     55   
                if (*use_dual_stack) == (true) {
   56     56   
                    return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   57     57   
                        "Invalid Configuration: Dualstack and local endpoint are not supported".to_string(),
   58     58   
                    ));
   59     59   
                }
   60     60   
                return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   61     61   
                    .url("http://localhost:8000".to_string())
   62     62   
                    .property(
   63     63   
                        "authSchemes",
   64     64   
                        vec![::aws_smithy_types::Document::from({
   65         -
                            let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
          65  +
                            let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(3);
   66     66   
                            out.insert("name".to_string(), "sigv4".to_string().into());
   67     67   
                            out.insert("signingName".to_string(), "dynamodb".to_string().into());
   68     68   
                            out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
   69     69   
                            out
   70     70   
                        })],
   71     71   
                    )
   72     72   
                    .build());
   73     73   
            }
   74     74   
            if (*use_fips) == (true) {
   75     75   
                if (*use_dual_stack) == (true) {

tmp-codegen-diff/aws-sdk/sdk/dynamodb/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/ec2/Cargo.toml

@@ -19,19 +155,155 @@
   39     39   
path = "../aws-smithy-observability"
   40     40   
version = "0.2.6"
   41     41   
   42     42   
[dependencies.aws-smithy-query]
   43     43   
path = "../aws-smithy-query"
   44     44   
version = "0.60.15"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime]
   47     47   
path = "../aws-smithy-runtime"
   48     48   
features = ["client"]
   49         -
version = "1.10.3"
          49  +
version = "1.10.4"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53     53   
features = ["client", "http-1x"]
   54         -
version = "1.11.6"
          54  +
version = "1.11.7"
   55     55   
   56     56   
[dependencies.aws-smithy-types]
   57     57   
path = "../aws-smithy-types"
   58     58   
features = ["http-body-1-x"]
   59         -
version = "1.4.7"
          59  +
version = "1.4.8"
   60     60   
   61     61   
[dependencies.aws-smithy-xml]
   62     62   
path = "../aws-smithy-xml"
   63     63   
version = "0.60.15"
   64     64   
   65     65   
[dependencies.aws-types]
   66     66   
path = "../aws-types"
   67     67   
version = "1.4.0"
   68     68   
   69     69   
[dependencies.fastrand]
   70     70   
version = "2.0.0"
   71     71   
   72     72   
[dependencies.http]
   73     73   
version = "0.2.9"
   74     74   
   75     75   
[dependencies.http-1x]
   76     76   
version = "1"
   77     77   
package = "http"
   78     78   
   79     79   
[dependencies.regex-lite]
   80     80   
version = "0.1.5"
   81     81   
   82     82   
[dependencies.tracing]
   83     83   
version = "0.1"
   84     84   
[dev-dependencies.aws-config]
   85     85   
path = "../aws-config"
   86     86   
version = "1.9.0"
   87     87   
   88     88   
[dev-dependencies.aws-credential-types]
   89     89   
path = "../aws-credential-types"
   90     90   
features = ["test-util"]
   91     91   
version = "1.2.14"
   92     92   
   93     93   
[dev-dependencies.aws-runtime]
   94     94   
path = "../aws-runtime"
   95     95   
features = ["test-util"]
   96     96   
version = "1.7.3"
   97     97   
   98     98   
[dev-dependencies.aws-smithy-async]
   99     99   
path = "../aws-smithy-async"
  100    100   
features = ["test-util"]
  101    101   
version = "1.2.14"
  102    102   
  103    103   
[dev-dependencies.aws-smithy-http-client]
  104    104   
path = "../aws-smithy-http-client"
  105    105   
features = ["test-util", "wire-mock"]
  106    106   
version = "1.1.12"
  107    107   
  108    108   
[dev-dependencies.aws-smithy-protocol-test]
  109    109   
path = "../aws-smithy-protocol-test"
  110    110   
version = "0.63.14"
  111    111   
  112    112   
[dev-dependencies.aws-smithy-runtime]
  113    113   
path = "../aws-smithy-runtime"
  114    114   
features = ["test-util"]
  115         -
version = "1.10.3"
         115  +
version = "1.10.4"
  116    116   
  117    117   
[dev-dependencies.aws-smithy-runtime-api]
  118    118   
path = "../aws-smithy-runtime-api"
  119    119   
features = ["test-util"]
  120         -
version = "1.11.6"
         120  +
version = "1.11.7"
  121    121   
  122    122   
[dev-dependencies.aws-smithy-types]
  123    123   
path = "../aws-smithy-types"
  124    124   
features = ["http-body-1-x", "test-util"]
  125         -
version = "1.4.7"
         125  +
version = "1.4.8"
  126    126   
  127    127   
[dev-dependencies.futures-util]
  128    128   
version = "0.3.25"
  129    129   
features = ["alloc"]
  130    130   
default-features = false
  131    131   
  132    132   
[dev-dependencies.proptest]
  133    133   
version = "1"
  134    134   
  135    135   
[dev-dependencies.serde_json]

tmp-codegen-diff/aws-sdk/sdk/ec2/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/ecs/Cargo.toml

@@ -15,15 +85,85 @@
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.62.5"
   37     37   
   38     38   
[dependencies.aws-smithy-observability]
   39     39   
path = "../aws-smithy-observability"
   40     40   
version = "0.2.6"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client"]
   45         -
version = "1.10.3"
          45  +
version = "1.10.4"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50         -
version = "1.11.6"
          50  +
version = "1.11.7"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
features = ["http-body-1-x"]
   55         -
version = "1.4.7"
          55  +
version = "1.4.8"
   56     56   
   57     57   
[dependencies.aws-types]
   58     58   
path = "../aws-types"
   59     59   
version = "1.4.0"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"

tmp-codegen-diff/aws-sdk/sdk/ecs/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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/glacier/Cargo.toml

@@ -19,19 +160,160 @@
   39     39   
path = "../aws-smithy-json"
   40     40   
version = "0.62.5"
   41     41   
   42     42   
[dependencies.aws-smithy-observability]
   43     43   
path = "../aws-smithy-observability"
   44     44   
version = "0.2.6"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime]
   47     47   
path = "../aws-smithy-runtime"
   48     48   
features = ["client"]
   49         -
version = "1.10.3"
          49  +
version = "1.10.4"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53     53   
features = ["client", "http-1x"]
   54         -
version = "1.11.6"
          54  +
version = "1.11.7"
   55     55   
   56     56   
[dependencies.aws-smithy-types]
   57     57   
path = "../aws-smithy-types"
   58     58   
features = ["http-body-1-x"]
   59         -
version = "1.4.7"
          59  +
version = "1.4.8"
   60     60   
   61     61   
[dependencies.aws-types]
   62     62   
path = "../aws-types"
   63     63   
version = "1.4.0"
   64     64   
   65     65   
[dependencies.bytes]
   66     66   
version = "1.4.0"
   67     67   
   68     68   
[dependencies.fastrand]
   69     69   
version = "2.0.0"
   70     70   
   71     71   
[dependencies.hex]
   72     72   
version = "0.4.3"
   73     73   
   74     74   
[dependencies.http]
   75     75   
version = "0.2.9"
   76     76   
   77     77   
[dependencies.http-1x]
   78     78   
version = "1"
   79     79   
package = "http"
   80     80   
   81     81   
[dependencies.regex-lite]
   82     82   
version = "0.1.5"
   83     83   
   84     84   
[dependencies.ring]
   85     85   
version = "0.17.5"
   86     86   
   87     87   
[dependencies.tracing]
   88     88   
version = "0.1"
   89     89   
[dev-dependencies.aws-config]
   90     90   
path = "../aws-config"
   91     91   
version = "1.9.0"
   92     92   
   93     93   
[dev-dependencies.aws-credential-types]
   94     94   
path = "../aws-credential-types"
   95     95   
features = ["test-util"]
   96     96   
version = "1.2.14"
   97     97   
   98     98   
[dev-dependencies.aws-runtime]
   99     99   
path = "../aws-runtime"
  100    100   
features = ["test-util"]
  101    101   
version = "1.7.3"
  102    102   
  103    103   
[dev-dependencies.aws-smithy-async]
  104    104   
path = "../aws-smithy-async"
  105    105   
features = ["test-util"]
  106    106   
version = "1.2.14"
  107    107   
  108    108   
[dev-dependencies.aws-smithy-http-client]
  109    109   
path = "../aws-smithy-http-client"
  110    110   
features = ["test-util", "wire-mock"]
  111    111   
version = "1.1.12"
  112    112   
  113    113   
[dev-dependencies.aws-smithy-protocol-test]
  114    114   
path = "../aws-smithy-protocol-test"
  115    115   
version = "0.63.14"
  116    116   
  117    117   
[dev-dependencies.aws-smithy-runtime]
  118    118   
path = "../aws-smithy-runtime"
  119    119   
features = ["test-util"]
  120         -
version = "1.10.3"
         120  +
version = "1.10.4"
  121    121   
  122    122   
[dev-dependencies.aws-smithy-runtime-api]
  123    123   
path = "../aws-smithy-runtime-api"
  124    124   
features = ["test-util"]
  125         -
version = "1.11.6"
         125  +
version = "1.11.7"
  126    126   
  127    127   
[dev-dependencies.aws-smithy-types]
  128    128   
path = "../aws-smithy-types"
  129    129   
features = ["http-body-1-x", "test-util"]
  130         -
version = "1.4.7"
         130  +
version = "1.4.8"
  131    131   
  132    132   
[dev-dependencies.futures-util]
  133    133   
version = "0.3.25"
  134    134   
features = ["alloc"]
  135    135   
default-features = false
  136    136   
  137    137   
[dev-dependencies.pretty_assertions]
  138    138   
version = "1.3.0"
  139    139   
  140    140   
[dev-dependencies.proptest]

tmp-codegen-diff/aws-sdk/sdk/glacier/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) {
          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) {
   13     16   
                    return false;
   14     17   
                }
          18  +
                start = i + 1;
   15     19   
            }
   16         -
        true
          20  +
        }
          21  +
        is_valid_segment(bytes, start, bytes.len(), e)
   17     22   
    } else {
   18         -
        if label.is_empty() || label.len() > 63 {
          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 {
   19     31   
        e.report_error("host was too short or too long");
   20     32   
        return false;
   21     33   
    }
   22         -
        label.chars().enumerate().all(|(idx, ch)| match (ch, idx) {
   23         -
            ('-', 0) => {
          34  +
    if bytes[start] == b'-' {
   24     35   
        e.report_error("cannot start with `-`");
   25         -
                false
          36  +
        return false;
   26     37   
    }
   27         -
            _ => ch.is_alphanumeric() || ch == '-',
   28         -
        })
          38  +
    for &b in &bytes[start..end] {
          39  +
        if !b.is_ascii_alphanumeric() && b != b'-' {
          40  +
            return false;
   29     41   
        }
          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   
}