AWS SDK

AWS SDK

rev. 98036c661a3227e41769d0c184ee5386a362365a (ignoring whitespace)

Files changed:

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

@@ -25,25 +85,85 @@
   45     45   
version = "1.11.1"
   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     50   
version = "1.12.0"
   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.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
@@ -90,90 +148,148 @@
  110    110   
version = "1.11.1"
  111    111   
  112    112   
[dev-dependencies.aws-smithy-runtime-api]
  113    113   
path = "../aws-smithy-runtime-api"
  114    114   
features = ["test-util"]
  115    115   
version = "1.12.0"
  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

@@ -25,25 +85,85 @@
   45     45   
version = "1.11.1"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   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.3.15"
   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

@@ -25,25 +85,85 @@
   45     45   
version = "1.11.1"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   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.3.15"
   60     60   
   61     61   
[dependencies.bytes]
   62     62   
version = "1.4.0"
   63     63   
   64     64   
[dependencies.fastrand]
   65     65   
version = "2.0.0"
@@ -93,93 +153,153 @@
  113    113   
version = "1.11.1"
  114    114   
  115    115   
[dev-dependencies.aws-smithy-runtime-api]
  116    116   
path = "../aws-smithy-runtime-api"
  117    117   
features = ["test-util"]
  118    118   
version = "1.12.0"
  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

@@ -29,29 +89,89 @@
   49     49   
version = "1.11.1"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53     53   
features = ["client", "http-1x"]
   54     54   
version = "1.12.0"
   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.3.15"
   68     68   
   69     69   
[dependencies.fastrand]
@@ -95,95 +155,155 @@
  115    115   
version = "1.11.1"
  116    116   
  117    117   
[dev-dependencies.aws-smithy-runtime-api]
  118    118   
path = "../aws-smithy-runtime-api"
  119    119   
features = ["test-util"]
  120    120   
version = "1.12.0"
  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

@@ -25,25 +85,85 @@
   45     45   
version = "1.11.1"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-1x"]
   50     50   
version = "1.12.0"
   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.3.15"
   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

@@ -29,29 +89,89 @@
   49     49   
version = "1.11.1"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53     53   
features = ["client", "http-1x"]
   54     54   
version = "1.12.0"
   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.3.15"
   64     64   
   65     65   
[dependencies.bytes]
   66     66   
version = "1.4.0"
   67     67   
   68     68   
[dependencies.fastrand]
   69     69   
version = "2.0.0"
@@ -100,100 +160,160 @@
  120    120   
version = "1.11.1"
  121    121   
  122    122   
[dev-dependencies.aws-smithy-runtime-api]
  123    123   
path = "../aws-smithy-runtime-api"
  124    124   
features = ["test-util"]
  125    125   
version = "1.12.0"
  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   
}

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

@@ -29,29 +89,89 @@
   49     49   
version = "1.11.1"
   50     50   
   51     51   
[dependencies.aws-smithy-runtime-api]
   52     52   
path = "../aws-smithy-runtime-api"
   53     53   
features = ["client", "http-1x"]
   54     54   
version = "1.12.0"
   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.3.15"
   68     68   
   69     69   
[dependencies.fastrand]
@@ -95,95 +153,153 @@
  115    115   
version = "1.11.1"
  116    116   
  117    117   
[dev-dependencies.aws-smithy-runtime-api]
  118    118   
path = "../aws-smithy-runtime-api"
  119    119   
features = ["test-util"]
  120    120   
version = "1.12.0"
  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/iam/src/config/endpoint/internals.rs

@@ -19,19 +421,421 @@
   39     39   
        #[allow(unused_variables)]
   40     40   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     41   
            if (partition_result.name()) == ("aws") {
   42     42   
                if (*use_fips) == (false) {
   43     43   
                    if (*use_dual_stack) == (true) {
   44     44   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   45     45   
                            .url("https://iam.global.api.aws".to_string())
   46     46   
                            .property(
   47     47   
                                "authSchemes",
   48     48   
                                vec![::aws_smithy_types::Document::from({
   49         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
          49  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
   50     50   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
   51     51   
                                    out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
   52     52   
                                    out
   53     53   
                                })],
   54     54   
                            )
   55     55   
                            .build());
   56     56   
                    }
   57     57   
                }
   58     58   
            }
   59     59   
            if (partition_result.name()) == ("aws") {
   60     60   
                if (*use_fips) == (true) {
   61     61   
                    if (*use_dual_stack) == (true) {
   62     62   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   63     63   
                            .url("https://iam-fips.global.api.aws".to_string())
   64     64   
                            .property(
   65     65   
                                "authSchemes",
   66     66   
                                vec![::aws_smithy_types::Document::from({
   67         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
          67  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
   68     68   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
   69     69   
                                    out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
   70     70   
                                    out
   71     71   
                                })],
   72     72   
                            )
   73     73   
                            .build());
   74     74   
                    }
   75     75   
                }
   76     76   
            }
   77     77   
            if (partition_result.name()) == ("aws-cn") {
   78     78   
                if (*use_fips) == (false) {
   79     79   
                    if (*use_dual_stack) == (true) {
   80     80   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   81     81   
                            .url("https://iam.global.api.amazonwebservices.com.cn".to_string())
   82     82   
                            .property(
   83     83   
                                "authSchemes",
   84     84   
                                vec![::aws_smithy_types::Document::from({
   85         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
          85  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
   86     86   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
   87     87   
                                    out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
   88     88   
                                    out
   89     89   
                                })],
   90     90   
                            )
   91     91   
                            .build());
   92     92   
                    }
   93     93   
                }
   94     94   
            }
   95     95   
            if (partition_result.name()) == ("aws-cn") {
   96     96   
                if (*use_fips) == (false) {
   97     97   
                    if (*use_dual_stack) == (false) {
   98     98   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   99     99   
                            .url("https://iam.cn-north-1.amazonaws.com.cn".to_string())
  100    100   
                            .property(
  101    101   
                                "authSchemes",
  102    102   
                                vec![::aws_smithy_types::Document::from({
  103         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         103  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  104    104   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  105    105   
                                    out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
  106    106   
                                    out
  107    107   
                                })],
  108    108   
                            )
  109    109   
                            .build());
  110    110   
                    }
  111    111   
                }
  112    112   
            }
  113    113   
            if (partition_result.name()) == ("aws-us-gov") {
  114    114   
                if (*use_fips) == (false) {
  115    115   
                    if (*use_dual_stack) == (true) {
  116    116   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  117    117   
                            .url("https://iam.us-gov.api.aws".to_string())
  118    118   
                            .property(
  119    119   
                                "authSchemes",
  120    120   
                                vec![::aws_smithy_types::Document::from({
  121         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         121  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  122    122   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  123    123   
                                    out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
  124    124   
                                    out
  125    125   
                                })],
  126    126   
                            )
  127    127   
                            .build());
  128    128   
                    }
  129    129   
                }
  130    130   
            }
  131    131   
            if (partition_result.name()) == ("aws-us-gov") {
  132    132   
                if (*use_fips) == (true) {
  133    133   
                    if (*use_dual_stack) == (true) {
  134    134   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  135    135   
                            .url("https://iam.us-gov.api.aws".to_string())
  136    136   
                            .property(
  137    137   
                                "authSchemes",
  138    138   
                                vec![::aws_smithy_types::Document::from({
  139         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         139  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  140    140   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  141    141   
                                    out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
  142    142   
                                    out
  143    143   
                                })],
  144    144   
                            )
  145    145   
                            .build());
  146    146   
                    }
  147    147   
                }
  148    148   
            }
  149    149   
            if (partition_result.name()) == ("aws-us-gov") {
  150    150   
                if (*use_fips) == (false) {
  151    151   
                    if (*use_dual_stack) == (false) {
  152    152   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  153    153   
                            .url("https://iam.us-gov.amazonaws.com".to_string())
  154    154   
                            .property(
  155    155   
                                "authSchemes",
  156    156   
                                vec![::aws_smithy_types::Document::from({
  157         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         157  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  158    158   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  159    159   
                                    out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
  160    160   
                                    out
  161    161   
                                })],
  162    162   
                            )
  163    163   
                            .build());
  164    164   
                    }
  165    165   
                }
  166    166   
            }
  167    167   
            if (partition_result.name()) == ("aws-us-gov") {
  168    168   
                if (*use_fips) == (true) {
  169    169   
                    if (*use_dual_stack) == (false) {
  170    170   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  171    171   
                            .url("https://iam.us-gov.amazonaws.com".to_string())
  172    172   
                            .property(
  173    173   
                                "authSchemes",
  174    174   
                                vec![::aws_smithy_types::Document::from({
  175         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         175  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  176    176   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  177    177   
                                    out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
  178    178   
                                    out
  179    179   
                                })],
  180    180   
                            )
  181    181   
                            .build());
  182    182   
                    }
  183    183   
                }
  184    184   
            }
  185    185   
            if (partition_result.name()) == ("aws-iso") {
  186    186   
                if (*use_fips) == (false) {
  187    187   
                    if (*use_dual_stack) == (false) {
  188    188   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  189    189   
                            .url("https://iam.us-iso-east-1.c2s.ic.gov".to_string())
  190    190   
                            .property(
  191    191   
                                "authSchemes",
  192    192   
                                vec![::aws_smithy_types::Document::from({
  193         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         193  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  194    194   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  195    195   
                                    out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into());
  196    196   
                                    out
  197    197   
                                })],
  198    198   
                            )
  199    199   
                            .build());
  200    200   
                    }
  201    201   
                }
  202    202   
            }
  203    203   
            if (partition_result.name()) == ("aws-iso") {
  204    204   
                if (*use_fips) == (true) {
  205    205   
                    if (*use_dual_stack) == (false) {
  206    206   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  207    207   
                            .url("https://iam-fips.us-iso-east-1.c2s.ic.gov".to_string())
  208    208   
                            .property(
  209    209   
                                "authSchemes",
  210    210   
                                vec![::aws_smithy_types::Document::from({
  211         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         211  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  212    212   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  213    213   
                                    out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into());
  214    214   
                                    out
  215    215   
                                })],
  216    216   
                            )
  217    217   
                            .build());
  218    218   
                    }
  219    219   
                }
  220    220   
            }
  221    221   
            if (partition_result.name()) == ("aws-iso-b") {
  222    222   
                if (*use_fips) == (false) {
  223    223   
                    if (*use_dual_stack) == (false) {
  224    224   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  225    225   
                            .url("https://iam.us-isob-east-1.sc2s.sgov.gov".to_string())
  226    226   
                            .property(
  227    227   
                                "authSchemes",
  228    228   
                                vec![::aws_smithy_types::Document::from({
  229         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         229  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  230    230   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  231    231   
                                    out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into());
  232    232   
                                    out
  233    233   
                                })],
  234    234   
                            )
  235    235   
                            .build());
  236    236   
                    }
  237    237   
                }
  238    238   
            }
  239    239   
            if (partition_result.name()) == ("aws-iso-b") {
  240    240   
                if (*use_fips) == (true) {
  241    241   
                    if (*use_dual_stack) == (false) {
  242    242   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  243    243   
                            .url("https://iam-fips.us-isob-east-1.sc2s.sgov.gov".to_string())
  244    244   
                            .property(
  245    245   
                                "authSchemes",
  246    246   
                                vec![::aws_smithy_types::Document::from({
  247         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         247  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  248    248   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  249    249   
                                    out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into());
  250    250   
                                    out
  251    251   
                                })],
  252    252   
                            )
  253    253   
                            .build());
  254    254   
                    }
  255    255   
                }
  256    256   
            }
  257    257   
            if (partition_result.name()) == ("aws-iso-e") {
  258    258   
                if (*use_fips) == (false) {
  259    259   
                    if (*use_dual_stack) == (false) {
  260    260   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  261    261   
                            .url("https://iam.eu-isoe-west-1.cloud.adc-e.uk".to_string())
  262    262   
                            .property(
  263    263   
                                "authSchemes",
  264    264   
                                vec![::aws_smithy_types::Document::from({
  265         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         265  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  266    266   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  267    267   
                                    out.insert("signingRegion".to_string(), "eu-isoe-west-1".to_string().into());
  268    268   
                                    out
  269    269   
                                })],
  270    270   
                            )
  271    271   
                            .build());
  272    272   
                    }
  273    273   
                }
  274    274   
            }
  275    275   
            if (partition_result.name()) == ("aws-iso-f") {
  276    276   
                if (*use_fips) == (false) {
  277    277   
                    if (*use_dual_stack) == (false) {
  278    278   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  279    279   
                            .url("https://iam.us-isof-south-1.csp.hci.ic.gov".to_string())
  280    280   
                            .property(
  281    281   
                                "authSchemes",
  282    282   
                                vec![::aws_smithy_types::Document::from({
  283         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         283  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  284    284   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  285    285   
                                    out.insert("signingRegion".to_string(), "us-isof-south-1".to_string().into());
  286    286   
                                    out
  287    287   
                                })],
  288    288   
                            )
  289    289   
                            .build());
  290    290   
                    }
  291    291   
                }
  292    292   
            }
  293    293   
            if (partition_result.name()) == ("aws-eusc") {
  294    294   
                if (*use_fips) == (false) {
  295    295   
                    if (*use_dual_stack) == (false) {
  296    296   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  297    297   
                            .url("https://iam.eusc-de-east-1.amazonaws.eu".to_string())
  298    298   
                            .property(
  299    299   
                                "authSchemes",
  300    300   
                                vec![::aws_smithy_types::Document::from({
  301         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         301  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  302    302   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  303    303   
                                    out.insert("signingRegion".to_string(), "eusc-de-east-1".to_string().into());
  304    304   
                                    out
  305    305   
                                })],
  306    306   
                            )
  307    307   
                            .build());
  308    308   
                    }
  309    309   
                }
  310    310   
            }
  311    311   
            if (*use_fips) == (true) {
  312    312   
                if (*use_dual_stack) == (true) {
  313    313   
                    if (true) == (partition_result.supports_fips()) {
  314    314   
                        if (true) == (partition_result.supports_dual_stack()) {
  315    315   
                            return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  316    316   
                                .url({
  317    317   
                                    let mut out = String::new();
  318    318   
                                    out.push_str("https://iam-fips.");
  319    319   
                                    #[allow(clippy::needless_borrow)]
  320    320   
                                    out.push_str(&partition_result.dual_stack_dns_suffix());
  321    321   
                                    out
  322    322   
                                })
  323    323   
                                .property(
  324    324   
                                    "authSchemes",
  325    325   
                                    vec![::aws_smithy_types::Document::from({
  326         -
                                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         326  +
                                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  327    327   
                                        out.insert("name".to_string(), "sigv4".to_string().into());
  328    328   
                                        out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into());
  329    329   
                                        out
  330    330   
                                    })],
  331    331   
                                )
  332    332   
                                .build());
  333    333   
                        }
  334    334   
                    }
  335    335   
                    return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
  336    336   
                        "FIPS and DualStack are enabled, but this partition does not support one or both".to_string(),
  337    337   
                    ));
  338    338   
                }
  339    339   
            }
  340    340   
            if (*use_fips) == (true) {
  341    341   
                if (*use_dual_stack) == (false) {
  342    342   
                    if (partition_result.supports_fips()) == (true) {
  343    343   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  344    344   
                            .url({
  345    345   
                                let mut out = String::new();
  346    346   
                                out.push_str("https://iam-fips.");
  347    347   
                                #[allow(clippy::needless_borrow)]
  348    348   
                                out.push_str(&partition_result.dns_suffix());
  349    349   
                                out
  350    350   
                            })
  351    351   
                            .property(
  352    352   
                                "authSchemes",
  353    353   
                                vec![::aws_smithy_types::Document::from({
  354         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         354  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  355    355   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  356    356   
                                    out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into());
  357    357   
                                    out
  358    358   
                                })],
  359    359   
                            )
  360    360   
                            .build());
  361    361   
                    }
  362    362   
                    return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
  363    363   
                        "FIPS is enabled but this partition does not support FIPS".to_string(),
  364    364   
                    ));
  365    365   
                }
  366    366   
            }
  367    367   
            if (*use_fips) == (false) {
  368    368   
                if (*use_dual_stack) == (true) {
  369    369   
                    if (true) == (partition_result.supports_dual_stack()) {
  370    370   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  371    371   
                            .url({
  372    372   
                                let mut out = String::new();
  373    373   
                                out.push_str("https://iam.");
  374    374   
                                #[allow(clippy::needless_borrow)]
  375    375   
                                out.push_str(&partition_result.dual_stack_dns_suffix());
  376    376   
                                out
  377    377   
                            })
  378    378   
                            .property(
  379    379   
                                "authSchemes",
  380    380   
                                vec![::aws_smithy_types::Document::from({
  381         -
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         381  +
                                    let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  382    382   
                                    out.insert("name".to_string(), "sigv4".to_string().into());
  383    383   
                                    out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into());
  384    384   
                                    out
  385    385   
                                })],
  386    386   
                            )
  387    387   
                            .build());
  388    388   
                    }
  389    389   
                    return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
  390    390   
                        "DualStack is enabled but this partition does not support DualStack".to_string(),
  391    391   
                    ));
  392    392   
                }
  393    393   
            }
  394    394   
            return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
  395    395   
                .url({
  396    396   
                    let mut out = String::new();
  397    397   
                    out.push_str("https://iam.");
  398    398   
                    #[allow(clippy::needless_borrow)]
  399    399   
                    out.push_str(&partition_result.dns_suffix());
  400    400   
                    out
  401    401   
                })
  402    402   
                .property(
  403    403   
                    "authSchemes",
  404    404   
                    vec![::aws_smithy_types::Document::from({
  405         -
                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
         405  +
                        let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::with_capacity(2);
  406    406   
                        out.insert("name".to_string(), "sigv4".to_string().into());
  407    407   
                        out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into());
  408    408   
                        out
  409    409   
                    })],
  410    410   
                )
  411    411   
                .build());
  412    412   
        }
  413    413   
        #[allow(unreachable_code)]
  414    414   
        return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(format!(
  415    415   
            "No rules matched these parameters. This is a bug. {_params:?}"

tmp-codegen-diff/aws-sdk/sdk/iam/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   
}