AWS SDK

AWS SDK

rev. 03e6e47f15dfd569240d570d98975ebba692c405

Files changed:

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

@@ -1,1 +40,40 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
use std::fmt::Debug;
    7      7   
use std::sync::{Arc, Mutex};
    8      8   
    9      9   
use fastrand::Rng;
   10         -
use http_02x::{HeaderName, HeaderValue};
          10  +
use http_1x::{HeaderName, HeaderValue};
   11     11   
   12     12   
use aws_smithy_runtime_api::box_error::BoxError;
   13     13   
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
   14     14   
use aws_smithy_runtime_api::client::interceptors::Intercept;
   15     15   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   16     16   
use aws_smithy_types::config_bag::{ConfigBag, Storable, StoreReplace};
   17     17   
#[cfg(feature = "test-util")]
   18     18   
pub use test_util::{NoInvocationIdGenerator, PredefinedInvocationIdGenerator};
   19     19   
   20     20   
#[allow(clippy::declare_interior_mutable_const)] // we will never mutate this

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

@@ -1,1 +53,52 @@
   12     12   
    missing_docs,
   13     13   
    rustdoc::missing_crate_level_docs,
   14     14   
    missing_debug_implementations,
   15     15   
    rust_2018_idioms,
   16     16   
    unreachable_pub
   17     17   
)]
   18     18   
   19     19   
/// Supporting code for authentication in the AWS SDK.
   20     20   
pub mod auth;
   21     21   
   22         -
/// AWS-specific content-encoding tools
   23         -
#[cfg(feature = "http-02x")]
          22  +
/// AWS-specific content-encoding tools for http-02x and http-1x
   24     23   
pub mod content_encoding;
   25     24   
   26     25   
/// Supporting code for recursion detection in the AWS SDK.
   27     26   
pub mod recursion_detection;
   28     27   
   29     28   
/// Supporting code for user agent headers in the AWS SDK.
   30     29   
pub mod user_agent;
   31     30   
   32     31   
/// Supporting code for retry behavior specific to the AWS SDK.
   33     32   
pub mod retries;

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

@@ -1,1 +42,42 @@
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
use aws_smithy_runtime_api::box_error::BoxError;
    7      7   
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
    8      8   
use aws_smithy_runtime_api::client::interceptors::Intercept;
    9      9   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   10     10   
use aws_smithy_types::config_bag::ConfigBag;
   11     11   
use aws_types::os_shim_internal::Env;
   12         -
use http_02x::HeaderValue;
          12  +
use http_1x::HeaderValue;
   13     13   
use percent_encoding::{percent_encode, CONTROLS};
   14     14   
use std::borrow::Cow;
   15     15   
   16     16   
const TRACE_ID_HEADER: &str = "x-amzn-trace-id";
   17     17   
   18     18   
mod env {
   19     19   
    pub(super) const LAMBDA_FUNCTION_NAME: &str = "AWS_LAMBDA_FUNCTION_NAME";
   20     20   
    pub(super) const TRACE_ID: &str = "_X_AMZN_TRACE_ID";
   21     21   
}
   22     22   
@@ -56,56 +116,116 @@
   76     76   
}
   77     77   
   78     78   
#[cfg(test)]
   79     79   
mod tests {
   80     80   
    use super::*;
   81     81   
    use aws_smithy_protocol_test::{assert_ok, validate_headers};
   82     82   
    use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
   83     83   
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
   84     84   
    use aws_smithy_types::body::SdkBody;
   85     85   
    use aws_types::os_shim_internal::Env;
   86         -
    use http_02x::HeaderValue;
          86  +
    use http_1x::HeaderValue;
   87     87   
    use proptest::{prelude::*, proptest};
   88     88   
    use serde::Deserialize;
   89     89   
    use std::collections::HashMap;
   90     90   
   91     91   
    proptest! {
   92     92   
        #[test]
   93     93   
        fn header_encoding_never_panics(s in any::<Vec<u8>>()) {
   94     94   
            encode_header(&s);
   95     95   
        }
   96     96   
    }
@@ -123,123 +183,183 @@
  143    143   
        fn split_headers(headers: &[String]) -> impl Iterator<Item = (&str, &str)> {
  144    144   
            headers
  145    145   
                .iter()
  146    146   
                .map(|header| header.split_once(": ").expect("header must contain :"))
  147    147   
        }
  148    148   
    }
  149    149   
  150    150   
    fn check(test_case: TestCase) {
  151    151   
        let rc = RuntimeComponentsBuilder::for_tests().build().unwrap();
  152    152   
        let env = test_case.env();
  153         -
        let mut request = http_02x::Request::builder();
         153  +
        let mut request = http_1x::Request::builder();
  154    154   
        for (name, value) in test_case.request_headers_before() {
  155    155   
            request = request.header(name, value);
  156    156   
        }
  157    157   
        let request = request
  158    158   
            .body(SdkBody::empty())
  159    159   
            .expect("must be valid")
  160    160   
            .try_into()
  161    161   
            .unwrap();
  162    162   
        let mut context = InterceptorContext::new(Input::doesnt_matter());
  163    163   
        context.enter_serialization_phase();

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

@@ -1,1 +48,48 @@
    8      8   
use aws_smithy_runtime_api::box_error::BoxError;
    9      9   
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
   10     10   
use aws_smithy_runtime_api::client::interceptors::Intercept;
   11     11   
use aws_smithy_runtime_api::client::retries::RequestAttempts;
   12     12   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
   13     13   
use aws_smithy_types::config_bag::ConfigBag;
   14     14   
use aws_smithy_types::date_time::Format;
   15     15   
use aws_smithy_types::retry::RetryConfig;
   16     16   
use aws_smithy_types::timeout::TimeoutConfig;
   17     17   
use aws_smithy_types::DateTime;
   18         -
use http_02x::{HeaderName, HeaderValue};
          18  +
use http_1x::{HeaderName, HeaderValue};
   19     19   
use std::borrow::Cow;
   20     20   
use std::time::Duration;
   21     21   
   22     22   
#[allow(clippy::declare_interior_mutable_const)] // we will never mutate this
   23     23   
const AMZ_SDK_REQUEST: HeaderName = HeaderName::from_static("amz-sdk-request");
   24     24   
   25     25   
/// Generates and attaches a request header that communicates request-related metadata.
   26     26   
/// Examples include:
   27     27   
///
   28     28   
/// - When the client will time out this request.
@@ -161,161 +221,221 @@
  181    181   
    use crate::request_info::RequestPairs;
  182    182   
    use aws_smithy_runtime_api::client::interceptors::context::Input;
  183    183   
    use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
  184    184   
    use aws_smithy_runtime_api::client::interceptors::Intercept;
  185    185   
    use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
  186    186   
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
  187    187   
    use aws_smithy_types::config_bag::{ConfigBag, Layer};
  188    188   
    use aws_smithy_types::retry::RetryConfig;
  189    189   
    use aws_smithy_types::timeout::TimeoutConfig;
  190    190   
  191         -
    use http_02x::HeaderValue;
         191  +
    use http_1x::HeaderValue;
  192    192   
    use std::time::Duration;
  193    193   
  194    194   
    fn expect_header<'a>(context: &'a InterceptorContext, header_name: &str) -> &'a str {
  195    195   
        context
  196    196   
            .request()
  197    197   
            .expect("request is set")
  198    198   
            .headers()
  199    199   
            .get(header_name)
  200    200   
            .unwrap()
  201    201   
    }

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/retries/classifiers.rs

@@ -189,189 +249,249 @@
  209    209   
        ctx.set_output_or_error(Err(OrchestratorError::operation(Error::erase(
  210    210   
            CodedError::new("RequestTimeout"),
  211    211   
        ))));
  212    212   
        assert_eq!(policy.classify_retry(&ctx), RetryAction::transient_error())
  213    213   
    }
  214    214   
  215    215   
    #[test]
  216    216   
    fn classify_generic() {
  217    217   
        let policy = AwsErrorCodeClassifier::<ErrorMetadata>::new();
  218    218   
        let err = ErrorMetadata::builder().code("SlowDown").build();
  219         -
        let test_response = http_02x::Response::new("OK").map(SdkBody::from);
         219  +
        let test_response = http_1x::Response::new("OK").map(SdkBody::from);
  220    220   
  221    221   
        let mut ctx = InterceptorContext::new(Input::doesnt_matter());
  222    222   
        ctx.set_response(test_response.try_into().unwrap());
  223    223   
        ctx.set_output_or_error(Err(OrchestratorError::operation(Error::erase(err))));
  224    224   
  225    225   
        assert_eq!(policy.classify_retry(&ctx), RetryAction::throttling_error());
  226    226   
    }
  227    227   
  228    228   
    #[test]
  229    229   
    fn test_retry_after_header() {
  230    230   
        let policy = AwsErrorCodeClassifier::<ErrorMetadata>::new();
  231    231   
        let err = ErrorMetadata::builder().code("SlowDown").build();
  232         -
        let res = http_02x::Response::builder()
         232  +
        let res = http_1x::Response::builder()
  233    233   
            .header("x-amz-retry-after", "5000")
  234    234   
            .body("retry later")
  235    235   
            .unwrap()
  236    236   
            .map(SdkBody::from);
  237    237   
        let mut ctx = InterceptorContext::new(Input::doesnt_matter());
  238    238   
        ctx.set_response(res.try_into().unwrap());
  239    239   
        ctx.set_output_or_error(Err(OrchestratorError::operation(Error::erase(err))));
  240    240   
  241    241   
        assert_eq!(
  242    242   
            policy.classify_retry(&ctx),

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

@@ -1,1 +39,39 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
use std::borrow::Cow;
    7      7   
use std::fmt;
    8      8   
    9         -
use http_02x::header::{HeaderName, HeaderValue, InvalidHeaderValue, USER_AGENT};
           9  +
use http_1x::header::{HeaderName, HeaderValue, InvalidHeaderValue, USER_AGENT};
   10     10   
   11     11   
use aws_credential_types::credential_feature::AwsCredentialFeature;
   12     12   
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
   13     13   
use aws_smithy_runtime_api::box_error::BoxError;
   14     14   
use aws_smithy_runtime_api::client::http::HttpClient;
   15     15   
use aws_smithy_runtime_api::client::interceptors::context::{
   16     16   
    BeforeTransmitInterceptorContextMut, BeforeTransmitInterceptorContextRef,
   17     17   
};
   18     18   
use aws_smithy_runtime_api::client::interceptors::Intercept;
   19     19   
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;

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

@@ -1,1 +131,131 @@
    3      3   
name = "hmac"
    4      4   
harness = false
    5      5   
    6      6   
[[bench]]
    7      7   
name = "sigv4a"
    8      8   
harness = false
    9      9   
required-features = ["sigv4a"]
   10     10   
   11     11   
[package]
   12     12   
name = "aws-sigv4"
   13         -
version = "1.3.7"
          13  +
version = "1.3.8"
   14     14   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "David Barsky <me@davidbarsky.com>"]
   15     15   
description = "SigV4 signer for HTTP requests and Event Stream messages."
   16     16   
edition = "2021"
   17     17   
exclude = ["aws-sig-v4-test-suite/*"]
   18     18   
license = "Apache-2.0"
   19     19   
repository = "https://github.com/smithy-lang/smithy-rs"
   20     20   
rust-version = "1.88"
   21     21   
[package.metadata.docs.rs]
   22     22   
all-features = true
   23     23   
targets = ["x86_64-unknown-linux-gnu"]
   24     24   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   25     25   
rustdoc-args = ["--cfg", "docsrs"]
   26     26   
   27     27   
[package.metadata.smithy-rs-release-tooling]
   28     28   
stable = true
   29     29   
   30     30   
[features]
   31     31   
default = ["sign-http", "http1"]
   32     32   
http0-compat = ["dep:http0"]
   33     33   
http1 = ["dep:http"]
   34     34   
sign-http = ["dep:http0", "dep:percent-encoding", "dep:form_urlencoded"]
   35     35   
sign-eventstream = ["dep:aws-smithy-eventstream"]
   36     36   
sigv4a = ["dep:p256", "dep:crypto-bigint", "dep:subtle", "dep:zeroize", "dep:ring"]
   37     37   
   38     38   
[dependencies]
   39     39   
bytes = "1.10.0"
   40     40   
hex = "0.4.3"
   41     41   
hmac = "0.12"
   42     42   
sha2 = "0.10"
   43     43   
time = "0.3.5"
   44     44   
tracing = "0.1.40"
   45     45   
   46     46   
[dependencies.aws-credential-types]
   47     47   
path = "../aws-credential-types"
   48     48   
version = "1.2.11"
   49     49   
   50     50   
[dependencies.aws-smithy-eventstream]
   51     51   
path = "../aws-smithy-eventstream"
   52     52   
optional = true
   53         -
version = "0.60.14"
          53  +
version = "0.60.15"
   54     54   
   55     55   
[dependencies.aws-smithy-http]
   56     56   
path = "../aws-smithy-http"
   57         -
version = "0.62.6"
          57  +
version = "0.63.0"
   58     58   
   59     59   
[dependencies.aws-smithy-runtime-api]
   60     60   
path = "../aws-smithy-runtime-api"
   61     61   
features = ["client"]
   62         -
version = "1.10.0"
          62  +
version = "1.11.0"
   63     63   
   64     64   
[dependencies.aws-smithy-types]
   65     65   
path = "../aws-smithy-types"
   66         -
version = "1.3.6"
          66  +
version = "1.4.0"
   67     67   
   68     68   
[dependencies.form_urlencoded]
   69     69   
version = "1.2.1"
   70     70   
optional = true
   71     71   
   72     72   
[dependencies.http0]
   73         -
version = "0.2.9"
   74         -
optional = true
   75     73   
package = "http"
          74  +
version = "0.2.12"
          75  +
optional = true
   76     76   
   77     77   
[dependencies.http]
   78         -
version = "1.1.0"
          78  +
version = "1.3.1"
   79     79   
optional = true
   80     80   
   81     81   
[dependencies.p256]
   82     82   
version = "0.11"
   83     83   
features = ["ecdsa"]
   84     84   
optional = true
   85     85   
   86     86   
[dependencies.percent-encoding]
   87     87   
version = "2.3.1"
   88     88   
optional = true
   89     89   
   90     90   
[dependencies.ring]
   91     91   
version = "0.17.5"
   92     92   
optional = true
   93     93   
   94     94   
[dependencies.crypto-bigint]
   95     95   
version = "0.5.4"
   96     96   
optional = true
   97     97   
   98     98   
[dependencies.subtle]
   99     99   
version = "2.5.0"
  100    100   
optional = true
  101    101   
  102    102   
[dependencies.zeroize]
  103    103   
version = "^1.7.0"
  104    104   
optional = true
  105    105   
  106    106   
[dev-dependencies]
  107    107   
bytes = "1"
  108    108   
hex-literal = "0.4.1"
  109    109   
httparse = "1.10.1"
  110    110   
pretty_assertions = "1.3"
  111    111   
proptest = "1.2"
  112    112   
serde = "1.0.180"
  113    113   
serde_derive = "1.0.180"
  114    114   
serde_json = "1.0.104"
  115    115   
criterion = "0.5"
  116    116   
  117    117   
[dev-dependencies.aws-credential-types]
  118    118   
path = "../aws-credential-types"
  119    119   
features = ["test-util", "hardcoded-credentials"]
  120    120   
version = "1.2.11"
  121    121   
  122    122   
[dev-dependencies.aws-smithy-runtime-api]
  123    123   
path = "../aws-smithy-runtime-api"
  124    124   
features = ["client", "test-util"]
  125         -
version = "1.10.0"
         125  +
version = "1.11.0"
  126    126   
  127    127   
[dev-dependencies.time]
  128    128   
version = "0.3.5"
  129    129   
features = ["parsing"]
  130    130   
[target."cfg(not(any(target_arch = \"powerpc\", target_arch = \"powerpc64\")))".dev-dependencies]
  131    131   
ring = "0.17.5"

tmp-codegen-diff/aws-sdk/sdk/aws-sigv4/src/http_request/canonical_request.rs

@@ -1,1 +50,50 @@
    8      8   
use crate::http_request::settings::SessionTokenMode;
    9      9   
use crate::http_request::settings::UriPathNormalizationMode;
   10     10   
use crate::http_request::sign::SignableRequest;
   11     11   
use crate::http_request::uri_path_normalization::normalize_uri_path;
   12     12   
use crate::http_request::url_escape::percent_encode_path;
   13     13   
use crate::http_request::{PayloadChecksumKind, SignableBody, SignatureLocation, SigningParams};
   14     14   
use crate::http_request::{PercentEncodingMode, SigningSettings};
   15     15   
use crate::sign::v4::sha256_hex_string;
   16     16   
use crate::SignatureVersion;
   17     17   
use aws_smithy_http::query_writer::QueryWriter;
   18         -
use http0::header::{AsHeaderName, HeaderName, HOST};
   19         -
use http0::uri::{Port, Scheme};
   20         -
use http0::{HeaderMap, HeaderValue, Uri};
          18  +
use http::header::{AsHeaderName, HeaderName, HOST};
          19  +
use http::uri::{Port, Scheme};
          20  +
use http::{HeaderMap, HeaderValue, Uri};
   21     21   
use std::borrow::Cow;
   22     22   
use std::cmp::Ordering;
   23     23   
use std::fmt;
   24     24   
use std::str::FromStr;
   25     25   
use std::time::SystemTime;
   26     26   
   27     27   
#[cfg(feature = "sigv4a")]
   28     28   
pub(crate) mod sigv4a;
   29     29   
   30     30   
pub(crate) mod header {
@@ -663,663 +723,723 @@
  683    683   
    use crate::http_request::test::SigningSuiteTest;
  684    684   
    use crate::http_request::{
  685    685   
        PayloadChecksumKind, SessionTokenMode, SignableBody, SignableRequest, SignatureLocation,
  686    686   
        SigningParams, SigningSettings,
  687    687   
    };
  688    688   
    use crate::sign::v4;
  689    689   
    use crate::sign::v4::sha256_hex_string;
  690    690   
    use aws_credential_types::Credentials;
  691    691   
    use aws_smithy_http::query_writer::QueryWriter;
  692    692   
    use aws_smithy_runtime_api::client::identity::Identity;
  693         -
    use http0::{HeaderValue, Uri};
         693  +
    use http::{HeaderValue, Uri};
  694    694   
    use pretty_assertions::assert_eq;
  695    695   
    use proptest::{prelude::*, proptest};
  696    696   
    use std::borrow::Cow;
  697    697   
    use std::time::Duration;
  698    698   
  699    699   
    fn signing_params(identity: &Identity, settings: SigningSettings) -> SigningParams<'_> {
  700    700   
        v4::signing_params::Builder::default()
  701    701   
            .identity(identity)
  702    702   
            .region("test-region")
  703    703   
            .name("testservicename")
@@ -873,873 +1086,1086 @@
  893    893   
        let identity = Credentials::for_tests().into();
  894    894   
        let signing_params = signing_params(&identity, SigningSettings::default());
  895    895   
        let creq = CanonicalRequest::from(&req, &signing_params).unwrap();
  896    896   
        let expected = test.canonical_request(SignatureLocation::Headers);
  897    897   
        let actual = format!("{}", creq);
  898    898   
        assert_eq!(actual, expected);
  899    899   
    }
  900    900   
  901    901   
    #[test]
  902    902   
    fn test_tilde_in_uri() {
  903         -
        let req = http0::Request::builder()
         903  +
        let req = http::Request::builder()
  904    904   
            .uri("https://s3.us-east-1.amazonaws.com/my-bucket?list-type=2&prefix=~objprefix&single&k=&unreserved=-_.~").body("").unwrap().into();
  905    905   
        let req = SignableRequest::from(&req);
  906    906   
        let identity = Credentials::for_tests().into();
  907    907   
        let signing_params = signing_params(&identity, SigningSettings::default());
  908    908   
        let creq = CanonicalRequest::from(&req, &signing_params).unwrap();
  909    909   
        assert_eq!(
  910    910   
            Some("k=&list-type=2&prefix=~objprefix&single=&unreserved=-_.~"),
  911    911   
            creq.params.as_deref(),
  912    912   
        );
  913    913   
    }
  914    914   
  915    915   
    #[test]
  916    916   
    fn test_signing_urls_with_percent_encoded_query_strings() {
  917    917   
        let all_printable_ascii_chars: String = (32u8..127).map(char::from).collect();
  918    918   
        let uri = Uri::from_static("https://s3.us-east-1.amazonaws.com/my-bucket");
  919    919   
  920    920   
        let mut query_writer = QueryWriter::new(&uri);
  921    921   
        query_writer.insert("list-type", "2");
  922    922   
        query_writer.insert("prefix", &all_printable_ascii_chars);
  923    923   
  924         -
        let req = http0::Request::builder()
         924  +
        let req = http::Request::builder()
  925    925   
            .uri(query_writer.build_uri())
  926    926   
            .body("")
  927    927   
            .unwrap()
  928    928   
            .into();
  929    929   
        let req = SignableRequest::from(&req);
  930    930   
        let identity = Credentials::for_tests().into();
  931    931   
        let signing_params = signing_params(&identity, SigningSettings::default());
  932    932   
        let creq = CanonicalRequest::from(&req, &signing_params).unwrap();
  933    933   
  934    934   
        let expected = "list-type=2&prefix=%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~";
  935    935   
        let actual = creq.params.unwrap();
  936    936   
        assert_eq!(expected, actual);
  937    937   
    }
  938    938   
  939    939   
    #[test]
  940    940   
    fn test_omit_session_token() {
  941    941   
        let test = SigningSuiteTest::v4("get-vanilla-query-order-key-case");
  942    942   
        let req = test.request();
  943    943   
        let req = SignableRequest::from(&req);
  944    944   
        let settings = SigningSettings {
  945    945   
            session_token_mode: SessionTokenMode::Include,
  946    946   
            ..Default::default()
  947    947   
        };
  948    948   
        let identity = Credentials::for_tests_with_session_token().into();
  949    949   
        let mut signing_params = signing_params(&identity, settings);
  950    950   
  951    951   
        let creq = CanonicalRequest::from(&req, &signing_params).unwrap();
  952    952   
        assert_eq!(
  953    953   
            creq.values.signed_headers().as_str(),
  954    954   
            "host;x-amz-date;x-amz-security-token"
  955    955   
        );
  956    956   
        assert_eq!(
  957    957   
            creq.headers.get("x-amz-security-token").unwrap(),
  958    958   
            "notarealsessiontoken"
  959    959   
        );
  960    960   
  961    961   
        signing_params.set_session_token_mode(SessionTokenMode::Exclude);
  962    962   
        let creq = CanonicalRequest::from(&req, &signing_params).unwrap();
  963    963   
        assert_eq!(
  964    964   
            creq.headers.get("x-amz-security-token").unwrap(),
  965    965   
            "notarealsessiontoken"
  966    966   
        );
  967    967   
        assert_eq!(creq.values.signed_headers().as_str(), "host;x-amz-date");
  968    968   
    }
  969    969   
  970    970   
    // It should exclude authorization, user-agent, x-amzn-trace-id, and transfer-encoding headers from presigning
  971    971   
    #[test]
  972    972   
    fn non_presigning_header_exclusion() {
  973         -
        let request = http0::Request::builder()
         973  +
        let request = http::Request::builder()
  974    974   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  975    975   
            .header("authorization", "test-authorization")
  976    976   
            .header("content-type", "application/xml")
  977    977   
            .header("content-length", "0")
  978    978   
            .header("user-agent", "test-user-agent")
  979    979   
            .header("x-amzn-trace-id", "test-trace-id")
  980    980   
            .header("x-amz-user-agent", "test-user-agent")
  981    981   
            .header("transfer-encoding", "chunked")
  982    982   
            .body("")
  983    983   
            .unwrap()
  984    984   
            .into();
  985    985   
        let request = SignableRequest::from(&request);
  986    986   
  987    987   
        let settings = SigningSettings {
  988    988   
            signature_location: SignatureLocation::Headers,
  989    989   
            ..Default::default()
  990    990   
        };
  991    991   
  992    992   
        let identity = Credentials::for_tests().into();
  993    993   
        let signing_params = signing_params(&identity, settings);
  994    994   
        let canonical = CanonicalRequest::from(&request, &signing_params).unwrap();
  995    995   
  996    996   
        let values = canonical.values.as_headers().unwrap();
  997    997   
        assert_eq!(
  998    998   
            "content-length;content-type;host;x-amz-date;x-amz-user-agent",
  999    999   
            values.signed_headers.as_str()
 1000   1000   
        );
 1001   1001   
    }
 1002   1002   
 1003   1003   
    // It should exclude authorization, user-agent, x-amz-user-agent, x-amzn-trace-id, and transfer-encoding headers from presigning
 1004   1004   
    #[test]
 1005   1005   
    fn presigning_header_exclusion() {
 1006         -
        let request = http0::Request::builder()
        1006  +
        let request = http::Request::builder()
 1007   1007   
            .uri("https://some-endpoint.some-region.amazonaws.com")
 1008   1008   
            .header("authorization", "test-authorization")
 1009   1009   
            .header("content-type", "application/xml")
 1010   1010   
            .header("content-length", "0")
 1011   1011   
            .header("user-agent", "test-user-agent")
 1012   1012   
            .header("x-amzn-trace-id", "test-trace-id")
 1013   1013   
            .header("x-amz-user-agent", "test-user-agent")
 1014   1014   
            .header("transfer-encoding", "chunked")
 1015   1015   
            .body("")
 1016   1016   
            .unwrap()
 1017   1017   
            .into();
 1018   1018   
        let request = SignableRequest::from(&request);
 1019   1019   
 1020   1020   
        let settings = SigningSettings {
 1021   1021   
            signature_location: SignatureLocation::QueryParams,
 1022   1022   
            expires_in: Some(Duration::from_secs(30)),
 1023   1023   
            ..Default::default()
 1024   1024   
        };
 1025   1025   
 1026   1026   
        let identity = Credentials::for_tests().into();
 1027   1027   
        let signing_params = signing_params(&identity, settings);
 1028   1028   
        let canonical = CanonicalRequest::from(&request, &signing_params).unwrap();
 1029   1029   
 1030   1030   
        let values = canonical.values.into_query_params().unwrap();
 1031   1031   
        assert_eq!(
 1032   1032   
            "content-length;content-type;host",
 1033   1033   
            values.signed_headers.as_str()
 1034   1034   
        );
 1035   1035   
    }
 1036   1036   
 1037   1037   
    #[allow(clippy::ptr_arg)] // The proptest macro requires this arg to be a Vec instead of a slice.
 1038   1038   
    fn valid_input(input: &Vec<String>) -> bool {
 1039   1039   
        [
 1040   1040   
            "content-length".to_owned(),
 1041   1041   
            "content-type".to_owned(),
 1042   1042   
            "host".to_owned(),
 1043   1043   
        ]
 1044   1044   
        .iter()
 1045   1045   
        .all(|element| !input.contains(element))
 1046   1046   
    }
 1047   1047   
 1048   1048   
    proptest! {
 1049   1049   
        #[test]
 1050   1050   
        fn presigning_header_exclusion_with_explicit_exclusion_list_specified(
 1051   1051   
            excluded_headers in prop::collection::vec("[a-z]{1,20}", 1..10).prop_filter(
 1052   1052   
                "`excluded_headers` should pass the `valid_input` check",
 1053   1053   
                valid_input,
 1054   1054   
            )
 1055   1055   
        ) {
 1056         -
            let mut request_builder = http0::Request::builder()
        1056  +
            let mut request_builder = http::Request::builder()
 1057   1057   
                .uri("https://some-endpoint.some-region.amazonaws.com")
 1058   1058   
                .header("content-type", "application/xml")
 1059   1059   
                .header("content-length", "0");
 1060   1060   
            for key in &excluded_headers {
 1061   1061   
                request_builder = request_builder.header(key, "value");
 1062   1062   
            }
 1063   1063   
            let request = request_builder.body("").unwrap().into();
 1064   1064   
 1065   1065   
            let request = SignableRequest::from(&request);
 1066   1066   

tmp-codegen-diff/aws-sdk/sdk/aws-sigv4/src/http_request/error.rs

@@ -1,1 +37,37 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6         -
use http0::header::{InvalidHeaderName, InvalidHeaderValue};
    7         -
use http0::uri::InvalidUri;
           6  +
use http::header::{InvalidHeaderName, InvalidHeaderValue};
           7  +
use http::uri::InvalidUri;
    8      8   
use std::error::Error;
    9      9   
use std::fmt;
   10     10   
   11     11   
#[derive(Debug)]
   12     12   
enum SigningErrorKind {
   13     13   
    FailedToCreateCanonicalRequest { source: CanonicalRequestError },
   14     14   
    UnsupportedIdentityType,
   15     15   
}
   16     16   
   17     17   
/// Error signing request

tmp-codegen-diff/aws-sdk/sdk/aws-sigv4/src/http_request/settings.rs

@@ -1,1 +36,36 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6         -
use http0::header::{AUTHORIZATION, TRANSFER_ENCODING, USER_AGENT};
           6  +
use http::header::{AUTHORIZATION, TRANSFER_ENCODING, USER_AGENT};
    7      7   
use std::borrow::Cow;
    8      8   
use std::time::Duration;
    9      9   
   10     10   
const HEADER_NAME_X_RAY_TRACE_ID: &str = "x-amzn-trace-id";
   11     11   
   12     12   
/// HTTP-specific signing settings
   13     13   
#[derive(Clone, Debug, PartialEq)]
   14     14   
#[non_exhaustive]
   15     15   
pub struct SigningSettings {
   16     16   
    /// Specifies how to encode the request URL when signing. Some services do not decode

tmp-codegen-diff/aws-sdk/sdk/aws-sigv4/src/http_request/sign.rs

@@ -1,1 +47,47 @@
    7      7   
use super::{PayloadChecksumKind, SignatureLocation};
    8      8   
use crate::http_request::canonical_request::header;
    9      9   
use crate::http_request::canonical_request::param;
   10     10   
use crate::http_request::canonical_request::{CanonicalRequest, StringToSign};
   11     11   
use crate::http_request::error::CanonicalRequestError;
   12     12   
use crate::http_request::SigningParams;
   13     13   
use crate::sign::v4;
   14     14   
#[cfg(feature = "sigv4a")]
   15     15   
use crate::sign::v4a;
   16     16   
use crate::{SignatureVersion, SigningOutput};
   17         -
use http0::Uri;
          17  +
use http::Uri;
   18     18   
use std::borrow::Cow;
   19     19   
use std::fmt::{Debug, Formatter};
   20     20   
use std::str;
   21     21   
   22     22   
const LOG_SIGNABLE_BODY: &str = "LOG_SIGNABLE_BODY";
   23     23   
   24     24   
/// Represents all of the information necessary to sign an HTTP request.
   25     25   
#[derive(Debug)]
   26     26   
#[non_exhaustive]
   27     27   
pub struct SignableRequest<'a> {
@@ -179,179 +243,248 @@
  199    199   
    /// Applies the instructions to the given `request`.
  200    200   
    pub fn apply_to_request_http0x<B>(self, request: &mut http0::Request<B>) {
  201    201   
        let (new_headers, new_query) = self.into_parts();
  202    202   
        for header in new_headers.into_iter() {
  203    203   
            let mut value = http0::HeaderValue::from_str(&header.value).unwrap();
  204    204   
            value.set_sensitive(header.sensitive);
  205    205   
            request.headers_mut().insert(header.key, value);
  206    206   
        }
  207    207   
  208    208   
        if !new_query.is_empty() {
  209         -
            let mut query = aws_smithy_http::query_writer::QueryWriter::new(request.uri());
         209  +
            let mut query = aws_smithy_http::query_writer::QueryWriter::new_from_string(
         210  +
                &request.uri().to_string(),
         211  +
            )
         212  +
            .expect("unreachable: URI is valid");
  210    213   
            for (name, value) in new_query {
  211    214   
                query.insert(name, &value);
  212    215   
            }
  213         -
            *request.uri_mut() = query.build_uri();
         216  +
            let query_uri = query.build_uri().to_string();
         217  +
            let query_http0 = query_uri.parse::<http0::Uri>().expect("URI is valid");
         218  +
            *request.uri_mut() = query_http0;
  214    219   
        }
  215    220   
    }
  216    221   
  217    222   
    #[cfg(any(feature = "http1", test))]
  218    223   
    /// Applies the instructions to the given `request`.
  219    224   
    pub fn apply_to_request_http1x<B>(self, request: &mut http::Request<B>) {
  220    225   
        // TODO(https://github.com/smithy-lang/smithy-rs/issues/3367): Update query writer to reduce
  221    226   
        // allocations
  222    227   
        let (new_headers, new_query) = self.into_parts();
  223    228   
        for header in new_headers.into_iter() {
@@ -487,492 +547,552 @@
  507    512   
mod tests {
  508    513   
    use crate::date_time::test_parsers::parse_date_time;
  509    514   
    use crate::http_request::sign::{add_header, SignableRequest};
  510    515   
    use crate::http_request::test::SigningSuiteTest;
  511    516   
    use crate::http_request::{
  512    517   
        sign, SessionTokenMode, SignableBody, SignatureLocation, SigningInstructions,
  513    518   
        SigningSettings,
  514    519   
    };
  515    520   
    use crate::sign::v4;
  516    521   
    use aws_credential_types::Credentials;
  517         -
    use http0::{HeaderValue, Request};
         522  +
    use http::{HeaderValue, Request};
  518    523   
    use pretty_assertions::assert_eq;
  519    524   
    use proptest::proptest;
  520    525   
    use std::borrow::Cow;
  521    526   
    use std::iter;
  522    527   
  523    528   
    macro_rules! assert_req_eq {
  524    529   
        (http: $expected:expr, $actual:expr) => {
  525    530   
            let mut expected = ($expected).map(|_b|"body");
  526    531   
            let mut actual = ($actual).map(|_b|"body");
  527    532   
            make_headers_comparable(&mut expected);
@@ -741,746 +954,959 @@
  761    766   
  762    767   
        let original = test.request();
  763    768   
        let signable = SignableRequest::from(&original);
  764    769   
        let out = sign(signable, &params).unwrap();
  765    770   
        assert_eq!(
  766    771   
            "57d157672191bac40bae387e48bbe14b15303c001fdbb01f4abf295dccb09705",
  767    772   
            out.signature
  768    773   
        );
  769    774   
  770    775   
        let mut signed = original.as_http_request();
  771         -
        out.output.apply_to_request_http0x(&mut signed);
         776  +
        out.output.apply_to_request_http1x(&mut signed);
  772    777   
  773    778   
        let expected = test.signed_request(SignatureLocation::Headers);
  774    779   
        assert_req_eq!(expected, signed);
  775    780   
    }
  776    781   
  777    782   
    #[test]
  778    783   
    fn test_sign_headers_utf8() {
  779    784   
        let settings = SigningSettings::default();
  780    785   
        let identity = &Credentials::for_tests().into();
  781    786   
        let params = v4::SigningParams {
  782    787   
            identity,
  783    788   
            region: "us-east-1",
  784    789   
            name: "service",
  785    790   
            time: parse_date_time("20150830T123600Z").unwrap(),
  786    791   
            settings,
  787    792   
        }
  788    793   
        .into();
  789    794   
  790         -
        let original = http0::Request::builder()
         795  +
        let original = http::Request::builder()
  791    796   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  792    797   
            .header("some-header", HeaderValue::from_str("テスト").unwrap())
  793    798   
            .body("")
  794    799   
            .unwrap()
  795    800   
            .into();
  796    801   
        let signable = SignableRequest::from(&original);
  797    802   
        let out = sign(signable, &params).unwrap();
  798    803   
        assert_eq!(
  799    804   
            "55e16b31f9bde5fd04f9d3b780dd2b5e5f11a5219001f91a8ca9ec83eaf1618f",
  800    805   
            out.signature
  801    806   
        );
  802    807   
  803    808   
        let mut signed = original.as_http_request();
  804         -
        out.output.apply_to_request_http0x(&mut signed);
         809  +
        out.output.apply_to_request_http1x(&mut signed);
  805    810   
  806         -
        let expected = http0::Request::builder()
         811  +
        let expected = http::Request::builder()
  807    812   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  808    813   
            .header("some-header", HeaderValue::from_str("テスト").unwrap())
  809    814   
            .header(
  810    815   
                "x-amz-date",
  811    816   
                HeaderValue::from_str("20150830T123600Z").unwrap(),
  812    817   
            )
  813    818   
            .header(
  814    819   
                "authorization",
  815    820   
                HeaderValue::from_str(
  816    821   
                    "AWS4-HMAC-SHA256 \
  817    822   
                        Credential=ANOTREAL/20150830/us-east-1/service/aws4_request, \
  818    823   
                        SignedHeaders=host;some-header;x-amz-date, \
  819    824   
                        Signature=55e16b31f9bde5fd04f9d3b780dd2b5e5f11a5219001f91a8ca9ec83eaf1618f",
  820    825   
                )
  821    826   
                .unwrap(),
  822    827   
            )
  823    828   
            .body("")
  824    829   
            .unwrap();
  825    830   
        assert_req_eq!(http: expected, signed);
  826    831   
    }
  827    832   
  828    833   
    #[test]
  829    834   
    fn test_sign_headers_excluding_session_token() {
  830    835   
        let settings = SigningSettings {
  831    836   
            session_token_mode: SessionTokenMode::Exclude,
  832    837   
            ..Default::default()
  833    838   
        };
  834    839   
        let identity = &Credentials::for_tests_with_session_token().into();
  835    840   
        let params = v4::SigningParams {
  836    841   
            identity,
  837    842   
            region: "us-east-1",
  838    843   
            name: "service",
  839    844   
            time: parse_date_time("20150830T123600Z").unwrap(),
  840    845   
            settings,
  841    846   
        }
  842    847   
        .into();
  843    848   
  844         -
        let original = http0::Request::builder()
         849  +
        let original = http::Request::builder()
  845    850   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  846    851   
            .body("")
  847    852   
            .unwrap()
  848    853   
            .into();
  849    854   
        let out_without_session_token = sign(SignableRequest::from(&original), &params).unwrap();
  850    855   
  851    856   
        let out_with_session_token_but_excluded =
  852    857   
            sign(SignableRequest::from(&original), &params).unwrap();
  853    858   
        assert_eq!(
  854    859   
            "ab32de057edf094958d178b3c91f3c8d5c296d526b11da991cd5773d09cea560",
  855    860   
            out_with_session_token_but_excluded.signature
  856    861   
        );
  857    862   
        assert_eq!(
  858    863   
            out_with_session_token_but_excluded.signature,
  859    864   
            out_without_session_token.signature
  860    865   
        );
  861    866   
  862    867   
        let mut signed = original.as_http_request();
  863    868   
        out_with_session_token_but_excluded
  864    869   
            .output
  865         -
            .apply_to_request_http0x(&mut signed);
         870  +
            .apply_to_request_http1x(&mut signed);
  866    871   
  867         -
        let expected = http0::Request::builder()
         872  +
        let expected = http::Request::builder()
  868    873   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  869    874   
            .header(
  870    875   
                "x-amz-date",
  871    876   
                HeaderValue::from_str("20150830T123600Z").unwrap(),
  872    877   
            )
  873    878   
            .header(
  874    879   
                "authorization",
  875    880   
                HeaderValue::from_str(
  876    881   
                    "AWS4-HMAC-SHA256 \
  877    882   
                        Credential=ANOTREAL/20150830/us-east-1/service/aws4_request, \
  878    883   
                        SignedHeaders=host;x-amz-date, \
  879    884   
                        Signature=ab32de057edf094958d178b3c91f3c8d5c296d526b11da991cd5773d09cea560",
  880    885   
                )
  881    886   
                .unwrap(),
  882    887   
            )
  883    888   
            .header(
  884    889   
                "x-amz-security-token",
  885    890   
                HeaderValue::from_str("notarealsessiontoken").unwrap(),
  886    891   
            )
  887    892   
            .body(b"")
  888    893   
            .unwrap();
  889    894   
        assert_req_eq!(http: expected, signed);
  890    895   
    }
  891    896   
  892    897   
    #[test]
  893    898   
    fn test_sign_headers_space_trimming() {
  894    899   
        let settings = SigningSettings::default();
  895    900   
        let identity = &Credentials::for_tests().into();
  896    901   
        let params = v4::SigningParams {
  897    902   
            identity,
  898    903   
            region: "us-east-1",
  899    904   
            name: "service",
  900    905   
            time: parse_date_time("20150830T123600Z").unwrap(),
  901    906   
            settings,
  902    907   
        }
  903    908   
        .into();
  904    909   
  905         -
        let original = http0::Request::builder()
         910  +
        let original = http::Request::builder()
  906    911   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  907    912   
            .header(
  908    913   
                "some-header",
  909    914   
                HeaderValue::from_str("  test  test   ").unwrap(),
  910    915   
            )
  911    916   
            .body("")
  912    917   
            .unwrap()
  913    918   
            .into();
  914    919   
        let signable = SignableRequest::from(&original);
  915    920   
        let out = sign(signable, &params).unwrap();
  916    921   
        assert_eq!(
  917    922   
            "244f2a0db34c97a528f22715fe01b2417b7750c8a95c7fc104a3c48d81d84c08",
  918    923   
            out.signature
  919    924   
        );
  920    925   
  921    926   
        let mut signed = original.as_http_request();
  922         -
        out.output.apply_to_request_http0x(&mut signed);
         927  +
        out.output.apply_to_request_http1x(&mut signed);
  923    928   
  924         -
        let expected = http0::Request::builder()
         929  +
        let expected = http::Request::builder()
  925    930   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  926    931   
            .header(
  927    932   
                "some-header",
  928    933   
                HeaderValue::from_str("  test  test   ").unwrap(),
  929    934   
            )
  930    935   
            .header(
  931    936   
                "x-amz-date",
  932    937   
                HeaderValue::from_str("20150830T123600Z").unwrap(),
  933    938   
            )
  934    939   
            .header(
@@ -957,962 +1042,1047 @@
  977    982   
        }
  978    983   
    }
  979    984   
  980    985   
    #[test]
  981    986   
    fn apply_signing_instructions_headers() {
  982    987   
        let mut headers = vec![];
  983    988   
        add_header(&mut headers, "some-header", "foo", false);
  984    989   
        add_header(&mut headers, "some-other-header", "bar", false);
  985    990   
        let instructions = SigningInstructions::new(headers, vec![]);
  986    991   
  987         -
        let mut request = http0::Request::builder()
         992  +
        let mut request = http::Request::builder()
  988    993   
            .uri("https://some-endpoint.some-region.amazonaws.com")
  989    994   
            .body("")
  990    995   
            .unwrap();
  991    996   
  992         -
        instructions.apply_to_request_http0x(&mut request);
         997  +
        instructions.apply_to_request_http1x(&mut request);
  993    998   
  994    999   
        let get_header = |n: &str| request.headers().get(n).unwrap().to_str().unwrap();
  995   1000   
        assert_eq!("foo", get_header("some-header"));
  996   1001   
        assert_eq!("bar", get_header("some-other-header"));
  997   1002   
    }
  998   1003   
  999   1004   
    #[test]
 1000   1005   
    fn apply_signing_instructions_query_params() {
 1001   1006   
        let params = vec![
 1002   1007   
            ("some-param", Cow::Borrowed("f&o?o")),
 1003   1008   
            ("some-other-param?", Cow::Borrowed("bar")),
 1004   1009   
        ];
 1005   1010   
        let instructions = SigningInstructions::new(vec![], params);
 1006   1011   
 1007         -
        let mut request = http0::Request::builder()
        1012  +
        let mut request = http::Request::builder()
 1008   1013   
            .uri("https://some-endpoint.some-region.amazonaws.com/some/path")
 1009   1014   
            .body("")
 1010   1015   
            .unwrap();
 1011   1016   
 1012         -
        instructions.apply_to_request_http0x(&mut request);
        1017  +
        instructions.apply_to_request_http1x(&mut request);
 1013   1018   
 1014   1019   
        assert_eq!(
 1015   1020   
            "/some/path?some-param=f%26o%3Fo&some-other-param%3F=bar",
 1016   1021   
            request.uri().path_and_query().unwrap().to_string()
 1017   1022   
        );
 1018   1023   
    }
 1019   1024   
 1020   1025   
    #[test]
 1021   1026   
    fn apply_signing_instructions_query_params_http_1x() {
 1022   1027   
        let params = vec![

tmp-codegen-diff/aws-sdk/sdk/aws-sigv4/src/http_request/test.rs

@@ -1,1 +45,45 @@
    5      5   
    6      6   
//! Functions shared between the tests of several modules.
    7      7   
    8      8   
use crate::http_request::canonical_request::{CanonicalRequest, StringToSign};
    9      9   
use crate::http_request::{
   10     10   
    PayloadChecksumKind, SessionTokenMode, SignableBody, SignableRequest, SignatureLocation,
   11     11   
    SigningSettings,
   12     12   
};
   13     13   
use aws_credential_types::Credentials;
   14     14   
use aws_smithy_runtime_api::client::identity::Identity;
   15         -
use http0::{Method, Uri};
          15  +
use http::Uri;
   16     16   
use std::borrow::Cow;
   17     17   
use std::error::Error as StdError;
   18     18   
use std::time::{Duration, SystemTime};
   19     19   
use time::format_description::well_known::Rfc3339;
   20     20   
use time::OffsetDateTime;
   21     21   
   22     22   
/// Common test suite collection
   23     23   
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
   24     24   
enum Collection {
   25     25   
    V4,
@@ -121,121 +231,231 @@
  141    141   
        form_urlencoded::parse(expected.query().unwrap_or_default().as_bytes()).collect();
  142    142   
    expected_params.sort();
  143    143   
  144    144   
    let mut actual_params: Vec<(Cow<'_, str>, Cow<'_, str>)> =
  145    145   
        form_urlencoded::parse(actual.query().unwrap_or_default().as_bytes()).collect();
  146    146   
    actual_params.sort();
  147    147   
  148    148   
    assert_eq!(expected_params, actual_params);
  149    149   
}
  150    150   
  151         -
fn assert_requests_eq(expected: TestRequest, actual: http0::Request<&str>) {
         151  +
fn assert_requests_eq(expected: TestRequest, actual: http::Request<&str>) {
  152    152   
    let expected = expected.as_http_request();
  153    153   
    let actual = actual;
  154    154   
    assert_eq!(expected.method(), actual.method());
  155    155   
    assert_eq!(
  156    156   
        expected.headers().len(),
  157    157   
        actual.headers().len(),
  158    158   
        "extra or missing headers"
  159    159   
    );
  160    160   
    assert_eq!(expected.headers(), actual.headers(), "headers mismatch");
  161    161   
    assert_uri_eq(expected.uri(), actual.uri());
  162    162   
    assert_eq!(*expected.body(), *actual.body(), "body mismatch");
  163    163   
}
  164    164   
  165    165   
/// Run the given test from the v4 suite for the given signature location
  166    166   
pub(crate) fn run_v4_test(test_name: &'static str, signature_location: SignatureLocation) {
  167    167   
    let test = SigningSuiteTest::v4(test_name);
  168    168   
    let tc = test.context();
  169    169   
    let params = new_v4_signing_params_from_context(&tc, signature_location);
  170    170   
  171    171   
    let req = test.request();
  172    172   
    let expected_creq = test.canonical_request(signature_location);
  173    173   
    let signable_req = SignableRequest::from(&req);
  174    174   
    let actual_creq = CanonicalRequest::from(&signable_req, &params).unwrap();
  175    175   
  176    176   
    // check canonical request
  177    177   
    assert_eq!(
  178    178   
        expected_creq,
  179    179   
        actual_creq.to_string(),
  180    180   
        "canonical request didn't match (signature location: {signature_location:?})"
  181    181   
    );
  182    182   
  183    183   
    let expected_string_to_sign = test.string_to_sign(signature_location);
  184    184   
    let hashed_creq = &crate::sign::v4::sha256_hex_string(actual_creq.to_string().as_bytes());
  185    185   
    let actual_string_to_sign = StringToSign::new_v4(
  186    186   
        *params.time(),
  187    187   
        params.region().unwrap(),
  188    188   
        params.name(),
  189    189   
        hashed_creq,
  190    190   
    )
  191    191   
    .to_string();
  192    192   
  193    193   
    // check string to sign
  194    194   
    assert_eq!(
  195    195   
        expected_string_to_sign, actual_string_to_sign,
  196    196   
        "'string to sign' didn't match (signature location: {signature_location:?})"
  197    197   
    );
  198    198   
  199    199   
    let out = crate::http_request::sign(signable_req, &params).unwrap();
  200    200   
    let mut signed = req.as_http_request();
  201         -
    out.output.apply_to_request_http0x(&mut signed);
         201  +
    out.output.apply_to_request_http1x(&mut signed);
  202    202   
  203    203   
    // check signature
  204    204   
    assert_eq!(
  205    205   
        test.signature(signature_location),
  206    206   
        out.signature,
  207    207   
        "signature didn't match (signature location: {signature_location:?})"
  208    208   
    );
  209    209   
  210    210   
    let expected = test.signed_request(signature_location);
  211    211   
    assert_requests_eq(expected, signed);
@@ -337,337 +397,397 @@
  357    357   
        .to_string();
  358    358   
  359    359   
        assert_eq!(
  360    360   
            expected_string_to_sign, actual_string_to_sign,
  361    361   
            "'string to sign' didn't match (signature location: {signature_location:?})"
  362    362   
        );
  363    363   
  364    364   
        let out = sign(signable_req, &params).unwrap();
  365    365   
        // Sigv4a signatures are non-deterministic, so we can't compare the signature directly.
  366    366   
        out.output
  367         -
            .apply_to_request_http0x(&mut req.as_http_request());
         367  +
            .apply_to_request_http1x(&mut req.as_http_request());
  368    368   
  369    369   
        let creds = params.credentials().unwrap();
  370    370   
        let signing_key =
  371    371   
            v4a::generate_signing_key(creds.access_key_id(), creds.secret_access_key());
  372    372   
        let sig = DerSignature::from_bytes(&hex::decode(out.signature).unwrap()).unwrap();
  373    373   
        let sig = sig
  374    374   
            .try_into()
  375    375   
            .expect("DER-style signatures are always convertible into fixed-size signatures");
  376    376   
  377    377   
        let signing_key = SigningKey::from_bytes(signing_key.as_ref()).unwrap();
@@ -442,442 +539,566 @@
  462    462   
            TestSignedBody::Bytes(data) => SignableBody::Bytes(data.as_slice()),
  463    463   
        }
  464    464   
    }
  465    465   
}
  466    466   
  467    467   
impl TestRequest {
  468    468   
    pub(crate) fn set_body(&mut self, body: SignableBody<'static>) {
  469    469   
        self.body = TestSignedBody::Signable(body);
  470    470   
    }
  471    471   
  472         -
    pub(crate) fn as_http_request(&self) -> http0::Request<&'static str> {
  473         -
        let mut builder = http0::Request::builder()
         472  +
    pub(crate) fn as_http_request(&self) -> http::Request<&'static str> {
         473  +
        let mut builder = http::Request::builder()
  474    474   
            .uri(&self.uri)
  475         -
            .method(Method::from_bytes(self.method.as_bytes()).unwrap());
         475  +
            .method(http::Method::from_bytes(self.method.as_bytes()).unwrap());
  476    476   
        for (k, v) in &self.headers {
  477    477   
            builder = builder.header(k, v);
  478    478   
        }
  479    479   
        builder.body("body").unwrap()
  480    480   
    }
  481    481   
}
  482    482   
  483    483   
impl<B: AsRef<[u8]>> From<http0::Request<B>> for TestRequest {
  484    484   
    fn from(value: http0::Request<B>) -> Self {
  485    485   
        let invalid = value
  486    486   
            .headers()
  487    487   
            .values()
  488    488   
            .find(|h| std::str::from_utf8(h.as_bytes()).is_err());
  489    489   
        if let Some(invalid) = invalid {
  490    490   
            panic!("invalid header: {:?}", invalid);
  491    491   
        }
  492    492   
        Self {
  493    493   
            uri: value.uri().to_string(),
  494    494   
            method: value.method().to_string(),
  495    495   
            headers: value
  496    496   
                .headers()
  497    497   
                .iter()
  498    498   
                .map(|(k, v)| {
  499    499   
                    (
  500    500   
                        k.to_string(),
  501    501   
                        String::from_utf8(v.as_bytes().to_vec()).unwrap(),
  502    502   
                    )
  503    503   
                })
  504    504   
                .collect::<Vec<_>>(),
  505    505   
            body: TestSignedBody::Bytes(value.body().as_ref().to_vec()),
  506    506   
        }
  507    507   
    }
  508    508   
}
  509    509   
         510  +
impl<B: AsRef<[u8]>> From<http::Request<B>> for TestRequest {
         511  +
    fn from(value: http::Request<B>) -> Self {
         512  +
        let invalid = value
         513  +
            .headers()
         514  +
            .values()
         515  +
            .find(|h| std::str::from_utf8(h.as_bytes()).is_err());
         516  +
        if let Some(invalid) = invalid {
         517  +
            panic!("invalid header: {:?}", invalid);
         518  +
        }
         519  +
        Self {
         520  +
            uri: value.uri().to_string(),
         521  +
            method: value.method().to_string(),
         522  +
            headers: value
         523  +
                .headers()
         524  +
                .iter()
         525  +
                .map(|(k, v)| {
         526  +
                    (
         527  +
                        k.to_string(),
         528  +
                        String::from_utf8(v.as_bytes().to_vec()).unwrap(),
         529  +
                    )
         530  +
                })
         531  +
                .collect::<Vec<_>>(),
         532  +
            body: TestSignedBody::Bytes(value.body().as_ref().to_vec()),
         533  +
        }
         534  +
    }
         535  +
}
         536  +
  510    537   
impl<'a> From<&'a TestRequest> for SignableRequest<'a> {
  511    538   
    fn from(request: &'a TestRequest) -> SignableRequest<'a> {
  512    539   
        SignableRequest::new(
  513    540   
            &request.method,
  514    541   
            &request.uri,
  515    542   
            request
  516    543   
                .headers
  517    544   
                .iter()
  518    545   
                .map(|(k, v)| (k.as_str(), v.as_str())),
  519    546   
            request.body.as_signable_body(),

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

@@ -1,1 +41,41 @@
    1      1   
[package]
    2      2   
name = "aws-smithy-async"
    3         -
version = "1.2.7"
           3  +
version = "1.2.8"
    4      4   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "John DiSanti <jdisanti@amazon.com>"]
    5      5   
description = "Async runtime agnostic abstractions for smithy-rs."
    6      6   
edition = "2021"
    7      7   
license = "Apache-2.0"
    8      8   
repository = "https://github.com/smithy-lang/smithy-rs"
    9      9   
rust-version = "1.88"
   10     10   
   11     11   
[features]
   12     12   
rt-tokio = ["tokio/time"]
   13     13   
test-util = ["rt-tokio", "tokio/rt"]
   14     14   
   15     15   
[dependencies]
   16     16   
pin-project-lite = "0.2.14"
   17         -
tokio = { version = "1.40.0", features = ["sync"] }
          17  +
tokio = { version = "1.46.0", features = ["sync"] }
   18     18   
futures-util = { version = "0.3.29", default-features = false }
   19     19   
   20     20   
[dev-dependencies]
   21     21   
pin-utils = "0.1"
   22     22   
tokio = { version = "1.23.1", features = ["rt", "macros", "test-util"] }
   23     23   
tokio-test = "0.4.2"
   24     24   
   25     25   
# futures-util is used by `now_or_later`, for instance, but the tooling
   26     26   
# reports a false positive, saying it is unused.
   27     27   
[package.metadata.cargo-udeps.ignore]

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

@@ -1,1 +33,33 @@
   20     20   
all-features = true
   21     21   
targets = ["x86_64-unknown-linux-gnu"]
   22     22   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   23     23   
rustdoc-args = ["--cfg", "docsrs"]
   24     24   
[dependencies.minicbor]
   25     25   
version = "0.24.2"
   26     26   
features = ["alloc", "half"]
   27     27   
   28     28   
[dependencies.aws-smithy-types]
   29     29   
path = "../aws-smithy-types"
   30         -
version = "1.3.6"
          30  +
version = "1.4.0"
   31     31   
   32     32   
[dev-dependencies]
   33     33   
criterion = "0.5.1"

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

@@ -1,1 +44,52 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-checksums"
    4         -
version = "0.63.13"
           4  +
version = "0.64.0"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
    6      6   
description = "Checksum calculation and verification callbacks"
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
rust-version = "1.88"
   11     11   
[package.metadata.docs.rs]
   12     12   
all-features = true
   13     13   
targets = ["x86_64-unknown-linux-gnu"]
   14     14   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   15     15   
rustdoc-args = ["--cfg", "docsrs"]
   16     16   
   17     17   
[dependencies]
   18     18   
bytes = "1.10.0"
   19     19   
crc-fast = "~1.9.0"
   20     20   
hex = "0.4.3"
   21         -
http = "0.2.9"
   22         -
http-body = "0.4.5"
          21  +
http-body-util = "0.1.3"
   23     22   
md-5 = "0.10"
   24     23   
pin-project-lite = "0.2.14"
   25     24   
sha1 = "0.10"
   26     25   
sha2 = "0.10"
   27     26   
tracing = "0.1.40"
   28     27   
   29     28   
[dependencies.aws-smithy-http]
   30     29   
path = "../aws-smithy-http"
   31         -
version = "0.62.6"
          30  +
version = "0.63.0"
   32     31   
   33     32   
[dependencies.aws-smithy-types]
   34     33   
path = "../aws-smithy-types"
   35         -
version = "1.3.6"
          34  +
features = ["http-body-1-x"]
          35  +
version = "1.4.0"
          36  +
          37  +
[dependencies.http-1x]
          38  +
package = "http"
          39  +
version = "1.3.1"
          40  +
          41  +
[dependencies.http-body-1x]
          42  +
package = "http-body"
          43  +
version = "1.0.1"
   36     44   
   37     45   
[dev-dependencies]
   38     46   
bytes-utils = "0.1.2"
   39     47   
pretty_assertions = "1.3"
   40     48   
tracing-test = "0.2.1"
   41     49   
   42     50   
[dev-dependencies.tokio]
   43     51   
version = "1.23.1"
   44     52   
features = ["macros", "rt"]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-checksums/src/body/cache.rs

@@ -1,1 +38,38 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6      6   
//! Checksum caching functionality.
    7      7   
    8         -
use http::HeaderMap;
           8  +
use http_1x::HeaderMap;
    9      9   
use std::sync::{Arc, Mutex};
   10     10   
   11     11   
/// A cache for storing previously calculated checksums.
   12     12   
#[derive(Debug, Clone)]
   13     13   
pub struct ChecksumCache {
   14     14   
    inner: Arc<Mutex<Option<HeaderMap>>>,
   15     15   
}
   16     16   
   17     17   
impl ChecksumCache {
   18     18   
    /// Create a new empty checksum cache.