From bdec1a232a5dfdba16bafd1f637c99a920a30734 Mon Sep 17 00:00:00 2001 From: Aaron Todd Date: Mon, 10 Mar 2025 09:48:22 -0400 Subject: [PATCH] change default HTTPS client to hyper1 (#4040) ## Motivation and Context * https://github.com/smithy-lang/smithy-rs/issues/3710 * https://github.com/smithy-lang/smithy-rs/issues/1925 * https://github.com/awslabs/aws-sdk-rust/issues/977 ## Description Updates the default HTTPS client to be based off hyper 1.x, rustls, and aws-lc. See the GitHub discussion: https://github.com/awslabs/aws-sdk-rust/discussions/1257 This PR is a rollup of previously reviewed PRs: * Refactor the runtime structure and consolidate HTTP client implementation(s): [smithy-rs#3866](https://github.com/smithy-lang/smithy-rs/pull/3866) * Migrate HTTP test utils: [smithy-rs#3888](https://github.com/smithy-lang/smithy-rs/pull/3888) * Update runtime to use new test utils: [smithy-rs#3898](https://github.com/smithy-lang/smithy-rs/pull/3898) * Backport connection poisoning: [smithy-rs#3795](https://github.com/smithy-lang/smithy-rs/pull/3795) * Deprecate HTTP 02x presign APIs: [smithy-rs#3823](https://github.com/smithy-lang/smithy-rs/pull/3823) * Enable hyper1 as default client: [smithy-rs#]() * Enable hyper1 behind BMV:[smithy-rs#3973](https://github.com/smithy-lang/smithy-rs/pull/3973) * s2n-tls provider (by Sam): [smithy-rs#3965](https://github.com/smithy-lang/smithy-rs/pull/3965) * custom TLS config: [smithy-rs#4032](https://github.com/smithy-lang/smithy-rs/pull/4032) ## Testing ## Checklist - [x] For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "client," "server," or both in the `applies_to` key. - [x] For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the `.changelog` directory, specifying "aws-sdk-rust" in the `applies_to` key. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Sam Clark <3758302+goatgoose@users.noreply.github.com> Co-authored-by: Landon James --- .changelog/1741027916.md | 15 + .github/workflows/ci.yml | 20 +- aws/rust-runtime/Cargo.lock | 259 ++-- aws/rust-runtime/aws-config/Cargo.lock | 567 ++++++-- aws/rust-runtime/aws-config/Cargo.toml | 28 +- .../src/default_provider/credentials.rs | 10 +- aws/rust-runtime/aws-config/src/ecs.rs | 4 +- .../src/http_credential_provider.rs | 2 +- .../aws-config/src/imds/client.rs | 6 +- .../aws-config/src/imds/credentials.rs | 21 +- .../aws-config/src/imds/region.rs | 2 +- aws/rust-runtime/aws-config/src/lib.rs | 34 +- .../aws-config/src/meta/credentials/chain.rs | 4 +- .../aws-config/src/profile/credentials.rs | 2 +- .../aws-config/src/provider_config.rs | 2 +- aws/rust-runtime/aws-config/src/sso/token.rs | 5 +- .../aws-config/src/sts/assume_role.rs | 4 +- aws/rust-runtime/aws-config/src/test_case.rs | 9 +- .../aws-credential-types/Cargo.toml | 4 +- aws/rust-runtime/aws-inlineable/Cargo.toml | 8 +- aws/rust-runtime/aws-runtime/Cargo.toml | 14 +- aws/rust-runtime/aws-sigv4/Cargo.toml | 20 +- aws/rust-runtime/aws-types/Cargo.toml | 4 +- .../rustsdk/AwsFluentClientDecorator.kt | 6 + .../smithy/rustsdk/AwsPresigningDecorator.kt | 2 +- .../rustsdk/IntegrationTestDependencies.kt | 13 +- .../apigateway/ApiGatewayDecorator.kt | 1 + .../customize/glacier/GlacierDecorator.kt | 1 + .../rustsdk/EndpointBuiltInsDecoratorTest.kt | 8 +- .../amazon/smithy/rustsdk/HttpChecksumTest.kt | 23 +- .../HttpRequestCompressionDecoratorTest.kt | 38 +- .../smithy/rustsdk/SigV4AuthDecoratorTest.kt | 5 +- aws/sdk/Cargo.lock | 470 ++++--- .../previous-release-comparison/Cargo.lock | 681 +++++---- aws/sdk/benchmarks/s3-express/Cargo.lock | 217 ++- .../integration-tests/codecatalyst/Cargo.toml | 3 +- .../codecatalyst/tests/sso_bearer_auth.rs | 2 +- aws/sdk/integration-tests/dynamodb/Cargo.toml | 5 +- .../dynamodb/benches/deserialization_bench.rs | 4 +- .../dynamodb/tests/auth_scheme_error.rs | 2 +- .../dynamodb/tests/endpoints.rs | 4 +- .../dynamodb/tests/movies.rs | 66 +- .../dynamodb/tests/paginators.rs | 14 +- .../retries-with-client-rate-limiting.rs | 18 +- .../dynamodb/tests/shared-config.rs | 4 +- .../tests/test-error-classification.rs | 3 +- .../dynamodb/tests/timeouts.rs | 2 +- aws/sdk/integration-tests/ec2/Cargo.toml | 6 +- .../integration-tests/ec2/tests/paginators.rs | 6 +- .../integration-tests/ec2/tests/waiters.rs | 5 +- aws/sdk/integration-tests/glacier/Cargo.toml | 5 +- .../glacier/tests/custom-headers.rs | 2 +- aws/sdk/integration-tests/iam/Cargo.toml | 5 +- .../iam/tests/resolve-global-endpoint.rs | 2 +- aws/sdk/integration-tests/kms/Cargo.toml | 5 +- .../kms/tests/integration.rs | 28 +- .../kms/tests/retryable_errors.rs | 8 +- aws/sdk/integration-tests/lambda/Cargo.toml | 5 +- .../tests/naughty-strings-client-context.rs | 2 +- .../lambda/tests/request_id.rs | 8 +- .../no-default-features/Cargo.toml | 5 +- .../tests/client-construction.rs | 12 +- aws/sdk/integration-tests/polly/Cargo.toml | 2 +- .../polly/tests/presigning.rs | 4 +- .../integration-tests/qldbsession/Cargo.toml | 5 +- .../qldbsession/tests/integration.rs | 10 +- aws/sdk/integration-tests/s3/Cargo.toml | 10 +- .../s3/tests/alternative-async-runtime.rs | 2 +- .../s3/tests/body_size_hint.rs | 6 +- .../s3/tests/bucket-required.rs | 2 +- .../s3/tests/business_metrics.rs | 2 +- .../integration-tests/s3/tests/checksums.rs | 25 +- .../s3/tests/config-override.rs | 2 +- .../s3/tests/content-length-enforcement.rs | 2 +- .../s3/tests/customizable-operation.rs | 4 +- .../integration-tests/s3/tests/endpoints.rs | 2 +- .../s3/tests/expires_interceptor.rs | 8 +- aws/sdk/integration-tests/s3/tests/express.rs | 24 +- .../integration-tests/s3/tests/hyper-10.rs | 9 +- .../s3/tests/identity-cache.rs | 18 +- .../s3/tests/ignore-invalid-xml-body-root.rs | 8 +- .../s3/tests/interceptors.rs | 6 +- .../s3/tests/naughty-string-metadata.rs | 4 +- aws/sdk/integration-tests/s3/tests/no_auth.rs | 2 +- .../s3/tests/normalize-uri-path.rs | 2 +- .../integration-tests/s3/tests/presigning.rs | 4 +- .../query-strings-are-correctly-encoded.rs | 2 +- .../integration-tests/s3/tests/reconnects.rs | 3 +- .../s3/tests/recursion-detection.rs | 2 +- .../integration-tests/s3/tests/request_id.rs | 12 +- .../s3/tests/request_information_headers.rs | 2 +- .../s3/tests/required-query-params.rs | 2 +- .../tests/retry-classifier-customization.rs | 14 +- .../s3/tests/select-object-content.rs | 2 +- .../s3/tests/service_timeout_overrides.rs | 2 +- .../integration-tests/s3/tests/signing-it.rs | 9 +- .../s3/tests/stalled-stream-protection.rs | 19 +- .../s3/tests/status-200-errors.rs | 6 +- .../s3/tests/streaming-response.rs | 6 +- .../integration-tests/s3/tests/timeouts.rs | 4 +- .../integration-tests/s3control/Cargo.toml | 5 +- .../s3control/tests/signing-it.rs | 8 +- aws/sdk/integration-tests/sts/Cargo.toml | 3 +- .../integration-tests/sts/tests/signing-it.rs | 2 +- .../timestreamquery/Cargo.toml | 1 + .../timestreamquery/tests/endpoint_disco.rs | 2 +- .../transcribestreaming/Cargo.toml | 4 +- .../transcribestreaming/tests/test.rs | 2 +- build.gradle.kts | 26 +- buildSrc/src/main/kotlin/CrateSet.kt | 2 + .../client/FluentClientDecorator.kt | 5 + .../protocol/ClientProtocolTestGenerator.kt | 4 +- .../SensitiveOutputDecoratorTest.kt | 3 +- .../smithy/endpoint/EndpointsDecoratorTest.kt | 4 +- ...onfigOverrideRuntimePluginGeneratorTest.kt | 4 +- .../generators/EndpointTraitBindingsTest.kt | 7 +- .../CustomizableOperationGeneratorTest.kt | 4 +- .../client/FluentClientGeneratorTest.kt | 8 +- .../protocols/AwsQueryCompatibleTest.kt | 20 +- ...entEventStreamUnmarshallerGeneratorTest.kt | 3 +- .../codegen/core/rustlang/CargoDependency.kt | 13 +- .../rust/codegen/core/smithy/RuntimeType.kt | 5 +- design/src/rfcs/rfc0037_http_wrapper.md | 2 +- design/src/server/instrumentation.md | 4 +- design/src/server/middleware.md | 12 +- examples/pokemon-service-common/Cargo.toml | 2 +- rust-runtime/Cargo.lock | 497 ++++--- rust-runtime/Cargo.toml | 1 + rust-runtime/aws-smithy-async/Cargo.toml | 6 +- rust-runtime/aws-smithy-checksums/Cargo.toml | 12 +- .../aws-smithy-compression/Cargo.toml | 6 +- .../aws-smithy-eventstream/Cargo.toml | 4 +- .../aws-smithy-experimental/Cargo.toml | 46 +- .../examples/client-aws-lc.rs | 20 - .../examples/client-ring.rs | 12 - .../external-types.toml | 4 - .../aws-smithy-experimental/src/hyper_1_0.rs | 1246 ----------------- .../aws-smithy-experimental/src/lib.rs | 6 +- .../aws-smithy-http-client/Cargo.toml | 159 +++ rust-runtime/aws-smithy-http-client/LICENSE | 175 +++ rust-runtime/aws-smithy-http-client/README.md | 7 + .../examples/client-aws-lc.rs | 23 + .../examples/client-ring.rs | 15 + .../examples/client-s2n-tls.rs | 12 + .../examples/custom-dns.rs | 9 +- .../external-types.toml | 24 + .../aws-smithy-http-client/src/client.rs | 1003 +++++++++++++ .../aws-smithy-http-client/src/client/dns.rs | 40 + .../src/client/timeout.rs | 316 +++++ .../aws-smithy-http-client/src/client/tls.rs | 354 +++++ .../aws-smithy-http-client/src/error.rs | 26 + .../src/hyper_legacy.rs} | 45 +- .../aws-smithy-http-client/src/lib.rs | 106 ++ .../src}/test_util.rs | 19 +- .../src/test_util/body.rs | 95 ++ .../src}/test_util/capture_request.rs | 77 +- .../src}/test_util/dvr.rs | 41 +- .../src}/test_util/dvr/record.rs | 15 +- .../src}/test_util/dvr/replay.rs | 35 +- .../src}/test_util/infallible.rs | 13 +- .../src/test_util/legacy_infallible.rs | 83 ++ .../src}/test_util/never.rs | 128 +- .../src}/test_util/replay.rs | 17 +- .../src}/test_util/wire.rs | 235 ++-- .../test-data/example.com.json | 0 .../aws-smithy-http-client/tests/openssl.cnf | 23 + .../tests/regen-certificates.sh | 72 + .../aws-smithy-http-client/tests/server.pem | 80 ++ .../aws-smithy-http-client/tests/server.rsa | 28 + .../tests/smoke_test_clients.rs | 78 +- .../aws-smithy-http-client/tests/tls.rs | 268 ++++ .../aws-smithy-http-server-python/Cargo.toml | 22 +- .../aws-smithy-http-server/Cargo.toml | 24 +- rust-runtime/aws-smithy-http/Cargo.toml | 20 +- rust-runtime/aws-smithy-http/src/endpoint.rs | 26 +- rust-runtime/aws-smithy-json/Cargo.toml | 2 +- .../aws-smithy-observability/Cargo.toml | 4 +- .../aws-smithy-protocol-test/Cargo.toml | 6 +- .../aws-smithy-runtime-api/Cargo.toml | 12 +- .../src/client/behavior_version.rs | 31 +- .../src/client/connection.rs | 78 +- .../src/http/headers.rs | 36 + rust-runtime/aws-smithy-runtime/Cargo.toml | 61 +- rust-runtime/aws-smithy-runtime/additional-ci | 3 +- .../aws-smithy-runtime/external-types.toml | 5 + rust-runtime/aws-smithy-runtime/src/client.rs | 2 +- .../aws-smithy-runtime/src/client/defaults.rs | 48 +- .../aws-smithy-runtime/src/client/endpoint.rs | 4 + .../aws-smithy-runtime/src/client/http.rs | 79 +- .../http/body/content_length_enforcement.rs | 2 +- .../src/client/http/connection_poisoning.rs | 78 +- .../src/client/orchestrator.rs | 6 +- .../src/client/orchestrator/auth.rs | 2 +- .../src/client/orchestrator/operation.rs | 16 +- .../src/client/retries/strategy/standard.rs | 20 +- .../src/client/retries/token_bucket.rs | 2 +- .../aws-smithy-runtime/src/client/waiters.rs | 4 +- rust-runtime/aws-smithy-runtime/src/lib.rs | 10 +- .../tests/reconnect_on_transient_error.rs | 6 +- .../tests/stalled_stream_common.rs | 5 +- .../tests/stalled_stream_download.rs | 5 +- .../tests/stalled_stream_performance.rs | 5 +- .../tests/stalled_stream_upload.rs | 5 +- .../aws-smithy-types-convert/Cargo.toml | 4 +- rust-runtime/aws-smithy-types/Cargo.toml | 20 +- .../src/body/http_body_0_4_x.rs | 1 + .../src/byte_stream/http_body_0_4_x.rs | 1 + rust-runtime/aws-smithy-wasm/Cargo.toml | 4 +- rust-runtime/inlineable/Cargo.toml | 16 +- tools/ci-build/Dockerfile | 2 +- .../runtime-versioner/src/command/patch.rs | 57 + .../ci-build/sdk-lints/src/lint_cargo_toml.rs | 12 +- tools/ci-resources/tls-stub/Cargo.toml | 10 +- tools/ci-resources/tls-stub/src/main.rs | 82 +- tools/ci-scripts/check-aws-config | 4 +- tools/ci-scripts/check-aws-sdk-cargo-deny | 1 + tools/ci-scripts/check-rust-runtimes | 6 +- tools/ci-scripts/test-windows.sh | 6 +- 218 files changed, 6142 insertions(+), 3337 deletions(-) create mode 100644 .changelog/1741027916.md delete mode 100644 rust-runtime/aws-smithy-experimental/examples/client-aws-lc.rs delete mode 100644 rust-runtime/aws-smithy-experimental/examples/client-ring.rs delete mode 100644 rust-runtime/aws-smithy-experimental/external-types.toml delete mode 100644 rust-runtime/aws-smithy-experimental/src/hyper_1_0.rs create mode 100644 rust-runtime/aws-smithy-http-client/Cargo.toml create mode 100644 rust-runtime/aws-smithy-http-client/LICENSE create mode 100644 rust-runtime/aws-smithy-http-client/README.md create mode 100644 rust-runtime/aws-smithy-http-client/examples/client-aws-lc.rs create mode 100644 rust-runtime/aws-smithy-http-client/examples/client-ring.rs create mode 100644 rust-runtime/aws-smithy-http-client/examples/client-s2n-tls.rs rename rust-runtime/{aws-smithy-experimental => aws-smithy-http-client}/examples/custom-dns.rs (73%) create mode 100644 rust-runtime/aws-smithy-http-client/external-types.toml create mode 100644 rust-runtime/aws-smithy-http-client/src/client.rs create mode 100644 rust-runtime/aws-smithy-http-client/src/client/dns.rs create mode 100644 rust-runtime/aws-smithy-http-client/src/client/timeout.rs create mode 100644 rust-runtime/aws-smithy-http-client/src/client/tls.rs create mode 100644 rust-runtime/aws-smithy-http-client/src/error.rs rename rust-runtime/{aws-smithy-runtime/src/client/http/hyper_014.rs => aws-smithy-http-client/src/hyper_legacy.rs} (97%) create mode 100644 rust-runtime/aws-smithy-http-client/src/lib.rs rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util.rs (82%) create mode 100644 rust-runtime/aws-smithy-http-client/src/test_util/body.rs rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/capture_request.rs (60%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/dvr.rs (90%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/dvr/record.rs (95%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/dvr/replay.rs (92%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/infallible.rs (78%) create mode 100644 rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/never.rs (54%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/replay.rs (95%) rename rust-runtime/{aws-smithy-runtime/src/client/http => aws-smithy-http-client/src}/test_util/wire.rs (53%) rename rust-runtime/{aws-smithy-runtime => aws-smithy-http-client}/test-data/example.com.json (100%) create mode 100644 rust-runtime/aws-smithy-http-client/tests/openssl.cnf create mode 100755 rust-runtime/aws-smithy-http-client/tests/regen-certificates.sh create mode 100644 rust-runtime/aws-smithy-http-client/tests/server.pem create mode 100644 rust-runtime/aws-smithy-http-client/tests/server.rsa rename rust-runtime/{aws-smithy-experimental => aws-smithy-http-client}/tests/smoke_test_clients.rs (58%) create mode 100644 rust-runtime/aws-smithy-http-client/tests/tls.rs diff --git a/.changelog/1741027916.md b/.changelog/1741027916.md new file mode 100644 index 000000000..05ab4a7d6 --- /dev/null +++ b/.changelog/1741027916.md @@ -0,0 +1,15 @@ +--- +applies_to: +- aws-sdk-rust +- client +authors: +- aajtodd +references: +- aws-sdk-rust#977 +- smithy-rs#1925 +- smithy-rs#3710 +breaking: false +new_feature: false +bug_fix: false +--- +Updates the default HTTP client to be based on the 1.x version of hyper and updates the default TLS provider to [rustls](https://github.com/rustls/rustls) with [aws-lc](https://github.com/aws/aws-lc-rs). For more information see the GitHub [discussion](https://github.com/awslabs/aws-sdk-rust/discussions/1257). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6ba23718..3575666f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -241,35 +241,35 @@ jobs: name: Exotic platform support runs-on: ubuntu-latest timeout-minutes: 10 + env: + CROSS_CONFIG: Cross.toml strategy: fail-fast: false + # We always exclude `aws-smithy-http-server-python`, `aws-smithy-http-server-typescript`, and `aws-smithy-experimental` since they are experimental. + # We exclude `aws-smithy-http-client` due to FIPS related feature flags and aws-lc-fips target support matrix: include: - # We always exclude `aws-smithy-http-server-python` and - # `aws-smithy-http-server-typescript` since they are experimental. - target: i686-unknown-linux-gnu build_smithy_rs_features: --all-features build_aws_exclude: '' - build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental + build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client test_smithy_rs_features: --all-features test_aws_exclude: '' - test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental + test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client - target: powerpc-unknown-linux-gnu build_smithy_rs_features: '' build_aws_exclude: --exclude aws-inlineable - build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental + build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client test_smithy_rs_features: '' test_aws_exclude: --exclude aws-inlineable - test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript + test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client - target: powerpc64-unknown-linux-gnu build_smithy_rs_features: '' build_aws_exclude: --exclude aws-inlineable - build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental + build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client test_smithy_rs_features: '' test_aws_exclude: --exclude aws-inlineable - test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental - env: - CROSS_CONFIG: Cross.toml + test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript --exclude aws-smithy-experimental --exclude aws-smithy-http-client steps: - name: Checkout uses: actions/checkout@v4 diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 6902fcea4..0bdd36dc4 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -63,15 +63,21 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -80,7 +86,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-credential-types" -version = "1.2.1" +version = "1.2.2" dependencies = [ "async-trait", "aws-smithy-async", @@ -138,7 +144,7 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.5.5" +version = "1.5.6" dependencies = [ "arbitrary", "aws-credential-types", @@ -184,7 +190,7 @@ version = "0.60.3" [[package]] name = "aws-sigv4" -version = "1.2.9" +version = "1.3.0" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -219,7 +225,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.5" dependencies = [ "futures-util", "pin-project-lite", @@ -228,7 +234,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.63.0" +version = "0.63.1" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -248,7 +254,7 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" -version = "0.60.6" +version = "0.60.7" dependencies = [ "aws-smithy-types", "bytes", @@ -257,7 +263,7 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.12" +version = "0.62.0" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -265,6 +271,7 @@ dependencies = [ "bytes-utils", "futures-core", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "once_cell", "percent-encoding", @@ -273,9 +280,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "aws-smithy-http-client" +version = "1.0.0" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "h2 0.4.8", + "http 0.2.12", + "http-body 0.4.6", + "hyper", + "hyper-rustls", + "pin-project-lite", + "rustls", + "tokio", + "tracing", +] + [[package]] name = "aws-smithy-protocol-test" -version = "0.63.0" +version = "0.63.1" dependencies = [ "assert-json-diff", "aws-smithy-runtime-api", @@ -292,32 +317,29 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.8" +version = "1.8.0" dependencies = [ "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", - "h2", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", - "httparse", - "hyper", - "hyper-rustls", "once_cell", "pin-project-lite", "pin-utils", - "rustls", "tokio", "tracing", ] [[package]] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.7.4" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -332,7 +354,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.13" +version = "1.3.0" dependencies = [ "base64-simd", "bytes", @@ -356,7 +378,7 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.5" +version = "1.3.6" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -432,9 +454,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -468,9 +490,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-utils" @@ -509,9 +531,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] @@ -524,9 +546,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "num-traits", ] @@ -560,18 +582,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstyle", "clap_lex", @@ -814,7 +836,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -831,9 +853,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -1028,6 +1050,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -1051,9 +1092,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" [[package]] name = "hex" @@ -1134,9 +1175,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1154,7 +1195,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -1300,7 +1341,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1336,9 +1377,9 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi", "libc", @@ -1356,9 +1397,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" @@ -1378,21 +1419,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -1406,9 +1447,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lru" @@ -1452,9 +1493,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -1715,9 +1756,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -1750,9 +1791,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -1818,9 +1859,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ "bitflags", ] @@ -1888,9 +1929,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", @@ -1926,9 +1967,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" dependencies = [ "bitflags", "errno", @@ -1982,9 +2023,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rusty-fork" @@ -2000,9 +2041,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2077,9 +2118,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "separator" @@ -2089,29 +2130,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -2235,9 +2276,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -2252,14 +2293,14 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "tempfile" -version = "3.17.1" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand", @@ -2286,7 +2327,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2301,9 +2342,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "num-conv", @@ -2315,15 +2356,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -2351,9 +2392,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -2390,7 +2431,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2441,7 +2482,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2501,7 +2542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2524,9 +2565,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-segmentation" @@ -2565,9 +2606,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" [[package]] name = "valuable" @@ -2652,7 +2693,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-shared", ] @@ -2674,7 +2715,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2870,7 +2911,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -2892,27 +2933,27 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -2941,5 +2982,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] diff --git a/aws/rust-runtime/aws-config/Cargo.lock b/aws/rust-runtime/aws-config/Cargo.lock index 865c24fad..1b3f394fa 100644 --- a/aws/rust-runtime/aws-config/Cargo.lock +++ b/aws/rust-runtime/aws-config/Cargo.lock @@ -37,6 +37,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -45,7 +51,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.18" +version = "1.6.0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -54,6 +60,7 @@ dependencies = [ "aws-sdk-sts", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-runtime", "aws-smithy-runtime-api", @@ -63,8 +70,7 @@ dependencies = [ "fastrand", "futures-util", "hex", - "http 0.2.12", - "hyper-rustls", + "http 1.2.0", "ring", "serde", "serde_json", @@ -79,7 +85,7 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.1" +version = "1.2.2" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -87,9 +93,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "aws-lc-rs" +version = "1.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4e8200b9a4a5801a769d50eeabc05670fec7e959a8cb7a63a93e4e519942ae" +dependencies = [ + "aws-lc-sys", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "paste", +] + [[package]] name = "aws-runtime" -version = "1.5.5" +version = "1.5.6" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -174,7 +205,7 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.8" +version = "1.3.0" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -195,7 +226,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.5" dependencies = [ "futures-util", "pin-project-lite", @@ -204,7 +235,7 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.12" +version = "0.62.0" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -212,6 +243,7 @@ dependencies = [ "bytes-utils", "futures-core", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "once_cell", "percent-encoding", @@ -220,16 +252,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "aws-smithy-http-client" +version = "1.0.0" +dependencies = [ + "aws-smithy-async", + "aws-smithy-protocol-test", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "h2 0.4.8", + "http 0.2.12", + "http 1.2.0", + "http-body 0.4.6", + "http-body 1.0.1", + "hyper 0.14.32", + "hyper 1.6.0", + "hyper-rustls", + "hyper-util", + "indexmap", + "pin-project-lite", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "serde", + "serde_json", + "tokio", + "tower", + "tracing", +] + [[package]] name = "aws-smithy-json" -version = "0.61.2" +version = "0.61.3" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-protocol-test" -version = "0.63.0" +version = "0.63.1" dependencies = [ "assert-json-diff", "aws-smithy-runtime-api", @@ -254,29 +316,22 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.8" +version = "1.8.0" dependencies = [ "aws-smithy-async", "aws-smithy-http", - "aws-smithy-protocol-test", + "aws-smithy-http-client", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", - "h2", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", - "httparse", - "hyper", - "hyper-rustls", - "indexmap", "once_cell", "pin-project-lite", "pin-utils", - "rustls", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -284,7 +339,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.7.4" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -299,7 +354,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.13" +version = "1.3.0" dependencies = [ "base64-simd", "bytes", @@ -327,7 +382,7 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.5" +version = "1.3.6" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -352,12 +407,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64-simd" version = "0.8.0" @@ -368,11 +417,34 @@ dependencies = [ "vsimd", ] +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.99", + "which", +] + [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -394,9 +466,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-utils" @@ -429,13 +501,24 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -444,9 +527,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "num-traits", ] @@ -478,11 +561,31 @@ dependencies = [ "half", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" dependencies = [ "core-foundation-sys", "libc", @@ -559,14 +662,20 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "equivalent" @@ -574,6 +683,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "extend" version = "0.1.2" @@ -607,6 +726,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures-channel" version = "0.3.31" @@ -673,6 +798,12 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "h2" version = "0.3.26" @@ -692,6 +823,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -723,6 +873,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "http" version = "0.2.12" @@ -781,9 +940,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -801,7 +960,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -815,21 +974,61 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.8", + "http 1.2.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 0.2.12", - "hyper", - "log", + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", "rustls", "rustls-native-certs", + "rustls-pki-types", "tokio", "tokio-rustls", - "webpki-roots", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.6.0", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -947,7 +1146,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -982,11 +1181,29 @@ dependencies = [ "serde", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] [[package]] name = "lazy_static" @@ -994,17 +1211,39 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -1018,9 +1257,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "matchers" @@ -1045,9 +1284,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -1184,6 +1423,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1218,6 +1463,16 @@ dependencies = [ "yansi", ] +[[package]] +name = "prettyplease" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" +dependencies = [ + "proc-macro2", + "syn 2.0.99", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1244,27 +1499,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ "bitflags", ] @@ -1321,9 +1576,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.9" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", @@ -1348,6 +1603,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.1" @@ -1357,54 +1618,68 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ - "log", - "ring", + "aws-lc-rs", + "once_cell", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-pki-types" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ + "aws-lc-rs", "ring", + "rustls-pki-types", "untrusted", ] [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" @@ -1421,21 +1696,11 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "security-framework" -version = "2.11.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags", "core-foundation", @@ -1456,9 +1721,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "separator" @@ -1468,29 +1733,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "indexmap", "itoa", @@ -1584,9 +1849,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -1601,7 +1866,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1621,7 +1886,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1636,9 +1901,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "num-conv", @@ -1650,15 +1915,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -1676,9 +1941,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1715,14 +1980,14 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", "tokio", @@ -1741,6 +2006,22 @@ dependencies = [ "tokio", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -1766,7 +2047,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1839,7 +2120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1856,9 +2137,9 @@ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "untrusted" @@ -1897,9 +2178,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" [[package]] name = "valuable" @@ -1935,10 +2216,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "webpki-roots" -version = "0.25.4" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] [[package]] name = "winapi" @@ -2088,28 +2375,28 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -2138,5 +2425,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] diff --git a/aws/rust-runtime/aws-config/Cargo.toml b/aws/rust-runtime/aws-config/Cargo.toml index 2fda830ae..d3e2a4a06 100644 --- a/aws/rust-runtime/aws-config/Cargo.toml +++ b/aws/rust-runtime/aws-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-config" -version = "1.5.18" +version = "1.6.0" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", @@ -13,11 +13,16 @@ repository = "https://github.com/smithy-lang/smithy-rs" [features] behavior-version-latest = [] -client-hyper = ["aws-smithy-runtime/connector-hyper-0-14-x"] credentials-process = ["tokio/process"] -default = ["client-hyper", "rustls", "rt-tokio", "credentials-process", "sso"] +default = ["default-https-client", "rt-tokio", "credentials-process", "sso"] rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/rt"] -rustls = ["aws-smithy-runtime/tls-rustls", "client-hyper"] +# NOTE: `client-hyper` and `rustls` were proxies for enabling the default HTTP client plugin of `aws-smithy-runtime` +# there is no direct usage otherwise on hyper or rustls in this crate. These are superceded by the more appropriately +# named `default-https-client` feature and `client-hyper` and `rustls` are now synonyms for the same +# TODO(hyper1) - deprecate legacy `client-hyper` and `rustls` features when available in cargo: https://github.com/rust-lang/cargo/issues/7130 +client-hyper = ["aws-smithy-runtime/default-https-client"] +rustls = ["client-hyper"] +default-https-client = ["aws-smithy-runtime/default-https-client"] sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:ring", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"] test-util = ["aws-runtime/test-util"] @@ -36,7 +41,7 @@ aws-smithy-runtime-api = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtim aws-smithy-types = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-types" } aws-types = { path = "../../sdk/build/aws-sdk/sdk/aws-types" } bytes = "1.1.0" -http = "0.2.4" +http = "1" time = { version = "0.3.4", features = ["parsing"] } tokio = { version = "1.13.1", features = ["sync"] } tracing = { version = "0.1" } @@ -55,7 +60,9 @@ zeroize = { version = "1", optional = true } aws-sdk-ssooidc = { path = "../../sdk/build/aws-sdk/sdk/ssooidc", default-features = false, optional = true } [dev-dependencies] -aws-smithy-runtime = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x", "test-util"] } +aws-smithy-async = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-async", features = ["rt-tokio", "test-util"] } +aws-smithy-runtime = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-http-client = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http-client", features = ["default-client", "test-util"] } aws-smithy-runtime-api = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["test-util"] } futures-util = { version = "0.3.29", default-features = false } tracing-test = "0.2.4" @@ -66,11 +73,6 @@ tokio = { version = "1.23.1", features = ["full", "test-util"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -# used for a usage example -hyper-rustls = { version = "0.24", features = ["webpki-tokio", "http2", "http1"] } -aws-smithy-async = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-async", features = ["rt-tokio", "test-util"] } - - [package.metadata.docs.rs] all-features = true targets = ["x86_64-unknown-linux-gnu"] @@ -83,3 +85,7 @@ rustdoc-args = ["--cfg", "docsrs"] # Crate("aws-config", STABLE_VERSION_PROP_NAME), [package.metadata.smithy-rs-release-tooling] stable = true + +# FIXME - workaround minimal-versions check issue with proc-macro < 1.0.60 +[package.metadata.cargo-udeps.ignore] +normal = ["proc-macro2"] diff --git a/aws/rust-runtime/aws-config/src/default_provider/credentials.rs b/aws/rust-runtime/aws-config/src/default_provider/credentials.rs index db676fe43..65457d705 100644 --- a/aws/rust-runtime/aws-config/src/default_provider/credentials.rs +++ b/aws/rust-runtime/aws-config/src/default_provider/credentials.rs @@ -14,7 +14,7 @@ use crate::meta::credentials::CredentialsProviderChain; use crate::meta::region::ProvideRegion; use crate::provider_config::ProviderConfig; -#[cfg(feature = "rustls")] +#[cfg(any(feature = "default-https-client", feature = "rustls"))] /// Default Credentials Provider chain /// /// The region from the default region provider will be used @@ -170,7 +170,7 @@ impl Builder { /// Creates a `DefaultCredentialsChain` /// /// ## Panics - /// This function will panic if no connector has been set or the `rustls` + /// This function will panic if no connector has been set or the `default-https-client` /// feature has been disabled. pub async fn build(self) -> DefaultCredentialsChain { let region = match self.region_override { @@ -347,17 +347,15 @@ mod test { } #[tokio::test] - #[cfg(feature = "client-hyper")] async fn no_providers_configured_err() { use crate::provider_config::ProviderConfig; use aws_credential_types::provider::error::CredentialsError; use aws_smithy_async::rt::sleep::TokioSleep; - use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; - use aws_smithy_runtime::client::http::test_util::NeverTcpConnector; + use aws_smithy_http_client::test_util::NeverTcpConnector; tokio::time::pause(); let conf = ProviderConfig::no_configuration() - .with_http_client(HyperClientBuilder::new().build(NeverTcpConnector::new())) + .with_http_client(NeverTcpConnector::new().into_client()) .with_time_source(StaticTimeSource::new(UNIX_EPOCH)) .with_sleep_impl(TokioSleep::new()); let provider = DefaultCredentialsChain::builder() diff --git a/aws/rust-runtime/aws-config/src/ecs.rs b/aws/rust-runtime/aws-config/src/ecs.rs index 8887b7fa0..9edc93fcb 100644 --- a/aws/rust-runtime/aws-config/src/ecs.rs +++ b/aws/rust-runtime/aws-config/src/ecs.rs @@ -58,7 +58,7 @@ use crate::http_credential_provider::HttpCredentialProvider; use crate::provider_config::ProviderConfig; use aws_credential_types::provider::{self, error::CredentialsError, future, ProvideCredentials}; -use aws_smithy_runtime::client::endpoint::apply_endpoint; +use aws_smithy_http::endpoint::apply_endpoint; use aws_smithy_runtime_api::client::dns::{ResolveDns, ResolveDnsError, SharedDnsResolver}; use aws_smithy_runtime_api::client::http::HttpConnectorSettings; use aws_smithy_runtime_api::shared::IntoShared; @@ -501,7 +501,7 @@ mod test { use aws_credential_types::Credentials; use aws_smithy_async::future::never::Never; use aws_smithy_async::rt::sleep::TokioSleep; - use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_runtime_api::client::dns::DnsFuture; use aws_smithy_runtime_api::client::http::HttpClient; use aws_smithy_runtime_api::shared::IntoShared; diff --git a/aws/rust-runtime/aws-config/src/http_credential_provider.rs b/aws/rust-runtime/aws-config/src/http_credential_provider.rs index 41911e16f..240b439f4 100644 --- a/aws/rust-runtime/aws-config/src/http_credential_provider.rs +++ b/aws/rust-runtime/aws-config/src/http_credential_provider.rs @@ -220,7 +220,7 @@ impl ClassifyRetry for HttpCredentialRetryClassifier { mod test { use super::*; use aws_credential_types::provider::error::CredentialsError; - use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; use http::{Request, Response, Uri}; use std::time::SystemTime; diff --git a/aws/rust-runtime/aws-config/src/imds/client.rs b/aws/rust-runtime/aws-config/src/imds/client.rs index 3f23cfdc9..00abaa374 100644 --- a/aws/rust-runtime/aws-config/src/imds/client.rs +++ b/aws/rust-runtime/aws-config/src/imds/client.rs @@ -638,9 +638,7 @@ pub(crate) mod test { use crate::provider_config::ProviderConfig; use aws_smithy_async::rt::sleep::TokioSleep; use aws_smithy_async::test_util::{instant_time_and_sleep, InstantSleep}; - use aws_smithy_runtime::client::http::test_util::{ - capture_request, ReplayEvent, StaticReplayClient, - }; + use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::client::interceptors::context::{ Input, InterceptorContext, Output, @@ -1104,7 +1102,7 @@ pub(crate) mod test { #[cfg_attr(windows, ignore)] /// Verify that the end-to-end real client has a 1-second connect timeout #[tokio::test] - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] async fn one_second_connect_timeout() { use crate::imds::client::ImdsError; let client = Client::builder() diff --git a/aws/rust-runtime/aws-config/src/imds/credentials.rs b/aws/rust-runtime/aws-config/src/imds/credentials.rs index 888237d1a..220a0f11a 100644 --- a/aws/rust-runtime/aws-config/src/imds/credentials.rs +++ b/aws/rust-runtime/aws-config/src/imds/credentials.rs @@ -208,12 +208,12 @@ impl ImdsCredentialsProvider { async fn retrieve_credentials(&self) -> provider::Result { if self.imds_disabled() { - tracing::debug!( - "IMDS disabled because AWS_EC2_METADATA_DISABLED env var was set to `true`" + let err = format!( + "IMDS disabled by {} env var set to `true`", + super::env::EC2_METADATA_DISABLED ); - return Err(CredentialsError::not_loaded( - "IMDS disabled by AWS_ECS_METADATA_DISABLED env var", - )); + tracing::debug!(err); + return Err(CredentialsError::not_loaded(err)); } tracing::debug!("loading credentials from IMDS"); let profile: Cow<'_, str> = match &self.profile { @@ -289,7 +289,7 @@ mod test { use crate::provider_config::ProviderConfig; use aws_credential_types::provider::ProvideCredentials; use aws_smithy_async::test_util::instant_time_and_sleep; - use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; use std::time::{Duration, UNIX_EPOCH}; use tracing_test::traced_test; @@ -322,6 +322,7 @@ mod test { ]); let client = ImdsCredentialsProvider::builder() .imds_client(make_imds_client(&http_client)) + .configure(&ProviderConfig::no_configuration()) .build(); let creds1 = client.provide_credentials().await.expect("valid creds"); let creds2 = client.provide_credentials().await.expect("valid creds"); @@ -417,7 +418,7 @@ mod test { } #[tokio::test] - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] async fn read_timeout_during_credentials_refresh_should_yield_last_retrieved_credentials() { let client = crate::imds::Client::builder() // 240.* can never be resolved @@ -435,7 +436,7 @@ mod test { } #[tokio::test] - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] async fn read_timeout_during_credentials_refresh_should_error_without_last_retrieved_credentials( ) { let client = crate::imds::Client::builder() @@ -457,7 +458,7 @@ mod test { // TODO(https://github.com/awslabs/aws-sdk-rust/issues/1117) This test is ignored on Windows because it uses Unix-style paths #[cfg_attr(windows, ignore)] #[tokio::test] - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] async fn external_timeout_during_credentials_refresh_should_yield_last_retrieved_credentials() { use aws_smithy_async::rt::sleep::AsyncSleep; let client = crate::imds::Client::builder() @@ -468,6 +469,7 @@ mod test { let expected = aws_credential_types::Credentials::for_tests(); let provider = ImdsCredentialsProvider::builder() .imds_client(client) + .configure(&ProviderConfig::no_configuration()) // seed fallback credentials for testing .last_retrieved_credentials(expected.clone()) .build(); @@ -515,6 +517,7 @@ mod test { ]); let provider = ImdsCredentialsProvider::builder() .imds_client(make_imds_client(&http_client)) + .configure(&ProviderConfig::no_configuration()) .build(); let creds1 = provider.provide_credentials().await.expect("valid creds"); assert_eq!(creds1.access_key_id(), "ASIARTEST"); diff --git a/aws/rust-runtime/aws-config/src/imds/region.rs b/aws/rust-runtime/aws-config/src/imds/region.rs index c837438a6..d8da43ed2 100644 --- a/aws/rust-runtime/aws-config/src/imds/region.rs +++ b/aws/rust-runtime/aws-config/src/imds/region.rs @@ -120,7 +120,7 @@ mod test { use crate::imds::region::ImdsRegionProvider; use crate::provider_config::ProviderConfig; use aws_smithy_async::rt::sleep::TokioSleep; - use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; use aws_types::region::Region; use tracing_test::traced_test; diff --git a/aws/rust-runtime/aws-config/src/lib.rs b/aws/rust-runtime/aws-config/src/lib.rs index 28da7ba8b..0548c1598 100644 --- a/aws/rust-runtime/aws-config/src/lib.rs +++ b/aws/rust-runtime/aws-config/src/lib.rs @@ -396,31 +396,6 @@ mod loader { /// /// If you wish to use a separate HTTP client for credentials providers when creating clients, /// then override the HTTP client set with this function on the client-specific `Config`s. - /// - /// ## Examples - /// - /// ```no_run - /// # use aws_smithy_async::rt::sleep::SharedAsyncSleep; - /// #[cfg(feature = "client-hyper")] - /// # async fn create_config() { - /// use std::time::Duration; - /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; - /// - /// let tls_connector = hyper_rustls::HttpsConnectorBuilder::new() - /// .with_webpki_roots() - /// // NOTE: setting `https_only()` will not allow this connector to work with IMDS. - /// .https_only() - /// .enable_http1() - /// .enable_http2() - /// .build(); - /// - /// let hyper_client = HyperClientBuilder::new().build(tls_connector); - /// let sdk_config = aws_config::from_env() - /// .http_client(hyper_client) - /// .load() - /// .await; - /// # } - /// ``` pub fn http_client(mut self, http_client: impl HttpClient + 'static) -> Self { self.http_client = Some(http_client.into_shared()); self @@ -946,6 +921,7 @@ mod loader { let identity_cache = match self.identity_cache { None => match self.behavior_version { + #[allow(deprecated)] Some(bv) if bv.is_at_least(BehaviorVersion::v2024_03_28()) => { Some(IdentityCache::lazy().build()) } @@ -1005,7 +981,7 @@ mod loader { use crate::{defaults, ConfigLoader}; use aws_credential_types::provider::ProvideCredentials; use aws_smithy_async::rt::sleep::TokioSleep; - use aws_smithy_runtime::client::http::test_util::{infallible_client_fn, NeverClient}; + use aws_smithy_http_client::test_util::{infallible_client_fn, NeverClient}; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_types::app_name::AppName; use aws_types::origin::Origin; @@ -1215,7 +1191,7 @@ mod loader { ); } - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] #[tokio::test] async fn disable_default_credentials() { let config = defaults(BehaviorVersion::latest()) @@ -1225,7 +1201,7 @@ mod loader { assert!(config.credentials_provider().is_none()); } - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] #[tokio::test] async fn identity_cache_defaulted() { let config = defaults(BehaviorVersion::latest()).load().await; @@ -1233,7 +1209,7 @@ mod loader { assert!(config.identity_cache().is_some()); } - #[cfg(feature = "rustls")] + #[cfg(feature = "default-https-client")] #[allow(deprecated)] #[tokio::test] async fn identity_cache_old_behavior_version() { diff --git a/aws/rust-runtime/aws-config/src/meta/credentials/chain.rs b/aws/rust-runtime/aws-config/src/meta/credentials/chain.rs index 17f494986..8c17db85e 100644 --- a/aws/rust-runtime/aws-config/src/meta/credentials/chain.rs +++ b/aws/rust-runtime/aws-config/src/meta/credentials/chain.rs @@ -73,7 +73,7 @@ impl CredentialsProviderChain { } /// Add a fallback to the default provider chain - #[cfg(feature = "rustls")] + #[cfg(any(feature = "default-https-client", feature = "rustls"))] pub async fn or_default_provider(self) -> Self { self.or_else( "DefaultProviderChain", @@ -82,7 +82,7 @@ impl CredentialsProviderChain { } /// Creates a credential provider chain that starts with the default provider - #[cfg(feature = "rustls")] + #[cfg(any(feature = "default-https-client", feature = "rustls"))] pub async fn default_provider() -> Self { Self::first_try( "DefaultProviderChain", diff --git a/aws/rust-runtime/aws-config/src/profile/credentials.rs b/aws/rust-runtime/aws-config/src/profile/credentials.rs index 9f4d352b0..f0e3181ac 100644 --- a/aws/rust-runtime/aws-config/src/profile/credentials.rs +++ b/aws/rust-runtime/aws-config/src/profile/credentials.rs @@ -91,7 +91,7 @@ pub(crate) mod repr; /// future::ProvideCredentials::new(self.load_credentials()) /// } /// } -/// # if cfg!(feature = "rustls") { +/// # if cfg!(feature = "default-https-client") { /// let provider = ProfileFileCredentialsProvider::builder() /// .with_custom_provider("Custom", MyCustomProvider) /// .build(); diff --git a/aws/rust-runtime/aws-config/src/provider_config.rs b/aws/rust-runtime/aws-config/src/provider_config.rs index bf86ae12e..6c23a9666 100644 --- a/aws/rust-runtime/aws-config/src/provider_config.rs +++ b/aws/rust-runtime/aws-config/src/provider_config.rs @@ -128,7 +128,7 @@ impl ProviderConfig { /// /// # Examples /// ```no_run - /// # #[cfg(feature = "rustls")] + /// # #[cfg(feature = "default-https-client")] /// # fn example() { /// use aws_config::provider_config::ProviderConfig; /// use aws_sdk_sts::config::Region; diff --git a/aws/rust-runtime/aws-config/src/sso/token.rs b/aws/rust-runtime/aws-config/src/sso/token.rs index 0cf6f0572..51cc2bd12 100644 --- a/aws/rust-runtime/aws-config/src/sso/token.rs +++ b/aws/rust-runtime/aws-config/src/sso/token.rs @@ -406,10 +406,9 @@ mod tests { use aws_smithy_async::rt::sleep::TokioSleep; use aws_smithy_async::test_util::instant_time_and_sleep; use aws_smithy_async::time::{StaticTimeSource, TimeSource}; - use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; + use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_runtime::{ - assert_str_contains, - client::http::test_util::{capture_request, ReplayEvent, StaticReplayClient}, + assert_str_contains, test_util::capture_test_logs::capture_test_logs, }; use aws_smithy_runtime_api::client::http::HttpClient; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; diff --git a/aws/rust-runtime/aws-config/src/sts/assume_role.rs b/aws/rust-runtime/aws-config/src/sts/assume_role.rs index 11b85d2ab..515de8dec 100644 --- a/aws/rust-runtime/aws-config/src/sts/assume_role.rs +++ b/aws/rust-runtime/aws-config/src/sts/assume_role.rs @@ -335,9 +335,7 @@ mod test { use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; use aws_smithy_async::test_util::instant_time_and_sleep; use aws_smithy_async::time::StaticTimeSource; - use aws_smithy_runtime::client::http::test_util::{ - capture_request, ReplayEvent, StaticReplayClient, - }; + use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; use aws_smithy_types::body::SdkBody; diff --git a/aws/rust-runtime/aws-config/src/test_case.rs b/aws/rust-runtime/aws-config/src/test_case.rs index 4076094e6..54d121feb 100644 --- a/aws/rust-runtime/aws-config/src/test_case.rs +++ b/aws/rust-runtime/aws-config/src/test_case.rs @@ -7,9 +7,7 @@ use crate::default_provider::use_dual_stack::use_dual_stack_provider; use crate::default_provider::use_fips::use_fips_provider; use crate::provider_config::ProviderConfig; use aws_smithy_async::rt::sleep::{AsyncSleep, Sleep, TokioSleep}; -use aws_smithy_runtime::client::http::test_util::dvr::{ - NetworkTraffic, RecordingClient, ReplayingClient, -}; +use aws_smithy_http_client::test_util::dvr::{NetworkTraffic, RecordingClient, ReplayingClient}; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::shared::IntoShared; @@ -320,8 +318,8 @@ where O: for<'a> Deserialize<'a> + Secrets + PartialEq + Debug, E: Error, { + #[cfg(feature = "default-https-client")] #[allow(unused)] - #[cfg(all(feature = "client-hyper", feature = "rustls"))] /// Record a test case from live (remote) HTTPS traffic /// /// The `default_connector()` from the crate will be used @@ -329,11 +327,12 @@ where // swap out the connector generated from `http-traffic.json` for a real connector: use std::error::Error; - let live_connector = aws_smithy_runtime::client::http::hyper_014::default_connector( + let live_connector = aws_smithy_http_client::default_connector( &Default::default(), self.provider_config.sleep_impl(), ) .expect("feature gate on this function makes this always return Some"); + let live_client = RecordingClient::new(live_connector); let config = self .provider_config diff --git a/aws/rust-runtime/aws-credential-types/Cargo.toml b/aws/rust-runtime/aws-credential-types/Cargo.toml index d0b53f7d9..1cb3b408d 100644 --- a/aws/rust-runtime/aws-credential-types/Cargo.toml +++ b/aws/rust-runtime/aws-credential-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-credential-types" -version = "1.2.1" +version = "1.2.2" authors = ["AWS Rust SDK Team "] description = "Types for AWS SDK credentials." edition = "2021" @@ -15,7 +15,7 @@ test-util = ["aws-smithy-runtime-api/test-util"] aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" } aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client", "http-auth"] } -zeroize = "1" +zeroize = "1.7.0" [dev-dependencies] async-trait = "0.1.74" # used to test compatibility diff --git a/aws/rust-runtime/aws-inlineable/Cargo.toml b/aws/rust-runtime/aws-inlineable/Cargo.toml index 6c1811b72..3ef874ff5 100644 --- a/aws/rust-runtime/aws-inlineable/Cargo.toml +++ b/aws/rust-runtime/aws-inlineable/Cargo.toml @@ -25,19 +25,19 @@ aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" } aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", features = ["client"] } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types", features = ["http-body-0-4-x"] } -bytes = "1" +bytes = "1.10.0" fastrand = "2.3.0" hex = "0.4.3" http = "0.2.9" http-body = "0.4.5" -http-1x = { package = "http", version = "1", optional = true } +http-1x = { package = "http", version = "1.1.0", optional = true } http-body-1x = { package = "http-body", version = "1", optional = true } hmac = "0.12" lru = "0.12.5" ring = "0.17.5" sha2 = "0.10" -tokio = "1.23.1" -tracing = "0.1" +tokio = "1.40.0" +tracing = "0.1.40" url = "2.5.4" [dev-dependencies] diff --git a/aws/rust-runtime/aws-runtime/Cargo.toml b/aws/rust-runtime/aws-runtime/Cargo.toml index 6aa92f9fd..adcb5e4b9 100644 --- a/aws/rust-runtime/aws-runtime/Cargo.toml +++ b/aws/rust-runtime/aws-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-runtime" -version = "1.5.5" +version = "1.5.6" authors = ["AWS Rust SDK Team "] description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly." edition = "2021" @@ -25,17 +25,17 @@ aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", featur aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" } aws-types = { path = "../aws-types" } -bytes = "1.1" +bytes = "1.10.0" fastrand = "2.3.0" -http-02x = { package = "http", version = "0.2.3" } +http-02x = { package = "http", version = "0.2.9" } http-body-04x = { package = "http-body", version = "0.4.5" } http-1x = { package = "http", version = "1.1.0", optional = true } http-body-1x = { package = "http-body", version = "1.0.0", optional = true } -once_cell = "1.18.0" -percent-encoding = "2.1.0" -pin-project-lite = "0.2.9" +once_cell = "1.20.1" +percent-encoding = "2.3.1" +pin-project-lite = "0.2.14" regex-lite = { version = "0.1.5", optional = true } -tracing = "0.1" +tracing = "0.1.40" uuid = { version = "1" } [dev-dependencies] diff --git a/aws/rust-runtime/aws-sigv4/Cargo.toml b/aws/rust-runtime/aws-sigv4/Cargo.toml index 9f82487bd..d01d9c95b 100644 --- a/aws/rust-runtime/aws-sigv4/Cargo.toml +++ b/aws/rust-runtime/aws-sigv4/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-sigv4" -version = "1.2.9" +version = "1.3.0" authors = ["AWS Rust SDK Team ", "David Barsky "] description = "SigV4 signer for HTTP requests and Event Stream messages." edition = "2021" @@ -22,22 +22,22 @@ aws-smithy-eventstream = { path = "../../../rust-runtime/aws-smithy-eventstream" aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" } -bytes = "1" -form_urlencoded = { version = "1.0", optional = true } -hex = "0.4" +bytes = "1.10.0" +form_urlencoded = { version = "1.2.1", optional = true } +hex = "0.4.3" hmac = "0.12" -http0 = { version = "0.2", optional = true, package = "http" } -http = { version = "1", optional = true } -once_cell = "1.8" +http0 = { version = "0.2.9", optional = true, package = "http" } +http = { version = "1.1.0", optional = true } +once_cell = "1.20.1" p256 = { version = "0.11", features = ["ecdsa"], optional = true } -percent-encoding = { version = "2.1", optional = true } +percent-encoding = { version = "2.3.1", optional = true } ring = { version = "0.17.5", optional = true } sha2 = "0.10" crypto-bigint = { version = "0.5.4", optional = true } subtle = { version = "2.5.0", optional = true } time = "0.3.5" -tracing = "0.1" -zeroize = { version = "^1", optional = true } +tracing = "0.1.40" +zeroize = { version = "^1.7.0", optional = true } [dev-dependencies] aws-credential-types = { path = "../aws-credential-types", features = ["test-util", "hardcoded-credentials"] } diff --git a/aws/rust-runtime/aws-types/Cargo.toml b/aws/rust-runtime/aws-types/Cargo.toml index 9f36cad4d..d51b04b10 100644 --- a/aws/rust-runtime/aws-types/Cargo.toml +++ b/aws/rust-runtime/aws-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-types" -version = "1.3.5" +version = "1.3.6" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "Cross-service types for the AWS SDK." edition = "2021" @@ -17,7 +17,7 @@ aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" } aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" } aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", optional = true } aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } -tracing = "0.1" +tracing = "0.1.40" # cargo does not support optional test dependencies, so to completely disable rustls # we need to add the webpki-roots feature here. # https://github.com/rust-lang/cargo/issues/1596 diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsFluentClientDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsFluentClientDecorator.kt index 7deabe37f..3488ca6f5 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsFluentClientDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsFluentClientDecorator.kt @@ -67,7 +67,13 @@ class AwsFluentClientDecorator : ClientCodegenDecorator { rustCrate.withModule(ClientRustModule.client) { AwsFluentClientExtensions(codegenContext, types).render(this) } + + // TODO(hyper1): disable rustls as a default feature in future release + // NOTE: We enable both rustls and default-https-client as default features. This keeps the legacy hyper+rustls + // stack working as is and lets BehaviorVersion control which client you get. In a future release we will + // break this and disable the rustls feature by default (and break old BMV versions w.r.t http client default). rustCrate.mergeFeature(Feature("rustls", default = true, listOf("aws-smithy-runtime/tls-rustls"))) + rustCrate.mergeFeature(Feature("default-https-client", default = true, listOf("aws-smithy-runtime/default-https-client"))) } override fun libRsCustomizations( diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt index 0c3cc189b..233541960 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt @@ -171,7 +171,7 @@ class AwsPresigningDecorator internal constructor( Feature( "http-1x", default = false, - listOf("dep:http-1x", "dep:http-body-1x", "aws-smithy-runtime-api/http-1x"), + listOf("dep:http-body-1x", "aws-smithy-runtime-api/http-1x"), ), ) } diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/IntegrationTestDependencies.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/IntegrationTestDependencies.kt index a9e3bc703..f8a427153 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/IntegrationTestDependencies.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/IntegrationTestDependencies.kt @@ -18,7 +18,8 @@ import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Compani import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.FuturesUtil import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.HdrHistogram import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.Hound -import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.HttpBody +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.Http1x +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.HttpBody1x import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.SerdeJson import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.Smol import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.TempFile @@ -27,7 +28,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Compani import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.TracingAppender import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.TracingSubscriber import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.TracingTest -import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyExperimental +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyHttpClient import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyProtocolTestHelpers import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyRuntime import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyRuntimeApiTestUtil @@ -103,12 +104,14 @@ class IntegrationTestDependencies( addDependency(SerdeJson) addDependency(smithyAsync) addDependency(smithyProtocolTestHelpers(runtimeConfig)) - addDependency(smithyRuntime(runtimeConfig).copy(features = setOf("test-util", "wire-mock"), scope = DependencyScope.Dev)) + addDependency(smithyRuntime(runtimeConfig).copy(features = setOf("test-util"), scope = DependencyScope.Dev)) addDependency(smithyRuntimeApiTestUtil(runtimeConfig)) addDependency(smithyTypes) addDependency(Tokio) addDependency(Tracing.toDevDependency()) addDependency(TracingSubscriber) + addDependency(smithyHttpClient(runtimeConfig).copy(features = setOf("test-util", "wire-mock"), scope = DependencyScope.Dev)) + addDependency(Http1x.toDevDependency()) } if (hasBenches) { addDependency(Criterion) @@ -156,13 +159,13 @@ class S3TestDependencies(private val runtimeConfig: RuntimeConfig) : LibRsCustom override fun section(section: LibRsSection): Writable = writable { addDependency(awsConfig(runtimeConfig).toDevDependency().withFeature("behavior-version-latest")) - addDependency(smithyExperimental(runtimeConfig).toDevDependency()) + addDependency(smithyHttpClient(runtimeConfig).toDevDependency().withFeature("rustls-ring")) addDependency(AsyncStd) addDependency(BytesUtils.toDevDependency()) addDependency(FastRand.toDevDependency()) addDependency(FuturesUtil.toDevDependency()) addDependency(HdrHistogram) - addDependency(HttpBody.toDevDependency()) + addDependency(HttpBody1x.toDevDependency().copy(optional = false)) addDependency(Smol) addDependency(TempFile) addDependency(TracingAppender) diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/apigateway/ApiGatewayDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/apigateway/ApiGatewayDecorator.kt index 7d13d1bf7..fc47ab5f7 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/apigateway/ApiGatewayDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/apigateway/ApiGatewayDecorator.kt @@ -42,6 +42,7 @@ private class ApiGatewayAcceptHeaderInterceptorCustomization(private val codegen additionalDependency = arrayOf( CargoDependency.smithyRuntimeApiClient(codegenContext.runtimeConfig), + CargoDependency.Http1x, ), ), ).resolve("AcceptHeaderInterceptor"), diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/glacier/GlacierDecorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/glacier/GlacierDecorator.kt index 9b4a79172..44e219e03 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/glacier/GlacierDecorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/glacier/GlacierDecorator.kt @@ -158,4 +158,5 @@ private fun glacierInterceptorDependencies(runtimeConfig: RuntimeConfig) = CargoDependency.Ring, CargoDependency.smithyHttp(runtimeConfig), CargoDependency.smithyRuntimeApiClient(runtimeConfig), + CargoDependency.Http1x, ) diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/EndpointBuiltInsDecoratorTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/EndpointBuiltInsDecoratorTest.kt index 61e831791..838aad0f9 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/EndpointBuiltInsDecoratorTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/EndpointBuiltInsDecoratorTest.kt @@ -129,11 +129,11 @@ class EndpointBuiltInsDecoratorTest { """, "tokio" to CargoDependency.Tokio.toDevDependency().withFeature("rt").withFeature("macros").toType(), "StaticReplayClient" to - CargoDependency.smithyRuntimeTestUtil(codegenContext.runtimeConfig).toType() - .resolve("client::http::test_util::StaticReplayClient"), + CargoDependency.smithyHttpClientTestUtil(codegenContext.runtimeConfig).toType() + .resolve("test_util::StaticReplayClient"), "ReplayEvent" to - CargoDependency.smithyRuntimeTestUtil(codegenContext.runtimeConfig).toType() - .resolve("client::http::test_util::ReplayEvent"), + CargoDependency.smithyHttpClientTestUtil(codegenContext.runtimeConfig).toType() + .resolve("test_util::ReplayEvent"), "SdkBody" to RuntimeType.sdkBody(codegenContext.runtimeConfig), ) } diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpChecksumTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpChecksumTest.kt index d6d64f761..7faadf3d3 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpChecksumTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpChecksumTest.kt @@ -167,6 +167,15 @@ internal class HttpChecksumTest { // Note about the `//#{PresigningMarker}` below. The `RequestChecksumInterceptor` relies on the `PresigningMarker` type from // the presigning inlineable. The decorator for that inlineable doesn't play nicely with the test model from the SEP, so we // use this as a kind of blunt way to include the presigning inlineable without actually wiring it up with the model. + // We also have to ensure the `http-1x` feature the presigning inlineable expects is present on the generated crate. + rustCrate.mergeFeature( + Feature( + "http-1x", + default = false, + listOf("dep:http-body-1x", "aws-smithy-runtime-api/http-1x"), + ), + ) + val testBase = writable { rustTemplate( @@ -290,6 +299,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -368,6 +378,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -389,7 +400,7 @@ internal class HttpChecksumTest { ##[::tokio::test] async fn ${algoLower}_response_checksums_works() { let (http_client, _rx) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .header("x-amz-checksum-$algoLower", "${testDef.checksumHeaderValue}") .body(SdkBody::from("${testDef.responsePayload}")) .unwrap(), @@ -414,6 +425,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -435,7 +447,7 @@ internal class HttpChecksumTest { ##[::tokio::test] async fn ${algoLower}_response_checksums_fail_correctly() { let (http_client, _rx) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .header("x-amz-checksum-$algoLower", "${testDef.checksumHeaderValue}") .body(SdkBody::from("${testDef.responsePayload}")) .unwrap(), @@ -476,6 +488,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -537,6 +550,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -613,7 +627,7 @@ internal class HttpChecksumTest { ##[::tokio::test] async fn response_config_ua_supported() { let (http_client, rx) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .header("x-amz-checksum-crc32", "i9aeUg==") .body(SdkBody::from("Hello world")) .unwrap(), @@ -645,7 +659,7 @@ internal class HttpChecksumTest { ##[::tokio::test] async fn response_config_ua_required() { let (http_client, rx) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .header("x-amz-checksum-crc32", "i9aeUg==") .body(SdkBody::from("Hello world")) .unwrap(), @@ -680,6 +694,7 @@ internal class HttpChecksumTest { *preludeScope, "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), + "http_1x" to CargoDependency.Http1x.toType(), ) } } diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpRequestCompressionDecoratorTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpRequestCompressionDecoratorTest.kt index 65f439fe1..52b5215d4 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpRequestCompressionDecoratorTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/HttpRequestCompressionDecoratorTest.kt @@ -135,7 +135,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_compression_isnt_applied_unless_modeled() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -151,7 +151,7 @@ class HttpRequestCompressionDecoratorTest { .await; let request = rx.expect_request(); // Check that the content-encoding header is not set. - assert_eq!(None, request.headers().get(#{http}::header::CONTENT_ENCODING)); + assert_eq!(None, request.headers().get(#{http_1x}::header::CONTENT_ENCODING)); let compressed_body = ByteStream::from(request.into_body()) .collect() @@ -164,7 +164,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_compression_can_be_disabled() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -182,7 +182,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is not set to "gzip" assert_ne!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -196,7 +196,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_min_size_body_over_minimum() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -215,7 +215,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is set to "gzip" assert_eq!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -229,7 +229,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_min_size_body_under_minimum() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -248,7 +248,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is not set to "gzip" assert_ne!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -262,7 +262,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_compression_implicitly_enabled() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -280,7 +280,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is set to "gzip" assert_eq!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -294,7 +294,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_compression_min_size_default() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -312,7 +312,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is not set to "gzip" assert_ne!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -326,7 +326,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_request_compression_streaming_body() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -356,7 +356,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-encoding header is set to "gzip" assert_eq!( Some("gzip"), - request.headers().get(#{http}::header::CONTENT_ENCODING) + request.headers().get(#{http_1x}::header::CONTENT_ENCODING) ); let compressed_body = ByteStream::from(request.into_body()) @@ -376,7 +376,7 @@ class HttpRequestCompressionDecoratorTest { ##[#{tokio}::test] async fn test_compressed_content_length() { - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -395,7 +395,7 @@ class HttpRequestCompressionDecoratorTest { // Check that the content-length header is set correctly. if let Some(content_length) = request .headers() - .get(#{http}::header::CONTENT_LENGTH) + .get(#{http_1x}::header::CONTENT_LENGTH) .and_then(|len| len.parse::().ok()) { assert_ne!( @@ -405,7 +405,7 @@ class HttpRequestCompressionDecoratorTest { assert_eq!(COMPRESSED_OUTPUT.len(), content_length); } - let (http_client, rx) = ::aws_smithy_runtime::client::http::test_util::capture_request(None); + let (http_client, rx) = #{capture_request}(None); let config = $moduleName::Config::builder() .region(Region::from_static("doesntmatter")) .with_test_defaults() @@ -435,7 +435,7 @@ class HttpRequestCompressionDecoratorTest { assert!( request .headers() - .get(#{http}::header::CONTENT_LENGTH) + .get(#{http_1x}::header::CONTENT_LENGTH) .is_none(), "expected that no content length header is set because the request is streaming." ); @@ -445,7 +445,7 @@ class HttpRequestCompressionDecoratorTest { "ByteStream" to RuntimeType.smithyTypes(rc).resolve("byte_stream::ByteStream"), "Blob" to RuntimeType.smithyTypes(rc).resolve("Blob"), "Region" to AwsRuntimeType.awsTypes(rc).resolve("region::Region"), - "http" to CargoDependency.Http.toType(), + "http_1x" to CargoDependency.Http1x.toType(), "tokio" to CargoDependency.Tokio.toType(), "capture_request" to RuntimeType.captureRequest(rc), "pretty_assertions" to CargoDependency.PrettyAssertions.toType(), diff --git a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecoratorTest.kt b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecoratorTest.kt index 3627b4158..88b17a395 100644 --- a/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecoratorTest.kt +++ b/aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/SigV4AuthDecoratorTest.kt @@ -6,6 +6,7 @@ package software.amazon.smithy.rustsdk import org.junit.jupiter.api.Test import software.amazon.smithy.rust.codegen.core.rustlang.Attribute +import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel @@ -162,11 +163,11 @@ class SigV4AuthDecoratorTest { "ByteStream" to RuntimeType.byteStream(rc), "Credentials" to AwsRuntimeType.awsCredentialTypesTestUtil(rc).resolve("Credentials"), "Region" to AwsRuntimeType.awsTypes(rc).resolve("region::Region"), - "ReplayEvent" to RuntimeType.smithyRuntimeTestUtil(rc).resolve("ReplayEvent"), + "ReplayEvent" to CargoDependency.smithyHttpClientTestUtil(rc).toType().resolve("test_util::ReplayEvent"), "Request" to RuntimeType.HttpRequest, "Response" to RuntimeType.HttpResponse, "SdkBody" to RuntimeType.sdkBody(rc), - "StaticReplayClient" to RuntimeType.smithyRuntimeTestUtil(rc).resolve("StaticReplayClient"), + "StaticReplayClient" to CargoDependency.smithyHttpClientTestUtil(rc).toType().resolve("test_util::StaticReplayClient"), "tracing_subscriber" to RuntimeType.TracingSubscriber, ) } diff --git a/aws/sdk/Cargo.lock b/aws/sdk/Cargo.lock index c1952e094..cc6fd09fe 100644 --- a/aws/sdk/Cargo.lock +++ b/aws/sdk/Cargo.lock @@ -303,7 +303,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -314,13 +314,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -337,7 +337,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.18" +version = "1.6.0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -346,6 +346,7 @@ dependencies = [ "aws-sdk-sts", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-runtime", "aws-smithy-runtime-api", @@ -355,8 +356,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "hex", - "http 0.2.12", - "hyper-rustls 0.24.2", + "http 1.2.0", "ring", "serde", "serde_json", @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.1" +version = "1.2.2" dependencies = [ "async-trait", "aws-smithy-async", @@ -413,21 +413,22 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.12.2" +version = "1.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" +checksum = "5e4e8200b9a4a5801a769d50eeabc05670fec7e959a8cb7a63a93e4e519942ae" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", "paste", + "untrusted 0.7.1", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ac4f13dad353b209b34cbec082338202cbc01c8f00336b55c750c13ac91f8f" +checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43" dependencies = [ "bindgen", "cc", @@ -439,7 +440,7 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.5.5" +version = "1.5.6" dependencies = [ "arbitrary", "aws-credential-types", @@ -512,6 +513,7 @@ dependencies = [ "aws-smithy-async", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -522,6 +524,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -539,6 +542,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -549,6 +553,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -589,6 +594,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -600,6 +606,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -617,6 +624,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-query", @@ -628,6 +636,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -669,6 +678,7 @@ dependencies = [ "aws-sigv4", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -679,6 +689,7 @@ dependencies = [ "futures-util", "hex", "http 0.2.12", + "http 1.2.0", "once_cell", "pretty_assertions", "regex-lite", @@ -699,6 +710,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-query", @@ -709,6 +721,7 @@ dependencies = [ "aws-types", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -726,6 +739,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -735,6 +749,7 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -753,6 +768,7 @@ dependencies = [ "aws-smithy-async", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -762,6 +778,7 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -780,6 +797,7 @@ dependencies = [ "aws-sigv4", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -808,6 +826,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -817,6 +836,7 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -834,6 +854,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-runtime", "aws-smithy-runtime-api", @@ -861,8 +882,8 @@ dependencies = [ "aws-smithy-async", "aws-smithy-checksums", "aws-smithy-eventstream", - "aws-smithy-experimental", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -908,6 +929,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -918,6 +940,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "md-5", "once_cell", "proptest", @@ -979,6 +1002,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-query", @@ -989,6 +1013,7 @@ dependencies = [ "aws-types", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -1006,6 +1031,7 @@ dependencies = [ "aws-runtime", "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -1016,6 +1042,7 @@ dependencies = [ "fastrand 2.3.0", "futures-util", "http 0.2.12", + "http 1.2.0", "once_cell", "regex-lite", "serde_json", @@ -1059,6 +1086,7 @@ dependencies = [ "aws-smithy-async", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-json", "aws-smithy-protocol-test", "aws-smithy-runtime", @@ -1070,6 +1098,7 @@ dependencies = [ "futures-util", "hound", "http 0.2.12", + "http 1.2.0", "hyper 0.14.32", "once_cell", "regex-lite", @@ -1085,7 +1114,7 @@ version = "0.60.3" [[package]] name = "aws-sigv4" -version = "1.2.9" +version = "1.3.0" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -1120,7 +1149,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.5" dependencies = [ "futures-util", "pin-project-lite", @@ -1140,7 +1169,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.63.0" +version = "0.63.1" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -1168,7 +1197,7 @@ version = "0.60.3" [[package]] name = "aws-smithy-compression" -version = "0.0.2" +version = "0.0.3" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -1201,28 +1230,11 @@ dependencies = [ [[package]] name = "aws-smithy-experimental" -version = "0.1.5" -dependencies = [ - "aws-smithy-async", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "h2 0.4.8", - "http 1.2.0", - "hyper 1.6.0", - "hyper-rustls 0.27.5", - "hyper-util", - "once_cell", - "pin-project-lite", - "rustls 0.23.23", - "tokio", - "tower", - "tracing", -] +version = "0.2.0" [[package]] name = "aws-smithy-http" -version = "0.61.1" +version = "0.62.0" dependencies = [ "async-stream", "aws-smithy-eventstream", @@ -1233,6 +1245,7 @@ dependencies = [ "futures-core", "futures-util", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "hyper 0.14.32", "once_cell", @@ -1248,13 +1261,50 @@ dependencies = [ name = "aws-smithy-http-auth" version = "0.60.3" +[[package]] +name = "aws-smithy-http-client" +version = "1.0.0" +dependencies = [ + "aws-smithy-async", + "aws-smithy-protocol-test", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "h2 0.4.8", + "http 0.2.12", + "http 1.2.0", + "http-body 0.4.6", + "http-body 1.0.1", + "http-body-util", + "hyper 0.14.32", + "hyper 1.6.0", + "hyper-rustls 0.24.2", + "hyper-rustls 0.27.5", + "hyper-util", + "indexmap", + "pin-project-lite", + "rustls 0.21.12", + "rustls 0.23.23", + "rustls-native-certs 0.8.1", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "s2n-tls", + "s2n-tls-hyper", + "serde", + "serde_json", + "tokio", + "tokio-rustls 0.26.2", + "tower", + "tracing", +] + [[package]] name = "aws-smithy-http-tower" version = "0.60.3" [[package]] name = "aws-smithy-json" -version = "0.61.2" +version = "0.61.3" dependencies = [ "aws-smithy-types", "proptest", @@ -1272,7 +1322,7 @@ dependencies = [ [[package]] name = "aws-smithy-observability" -version = "0.1.0" +version = "0.1.1" dependencies = [ "aws-smithy-runtime-api", "once_cell", @@ -1296,7 +1346,7 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" -version = "0.63.0" +version = "0.63.1" dependencies = [ "assert-json-diff", "aws-smithy-runtime-api", @@ -1321,33 +1371,26 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.8" +version = "1.8.0" dependencies = [ "approx", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-protocol-test", + "aws-smithy-http-client", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand 2.3.0", "futures-util", - "h2 0.3.26", "http 0.2.12", "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", - "httparse", "hyper 0.14.32", - "hyper-rustls 0.24.2", - "indexmap", "once_cell", "pin-project-lite", "pin-utils", "pretty_assertions", - "rustls 0.21.12", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -1356,7 +1399,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.7.4" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -1372,7 +1415,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.13" +version = "1.3.0" dependencies = [ "base64 0.13.1", "base64-simd", @@ -1406,7 +1449,7 @@ dependencies = [ [[package]] name = "aws-smithy-types-convert" -version = "0.60.8" +version = "0.60.9" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -1417,7 +1460,7 @@ dependencies = [ [[package]] name = "aws-smithy-wasm" -version = "0.1.3" +version = "0.1.4" dependencies = [ "aws-smithy-http", "aws-smithy-runtime-api", @@ -1440,7 +1483,7 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.5" +version = "1.3.6" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -1511,7 +1554,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -1524,7 +1567,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.98", + "syn 2.0.99", "which", ] @@ -1551,9 +1594,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -1600,9 +1643,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytes-utils" @@ -1641,9 +1684,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -1667,9 +1710,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "num-traits", ] @@ -1714,18 +1757,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstyle", "clap_lex", @@ -1990,7 +2033,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2018,7 +2061,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2041,9 +2084,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -2158,9 +2201,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -2277,7 +2320,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2463,6 +2506,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hermit-abi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" + [[package]] name = "hex" version = "0.4.3" @@ -2557,9 +2606,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -2604,6 +2653,7 @@ dependencies = [ "http 1.2.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2642,7 +2692,7 @@ dependencies = [ "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.1", + "tokio-rustls 0.26.2", "tower-service", ] @@ -2780,7 +2830,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2837,11 +2887,11 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi 0.5.0", "libc", "windows-sys 0.59.0", ] @@ -2866,9 +2916,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" @@ -2912,9 +2962,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libloading" @@ -2938,11 +2988,17 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -2956,9 +3012,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" dependencies = [ "value-bag", ] @@ -3015,7 +3071,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3026,9 +3082,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -3355,12 +3411,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" dependencies = [ "proc-macro2", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3389,9 +3445,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -3404,7 +3460,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.8.0", + "bitflags 2.9.0", "lazy_static", "num-traits", "rand", @@ -3424,9 +3480,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -3492,11 +3548,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -3562,15 +3618,15 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -3624,13 +3680,26 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] +[[package]] +name = "rustix" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.2", + "windows-sys 0.59.0", +] + [[package]] name = "rustls" version = "0.21.12" @@ -3650,6 +3719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "aws-lc-rs", + "log", "once_cell", "ring", "rustls-pki-types", @@ -3665,7 +3735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework 2.11.1", ] @@ -3691,6 +3761,15 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.11.0" @@ -3704,7 +3783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -3716,14 +3795,14 @@ dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rusty-fork" @@ -3739,9 +3818,60 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "s2n-tls" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca784a7bd2303b31dee13fe5d8617bd27c9e983342b6f07277d7bc07a2f32ea" +dependencies = [ + "errno", + "hex", + "libc", + "pin-project-lite", + "s2n-tls-sys", +] + +[[package]] +name = "s2n-tls-hyper" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de97dea004ba2d03d6f1618f0ee770b4a63e3ba98d1764a0fecd2e520123f9ec" +dependencies = [ + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", + "s2n-tls", + "s2n-tls-tokio", + "tower-service", +] + +[[package]] +name = "s2n-tls-sys" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac0a964de7522dd815253bea5f17e70fd382920ab20c69783ad5294519f4712" +dependencies = [ + "aws-lc-rs", + "cc", + "libc", +] + +[[package]] +name = "s2n-tls-tokio" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef2b3f1b676575bf221cb8fe5c0bb5720736b98957e7dc9d873cd50412cbc7a" +dependencies = [ + "errno", + "libc", + "pin-project-lite", + "s2n-tls", + "tokio", +] [[package]] name = "same-file" @@ -3783,7 +3913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -3812,7 +3942,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3825,7 +3955,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -3844,9 +3974,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "separator" @@ -3856,29 +3986,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "indexmap", "itoa", @@ -3909,7 +4039,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -4061,9 +4191,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -4078,20 +4208,20 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "tempfile" -version = "3.17.1" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand 2.3.0", "getrandom 0.3.1", "once_cell", - "rustix 0.38.44", + "rustix 1.0.0", "windows-sys 0.59.0", ] @@ -4112,7 +4242,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -4127,9 +4257,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "itoa", @@ -4142,15 +4272,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -4178,9 +4308,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -4217,7 +4347,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -4232,9 +4362,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls 0.23.23", "tokio", @@ -4279,13 +4409,12 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -4306,7 +4435,6 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4332,7 +4460,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -4405,7 +4533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -4428,9 +4556,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-segmentation" @@ -4438,6 +4566,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -4475,9 +4609,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" [[package]] name = "valuable" @@ -4583,7 +4717,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-shared", ] @@ -4618,7 +4752,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4845,7 +4979,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b37d270da94012e0ac490ac633ad5bdd76a10a3fb15069edb033c1b771ce931f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -4854,7 +4988,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -4901,7 +5035,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -4923,27 +5057,27 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -4972,5 +5106,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] diff --git a/aws/sdk/benchmarks/previous-release-comparison/Cargo.lock b/aws/sdk/benchmarks/previous-release-comparison/Cargo.lock index f2dedd252..d6bef445d 100644 --- a/aws/sdk/benchmarks/previous-release-comparison/Cargo.lock +++ b/aws/sdk/benchmarks/previous-release-comparison/Cargo.lock @@ -67,6 +67,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -75,25 +81,24 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" -version = "1.5.0" +version = "1.6.0" dependencies = [ - "aws-credential-types 1.2.0", - "aws-runtime 1.2.2", + "aws-credential-types 1.2.1", + "aws-runtime 1.5.0", "aws-sdk-sso", "aws-sdk-ssooidc", "aws-sdk-sts", "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.8", - "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-types 1.3.0", + "aws-smithy-http 0.62.0", + "aws-smithy-json 0.61.1", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-types 1.3.3", "bytes", "fastrand", "hex", - "http 0.2.12", - "hyper", + "http 1.1.0", "ring", "time", "tokio", @@ -105,37 +110,39 @@ dependencies = [ [[package]] name = "aws-credential-types" version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" dependencies = [ - "aws-smithy-async 1.2.1", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", "zeroize", ] [[package]] name = "aws-credential-types" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" +version = "1.2.1" dependencies = [ - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", + "aws-smithy-async 1.2.1", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", "zeroize", ] [[package]] name = "aws-runtime" -version = "1.2.2" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36978815abdd7297662bf906adff132941a02ecf425bc78fac7d90653ce87560" dependencies = [ "aws-credential-types 1.2.0", - "aws-sigv4 1.2.1", - "aws-smithy-async 1.2.1", + "aws-sigv4 1.2.2", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-eventstream 0.60.4", "aws-smithy-http 0.60.8", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-types 1.3.0", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", + "aws-types 1.3.1", "bytes", "fastrand", "http 0.2.12", @@ -148,22 +155,22 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36978815abdd7297662bf906adff132941a02ecf425bc78fac7d90653ce87560" +version = "1.5.0" dependencies = [ - "aws-credential-types 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-sigv4 1.2.2", - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-eventstream 0.60.4 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", - "aws-types 1.3.1", + "aws-credential-types 1.2.1", + "aws-sigv4 1.3.0", + "aws-smithy-async 1.2.1", + "aws-smithy-eventstream 0.60.5", + "aws-smithy-http 0.62.0", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-types 1.3.3", "bytes", "fastrand", "http 0.2.12", "http-body 0.4.6", + "once_cell", "percent-encoding", "pin-project-lite", "tracing", @@ -174,25 +181,25 @@ dependencies = [ name = "aws-sdk-s3" version = "0.0.0-local" dependencies = [ - "ahash", - "aws-credential-types 1.2.0", - "aws-runtime 1.2.2", - "aws-sigv4 1.2.1", + "aws-credential-types 1.2.1", + "aws-runtime 1.5.0", + "aws-sigv4 1.3.0", "aws-smithy-async 1.2.1", - "aws-smithy-checksums 0.60.9", - "aws-smithy-eventstream 0.60.4", - "aws-smithy-http 0.60.8", - "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-smithy-xml 0.60.8", - "aws-types 1.3.0", + "aws-smithy-checksums 0.60.14", + "aws-smithy-eventstream 0.60.5", + "aws-smithy-http 0.62.0", + "aws-smithy-json 0.61.1", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-smithy-xml 0.60.9", + "aws-types 1.3.3", "bytes", "fastrand", "hex", "hmac", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "lru", "once_cell", @@ -210,18 +217,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "724119d8fd2d2638b9979673f3b5c2979fa388c9ca27815e3cb5ad6234fac3f5" dependencies = [ "ahash", - "aws-credential-types 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-credential-types 1.2.0", "aws-runtime 1.2.3", "aws-sigv4 1.2.2", "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-checksums 0.60.9 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-eventstream 0.60.4 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-json 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-checksums 0.60.10", + "aws-smithy-eventstream 0.60.4", + "aws-smithy-http 0.60.8", + "aws-smithy-json 0.60.7", + "aws-smithy-runtime 1.5.5", "aws-smithy-runtime-api 1.7.0", "aws-smithy-types 1.2.0", - "aws-smithy-xml 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-xml 0.60.8", "aws-types 1.3.1", "bytes", "fastrand", @@ -242,15 +249,15 @@ dependencies = [ name = "aws-sdk-sso" version = "0.0.0-local" dependencies = [ - "aws-credential-types 1.2.0", - "aws-runtime 1.2.2", + "aws-credential-types 1.2.1", + "aws-runtime 1.5.0", "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.8", - "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-types 1.3.0", + "aws-smithy-http 0.62.0", + "aws-smithy-json 0.61.1", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-types 1.3.3", "bytes", "http 0.2.12", "once_cell", @@ -262,15 +269,15 @@ dependencies = [ name = "aws-sdk-ssooidc" version = "0.0.0-local" dependencies = [ - "aws-credential-types 1.2.0", - "aws-runtime 1.2.2", + "aws-credential-types 1.2.1", + "aws-runtime 1.5.0", "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.8", - "aws-smithy-json 0.60.7", - "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-types 1.3.0", + "aws-smithy-http 0.62.0", + "aws-smithy-json 0.61.1", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-types 1.3.3", "bytes", "http 0.2.12", "once_cell", @@ -282,17 +289,17 @@ dependencies = [ name = "aws-sdk-sts" version = "0.0.0-local" dependencies = [ - "aws-credential-types 1.2.0", - "aws-runtime 1.2.2", + "aws-credential-types 1.2.1", + "aws-runtime 1.5.0", "aws-smithy-async 1.2.1", - "aws-smithy-http 0.60.8", - "aws-smithy-json 0.60.7", + "aws-smithy-http 0.62.0", + "aws-smithy-json 0.61.1", "aws-smithy-query", - "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", - "aws-smithy-xml 0.60.8", - "aws-types 1.3.0", + "aws-smithy-runtime 1.8.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "aws-smithy-xml 0.60.9", + "aws-types 1.3.3", "http 0.2.12", "once_cell", "regex-lite", @@ -301,13 +308,15 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.1" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31eed8d45759b2c5fe7fd304dd70739060e9e0de509209036eabea14d0720cce" dependencies = [ "aws-credential-types 1.2.0", "aws-smithy-eventstream 0.60.4", "aws-smithy-http 0.60.8", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", "bytes", "crypto-bigint 0.5.5", "form_urlencoded", @@ -328,15 +337,13 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31eed8d45759b2c5fe7fd304dd70739060e9e0de509209036eabea14d0720cce" +version = "1.3.0" dependencies = [ - "aws-credential-types 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-eventstream 0.60.4 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", + "aws-credential-types 1.2.1", + "aws-smithy-eventstream 0.60.5", + "aws-smithy-http 0.62.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", "bytes", "crypto-bigint 0.5.5", "form_urlencoded", @@ -377,10 +384,12 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.9" +version = "0.60.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b30ea96823b8b25fb6471643a516e1bd475fd5575304e6240aea179f213216" dependencies = [ "aws-smithy-http 0.60.8", - "aws-smithy-types 1.1.10", + "aws-smithy-types 1.2.0", "bytes", "crc32c", "crc32fast", @@ -396,12 +405,10 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6242d6a54d3b4b83458f4abd7057ba93c4419dc71e8217e9acd3a748d656d99e" +version = "0.60.14" dependencies = [ - "aws-smithy-http 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.0", + "aws-smithy-http 0.62.0", + "aws-smithy-types 1.3.0", "bytes", "crc32c", "crc32fast", @@ -418,19 +425,19 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" version = "0.60.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" dependencies = [ - "aws-smithy-types 1.1.10", + "aws-smithy-types 1.2.0", "bytes", "crc32fast", ] [[package]] name = "aws-smithy-eventstream" -version = "0.60.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" +version = "0.60.5" dependencies = [ - "aws-smithy-types 1.2.0", + "aws-smithy-types 1.3.0", "bytes", "crc32fast", ] @@ -438,10 +445,12 @@ dependencies = [ [[package]] name = "aws-smithy-http" version = "0.60.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" dependencies = [ "aws-smithy-eventstream 0.60.4", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", "bytes", "bytes-utils", "futures-core", @@ -456,17 +465,16 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" +version = "0.62.0" dependencies = [ - "aws-smithy-eventstream 0.60.4 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", + "aws-smithy-eventstream 0.60.5", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", "bytes", "bytes-utils", "futures-core", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "once_cell", "percent-encoding", @@ -476,10 +484,29 @@ dependencies = [ ] [[package]] -name = "aws-smithy-json" -version = "0.60.7" +name = "aws-smithy-http-client" +version = "1.0.0" dependencies = [ - "aws-smithy-types 1.1.10", + "aws-smithy-async 1.2.1", + "aws-smithy-protocol-test 0.63.0", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", + "bytes", + "h2 0.4.7", + "http 0.2.12", + "http 1.1.0", + "http-body 0.4.6", + "http-body 1.0.0", + "hyper", + "hyper-rustls", + "indexmap", + "once_cell", + "pin-project-lite", + "rustls", + "serde", + "serde_json", + "tokio", + "tracing", ] [[package]] @@ -491,12 +518,21 @@ dependencies = [ "aws-smithy-types 1.2.0", ] +[[package]] +name = "aws-smithy-json" +version = "0.61.1" +dependencies = [ + "aws-smithy-types 1.3.0", +] + [[package]] name = "aws-smithy-protocol-test" version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31e8279cb24640c7349f2bda6ca818d5fcc85129386bd73c1d0999430d6ddf2" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.6.1", + "aws-smithy-runtime-api 1.7.0", "http 0.2.12", "pretty_assertions", "regex-lite", @@ -507,12 +543,13 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" -version = "0.60.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31e8279cb24640c7349f2bda6ca818d5fcc85129386bd73c1d0999430d6ddf2" +version = "0.63.0" dependencies = [ "assert-json-diff", - "aws-smithy-runtime-api 1.7.0", + "aws-smithy-runtime-api 1.7.4", + "base64-simd", + "cbor-diag", + "ciborium", "http 0.2.12", "pretty_assertions", "regex-lite", @@ -525,22 +562,24 @@ dependencies = [ name = "aws-smithy-query" version = "0.60.7" dependencies = [ - "aws-smithy-types 1.1.10", + "aws-smithy-types 1.3.0", "urlencoding", ] [[package]] name = "aws-smithy-runtime" version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d3965f6417a92a6d1009c5958a67042f57e46342afb37ca58f9ad26744ec73" dependencies = [ - "aws-smithy-async 1.2.1", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "aws-smithy-http 0.60.8", "aws-smithy-protocol-test 0.60.7", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", "bytes", "fastrand", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "http-body 1.0.0", @@ -556,35 +595,27 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "uuid", ] [[package]] name = "aws-smithy-runtime" -version = "1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d3965f6417a92a6d1009c5958a67042f57e46342afb37ca58f9ad26744ec73" +version = "1.8.0" dependencies = [ - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-http 0.60.8 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-protocol-test 0.60.7 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", + "aws-smithy-async 1.2.1", + "aws-smithy-http 0.62.0", + "aws-smithy-http-client", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", "bytes", "fastrand", - "h2", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "http-body 1.0.0", - "hyper", - "hyper-rustls", - "indexmap", + "httparse", "once_cell", "pin-project-lite", "pin-utils", - "rustls", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -592,10 +623,12 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.6.1" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b570ea39eb95bd32543f6e4032bce172cb6209b9bc8c83c770d08169e875afc" dependencies = [ - "aws-smithy-async 1.2.1", - "aws-smithy-types 1.1.10", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-types 1.2.0", "bytes", "http 0.2.12", "http 1.1.0", @@ -607,12 +640,10 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b570ea39eb95bd32543f6e4032bce172cb6209b9bc8c83c770d08169e875afc" +version = "1.7.4" dependencies = [ - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-types 1.2.0", + "aws-smithy-async 1.2.1", + "aws-smithy-types 1.3.0", "bytes", "http 0.2.12", "http 1.1.0", @@ -624,7 +655,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.10" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe321a6b21f5d8eabd0ade9c55d3d0335f3c3157fc2b3e87f05f34b539e4df5" dependencies = [ "base64-simd", "bytes", @@ -648,9 +681,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe321a6b21f5d8eabd0ade9c55d3d0335f3c3157fc2b3e87f05f34b539e4df5" +version = "1.3.0" dependencies = [ "base64-simd", "bytes", @@ -675,27 +706,29 @@ dependencies = [ [[package]] name = "aws-smithy-xml" version = "0.60.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" dependencies = [ "xmlparser", ] [[package]] name = "aws-smithy-xml" -version = "0.60.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" +version = "0.60.9" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.3.0" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f734808d43702a67e57d478a12e227d4d038d0b90c9005a78c87890d3805922" dependencies = [ "aws-credential-types 1.2.0", - "aws-smithy-async 1.2.1", - "aws-smithy-runtime-api 1.6.1", - "aws-smithy-types 1.1.10", + "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime-api 1.7.0", + "aws-smithy-types 1.2.0", "http 0.2.12", "rustc_version", "tracing", @@ -703,15 +736,12 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f734808d43702a67e57d478a12e227d4d038d0b90c9005a78c87890d3805922" +version = "1.3.3" dependencies = [ - "aws-credential-types 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-async 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "aws-smithy-runtime-api 1.7.0", - "aws-smithy-types 1.2.0", - "http 0.2.12", + "aws-credential-types 1.2.1", + "aws-smithy-async 1.2.1", + "aws-smithy-runtime-api 1.7.4", + "aws-smithy-types 1.3.0", "rustc_version", "tracing", ] @@ -774,6 +804,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -802,6 +841,25 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cbor-diag" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc245b6ecd09b23901a4fbad1ad975701fd5061ceaef6afa93a2d70605a64429" +dependencies = [ + "bs58", + "chrono", + "data-encoding", + "half", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "separator", + "url", + "uuid", +] + [[package]] name = "cc" version = "1.0.99" @@ -814,6 +872,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +dependencies = [ + "num-traits", +] + [[package]] name = "ciborium" version = "0.2.2" @@ -899,9 +966,9 @@ dependencies = [ [[package]] name = "crc32c" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" dependencies = [ "rustc_version", ] @@ -1016,6 +1083,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + [[package]] name = "der" version = "0.6.1" @@ -1060,7 +1133,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -1268,6 +1341,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -1288,6 +1380,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -1387,7 +1485,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -1532,7 +1630,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -1549,12 +1647,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", "serde", ] @@ -1566,7 +1664,7 @@ checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1623,7 +1721,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -1651,6 +1749,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.3" @@ -1662,13 +1766,24 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", ] [[package]] @@ -1681,6 +1796,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -1697,22 +1822,23 @@ dependencies = [ ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "num-rational" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", + "num-bigint", + "num-integer", + "num-traits", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "hermit-abi", - "libc", + "autocfg", ] [[package]] @@ -1726,9 +1852,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -1842,11 +1968,11 @@ name = "previous-release-comparison" version = "0.1.0" dependencies = [ "aws-config", - "aws-credential-types 1.2.0", + "aws-credential-types 1.2.1", "aws-sdk-s3 0.0.0-local", "aws-sdk-s3 1.34.0", "aws-smithy-runtime 1.5.5", - "aws-smithy-runtime 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "aws-smithy-runtime 1.8.0", "criterion", "http 0.2.12", "tokio", @@ -1878,9 +2004,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1996,7 +2122,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -2087,7 +2213,7 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -2143,34 +2269,41 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +[[package]] +name = "separator" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" + [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "indexmap", "itoa", + "memchr", "ryu", "serde", ] @@ -2247,7 +2380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -2291,9 +2424,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -2308,7 +2441,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -2328,7 +2461,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -2391,33 +2524,47 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" -version = "1.38.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -2468,7 +2615,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -2646,7 +2793,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -2668,7 +2815,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2711,7 +2858,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -2720,37 +2867,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2759,46 +2882,28 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.5" @@ -2811,48 +2916,24 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.5" @@ -2903,7 +2984,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", "synstructure", ] @@ -2924,7 +3005,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] [[package]] @@ -2944,7 +3025,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", "synstructure", ] @@ -2973,5 +3054,5 @@ checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.90", ] diff --git a/aws/sdk/benchmarks/s3-express/Cargo.lock b/aws/sdk/benchmarks/s3-express/Cargo.lock index e355bfd46..689207f3a 100644 --- a/aws/sdk/benchmarks/s3-express/Cargo.lock +++ b/aws/sdk/benchmarks/s3-express/Cargo.lock @@ -56,6 +56,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -64,7 +70,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" -version = "1.5.0" +version = "1.6.0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -81,8 +87,7 @@ dependencies = [ "bytes", "fastrand", "hex", - "http 0.2.12", - "hyper", + "http 1.1.0", "ring", "time", "tokio", @@ -93,7 +98,7 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.0" +version = "1.2.1" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -103,13 +108,14 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.2.2" +version = "1.5.0" dependencies = [ "aws-credential-types", "aws-sigv4", "aws-smithy-async", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", @@ -117,6 +123,7 @@ dependencies = [ "fastrand", "http 0.2.12", "http-body 0.4.6", + "once_cell", "percent-encoding", "pin-project-lite", "tracing", @@ -127,7 +134,6 @@ dependencies = [ name = "aws-sdk-s3" version = "0.0.0-local" dependencies = [ - "ahash", "aws-credential-types", "aws-runtime", "aws-sigv4", @@ -146,6 +152,7 @@ dependencies = [ "hex", "hmac", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "lru", "once_cell", @@ -219,7 +226,7 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.1" +version = "1.3.0" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -255,7 +262,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.9" +version = "0.60.14" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -274,7 +281,7 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" -version = "0.60.4" +version = "0.60.5" dependencies = [ "aws-smithy-types", "bytes", @@ -283,7 +290,7 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.8" +version = "0.62.0" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -292,6 +299,7 @@ dependencies = [ "bytes-utils", "futures-core", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "once_cell", "percent-encoding", @@ -300,9 +308,28 @@ dependencies = [ "tracing", ] +[[package]] +name = "aws-smithy-http-client" +version = "1.0.0" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "h2 0.4.7", + "http 0.2.12", + "http-body 0.4.6", + "hyper", + "hyper-rustls", + "once_cell", + "pin-project-lite", + "rustls", + "tokio", + "tracing", +] + [[package]] name = "aws-smithy-json" -version = "0.60.7" +version = "0.61.1" dependencies = [ "aws-smithy-types", ] @@ -317,32 +344,30 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.5.5" +version = "1.8.0" dependencies = [ "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", - "h2", "http 0.2.12", + "http 1.1.0", "http-body 0.4.6", "http-body 1.0.0", - "hyper", - "hyper-rustls", + "httparse", "once_cell", "pin-project-lite", "pin-utils", - "rustls", "tokio", "tracing", - "uuid", ] [[package]] name = "aws-smithy-runtime-api" -version = "1.6.1" +version = "1.7.4" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -357,7 +382,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.10" +version = "1.3.0" dependencies = [ "base64-simd", "bytes", @@ -381,20 +406,19 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.8" +version = "0.60.9" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.3.0" +version = "1.3.3" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http 0.2.12", "rustc_version", "tracing", ] @@ -582,9 +606,9 @@ dependencies = [ [[package]] name = "crc32c" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" dependencies = [ "rustc_version", ] @@ -933,6 +957,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -1052,7 +1095,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -1230,7 +1273,7 @@ checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1311,13 +1354,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1344,16 +1388,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" version = "0.36.0" @@ -1365,9 +1399,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -1565,7 +1599,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1658,7 +1692,7 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1808,7 +1842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1913,27 +1947,26 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -2166,16 +2199,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", + "windows-sys", ] [[package]] @@ -2184,22 +2208,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2208,46 +2217,28 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.5" @@ -2260,48 +2251,24 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.5" diff --git a/aws/sdk/integration-tests/codecatalyst/Cargo.toml b/aws/sdk/integration-tests/codecatalyst/Cargo.toml index d4fb2c808..1e5a7458c 100644 --- a/aws/sdk/integration-tests/codecatalyst/Cargo.toml +++ b/aws/sdk/integration-tests/codecatalyst/Cargo.toml @@ -12,6 +12,7 @@ publish = false [dependencies] aws-sdk-codecatalyst = { path = "../../build/aws-sdk/sdk/codecatalyst", features = ["behavior-version-latest", "test-util"] } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "wire-mock", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["wire-mock", "test-util"] } tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs index b11861b55..8118fe5cf 100644 --- a/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs +++ b/aws/sdk/integration-tests/codecatalyst/tests/sso_bearer_auth.rs @@ -7,7 +7,7 @@ use aws_sdk_codecatalyst::config::Token; #[tokio::test] async fn sso_bearer_auth() { - let replay = aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient::from_file( + let replay = aws_smithy_http_client::test_util::dvr::ReplayingClient::from_file( "tests/sso_bearer_auth.json", ) .unwrap(); diff --git a/aws/sdk/integration-tests/dynamodb/Cargo.toml b/aws/sdk/integration-tests/dynamodb/Cargo.toml index 135d5f8a4..d8abceac3 100644 --- a/aws/sdk/integration-tests/dynamodb/Cargo.toml +++ b/aws/sdk/integration-tests/dynamodb/Cargo.toml @@ -19,13 +19,14 @@ aws-sdk-dynamodb = { path = "../../build/aws-sdk/sdk/dynamodb", features = ["beh aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["test-util"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } aws-smithy-protocol-test = { path = "../../build/aws-sdk/sdk/aws-smithy-protocol-test" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util", "wire-mock"]} +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util", "wire-mock"] } aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["test-util"]} aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types", features = ["test-util"]} aws-types = { path = "../../build/aws-sdk/sdk/aws-types" } bytes = "1.0.0" futures-util = { version = "0.3.29", default-features = false } -http = "0.2.0" +http-1x = { package = "http", version = "1" } serde_json = "1.0.0" tokio = { version = "1.23.1", features = ["full", "test-util"] } tokio-stream = "0.1.5" diff --git a/aws/sdk/integration-tests/dynamodb/benches/deserialization_bench.rs b/aws/sdk/integration-tests/dynamodb/benches/deserialization_bench.rs index 1928a49ec..c9c9d2cce 100644 --- a/aws/sdk/integration-tests/dynamodb/benches/deserialization_bench.rs +++ b/aws/sdk/integration-tests/dynamodb/benches/deserialization_bench.rs @@ -14,7 +14,7 @@ fn do_bench() { use aws_sdk_dynamodb::operation::query::Query; use bytes::Bytes; - let response = HttpResponse::try_from(http::Response::builder() + let response = HttpResponse::try_from(http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -22,7 +22,7 @@ fn do_bench() { .header("connection", "keep-alive") .header("x-amzn-requestid", "A5FGSJ9ET4OKB8183S9M47RQQBVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "624725176") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(Bytes::copy_from_slice(br#"{"Count":2,"Items":[{"year":{"N":"2013"},"info":{"M":{"actors":{"L":[{"S":"Daniel Bruhl"},{"S":"Chris Hemsworth"},{"S":"Olivia Wilde"}]},"plot":{"S":"A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda."},"release_date":{"S":"2013-09-02T00:00:00Z"},"image_url":{"S":"http://ia.media-imdb.com/images/M/MV5BMTQyMDE0MTY0OV5BMl5BanBnXkFtZTcwMjI2OTI0OQ@@._V1_SX400_.jpg"},"genres":{"L":[{"S":"Action"},{"S":"Biography"},{"S":"Drama"},{"S":"Sport"}]},"directors":{"L":[{"S":"Ron Howard"}]},"rating":{"N":"8.3"},"rank":{"N":"2"},"running_time_secs":{"N":"7380"}}},"title":{"S":"Rush"}},{"year":{"N":"2013"},"info":{"M":{"actors":{"L":[{"S":"David Matthewman"},{"S":"Ann Thomas"},{"S":"Jonathan G. Neff"}]},"release_date":{"S":"2013-01-18T00:00:00Z"},"plot":{"S":"A rock band plays their music at high volumes, annoying the neighbors."},"genres":{"L":[{"S":"Comedy"},{"S":"Drama"}]},"image_url":{"S":"http://ia.media-imdb.com/images/N/O9ERWAU7FS797AJ7LU8HN09AMUP908RLlo5JF90EWR7LJKQ7@@._V1_SX400_.jpg"},"directors":{"L":[{"S":"Alice Smith"},{"S":"Bob Jones"}]},"rating":{"N":"6.2"},"rank":{"N":"11"},"running_time_secs":{"N":"5215"}}},"title":{"S":"Turn It Down, Or Else!"}}],"ScannedCount":2}"#))) .unwrap()).unwrap(); diff --git a/aws/sdk/integration-tests/dynamodb/tests/auth_scheme_error.rs b/aws/sdk/integration-tests/dynamodb/tests/auth_scheme_error.rs index 702a3fd93..85e016550 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/auth_scheme_error.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/auth_scheme_error.rs @@ -6,8 +6,8 @@ use aws_sdk_dynamodb::config::Region; use aws_sdk_dynamodb::error::DisplayErrorContext; use aws_sdk_dynamodb::{Client, Config}; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_runtime::assert_str_contains; -use aws_smithy_runtime::client::http::test_util::capture_request; #[tokio::test] async fn auth_scheme_error() { diff --git a/aws/sdk/integration-tests/dynamodb/tests/endpoints.rs b/aws/sdk/integration-tests/dynamodb/tests/endpoints.rs index e430d60d4..b675a6666 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/endpoints.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/endpoints.rs @@ -4,9 +4,9 @@ */ use aws_sdk_dynamodb::config::{self, Credentials, Region}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_types::SdkConfig; -use http::Uri; +use http_1x::Uri; async fn expect_uri( conf: SdkConfig, diff --git a/aws/sdk/integration-tests/dynamodb/tests/movies.rs b/aws/sdk/integration-tests/dynamodb/tests/movies.rs index 6254dd6ec..994316f08 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/movies.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/movies.rs @@ -5,7 +5,7 @@ use aws_sdk_dynamodb as dynamodb; use aws_smithy_async::assert_elapsed; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; use dynamodb::config::{Credentials, Region}; use dynamodb::operation::query::QueryOutput; @@ -14,8 +14,8 @@ use dynamodb::types::{ ScalarAttributeType, TableStatus, }; use dynamodb::Client; -use http::header::AUTHORIZATION; -use http::Uri; +use http_1x::header::AUTHORIZATION; +use http_1x::Uri; use serde_json::Value; use std::collections::HashMap; use std::time::Duration; @@ -196,7 +196,7 @@ async fn movies_it() { fn movies_it_test_connection() -> StaticReplayClient { StaticReplayClient::new(vec![ ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.CreateTable") .header("content-length", "313") @@ -204,7 +204,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155118Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"AttributeDefinitions":[{"AttributeName":"year","AttributeType":"N"},{"AttributeName":"title","AttributeType":"S"}],"TableName":"Movies-5","KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"ReadCapacityUnits":10,"WriteCapacityUnits":10}}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:18 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -212,9 +212,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "RCII0AALE00UALC7LJ9AD600B7VV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "3715137447") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"TableDescription":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"CREATING"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.DescribeTable") .header("content-length", "24") @@ -222,7 +222,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155119Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5"}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:18 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -230,16 +230,16 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "O1C6QKCG8GT7D2K922T4QRL9N3VV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "46742265") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"CREATING"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.DescribeTable") .header("content-length", "24") .header("authorization", "AWS4-HMAC-SHA256 Credential=ASIAR6OFQKMAFQIIYZ5T/20210308/us-east-1/dynamodb/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-target, Signature=7f3a743bb460f26296640ae775d282f0153eda750855ec00ace1815becfd2de5") .header("x-amz-date", "20210308T155120Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")).body(SdkBody::from(r#"{"TableName":"Movies-5"}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:20 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -247,9 +247,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "EN5N26BO1FAOEMUUSD7B7SUPPVVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "46742265") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"CREATING"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.DescribeTable") .header("content-length", "24") @@ -257,7 +257,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155121Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5"}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:21 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -265,9 +265,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "PHCMGEVI6JLN9JNMKSSA3M76H3VV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "46742265") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"CREATING"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.DescribeTable") .header("content-length", "24") @@ -275,7 +275,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155122Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5"}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:22 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -283,9 +283,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "1Q22O983HD3511TN6Q5RRTP0MFVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "46742265") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"CREATING"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.DescribeTable") .header("content-length", "24") @@ -293,7 +293,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155123Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5"}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -301,9 +301,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "ONJBNV2A9GBNUT34KH73JLL23BVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "24113616") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HASH"},{"AttributeName":"title","KeyType":"RANGE"}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":10,"WriteCapacityUnits":10},"TableArn":"arn:aws:dynamodb:us-east-1:134095065856:table/Movies-5","TableId":"b08c406a-7dbc-4f7d-b7c6-672a43ec21cd","TableName":"Movies-5","TableSizeBytes":0,"TableStatus":"ACTIVE"}}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.PutItem") .header("content-length", "619") @@ -311,7 +311,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155123Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5","Item":{"info":{"M":{"rating":{"N":"6.2"},"genres":{"L":[{"S":"Comedy"},{"S":"Drama"}]},"image_url":{"S":"http://ia.media-imdb.com/images/N/O9ERWAU7FS797AJ7LU8HN09AMUP908RLlo5JF90EWR7LJKQ7@@._V1_SX400_.jpg"},"release_date":{"S":"2013-01-18T00:00:00Z"},"actors":{"L":[{"S":"David Matthewman"},{"S":"Ann Thomas"},{"S":"Jonathan G. Neff"}]},"plot":{"S":"A rock band plays their music at high volumes, annoying the neighbors."},"running_time_secs":{"N":"5215"},"rank":{"N":"11"},"directors":{"L":[{"S":"Alice Smith"},{"S":"Bob Jones"}]}}},"title":{"S":"Turn It Down, Or Else!"},"year":{"N":"2013"}}}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -319,9 +319,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "E6TGS5HKHHV08HSQA31IO1IDMFVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "2745614147") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.PutItem") .header("content-length", "636") @@ -329,7 +329,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155123Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"TableName":"Movies-5","Item":{"info":{"M":{"plot":{"S":"A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda."},"rating":{"N":"8.3"},"rank":{"N":"2"},"release_date":{"S":"2013-09-02T00:00:00Z"},"directors":{"L":[{"S":"Ron Howard"}]},"image_url":{"S":"http://ia.media-imdb.com/images/M/MV5BMTQyMDE0MTY0OV5BMl5BanBnXkFtZTcwMjI2OTI0OQ@@._V1_SX400_.jpg"},"actors":{"L":[{"S":"Daniel Bruhl"},{"S":"Chris Hemsworth"},{"S":"Olivia Wilde"}]},"running_time_secs":{"N":"7380"},"genres":{"L":[{"S":"Action"},{"S":"Biography"},{"S":"Drama"},{"S":"Sport"}]}}},"title":{"S":"Rush"},"year":{"N":"2013"}}}"#)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -337,9 +337,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "B63D54LP2FOGQK9JE5KLJT49HJVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "2745614147") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.Query") .header("content-length", "156") @@ -347,7 +347,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155123Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r##"{"TableName":"Movies-5","KeyConditionExpression":"#yr = :yyyy","ExpressionAttributeNames":{"#yr":"year"},"ExpressionAttributeValues":{":yyyy":{"N":"2222"}}}"##)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -355,9 +355,9 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "AUAS9KJ0TK9BSR986TRPC2RGTRVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "3413411624") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Count":0,"Items":[],"ScannedCount":0}"#)).unwrap()), - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "DynamoDB_20120810.Query") .header("content-length", "156") @@ -365,7 +365,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("x-amz-date", "20210308T155123Z") .uri(Uri::from_static("https://dynamodb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r##"{"TableName":"Movies-5","KeyConditionExpression":"#yr = :yyyy","ExpressionAttributeNames":{"#yr":"year"},"ExpressionAttributeValues":{":yyyy":{"N":"2013"}}}"##)).unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("server", "Server") .header("date", "Mon, 08 Mar 2021 15:51:23 GMT") .header("content-type", "application/x-amz-json-1.0") @@ -373,7 +373,7 @@ fn movies_it_test_connection() -> StaticReplayClient { .header("connection", "keep-alive") .header("x-amzn-requestid", "A5FGSJ9ET4OKB8183S9M47RQQBVV4KQNSO5AEMVJF66Q9ASUAAJG") .header("x-amz-crc32", "624725176") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Count":2,"Items":[{"year":{"N":"2013"},"info":{"M":{"actors":{"L":[{"S":"Daniel Bruhl"},{"S":"Chris Hemsworth"},{"S":"Olivia Wilde"}]},"plot":{"S":"A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda."},"release_date":{"S":"2013-09-02T00:00:00Z"},"image_url":{"S":"http://ia.media-imdb.com/images/M/MV5BMTQyMDE0MTY0OV5BMl5BanBnXkFtZTcwMjI2OTI0OQ@@._V1_SX400_.jpg"},"genres":{"L":[{"S":"Action"},{"S":"Biography"},{"S":"Drama"},{"S":"Sport"}]},"directors":{"L":[{"S":"Ron Howard"}]},"rating":{"N":"8.3"},"rank":{"N":"2"},"running_time_secs":{"N":"7380"}}},"title":{"S":"Rush"}},{"year":{"N":"2013"},"info":{"M":{"actors":{"L":[{"S":"David Matthewman"},{"S":"Ann Thomas"},{"S":"Jonathan G. Neff"}]},"release_date":{"S":"2013-01-18T00:00:00Z"},"plot":{"S":"A rock band plays their music at high volumes, annoying the neighbors."},"genres":{"L":[{"S":"Comedy"},{"S":"Drama"}]},"image_url":{"S":"http://ia.media-imdb.com/images/N/O9ERWAU7FS797AJ7LU8HN09AMUP908RLlo5JF90EWR7LJKQ7@@._V1_SX400_.jpg"},"directors":{"L":[{"S":"Alice Smith"},{"S":"Bob Jones"}]},"rating":{"N":"6.2"},"rank":{"N":"11"},"running_time_secs":{"N":"5215"}}},"title":{"S":"Turn It Down, Or Else!"}}],"ScannedCount":2}"#)).unwrap()) ]) } diff --git a/aws/sdk/integration-tests/dynamodb/tests/paginators.rs b/aws/sdk/integration-tests/dynamodb/tests/paginators.rs index 7cb07f076..559922920 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/paginators.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/paginators.rs @@ -9,10 +9,8 @@ use std::iter::FromIterator; use aws_credential_types::Credentials; use aws_sdk_dynamodb::types::AttributeValue; use aws_sdk_dynamodb::{Client, Config}; +use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_protocol_test::{assert_ok, validate_body, MediaType}; -use aws_smithy_runtime::client::http::test_util::{ - capture_request, ReplayEvent, StaticReplayClient, -}; use aws_smithy_runtime_api::client::http::HttpClient; use aws_smithy_types::body::SdkBody; use aws_types::region::Region; @@ -46,15 +44,17 @@ async fn paginators_pass_args() { )); } -fn mk_request(body: &'static str) -> http::Request { - http::Request::builder() +fn mk_request(body: &'static str) -> http_1x::Request { + http_1x::Request::builder() .uri("https://dynamodb.us-east-1.amazonaws.com/") .body(SdkBody::from(body)) .unwrap() } -fn mk_response(body: &'static str) -> http::Response { - http::Response::builder().body(SdkBody::from(body)).unwrap() +fn mk_response(body: &'static str) -> http_1x::Response { + http_1x::Response::builder() + .body(SdkBody::from(body)) + .unwrap() } #[tokio::test(flavor = "current_thread")] diff --git a/aws/sdk/integration-tests/dynamodb/tests/retries-with-client-rate-limiting.rs b/aws/sdk/integration-tests/dynamodb/tests/retries-with-client-rate-limiting.rs index b1a973346..f4b6ac5cb 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/retries-with-client-rate-limiting.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/retries-with-client-rate-limiting.rs @@ -9,20 +9,20 @@ use aws_sdk_dynamodb::config::{ use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata}; use aws_smithy_async::test_util::instant_time_and_sleep; use aws_smithy_async::time::SharedTimeSource; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_runtime::client::retries::RetryPartition; use aws_smithy_types::body::SdkBody; use std::time::{Duration, SystemTime}; -fn req() -> http::Request { - http::Request::builder() +fn req() -> http_1x::Request { + http_1x::Request::builder() .body(SdkBody::from("request body")) .unwrap() } -fn ok() -> http::Response { +fn ok() -> http_1x::Response { let body = "{ \"TableNames\": [ \"Test\" ] }"; - http::Response::builder() + http_1x::Response::builder() .status(200) .header("server", "Server") .header("content-type", "application/x-amz-json-1.0") @@ -33,15 +33,15 @@ fn ok() -> http::Response { .unwrap() } -fn err() -> http::Response { - http::Response::builder() +fn err() -> http_1x::Response { + http_1x::Response::builder() .status(500) .body(SdkBody::from("{ \"message\": \"The request has failed because of an unknown error, exception or failure.\", \"code\": \"InternalServerError\" }")) .unwrap() } -fn throttling_err() -> http::Response { - http::Response::builder() +fn throttling_err() -> http_1x::Response { + http_1x::Response::builder() .status(400) .body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }")) .unwrap() diff --git a/aws/sdk/integration-tests/dynamodb/tests/shared-config.rs b/aws/sdk/integration-tests/dynamodb/tests/shared-config.rs index 02786fe0a..b0ed8a4e0 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/shared-config.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/shared-config.rs @@ -4,8 +4,8 @@ */ use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig}; -use aws_smithy_runtime::client::http::test_util::capture_request; -use http::Uri; +use aws_smithy_http_client::test_util::capture_request; +use http_1x::Uri; /// Iterative test of loading clients from shared configuration #[tokio::test] diff --git a/aws/sdk/integration-tests/dynamodb/tests/test-error-classification.rs b/aws/sdk/integration-tests/dynamodb/tests/test-error-classification.rs index 0e6ed27cd..5c7f550fe 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/test-error-classification.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/test-error-classification.rs @@ -9,8 +9,7 @@ use aws_credential_types::Credentials; use aws_sdk_dynamodb::types::AttributeValue; use aws_sdk_dynamodb::Client; use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; -use aws_smithy_runtime::client::http::test_util::wire::{ReplayedEvent, WireMockServer}; -use aws_smithy_runtime::{ev, match_events}; +use aws_smithy_http_client::test_util::wire::{ev, match_events, ReplayedEvent, WireMockServer}; use aws_smithy_types::retry::RetryConfig; use aws_smithy_types::timeout::TimeoutConfig; use aws_types::region::Region; diff --git a/aws/sdk/integration-tests/dynamodb/tests/timeouts.rs b/aws/sdk/integration-tests/dynamodb/tests/timeouts.rs index d7a41750d..783d7996b 100644 --- a/aws/sdk/integration-tests/dynamodb/tests/timeouts.rs +++ b/aws/sdk/integration-tests/dynamodb/tests/timeouts.rs @@ -9,7 +9,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig}; use aws_sdk_dynamodb::error::SdkError; use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep, Sleep}; -use aws_smithy_runtime::client::http::test_util::NeverClient; +use aws_smithy_http_client::test_util::NeverClient; use aws_smithy_types::retry::RetryConfig; use aws_smithy_types::timeout::TimeoutConfig; use aws_types::SdkConfig; diff --git a/aws/sdk/integration-tests/ec2/Cargo.toml b/aws/sdk/integration-tests/ec2/Cargo.toml index 402507a1a..e7d5c7bb5 100644 --- a/aws/sdk/integration-tests/ec2/Cargo.toml +++ b/aws/sdk/integration-tests/ec2/Cargo.toml @@ -11,9 +11,11 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-runtime = { path = "../../build/aws-sdk/sdk/aws-runtime", features = ["test-util"] } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["test-util"] } aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } -aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["client", "http-02x"] } +# TODO(hyper1) - remove legacy-test-util feature by providing an http 1.x answer to take_requests() function +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util", "legacy-test-util"] } +aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["client", "http-1x"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } aws-sdk-ec2 = { path = "../../build/aws-sdk/sdk/ec2", features = ["behavior-version-latest", "test-util"] } tokio = { version = "1.23.1", features = ["full"]} -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio-stream = "0.1.5" diff --git a/aws/sdk/integration-tests/ec2/tests/paginators.rs b/aws/sdk/integration-tests/ec2/tests/paginators.rs index bad9bbf79..4befb50e2 100644 --- a/aws/sdk/integration-tests/ec2/tests/paginators.rs +++ b/aws/sdk/integration-tests/ec2/tests/paginators.rs @@ -5,7 +5,7 @@ use aws_runtime::user_agent::test_util::assert_ua_contains_metric_values; use aws_sdk_ec2::{config::Credentials, config::Region, types::InstanceType, Client, Config}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_runtime_api::client::http::HttpClient; use aws_smithy_types::body::SdkBody; use std::collections::HashSet; @@ -36,7 +36,7 @@ async fn paginators_handle_empty_tokens() { "#; - let response = http::Response::builder() + let response = http_1x::Response::builder() .status(200) .body(SdkBody::from(response)) .unwrap(); @@ -69,7 +69,7 @@ async fn paginators_handle_unset_tokens() { edf3e86c-4baf-47c1-9228-9a5ea09542e8 "#; - let response = http::Response::builder() + let response = http_1x::Response::builder() .status(200) .body(SdkBody::from(response)) .unwrap(); diff --git a/aws/sdk/integration-tests/ec2/tests/waiters.rs b/aws/sdk/integration-tests/ec2/tests/waiters.rs index 8efbbb5ed..c9f5c5d34 100644 --- a/aws/sdk/integration-tests/ec2/tests/waiters.rs +++ b/aws/sdk/integration-tests/ec2/tests/waiters.rs @@ -8,9 +8,8 @@ use aws_sdk_ec2::{client::Waiters, config::Region, error::DisplayErrorContext, C use aws_smithy_async::test_util::tick_advance_sleep::{ tick_advance_time_and_sleep, TickAdvanceTime, }; -use aws_smithy_runtime::{ - client::http::test_util::dvr::ReplayingClient, test_util::capture_test_logs::show_test_logs, -}; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; +use aws_smithy_runtime::test_util::capture_test_logs::show_test_logs; use aws_smithy_runtime_api::client::waiters::error::WaiterError; use aws_smithy_types::retry::RetryConfig; use std::time::Duration; diff --git a/aws/sdk/integration-tests/glacier/Cargo.toml b/aws/sdk/integration-tests/glacier/Cargo.toml index 6674d35d4..707405bce 100644 --- a/aws/sdk/integration-tests/glacier/Cargo.toml +++ b/aws/sdk/integration-tests/glacier/Cargo.toml @@ -14,8 +14,9 @@ publish = false aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } aws-sdk-glacier = { path = "../../build/aws-sdk/sdk/glacier", features = ["behavior-version-latest"] } aws-smithy-protocol-test = { path = "../../build/aws-sdk/sdk/aws-smithy-protocol-test"} -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } bytes = "1.0.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio = { version = "1.23.1", features = ["full", "test-util"]} tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/glacier/tests/custom-headers.rs b/aws/sdk/integration-tests/glacier/tests/custom-headers.rs index 52194567c..7946a291c 100644 --- a/aws/sdk/integration-tests/glacier/tests/custom-headers.rs +++ b/aws/sdk/integration-tests/glacier/tests/custom-headers.rs @@ -5,8 +5,8 @@ use aws_sdk_glacier::config::{Credentials, Region}; use aws_sdk_glacier::primitives::ByteStream; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_protocol_test::{assert_ok, validate_headers}; -use aws_smithy_runtime::client::http::test_util::capture_request; #[tokio::test] async fn set_correct_headers() { diff --git a/aws/sdk/integration-tests/iam/Cargo.toml b/aws/sdk/integration-tests/iam/Cargo.toml index 0c1a02e8b..bb77e0c6a 100644 --- a/aws/sdk/integration-tests/iam/Cargo.toml +++ b/aws/sdk/integration-tests/iam/Cargo.toml @@ -13,9 +13,10 @@ publish = false [dev-dependencies] aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } aws-sdk-iam = { path = "../../build/aws-sdk/sdk/iam", features = ["behavior-version-latest"] } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } bytes = "1.0.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio = { version = "1.23.1", features = ["full", "test-util"]} tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/iam/tests/resolve-global-endpoint.rs b/aws/sdk/integration-tests/iam/tests/resolve-global-endpoint.rs index 70932827b..153797ee3 100644 --- a/aws/sdk/integration-tests/iam/tests/resolve-global-endpoint.rs +++ b/aws/sdk/integration-tests/iam/tests/resolve-global-endpoint.rs @@ -4,7 +4,7 @@ */ use aws_sdk_iam::config::{Credentials, Region}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn correct_endpoint_resolver() { diff --git a/aws/sdk/integration-tests/kms/Cargo.toml b/aws/sdk/integration-tests/kms/Cargo.toml index 86e314597..f96c8484c 100644 --- a/aws/sdk/integration-tests/kms/Cargo.toml +++ b/aws/sdk/integration-tests/kms/Cargo.toml @@ -21,9 +21,10 @@ aws-sdk-kms = { path = "../../build/aws-sdk/sdk/kms", features = ["test-util", " aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["test-util"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["test-util"] } bytes = "1.0.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/kms/tests/integration.rs b/aws/sdk/integration-tests/kms/tests/integration.rs index 7f832bc9e..2a70fdabf 100644 --- a/aws/sdk/integration-tests/kms/tests/integration.rs +++ b/aws/sdk/integration-tests/kms/tests/integration.rs @@ -5,10 +5,10 @@ use aws_sdk_kms as kms; use aws_sdk_kms::operation::RequestId; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_runtime_api::client::result::SdkError; use aws_smithy_types::body::SdkBody; -use http::Uri; +use http_1x::Uri; use kms::config::{Config, Credentials, Region}; // TODO(DVR): having the full HTTP requests right in the code is a bit gross, consider something @@ -19,11 +19,11 @@ use kms::config::{Config, Credentials, Region}; #[tokio::test] async fn generate_random_cn() { let http_client= StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .uri(Uri::from_static("https://kms.cn-north-1.amazonaws.com.cn/")) .body(SdkBody::from(r#"{"NumberOfBytes":64}"#)).unwrap(), - http::Response::builder() - .status(http::StatusCode::from_u16(200).unwrap()) + http_1x::Response::builder() + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Plaintext":"6CG0fbzzhg5G2VcFCPmJMJ8Njv3voYCgrGlp3+BZe7eDweCXgiyDH9BnkKvLmS7gQhnYDUlyES3fZVGwv5+CxA=="}"#)).unwrap()) ]); let conf = Config::builder() @@ -47,7 +47,7 @@ async fn generate_random_cn() { #[tokio::test] async fn generate_random() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.1") .header("x-amz-target", "TrentService.GenerateRandom") .header("content-length", "20") @@ -57,8 +57,8 @@ async fn generate_random() { .header("x-amz-user-agent", "aws-sdk-rust/0.123.test api/test-service/0.123 os/windows/XPSP3 lang/rust/1.50.0") .uri(Uri::from_static("https://kms.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"NumberOfBytes":64}"#)).unwrap(), - http::Response::builder() - .status(http::StatusCode::from_u16(200).unwrap()) + http_1x::Response::builder() + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{"Plaintext":"6CG0fbzzhg5G2VcFCPmJMJ8Njv3voYCgrGlp3+BZe7eDweCXgiyDH9BnkKvLmS7gQhnYDUlyES3fZVGwv5+CxA=="}"#)).unwrap()) ]); let conf = Config::builder() @@ -95,9 +95,9 @@ async fn generate_random() { #[tokio::test] async fn generate_random_malformed_response() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder().body(SdkBody::from(r#"{"NumberOfBytes":64}"#)).unwrap(), - http::Response::builder() - .status(http::StatusCode::from_u16(200).unwrap()) + http_1x::Request::builder().body(SdkBody::from(r#"{"NumberOfBytes":64}"#)).unwrap(), + http_1x::Response::builder() + .status(http_1x::StatusCode::from_u16(200).unwrap()) // last `}` replaced with a space, invalid JSON .body(SdkBody::from(r#"{"Plaintext":"6CG0fbzzhg5G2VcFCPmJMJ8Njv3voYCgrGlp3+BZe7eDweCXgiyDH9BnkKvLmS7gQhnYDUlyES3fZVGwv5+CxA==" "#)).unwrap()) ]); @@ -119,7 +119,7 @@ async fn generate_random_malformed_response() { #[tokio::test] async fn generate_random_keystore_not_found() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.1") .header("x-amz-target", "TrentService.GenerateRandom") .header("content-length", "56") @@ -129,8 +129,8 @@ async fn generate_random_keystore_not_found() { .header("x-amz-user-agent", "aws-sdk-rust/0.123.test api/test-service/0.123 os/windows/XPSP3 lang/rust/1.50.0") .uri(Uri::from_static("https://kms.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"NumberOfBytes":64,"CustomKeyStoreId":"does not exist"}"#)).unwrap(), - http::Response::builder() - .status(http::StatusCode::from_u16(400).unwrap()) + http_1x::Response::builder() + .status(http_1x::StatusCode::from_u16(400).unwrap()) .header("x-amzn-requestid", "bfe81a0a-9a08-4e71-9910-cdb5ab6ea3b6") .header("cache-control", "no-cache, no-store, must-revalidate, private") .header("expires", "0") diff --git a/aws/sdk/integration-tests/kms/tests/retryable_errors.rs b/aws/sdk/integration-tests/kms/tests/retryable_errors.rs index dc1a633a8..e8dfb20c8 100644 --- a/aws/sdk/integration-tests/kms/tests/retryable_errors.rs +++ b/aws/sdk/integration-tests/kms/tests/retryable_errors.rs @@ -6,7 +6,7 @@ use aws_credential_types::Credentials; use aws_runtime::retries::classifiers::AwsErrorCodeClassifier; use aws_sdk_kms as kms; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; +use aws_smithy_http_client::test_util::infallible_client_fn; use aws_smithy_runtime_api::client::interceptors::context::{Error, Input, InterceptorContext}; use aws_smithy_runtime_api::client::orchestrator::{HttpResponse, OrchestratorError}; use aws_smithy_runtime_api::client::result::SdkError; @@ -15,7 +15,7 @@ use bytes::Bytes; use kms::operation::create_alias::CreateAliasError; async fn make_err( - response: impl Fn() -> http::Response + Send + Sync + 'static, + response: impl Fn() -> http_1x::Response + Send + Sync + 'static, ) -> SdkError { let http_client = infallible_client_fn(move |_| response()); let conf = kms::Config::builder() @@ -35,7 +35,7 @@ async fn make_err( #[tokio::test] async fn errors_are_retryable() { let err = make_err(|| { - http::Response::builder() + http_1x::Response::builder() .status(400) .body(Bytes::from_static( br#"{ "code": "LimitExceededException" }"#, @@ -56,7 +56,7 @@ async fn errors_are_retryable() { #[tokio::test] async fn unmodeled_errors_are_retryable() { let err = make_err(|| { - http::Response::builder() + http_1x::Response::builder() .status(400) .body(Bytes::from_static(br#"{ "code": "ThrottlingException" }"#)) .unwrap() diff --git a/aws/sdk/integration-tests/lambda/Cargo.toml b/aws/sdk/integration-tests/lambda/Cargo.toml index 45ff53adf..2ff0565aa 100644 --- a/aws/sdk/integration-tests/lambda/Cargo.toml +++ b/aws/sdk/integration-tests/lambda/Cargo.toml @@ -13,11 +13,12 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-sdk-lambda = { path = "../../build/aws-sdk/sdk/lambda", features = ["behavior-version-latest"] } aws-smithy-eventstream = { path = "../../build/aws-sdk/sdk/aws-smithy-eventstream" } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } base64 = "0.13.0" bytes = "1.0.0" futures-core = "0.3.29" -http = "0.2.0" +http-1x = { package = "http", version = "1" } serde_json = "1.0.0" tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/lambda/tests/naughty-strings-client-context.rs b/aws/sdk/integration-tests/lambda/tests/naughty-strings-client-context.rs index 934dda7ff..4cffb2a4f 100644 --- a/aws/sdk/integration-tests/lambda/tests/naughty-strings-client-context.rs +++ b/aws/sdk/integration-tests/lambda/tests/naughty-strings-client-context.rs @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -// use http::HeaderValue; +// use http_1x::HeaderValue; const NAUGHTY_STRINGS: &str = include_str!("blns/blns.txt"); diff --git a/aws/sdk/integration-tests/lambda/tests/request_id.rs b/aws/sdk/integration-tests/lambda/tests/request_id.rs index 4517f05bc..3f75afa0f 100644 --- a/aws/sdk/integration-tests/lambda/tests/request_id.rs +++ b/aws/sdk/integration-tests/lambda/tests/request_id.rs @@ -7,11 +7,11 @@ use aws_sdk_lambda::config::{Credentials, Region}; use aws_sdk_lambda::operation::list_functions::ListFunctionsError; use aws_sdk_lambda::operation::RequestId; use aws_sdk_lambda::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; +use aws_smithy_http_client::test_util::infallible_client_fn; #[allow(deprecated)] async fn run_test( - response: impl Fn() -> http::Response<&'static str> + Send + Sync + 'static, + response: impl Fn() -> http_1x::Response<&'static str> + Send + Sync + 'static, expect_error: bool, ) { let http_client = infallible_client_fn(move |_| response()); @@ -37,7 +37,7 @@ async fn run_test( async fn get_request_id_from_unmodeled_error() { run_test( || { - http::Response::builder() + http_1x::Response::builder() .header("x-amzn-RequestId", "correct-request-id") .header("X-Amzn-Errortype", "ListFunctions") .status(500) @@ -53,7 +53,7 @@ async fn get_request_id_from_unmodeled_error() { async fn get_request_id_from_successful_response() { run_test( || { - http::Response::builder() + http_1x::Response::builder() .header("x-amzn-RequestId", "correct-request-id") .status(200) .body(r#"{"Functions":[],"NextMarker":null}"#) diff --git a/aws/sdk/integration-tests/no-default-features/Cargo.toml b/aws/sdk/integration-tests/no-default-features/Cargo.toml index 9ed56d6c0..1b9164b4c 100644 --- a/aws/sdk/integration-tests/no-default-features/Cargo.toml +++ b/aws/sdk/integration-tests/no-default-features/Cargo.toml @@ -17,9 +17,10 @@ publish = false aws-config = { path = "../../build/aws-sdk/sdk/aws-config", default-features = false } aws-sdk-s3 = { path = "../../build/aws-sdk/sdk/s3", default-features = false } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" } -aws-smithy-runtime= { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } futures = "0.3.25" tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } -http = "0.2.9" +http-1x = { package = "http", version = "1" } diff --git a/aws/sdk/integration-tests/no-default-features/tests/client-construction.rs b/aws/sdk/integration-tests/no-default-features/tests/client-construction.rs index d13a3c485..d552fceeb 100644 --- a/aws/sdk/integration-tests/no-default-features/tests/client-construction.rs +++ b/aws/sdk/integration-tests/no-default-features/tests/client-construction.rs @@ -10,11 +10,11 @@ use aws_sdk_s3::config::{ SharedAsyncSleep, Sleep, StalledStreamProtectionConfig, }; use aws_sdk_s3::primitives::SdkBody; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; +use aws_smithy_http_client::test_util::infallible_client_fn; use aws_sdk_s3::error::DisplayErrorContext; use aws_smithy_async::rt::sleep::AsyncSleep; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use std::time::Duration; @@ -23,7 +23,7 @@ use std::time::Duration; // the connector being enabled transitively #[tokio::test] #[should_panic( - expected = "Enable the `rustls` crate feature or configure a HTTP client to fix this." + expected = "Enable the `default-https-client` crate feature or configure an HTTP client to fix this." )] async fn test_clients_from_sdk_config() { aws_config::load_defaults(BehaviorVersion::latest()).await; @@ -58,8 +58,8 @@ async fn test_clients_from_service_config() { .expect_err("it should fail to send a request because there is no HTTP client"); let msg = format!("{}", DisplayErrorContext(err)); assert!( - msg.contains("No HTTP client was available to send this request. Enable the `rustls` crate feature or configure a HTTP client to fix this."), - "expected '{msg}' to contain 'No HTTP client was available to send this request. Enable the `rustls` crate feature or set a HTTP client to fix this.'" + msg.contains("No HTTP client was available to send this request. Enable the `default-https-client` crate feature or configure an HTTP client to fix this."), + "expected '{msg}' to contain 'No HTTP client was available to send this request. Enable the `default-https-client` crate feature or set an HTTP client to fix this.'" ); } @@ -68,7 +68,7 @@ async fn test_clients_from_service_config() { async fn test_missing_behavior_version() { use aws_sdk_s3::config::Region; let http_client = - infallible_client_fn(|_req| http::Response::builder().body(SdkBody::empty()).unwrap()); + infallible_client_fn(|_req| http_1x::Response::builder().body(SdkBody::empty()).unwrap()); let config = Config::builder() .region(Region::new("us-east-1")) diff --git a/aws/sdk/integration-tests/polly/Cargo.toml b/aws/sdk/integration-tests/polly/Cargo.toml index c68b4e69c..4e3cc965d 100644 --- a/aws/sdk/integration-tests/polly/Cargo.toml +++ b/aws/sdk/integration-tests/polly/Cargo.toml @@ -15,6 +15,6 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-sdk-polly = { path = "../../build/aws-sdk/sdk/polly", features = ["behavior-version-latest"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } bytes = "1.0.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio = { version = "1.23.1", features = ["full"]} tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/polly/tests/presigning.rs b/aws/sdk/integration-tests/polly/tests/presigning.rs index 51cfe93d5..cc6b0a6cc 100644 --- a/aws/sdk/integration-tests/polly/tests/presigning.rs +++ b/aws/sdk/integration-tests/polly/tests/presigning.rs @@ -32,7 +32,7 @@ async fn test_presigning() { .await .expect("success"); - let uri = presigned.uri().parse::().unwrap(); + let uri = presigned.uri().parse::().unwrap(); let pq = uri.path_and_query().unwrap(); let path = pq.path(); let query = pq.query().unwrap(); @@ -85,7 +85,7 @@ async fn test_presigning_customized() { .await .expect("success"); - let uri = presigned.uri().parse::().unwrap(); + let uri = presigned.uri().parse::().unwrap(); let pq = uri.path_and_query().unwrap(); let path = pq.path(); let query = pq.query().unwrap(); diff --git a/aws/sdk/integration-tests/qldbsession/Cargo.toml b/aws/sdk/integration-tests/qldbsession/Cargo.toml index d235881dd..e6337e6e7 100644 --- a/aws/sdk/integration-tests/qldbsession/Cargo.toml +++ b/aws/sdk/integration-tests/qldbsession/Cargo.toml @@ -19,8 +19,9 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-sdk-qldbsession = { path = "../../build/aws-sdk/sdk/qldbsession", features = ["test-util", "behavior-version-latest"] } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } -http = "0.2.0" +http-1x = { package = "http", version = "1" } tokio = { version = "1.23.1", features = ["full"]} tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/qldbsession/tests/integration.rs b/aws/sdk/integration-tests/qldbsession/tests/integration.rs index b0df9190a..1827eb23a 100644 --- a/aws/sdk/integration-tests/qldbsession/tests/integration.rs +++ b/aws/sdk/integration-tests/qldbsession/tests/integration.rs @@ -8,15 +8,15 @@ use aws_sdk_qldbsession::config::{Config, Credentials, Region}; use aws_sdk_qldbsession::types::StartSessionRequest; use aws_sdk_qldbsession::Client; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; -use http::Uri; +use http_1x::Uri; #[cfg(feature = "test-util")] #[tokio::test] async fn signv4_use_correct_service_name() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("content-type", "application/x-amz-json-1.0") .header("x-amz-target", "QLDBSession.SendCommand") .header("content-length", "49") @@ -26,8 +26,8 @@ async fn signv4_use_correct_service_name() { .header("user-agent", "aws-sdk-rust/0.123.test os/windows/XPSP3 lang/rust/1.50.0") .uri(Uri::from_static("https://session.qldb.us-east-1.amazonaws.com/")) .body(SdkBody::from(r#"{"StartSession":{"LedgerName":"not-real-ledger"}}"#)).unwrap(), - http::Response::builder() - .status(http::StatusCode::from_u16(200).unwrap()) + http_1x::Response::builder() + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"{}"#)).unwrap()), ]); let conf = Config::builder() diff --git a/aws/sdk/integration-tests/s3/Cargo.toml b/aws/sdk/integration-tests/s3/Cargo.toml index ae7b68cd6..9251a2632 100644 --- a/aws/sdk/integration-tests/s3/Cargo.toml +++ b/aws/sdk/integration-tests/s3/Cargo.toml @@ -23,18 +23,18 @@ aws-sdk-s3 = { path = "../../build/aws-sdk/sdk/s3", features = ["test-util", "be aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["test-util", "rt-tokio"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } aws-smithy-protocol-test = { path = "../../build/aws-sdk/sdk/aws-smithy-protocol-test" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util", "wire-mock", "tls-rustls"] } -aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } +aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["test-util", "http-1x"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } -aws-smithy-experimental = { path = "../../build/aws-sdk/sdk/aws-smithy-experimental", features = ["crypto-ring"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["default-client", "rustls-ring", "test-util", "wire-mock"] } aws-types = { path = "../../build/aws-sdk/sdk/aws-types" } bytes = "1" bytes-utils = "0.1.2" fastrand = "2.3.0" futures-util = { version = "0.3.29", default-features = false, features = ["alloc"] } hdrhistogram = "7.5.2" -http = "0.2.3" -http-body = "0.4.5" +http-1x = { package = "http", version = "1" } +http-body-1x = { package = "http-body", version = "1" } hyper = { version = "0.14.26", features = ["stream"] } once_cell = "1.18.0" pretty_assertions = "1.3" diff --git a/aws/sdk/integration-tests/s3/tests/alternative-async-runtime.rs b/aws/sdk/integration-tests/s3/tests/alternative-async-runtime.rs index 2c8c4f4b0..50a9a0018 100644 --- a/aws/sdk/integration-tests/s3/tests/alternative-async-runtime.rs +++ b/aws/sdk/integration-tests/s3/tests/alternative-async-runtime.rs @@ -13,7 +13,7 @@ use aws_sdk_s3::types::{ use aws_sdk_s3::{Client, Config}; use aws_smithy_async::assert_elapsed; use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep, Sleep}; -use aws_smithy_runtime::client::http::test_util::NeverClient; +use aws_smithy_http_client::test_util::NeverClient; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::client::result::SdkError; use aws_smithy_types::error::display::DisplayErrorContext; diff --git a/aws/sdk/integration-tests/s3/tests/body_size_hint.rs b/aws/sdk/integration-tests/s3/tests/body_size_hint.rs index 97e9ac723..458a224e5 100644 --- a/aws/sdk/integration-tests/s3/tests/body_size_hint.rs +++ b/aws/sdk/integration-tests/s3/tests/body_size_hint.rs @@ -11,8 +11,8 @@ use aws_sdk_s3::{ primitives::{ByteStream, SdkBody}, Client, }; -use aws_smithy_runtime::client::http::test_util::{capture_request, infallible_client_fn}; -use http_body::Body; +use aws_smithy_http_client::test_util::{capture_request, infallible_client_fn}; +use http_body_1x::Body; #[tokio::test] async fn download_body_size_hint_check() { @@ -25,7 +25,7 @@ async fn download_body_size_hint_check() { ); let http_client = infallible_client_fn(move |_| { - http::Response::builder() + http_1x::Response::builder() .status(200) .body((test_body)()) .unwrap() diff --git a/aws/sdk/integration-tests/s3/tests/bucket-required.rs b/aws/sdk/integration-tests/s3/tests/bucket-required.rs index 3795de6fe..40b24b34b 100644 --- a/aws/sdk/integration-tests/s3/tests/bucket-required.rs +++ b/aws/sdk/integration-tests/s3/tests/bucket-required.rs @@ -7,7 +7,7 @@ use aws_config::SdkConfig; use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region, StalledStreamProtectionConfig}; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn dont_dispatch_when_bucket_is_unset() { diff --git a/aws/sdk/integration-tests/s3/tests/business_metrics.rs b/aws/sdk/integration-tests/s3/tests/business_metrics.rs index f04474685..2fc8616d5 100644 --- a/aws/sdk/integration-tests/s3/tests/business_metrics.rs +++ b/aws/sdk/integration-tests/s3/tests/business_metrics.rs @@ -12,7 +12,7 @@ use aws_sdk_s3::{ primitives::ByteStream, Client, Config, }; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[derive(Debug)] struct TransferManagerFeatureInterceptor; diff --git a/aws/sdk/integration-tests/s3/tests/checksums.rs b/aws/sdk/integration-tests/s3/tests/checksums.rs index 695b141b8..91bd0be81 100644 --- a/aws/sdk/integration-tests/s3/tests/checksums.rs +++ b/aws/sdk/integration-tests/s3/tests/checksums.rs @@ -8,15 +8,14 @@ use aws_config::SdkConfig; use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region, StalledStreamProtectionConfig}; +use aws_sdk_s3::primitives::ByteStream; use aws_sdk_s3::types::ChecksumMode; use aws_sdk_s3::{operation::get_object::GetObjectOutput, types::ChecksumAlgorithm}; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::{ - capture_request, ReplayEvent, StaticReplayClient, -}; +use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; -use http::header::AUTHORIZATION; -use http::{HeaderValue, Uri}; +use http_1x::header::AUTHORIZATION; +use http_1x::{HeaderValue, Uri}; use std::time::{Duration, UNIX_EPOCH}; use tracing_test::traced_test; @@ -28,7 +27,7 @@ fn new_checksum_validated_response_test_connection( checksum_header_value: &'static str, ) -> StaticReplayClient { StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("x-amz-checksum-mode", "ENABLED") .header( "user-agent", @@ -49,7 +48,7 @@ fn new_checksum_validated_response_test_connection( )) .body(SdkBody::empty()) .unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "4B4NGF0EAWN0GE63") .header("content-length", "11") .header("etag", "\"3e25960a79dbc69b674cd4ec67a72c62\"") @@ -64,7 +63,7 @@ fn new_checksum_validated_response_test_connection( "kPl+IVVZAwsN8ePUyQJZ40WD9dzaqtr4eNESArqE68GSKtVvuvCTDe+SxhTT+JTUqXB1HL4OxNM=", ) .header("accept-ranges", "bytes") - .status(http::StatusCode::from_u16(200).unwrap()) + .status(http_1x::StatusCode::from_u16(200).unwrap()) .body(SdkBody::from(r#"Hello world"#)) .unwrap(), )]) @@ -319,14 +318,14 @@ async fn test_sha256_checksum_on_streaming_request() { .await } -async fn collect_body_into_string(mut body: aws_smithy_types::body::SdkBody) -> String { +async fn collect_body_into_string(body: aws_smithy_types::body::SdkBody) -> String { use bytes::Buf; use bytes_utils::SegmentedBuf; - use http_body::Body; use std::io::Read; + let mut stream = ByteStream::new(body); let mut output = SegmentedBuf::new(); - while let Some(buf) = body.data().await { + while let Some(buf) = stream.next().await { output.push(buf.unwrap()); } @@ -344,7 +343,7 @@ async fn collect_body_into_string(mut body: aws_smithy_types::body::SdkBody) -> async fn test_get_multipart_upload_part_checksum_validation() { let expected_checksum = "cpjwid==-12"; let (http_client, rcvr) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("etag", "\"3e25960a79dbc69b674cd4ec67a72c62\"") .header("x-amz-checksum-crc32", expected_checksum) .body(SdkBody::empty()) @@ -391,7 +390,7 @@ async fn test_get_multipart_upload_part_checksum_validation() { async fn test_response_checksum_ignores_invalid_base64() { let expected_checksum = "{}{!!#{})!{)@$(}"; let (http_client, rcvr) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("etag", "\"3e25960a79dbc69b674cd4ec67a72c62\"") .header("x-amz-checksum-crc32", expected_checksum) .body(SdkBody::empty()) diff --git a/aws/sdk/integration-tests/s3/tests/config-override.rs b/aws/sdk/integration-tests/s3/tests/config-override.rs index 653313e23..a9378c1d5 100644 --- a/aws/sdk/integration-tests/s3/tests/config-override.rs +++ b/aws/sdk/integration-tests/s3/tests/config-override.rs @@ -6,7 +6,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::{capture_request, CaptureRequestReceiver}; +use aws_smithy_http_client::test_util::{capture_request, CaptureRequestReceiver}; use aws_types::SdkConfig; fn test_client() -> (CaptureRequestReceiver, Client) { diff --git a/aws/sdk/integration-tests/s3/tests/content-length-enforcement.rs b/aws/sdk/integration-tests/s3/tests/content-length-enforcement.rs index 15bc78b27..a9c37c476 100644 --- a/aws/sdk/integration-tests/s3/tests/content-length-enforcement.rs +++ b/aws/sdk/integration-tests/s3/tests/content-length-enforcement.rs @@ -4,7 +4,7 @@ */ use aws_sdk_s3::{config::Region, error::DisplayErrorContext, Client, Config}; -use aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; #[tokio::test] async fn test_content_length_enforcement_is_not_applied_to_head_request() { diff --git a/aws/sdk/integration-tests/s3/tests/customizable-operation.rs b/aws/sdk/integration-tests/s3/tests/customizable-operation.rs index 891f1a124..69f1c6007 100644 --- a/aws/sdk/integration-tests/s3/tests/customizable-operation.rs +++ b/aws/sdk/integration-tests/s3/tests/customizable-operation.rs @@ -7,8 +7,8 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::presigning::PresigningConfig; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::capture_request; -use http::HeaderValue; +use aws_smithy_http_client::test_util::capture_request; +use http_1x::HeaderValue; use std::time::{Duration, SystemTime}; #[tokio::test] diff --git a/aws/sdk/integration-tests/s3/tests/endpoints.rs b/aws/sdk/integration-tests/s3/tests/endpoints.rs index 11b370ecc..0612a70c1 100644 --- a/aws/sdk/integration-tests/s3/tests/endpoints.rs +++ b/aws/sdk/integration-tests/s3/tests/endpoints.rs @@ -9,7 +9,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::Builder; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::{capture_request, CaptureRequestReceiver}; +use aws_smithy_http_client::test_util::{capture_request, CaptureRequestReceiver}; fn test_client(update_builder: fn(Builder) -> Builder) -> (CaptureRequestReceiver, Client) { let (http_client, captured_request) = capture_request(None); diff --git a/aws/sdk/integration-tests/s3/tests/expires_interceptor.rs b/aws/sdk/integration-tests/s3/tests/expires_interceptor.rs index 5d0e0cd16..488b6d342 100644 --- a/aws/sdk/integration-tests/s3/tests/expires_interceptor.rs +++ b/aws/sdk/integration-tests/s3/tests/expires_interceptor.rs @@ -5,19 +5,19 @@ #![cfg(feature = "test-util")] use aws_sdk_s3::{config::Region, Client, Config}; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; use aws_smithy_types::date_time::{DateTime, Format}; fn make_client(expires_val: &str) -> Client { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() - .uri(http::Uri::from_static( + http_1x::Request::builder() + .uri(http_1x::Uri::from_static( "https://some-test-bucket.s3.us-east-1.amazonaws.com/test.txt?attributes", )) .body(SdkBody::empty()) .unwrap(), - http::Response::builder() + http_1x::Response::builder() .header("Expires", expires_val) .status(200) .body(SdkBody::empty()) diff --git a/aws/sdk/integration-tests/s3/tests/express.rs b/aws/sdk/integration-tests/s3/tests/express.rs index 15635a9fd..1b4505368 100644 --- a/aws/sdk/integration-tests/s3/tests/express.rs +++ b/aws/sdk/integration-tests/s3/tests/express.rs @@ -13,13 +13,11 @@ use aws_sdk_s3::presigning::PresigningConfig; use aws_sdk_s3::primitives::SdkBody; use aws_sdk_s3::types::ChecksumAlgorithm; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient; -use aws_smithy_runtime::client::http::test_util::{ - capture_request, ReplayEvent, StaticReplayClient, -}; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; +use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_types::endpoint::Endpoint; -use http::Uri; +use http_1x::Uri; async fn test_client(update_builder: F) -> Client where @@ -106,16 +104,16 @@ async fn mixed_auths() { .unwrap(); } -fn create_session_request() -> http::Request { - http::Request::builder() +fn create_session_request() -> http_1x::Request { + http_1x::Request::builder() .uri("https://s3express-test-bucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com/?session") .method("GET") .body(SdkBody::empty()) .unwrap() } -fn create_session_response() -> http::Response { - http::Response::builder() +fn create_session_response() -> http_1x::Response { + http_1x::Response::builder() .status(200) .body(SdkBody::from( r#" @@ -189,8 +187,8 @@ async fn presigning() { fn operation_request_with_checksum( query: &str, kv: Option<(&str, &str)>, -) -> http::Request { - let mut b = http::Request::builder() +) -> http_1x::Request { + let mut b = http_1x::Request::builder() .uri(&format!("https://s3express-test-bucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com/{query}")) .method("GET"); if let Some((key, value)) = kv { @@ -199,8 +197,8 @@ fn operation_request_with_checksum( b.body(SdkBody::empty()).unwrap() } -fn response_ok() -> http::Response { - http::Response::builder() +fn response_ok() -> http_1x::Response { + http_1x::Response::builder() .status(200) .body(SdkBody::empty()) .unwrap() diff --git a/aws/sdk/integration-tests/s3/tests/hyper-10.rs b/aws/sdk/integration-tests/s3/tests/hyper-10.rs index 77e80d637..c8edc41f8 100644 --- a/aws/sdk/integration-tests/s3/tests/hyper-10.rs +++ b/aws/sdk/integration-tests/s3/tests/hyper-10.rs @@ -3,15 +3,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -use aws_smithy_experimental::hyper_1_0::CryptoMode; +use aws_smithy_http_client::tls; use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; #[tokio::test] #[ignore] async fn hyper_10_end_to_end() { - let http_client = aws_smithy_experimental::hyper_1_0::HyperClientBuilder::default() - .crypto_mode(CryptoMode::Ring) + let http_client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::Ring, + )) .build_https(); + let conf = aws_config::defaults(BehaviorVersion::latest()) .http_client(http_client) .load() diff --git a/aws/sdk/integration-tests/s3/tests/identity-cache.rs b/aws/sdk/integration-tests/s3/tests/identity-cache.rs index 6fa6a0aaf..7ad784bdd 100644 --- a/aws/sdk/integration-tests/s3/tests/identity-cache.rs +++ b/aws/sdk/integration-tests/s3/tests/identity-cache.rs @@ -12,15 +12,19 @@ use aws_credential_types::{ Credentials, }; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; +use aws_smithy_http_client::test_util::infallible_client_fn; // NOTE: These tests are _not_ S3 specific and would apply to any AWS SDK but due to the need to consume `aws-config` // (which depends on relocated runtime crates) we can't make this an `awsSdkIntegrationTest(..)`. #[tokio::test] async fn test_identity_cache_reused_by_default() { - let http_client = - infallible_client_fn(|_req| http::Response::builder().status(200).body("OK!").unwrap()); + let http_client = infallible_client_fn(|_req| { + http_1x::Response::builder() + .status(200) + .body("OK!") + .unwrap() + }); let provider = TestCredProvider::new(); let config = aws_config::defaults(BehaviorVersion::latest()) @@ -42,8 +46,12 @@ async fn test_identity_cache_reused_by_default() { #[allow(deprecated)] // intentionally testing an old behavior version #[tokio::test] async fn test_identity_cache_ga_behavior_version() { - let http_client = - infallible_client_fn(|_req| http::Response::builder().status(200).body("OK!").unwrap()); + let http_client = infallible_client_fn(|_req| { + http_1x::Response::builder() + .status(200) + .body("OK!") + .unwrap() + }); let provider = TestCredProvider::new(); diff --git a/aws/sdk/integration-tests/s3/tests/ignore-invalid-xml-body-root.rs b/aws/sdk/integration-tests/s3/tests/ignore-invalid-xml-body-root.rs index 1ab6a6ee5..da92a5e86 100644 --- a/aws/sdk/integration-tests/s3/tests/ignore-invalid-xml-body-root.rs +++ b/aws/sdk/integration-tests/s3/tests/ignore-invalid-xml-body-root.rs @@ -8,7 +8,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::Config; use aws_sdk_s3::{config::Credentials, config::Region, types::ObjectAttributes, Client}; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; const RESPONSE_BODY_XML: &[u8] = b"\ne1AsOh9IyGCa4hLN+2Od7jlnP14="; @@ -16,16 +16,16 @@ const RESPONSE_BODY_XML: &[u8] = b"\n< #[tokio::test] async fn ignore_invalid_xml_body_root() { let http_client = StaticReplayClient::new(vec![ - ReplayEvent::new(http::Request::builder() + ReplayEvent::new(http_1x::Request::builder() .header("x-amz-object-attributes", "Checksum") .header("x-amz-user-agent", "aws-sdk-rust/0.123.test api/test-service/0.123 os/windows/XPSP3 lang/rust/1.50.0") .header("x-amz-date", "20090213T233130Z") .header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20210618/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-object-attributes;x-amz-security-token;x-amz-user-agent, Signature=0e6ec749db5a0af07890a83f553319eda95be0e498d058c64880471a474c5378") .header("x-amz-content-sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") - .uri(http::Uri::from_static("https://some-test-bucket.s3.us-east-1.amazonaws.com/test.txt?attributes")) + .uri(http_1x::Uri::from_static("https://some-test-bucket.s3.us-east-1.amazonaws.com/test.txt?attributes")) .body(SdkBody::empty()) .unwrap(), - http::Response::builder() + http_1x::Response::builder() .header( "x-amz-id-2", "rbipIUyF3YKPIcqpz6hrP9x9mzYMSqkHzDEp6TEN/STcKvylDIE/LLN6x9t6EKJRrgctNsdNHWk=", diff --git a/aws/sdk/integration-tests/s3/tests/interceptors.rs b/aws/sdk/integration-tests/s3/tests/interceptors.rs index b8e1e07c4..97a302cc8 100644 --- a/aws/sdk/integration-tests/s3/tests/interceptors.rs +++ b/aws/sdk/integration-tests/s3/tests/interceptors.rs @@ -6,13 +6,13 @@ use aws_sdk_s3::config::interceptors::BeforeTransmitInterceptorContextMut; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::interceptors::Intercept; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace}; -use http::header::USER_AGENT; -use http::HeaderValue; +use http_1x::header::USER_AGENT; +use http_1x::HeaderValue; #[tokio::test] async fn interceptor_priority() { diff --git a/aws/sdk/integration-tests/s3/tests/naughty-string-metadata.rs b/aws/sdk/integration-tests/s3/tests/naughty-string-metadata.rs index 22d09d1b1..084f0d9a6 100644 --- a/aws/sdk/integration-tests/s3/tests/naughty-string-metadata.rs +++ b/aws/sdk/integration-tests/s3/tests/naughty-string-metadata.rs @@ -8,8 +8,8 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::Config; use aws_sdk_s3::{config::Credentials, config::Region, primitives::ByteStream, Client}; -use aws_smithy_runtime::client::http::test_util::capture_request; -use http::HeaderValue; +use aws_smithy_http_client::test_util::capture_request; +use http_1x::HeaderValue; const NAUGHTY_STRINGS: &str = include_str!("blns/blns.txt"); diff --git a/aws/sdk/integration-tests/s3/tests/no_auth.rs b/aws/sdk/integration-tests/s3/tests/no_auth.rs index 644e05add..30c2d2151 100644 --- a/aws/sdk/integration-tests/s3/tests/no_auth.rs +++ b/aws/sdk/integration-tests/s3/tests/no_auth.rs @@ -4,7 +4,7 @@ */ use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; #[tokio::test] diff --git a/aws/sdk/integration-tests/s3/tests/normalize-uri-path.rs b/aws/sdk/integration-tests/s3/tests/normalize-uri-path.rs index 135fb35df..a2e746d1e 100644 --- a/aws/sdk/integration-tests/s3/tests/normalize-uri-path.rs +++ b/aws/sdk/integration-tests/s3/tests/normalize-uri-path.rs @@ -7,7 +7,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::primitives::ByteStream; use aws_sdk_s3::Config; use aws_sdk_s3::{config::Credentials, config::Region, Client}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn test_operation_should_not_normalize_uri_path() { diff --git a/aws/sdk/integration-tests/s3/tests/presigning.rs b/aws/sdk/integration-tests/s3/tests/presigning.rs index 9791ae984..8450968ad 100644 --- a/aws/sdk/integration-tests/s3/tests/presigning.rs +++ b/aws/sdk/integration-tests/s3/tests/presigning.rs @@ -8,8 +8,8 @@ use std::collections::HashMap; use futures_util::future::FutureExt; use futures_util::Future; -use http::header::{CONTENT_LENGTH, CONTENT_TYPE}; -use http::Uri; +use http_1x::header::{CONTENT_LENGTH, CONTENT_TYPE}; +use http_1x::Uri; use s3::config::{Credentials, Region}; use s3::operation::get_object::builders::GetObjectFluentBuilder; use s3::operation::head_object::builders::HeadObjectFluentBuilder; diff --git a/aws/sdk/integration-tests/s3/tests/query-strings-are-correctly-encoded.rs b/aws/sdk/integration-tests/s3/tests/query-strings-are-correctly-encoded.rs index 31870702d..d2de92f3f 100644 --- a/aws/sdk/integration-tests/s3/tests/query-strings-are-correctly-encoded.rs +++ b/aws/sdk/integration-tests/s3/tests/query-strings-are-correctly-encoded.rs @@ -9,7 +9,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::operation::list_objects_v2::ListObjectsV2Error; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn test_s3_signer_query_string_with_all_valid_chars() { diff --git a/aws/sdk/integration-tests/s3/tests/reconnects.rs b/aws/sdk/integration-tests/s3/tests/reconnects.rs index 5390cb285..acc078c22 100644 --- a/aws/sdk/integration-tests/s3/tests/reconnects.rs +++ b/aws/sdk/integration-tests/s3/tests/reconnects.rs @@ -6,8 +6,7 @@ use aws_sdk_s3::config::retry::{ReconnectMode, RetryConfig}; use aws_sdk_s3::config::{Credentials, Region, SharedAsyncSleep}; use aws_smithy_async::rt::sleep::TokioSleep; -use aws_smithy_runtime::client::http::test_util::wire::{ReplayedEvent, WireMockServer}; -use aws_smithy_runtime::{ev, match_events}; +use aws_smithy_http_client::test_util::wire::{ev, match_events, ReplayedEvent, WireMockServer}; #[tokio::test] async fn test_disable_reconnect_on_503() { diff --git a/aws/sdk/integration-tests/s3/tests/recursion-detection.rs b/aws/sdk/integration-tests/s3/tests/recursion-detection.rs index adcd13a20..a98655225 100644 --- a/aws/sdk/integration-tests/s3/tests/recursion-detection.rs +++ b/aws/sdk/integration-tests/s3/tests/recursion-detection.rs @@ -7,7 +7,7 @@ use aws_config::SdkConfig; use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn recursion_detection_applied() { diff --git a/aws/sdk/integration-tests/s3/tests/request_id.rs b/aws/sdk/integration-tests/s3/tests/request_id.rs index 886b2d5ba..d38dbeb55 100644 --- a/aws/sdk/integration-tests/s3/tests/request_id.rs +++ b/aws/sdk/integration-tests/s3/tests/request_id.rs @@ -6,13 +6,13 @@ use aws_sdk_s3::operation::get_object::GetObjectError; use aws_sdk_s3::operation::{RequestId, RequestIdExt}; use aws_sdk_s3::{config::Credentials, config::Region, Client, Config}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_types::body::SdkBody; #[tokio::test] async fn get_request_id_from_modeled_error() { let (http_client, request) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "correct-request-id") .header("x-amz-id-2", "correct-extended-request-id") .status(404) @@ -62,7 +62,7 @@ async fn get_request_id_from_modeled_error() { #[allow(deprecated)] async fn get_request_id_from_unmodeled_error() { let (http_client, request) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "correct-request-id") .header("x-amz-id-2", "correct-extended-request-id") .status(500) @@ -108,7 +108,7 @@ async fn get_request_id_from_unmodeled_error() { #[tokio::test] async fn get_request_id_from_successful_nonstreaming_response() { let (http_client, request) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "correct-request-id") .header("x-amz-id-2", "correct-extended-request-id") .status(200) @@ -143,7 +143,7 @@ async fn get_request_id_from_successful_nonstreaming_response() { #[tokio::test] async fn get_request_id_from_successful_streaming_response() { let (http_client, request) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "correct-request-id") .header("x-amz-id-2", "correct-extended-request-id") .status(200) @@ -175,7 +175,7 @@ async fn get_request_id_from_successful_streaming_response() { #[tokio::test] async fn conversion_to_service_error_maintains_request_id() { let (http_client, request) = capture_request(Some( - http::Response::builder() + http_1x::Response::builder() .header("x-amz-request-id", "correct-request-id") .header("x-amz-id-2", "correct-extended-request-id") .status(404) diff --git a/aws/sdk/integration-tests/s3/tests/request_information_headers.rs b/aws/sdk/integration-tests/s3/tests/request_information_headers.rs index c444aa5b8..c8ced3ed2 100644 --- a/aws/sdk/integration-tests/s3/tests/request_information_headers.rs +++ b/aws/sdk/integration-tests/s3/tests/request_information_headers.rs @@ -15,7 +15,7 @@ use aws_sdk_s3::Client; use aws_smithy_async::test_util::InstantSleep; use aws_smithy_async::test_util::ManualTimeSource; use aws_smithy_async::time::SharedTimeSource; -use aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; diff --git a/aws/sdk/integration-tests/s3/tests/required-query-params.rs b/aws/sdk/integration-tests/s3/tests/required-query-params.rs index d9604260e..77437c722 100644 --- a/aws/sdk/integration-tests/s3/tests/required-query-params.rs +++ b/aws/sdk/integration-tests/s3/tests/required-query-params.rs @@ -6,7 +6,7 @@ use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::error::DisplayErrorContext; use aws_sdk_s3::Client; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; use aws_smithy_types::error::operation::BuildError; #[tokio::test] diff --git a/aws/sdk/integration-tests/s3/tests/retry-classifier-customization.rs b/aws/sdk/integration-tests/s3/tests/retry-classifier-customization.rs index ecac15f75..c66f68a15 100644 --- a/aws/sdk/integration-tests/s3/tests/retry-classifier-customization.rs +++ b/aws/sdk/integration-tests/s3/tests/retry-classifier-customization.rs @@ -7,7 +7,7 @@ use aws_sdk_s3::config::interceptors::InterceptorContext; use aws_sdk_s3::config::retry::{ClassifyRetry, RetryAction, RetryConfig}; use aws_sdk_s3::config::SharedAsyncSleep; use aws_smithy_async::rt::sleep::TokioSleep; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority; use aws_smithy_types::body::SdkBody; use std::sync::{Arc, Mutex}; @@ -51,21 +51,21 @@ impl ClassifyRetry for CustomizationTestClassifier { } } -fn req() -> http::Request { - http::Request::builder() +fn req() -> http_1x::Request { + http_1x::Request::builder() .body(SdkBody::from("request body")) .unwrap() } -fn ok() -> http::Response { - http::Response::builder() +fn ok() -> http_1x::Response { + http_1x::Response::builder() .status(200) .body(SdkBody::from("Hello!")) .unwrap() } -fn err() -> http::Response { - http::Response::builder() +fn err() -> http_1x::Response { + http_1x::Response::builder() .status(500) .body(SdkBody::from("This was an error")) .unwrap() diff --git a/aws/sdk/integration-tests/s3/tests/select-object-content.rs b/aws/sdk/integration-tests/s3/tests/select-object-content.rs index d9eb6d6df..8c7d93c12 100644 --- a/aws/sdk/integration-tests/s3/tests/select-object-content.rs +++ b/aws/sdk/integration-tests/s3/tests/select-object-content.rs @@ -11,8 +11,8 @@ use aws_sdk_s3::types::{ OutputSerialization, SelectObjectContentEventStream, }; use aws_sdk_s3::Client; +use aws_smithy_http_client::test_util::dvr::{Event, ReplayingClient}; use aws_smithy_protocol_test::{assert_ok, validate_body, MediaType}; -use aws_smithy_runtime::client::http::test_util::dvr::{Event, ReplayingClient}; use std::error::Error; #[tokio::test] diff --git a/aws/sdk/integration-tests/s3/tests/service_timeout_overrides.rs b/aws/sdk/integration-tests/s3/tests/service_timeout_overrides.rs index 062b04a60..62022d5cd 100644 --- a/aws/sdk/integration-tests/s3/tests/service_timeout_overrides.rs +++ b/aws/sdk/integration-tests/s3/tests/service_timeout_overrides.rs @@ -7,7 +7,7 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_credential_types::Credentials; use aws_smithy_async::assert_elapsed; use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; -use aws_smithy_runtime::client::http::test_util::NeverClient; +use aws_smithy_http_client::test_util::NeverClient; use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs; use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; use aws_smithy_runtime_api::client::result::SdkError; diff --git a/aws/sdk/integration-tests/s3/tests/signing-it.rs b/aws/sdk/integration-tests/s3/tests/signing-it.rs index c1027ec92..0af9726fa 100644 --- a/aws/sdk/integration-tests/s3/tests/signing-it.rs +++ b/aws/sdk/integration-tests/s3/tests/signing-it.rs @@ -9,20 +9,19 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::primitives::ByteStream; use aws_sdk_s3::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::capture_request; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; -use http::header::AUTHORIZATION; +use http_1x::header::AUTHORIZATION; #[tokio::test] async fn test_signer() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=27e3f59ec3cffaa10e4f1c92112e8fb62d468a04cd32be39e68215f830404dbb") .uri("https://test-bucket.s3.us-east-1.amazonaws.com/?list-type=2&prefix=prefix~") .body(SdkBody::empty()) .unwrap(), - http::Response::builder().status(200).body(SdkBody::empty()).unwrap(), + http_1x::Response::builder().status(200).body(SdkBody::empty()).unwrap(), )]); let config = Config::builder() .credentials_provider(SharedCredentialsProvider::new( diff --git a/aws/sdk/integration-tests/s3/tests/stalled-stream-protection.rs b/aws/sdk/integration-tests/s3/tests/stalled-stream-protection.rs index 920c95c1d..85e556081 100644 --- a/aws/sdk/integration-tests/s3/tests/stalled-stream-protection.rs +++ b/aws/sdk/integration-tests/s3/tests/stalled-stream-protection.rs @@ -13,7 +13,7 @@ use aws_sdk_s3::{Client, Config}; use aws_smithy_runtime::{assert_str_contains, test_util::capture_test_logs::capture_test_logs}; use aws_smithy_types::body::SdkBody; use bytes::{Bytes, BytesMut}; -use http_body::Body; +use http_body_1x::Body; use std::error::Error; use std::time::Duration; use std::{future::Future, task::Poll}; @@ -46,10 +46,10 @@ impl Body for SlowBody { type Data = Bytes; type Error = BoxError; - fn poll_data( + fn poll_frame( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll, Self::Error>>> { loop { let mut state = SlowBodyState::Taken; std::mem::swap(&mut state, &mut self.state); @@ -63,24 +63,17 @@ impl Body for SlowBody { }, SlowBodyState::Send => { self.state = SlowBodyState::Wait(Box::pin(sleep(Duration::from_micros(100)))); - return Poll::Ready(Some(Ok(Bytes::from_static( + return Poll::Ready(Some(Ok(http_body_1x::Frame::data(Bytes::from_static( b"data_data_data_data_data_data_data_data_data_data_data_data_\ data_data_data_data_data_data_data_data_data_data_data_data_\ data_data_data_data_data_data_data_data_data_data_data_data_\ data_data_data_data_data_data_data_data_data_data_data_data_", - )))); + ))))); } SlowBodyState::Taken => unreachable!(), } } } - - fn poll_trailers( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - ) -> Poll, Self::Error>> { - Poll::Ready(Ok(None)) - } } #[tokio::test] @@ -106,7 +99,7 @@ async fn test_stalled_stream_protection_defaults_for_upload() { .put_object() .bucket("a-test-bucket") .key("stalled-stream-test.txt") - .body(ByteStream::new(SdkBody::from_body_0_4(SlowBody::new()))) + .body(ByteStream::new(SdkBody::from_body_1_x(SlowBody::new()))) .send() .await .expect_err("upload stream stalled out"); diff --git a/aws/sdk/integration-tests/s3/tests/status-200-errors.rs b/aws/sdk/integration-tests/s3/tests/status-200-errors.rs index d04ad0940..2febaee6a 100644 --- a/aws/sdk/integration-tests/s3/tests/status-200-errors.rs +++ b/aws/sdk/integration-tests/s3/tests/status-200-errors.rs @@ -7,8 +7,8 @@ use aws_config::retry::{RetryConfigBuilder, RetryMode}; use aws_credential_types::provider::SharedCredentialsProvider; use aws_credential_types::Credentials; use aws_sdk_s3::Client; +use aws_smithy_http_client::test_util::infallible_client_fn; use aws_smithy_runtime::assert_str_contains; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; use aws_smithy_types::body::SdkBody; use aws_smithy_types::error::metadata::ProvideErrorMetadata; use aws_types::region::Region; @@ -26,7 +26,7 @@ const ERROR_RESPONSE: &str = r#" #[tokio::test] async fn status_200_errors() { let http_client = - infallible_client_fn(|_req| http::Response::new(SdkBody::from(ERROR_RESPONSE))); + infallible_client_fn(|_req| http_1x::Response::new(SdkBody::from(ERROR_RESPONSE))); let sdk_config = SdkConfig::builder() .credentials_provider(SharedCredentialsProvider::new(Credentials::for_tests())) .region(Region::new("us-west-4")) @@ -47,7 +47,7 @@ async fn status_200_errors() { #[tokio::test] async fn retry_200_internal_error() { let http_client = infallible_client_fn(|_req| { - http::Response::new(SdkBody::from( + http_1x::Response::new(SdkBody::from( r#" Server diff --git a/aws/sdk/integration-tests/s3/tests/streaming-response.rs b/aws/sdk/integration-tests/s3/tests/streaming-response.rs index 1bc4eef8a..819b417d1 100644 --- a/aws/sdk/integration-tests/s3/tests/streaming-response.rs +++ b/aws/sdk/integration-tests/s3/tests/streaming-response.rs @@ -8,11 +8,11 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3::config::{Credentials, Region}; use aws_sdk_s3::error::DisplayErrorContext; use aws_sdk_s3::Client; +use aws_smithy_http_client::test_util::infallible_client_fn; use aws_smithy_runtime::assert_str_contains; -use aws_smithy_runtime::client::http::test_util::infallible_client_fn; use aws_smithy_types::body::SdkBody; use bytes::BytesMut; -use http::header::CONTENT_LENGTH; +use http_1x::header::CONTENT_LENGTH; use std::future::Future; use std::net::SocketAddr; use std::time::Duration; @@ -24,7 +24,7 @@ async fn test_too_short_body_causes_an_error() { // in its own async runtime. But there's no reason a customer couldn't run their _own_ HttpClient // that was more poorly behaved, so we'll do that here. let http_client = infallible_client_fn(|_req| { - http::Response::builder() + http_1x::Response::builder() .header(CONTENT_LENGTH, 5000) .body(SdkBody::from("definitely not 5000 characters")) .unwrap() diff --git a/aws/sdk/integration-tests/s3/tests/timeouts.rs b/aws/sdk/integration-tests/s3/tests/timeouts.rs index 7f0f509f0..14e6f0d54 100644 --- a/aws/sdk/integration-tests/s3/tests/timeouts.rs +++ b/aws/sdk/integration-tests/s3/tests/timeouts.rs @@ -12,7 +12,7 @@ use aws_sdk_s3::types::{ }; use aws_sdk_s3::{Client, Config}; use aws_smithy_async::assert_elapsed; -use aws_smithy_runtime::client::http::test_util::NeverClient; +use aws_smithy_http_client::test_util::NeverClient; use std::future::Future; use std::net::SocketAddr; use std::time::Duration; @@ -194,7 +194,7 @@ async fn test_connect_timeout() { Err(err) => { let message = format!("{}", DisplayErrorContext(&err)); let expected = - "timeout: error trying to connect: HTTP connect timeout occurred after 300ms"; + "timeout: client error (Connect): HTTP connect timeout occurred after 300ms"; assert!( message.contains(expected), "expected '{message}' to contain '{expected}'" diff --git a/aws/sdk/integration-tests/s3control/Cargo.toml b/aws/sdk/integration-tests/s3control/Cargo.toml index fc059b283..7fd9f17ed 100644 --- a/aws/sdk/integration-tests/s3control/Cargo.toml +++ b/aws/sdk/integration-tests/s3control/Cargo.toml @@ -18,11 +18,12 @@ test-util = [] aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } aws-sdk-s3control = { path = "../../build/aws-sdk/sdk/s3control", features = ["test-util", "behavior-version-latest"] } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } aws-types = { path = "../../build/aws-sdk/sdk/aws-types" } bytes = "1.0.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } serde_json = "1.0.0" tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/s3control/tests/signing-it.rs b/aws/sdk/integration-tests/s3control/tests/signing-it.rs index b235f7aa1..d6548e431 100644 --- a/aws/sdk/integration-tests/s3control/tests/signing-it.rs +++ b/aws/sdk/integration-tests/s3control/tests/signing-it.rs @@ -6,14 +6,14 @@ use aws_credential_types::provider::SharedCredentialsProvider; use aws_sdk_s3control::config::{Credentials, Region}; use aws_sdk_s3control::{Client, Config}; -use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; -use http::header::AUTHORIZATION; +use http_1x::header::AUTHORIZATION; #[tokio::test] async fn test_signer() { let http_client = StaticReplayClient::new(vec![ReplayEvent::new( - http::Request::builder() + http_1x::Request::builder() .header("authorization", "AWS4-HMAC-SHA256 Credential=ANOTREAL/20090213/us-east-1/s3/aws4_request, \ SignedHeaders=host;x-amz-account-id;x-amz-content-sha256;x-amz-date;x-amz-user-agent, \ @@ -21,7 +21,7 @@ async fn test_signer() { .uri("https://test-bucket.s3-control.us-east-1.amazonaws.com/v20180820/accesspoint") .body(SdkBody::empty()) .unwrap(), - http::Response::builder().status(200).body(SdkBody::empty()).unwrap(), + http_1x::Response::builder().status(200).body(SdkBody::empty()).unwrap(), )]); let config = Config::builder() .credentials_provider(SharedCredentialsProvider::new( diff --git a/aws/sdk/integration-tests/sts/Cargo.toml b/aws/sdk/integration-tests/sts/Cargo.toml index c629b2d31..8d7bde580 100644 --- a/aws/sdk/integration-tests/sts/Cargo.toml +++ b/aws/sdk/integration-tests/sts/Cargo.toml @@ -14,7 +14,8 @@ publish = false aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] } aws-sdk-sts = { path = "../../build/aws-sdk/sdk/sts", features = ["behavior-version-latest"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" } tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } diff --git a/aws/sdk/integration-tests/sts/tests/signing-it.rs b/aws/sdk/integration-tests/sts/tests/signing-it.rs index 60ff2e368..960234768 100644 --- a/aws/sdk/integration-tests/sts/tests/signing-it.rs +++ b/aws/sdk/integration-tests/sts/tests/signing-it.rs @@ -4,7 +4,7 @@ */ use aws_sdk_sts::config::{Credentials, Region}; -use aws_smithy_runtime::client::http::test_util::capture_request; +use aws_smithy_http_client::test_util::capture_request; #[tokio::test] async fn assume_role_signed() { diff --git a/aws/sdk/integration-tests/timestreamquery/Cargo.toml b/aws/sdk/integration-tests/timestreamquery/Cargo.toml index ea94cf9bc..d9dc902fa 100644 --- a/aws/sdk/integration-tests/timestreamquery/Cargo.toml +++ b/aws/sdk/integration-tests/timestreamquery/Cargo.toml @@ -15,6 +15,7 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-sdk-timestreamquery = { path = "../../build/aws-sdk/sdk/timestreamquery", features = ["behavior-version-latest"] } aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async", features = ["test-util"] } aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["test-util"] } +aws-smithy-http-client = { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } aws-types = { path = "../../build/aws-sdk/sdk/aws-types" } tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing-subscriber = "0.3.17" diff --git a/aws/sdk/integration-tests/timestreamquery/tests/endpoint_disco.rs b/aws/sdk/integration-tests/timestreamquery/tests/endpoint_disco.rs index d78ca7626..fe4499842 100644 --- a/aws/sdk/integration-tests/timestreamquery/tests/endpoint_disco.rs +++ b/aws/sdk/integration-tests/timestreamquery/tests/endpoint_disco.rs @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -use aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient; +use aws_smithy_http_client::test_util::dvr::ReplayingClient; #[tokio::test] async fn do_endpoint_discovery() { diff --git a/aws/sdk/integration-tests/transcribestreaming/Cargo.toml b/aws/sdk/integration-tests/transcribestreaming/Cargo.toml index e9f8e0b9f..9d2057e70 100644 --- a/aws/sdk/integration-tests/transcribestreaming/Cargo.toml +++ b/aws/sdk/integration-tests/transcribestreaming/Cargo.toml @@ -14,11 +14,11 @@ aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", aws-sdk-transcribestreaming = { path = "../../build/aws-sdk/sdk/transcribestreaming", features = ["behavior-version-latest"] } aws-smithy-eventstream = { path = "../../build/aws-sdk/sdk/aws-smithy-eventstream", features = ["test-util"] } aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" } -aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] } +aws-smithy-http-client= { path = "../../build/aws-sdk/sdk/aws-smithy-http-client", features = ["test-util"] } bytes = "1.0.0" futures-core = "0.3.29" hound = "3.4.0" -http = "0.2.0" +http-1x = { package = "http", version = "1" } serde_json = "1.0.0" tokio = { version = "1.23.1", features = ["full", "test-util"] } tracing = "0.1" diff --git a/aws/sdk/integration-tests/transcribestreaming/tests/test.rs b/aws/sdk/integration-tests/transcribestreaming/tests/test.rs index f487b6c49..18626d828 100644 --- a/aws/sdk/integration-tests/transcribestreaming/tests/test.rs +++ b/aws/sdk/integration-tests/transcribestreaming/tests/test.rs @@ -16,7 +16,7 @@ use aws_sdk_transcribestreaming::types::{ }; use aws_sdk_transcribestreaming::{Client, Config}; use aws_smithy_eventstream::test_util::validate_body; -use aws_smithy_runtime::client::http::test_util::dvr::{Event, ReplayingClient}; +use aws_smithy_http_client::test_util::dvr::{Event, ReplayingClient}; use bytes::BufMut; use futures_core::Stream; use std::error::Error as StdError; diff --git a/build.gradle.kts b/build.gradle.kts index 0d8adb08d..40f95713b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -69,16 +69,18 @@ tasks.register("ktlintFormat") { jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") } -tasks.register("ktlintPreCommit") { - description = "Check Kotlin code style (for the pre-commit hooks)." - group = LifecycleBasePlugin.VERIFICATION_GROUP - classpath = ktlint - mainClass.set("com.pinterest.ktlint.Main") - args = listOf("--log-level=warn", "--color", "--relative", "--format", "--") + - System.getProperty("ktlintPreCommitArgs").let { args -> - check(args.isNotBlank()) { "need to pass in -DktlintPreCommitArgs=" } - args.split(" ") - } - // https://github.com/pinterest/ktlint/issues/1195#issuecomment-1009027802 - jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") +if (System.getProperties().containsKey("ktlintPreCommitArgs")) { + tasks.register("ktlintPreCommit") { + description = "Check Kotlin code style (for the pre-commit hooks)." + group = LifecycleBasePlugin.VERIFICATION_GROUP + classpath = ktlint + mainClass.set("com.pinterest.ktlint.Main") + args = listOf("--log-level=warn", "--color", "--relative", "--format", "--") + + System.getProperty("ktlintPreCommitArgs").let { args -> + check(args.isNotBlank()) { "need to pass in -DktlintPreCommitArgs=" } + args.split(" ") + } + // https://github.com/pinterest/ktlint/issues/1195#issuecomment-1009027802 + jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") + } } diff --git a/buildSrc/src/main/kotlin/CrateSet.kt b/buildSrc/src/main/kotlin/CrateSet.kt index 1bb86b41f..bb9d92a35 100644 --- a/buildSrc/src/main/kotlin/CrateSet.kt +++ b/buildSrc/src/main/kotlin/CrateSet.kt @@ -30,6 +30,7 @@ object CrateSet { "aws-smithy-runtime-api", "aws-smithy-runtime", "aws-smithy-types", + "aws-smithy-http-client", ) val version = { name: String -> @@ -65,6 +66,7 @@ object CrateSet { "aws-smithy-eventstream", "aws-smithy-experimental", "aws-smithy-http", + "aws-smithy-http-client", "aws-smithy-http-auth", "aws-smithy-http-tower", "aws-smithy-json", diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientDecorator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientDecorator.kt index 483485c73..de1ab6caf 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientDecorator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientDecorator.kt @@ -51,7 +51,12 @@ class FluentClientDecorator : ClientCodegenDecorator { customizations = listOf(GenericFluentClient(codegenContext)), ).render(rustCrate) + // TODO(hyper1): disable rustls as a default feature in future release + // NOTE: We enable both rustls and default-https-client as default features. This keeps the legacy hyper+rustls + // stack working as is and lets BehaviorVersion control which client you get. In a future release we will + // break this and disable the rustls feature by default (and break old BMV versions w.r.t http client default). rustCrate.mergeFeature(Feature("rustls", default = true, listOf("aws-smithy-runtime/tls-rustls"))) + rustCrate.mergeFeature(Feature("default-https-client", default = true, listOf("aws-smithy-runtime/default-https-client"))) } override fun libRsCustomizations( diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ClientProtocolTestGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ClientProtocolTestGenerator.kt index 28a448b3c..559db906e 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ClientProtocolTestGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ClientProtocolTestGenerator.kt @@ -199,8 +199,8 @@ class ClientProtocolTestGenerator( """, "capture_request" to - CargoDependency.smithyRuntimeTestUtil(rc).toType() - .resolve("client::http::test_util::capture_request"), + CargoDependency.smithyHttpClientTestUtil(rc).toType() + .resolve("test_util::capture_request"), "config" to ClientRustModule.config, "customParams" to customParams, ) diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SensitiveOutputDecoratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SensitiveOutputDecoratorTest.kt index e78e84e48..fca971abd 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SensitiveOutputDecoratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/SensitiveOutputDecoratorTest.kt @@ -23,6 +23,7 @@ class SensitiveOutputDecoratorTest { .resolve("test_util::capture_test_logs::capture_test_logs"), "capture_request" to RuntimeType.captureRequest(runtimeConfig), "SdkBody" to RuntimeType.sdkBody(runtimeConfig), + "http_1x" to CargoDependency.Http1x.toType(), ) private val model = @@ -59,7 +60,7 @@ class SensitiveOutputDecoratorTest { async fn redacting_sensitive_response_body() { let (_logs, logs_rx) = #{capture_test_logs}(); let (http_client, _r) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .status(200) .body(#{SdkBody}::from("")) .unwrap(), diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt index 08c57cda8..1e334ec47 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecoratorTest.kt @@ -307,8 +307,8 @@ class EndpointsDecoratorTest { } """, "NeverClient" to - CargoDependency.smithyRuntimeTestUtil(clientCodegenContext.runtimeConfig) - .toType().resolve("client::http::test_util::NeverClient"), + CargoDependency.smithyHttpClientTestUtil(clientCodegenContext.runtimeConfig) + .toType().resolve("test_util::NeverClient"), "TokioSleep" to CargoDependency.smithyAsync(clientCodegenContext.runtimeConfig) .withFeature("rt-tokio").toType().resolve("rt::sleep::TokioSleep"), diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ConfigOverrideRuntimePluginGeneratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ConfigOverrideRuntimePluginGeneratorTest.kt index bea5fa742..be67da605 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ConfigOverrideRuntimePluginGeneratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ConfigOverrideRuntimePluginGeneratorTest.kt @@ -135,8 +135,8 @@ internal class ConfigOverrideRuntimePluginGeneratorTest { "AsyncSleep" to RuntimeType.smithyAsync(runtimeConfig).resolve("rt::sleep::AsyncSleep"), "capture_request" to RuntimeType.captureRequest(runtimeConfig), "NeverClient" to - CargoDependency.smithyRuntimeTestUtil(runtimeConfig).toType() - .resolve("client::http::test_util::NeverClient"), + CargoDependency.smithyHttpClientTestUtil(runtimeConfig).toType() + .resolve("test_util::NeverClient"), "Timeout" to RuntimeType.smithyAsync(runtimeConfig).resolve("future::timeout::Timeout"), "TokioSleep" to CargoDependency.smithyAsync(runtimeConfig).withFeature("rt-tokio") diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/EndpointTraitBindingsTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/EndpointTraitBindingsTest.kt index 1b845677a..2fb08ddd8 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/EndpointTraitBindingsTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/EndpointTraitBindingsTest.kt @@ -205,7 +205,7 @@ internal class EndpointTraitBindingsTest { } let (http_client, _r) = capture_request(Some( - http::Response::builder() + #{http_1x}::Response::builder() .status(200) .body(SdkBody::from("")) .unwrap(), @@ -249,8 +249,9 @@ internal class EndpointTraitBindingsTest { } """, "capture_request" to - CargoDependency.smithyRuntimeTestUtil(clientCodegenContext.runtimeConfig) - .toType().resolve("client::http::test_util::capture_request"), + CargoDependency.smithyHttpClientTestUtil(clientCodegenContext.runtimeConfig) + .toType().resolve("test_util::capture_request"), + "http_1x" to CargoDependency.Http1x.toType(), ) } } diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/CustomizableOperationGeneratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/CustomizableOperationGeneratorTest.kt index 30090104f..867480e07 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/CustomizableOperationGeneratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/CustomizableOperationGeneratorTest.kt @@ -53,8 +53,8 @@ class CustomizableOperationGeneratorTest { } """, "NeverClient" to - CargoDependency.smithyRuntimeTestUtil(codegenContext.runtimeConfig).toType() - .resolve("client::http::test_util::NeverClient"), + CargoDependency.smithyHttpClientTestUtil(codegenContext.runtimeConfig).toType() + .resolve("test_util::NeverClient"), ) } } diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientGeneratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientGeneratorTest.kt index b300dfa8c..1b958727a 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientGeneratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/client/FluentClientGeneratorTest.kt @@ -87,8 +87,8 @@ class FluentClientGeneratorTest { } """, "NeverClient" to - CargoDependency.smithyRuntimeTestUtil(codegenContext.runtimeConfig).toType() - .resolve("client::http::test_util::NeverClient"), + CargoDependency.smithyHttpClientTestUtil(codegenContext.runtimeConfig).toType() + .resolve("test_util::NeverClient"), ) } } @@ -116,8 +116,8 @@ class FluentClientGeneratorTest { } """, "NeverClient" to - CargoDependency.smithyRuntimeTestUtil(codegenContext.runtimeConfig).toType() - .resolve("client::http::test_util::NeverClient"), + CargoDependency.smithyHttpClientTestUtil(codegenContext.runtimeConfig).toType() + .resolve("test_util::NeverClient"), ) } } diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt index 7de72b7d8..2e0643011 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/AwsQueryCompatibleTest.kt @@ -74,11 +74,11 @@ class AwsQueryCompatibleTest { tokioTest("should_parse_code_and_type_fields") { rustTemplate( """ - let response = |_: http::Request<#{SdkBody}>| { - http::Response::builder() + let response = |_: #{http_1x}::Request<#{SdkBody}>| { + #{http_1x}::Response::builder() .header( "x-amzn-query-error", - http::HeaderValue::from_static("AWS.SimpleQueueService.NonExistentQueue;Sender"), + #{http_1x}::HeaderValue::from_static("AWS.SimpleQueueService.NonExistentQueue;Sender"), ) .status(400) .body( @@ -107,8 +107,9 @@ class AwsQueryCompatibleTest { *RuntimeType.preludeScope, "SdkBody" to RuntimeType.sdkBody(context.runtimeConfig), "infallible_client_fn" to - CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) - .toType().resolve("client::http::test_util::infallible_client_fn"), + CargoDependency.smithyHttpClientTestUtil(context.runtimeConfig) + .toType().resolve("test_util::infallible_client_fn"), + "http_1x" to CargoDependency.Http1x.toType(), ) } } @@ -126,8 +127,8 @@ class AwsQueryCompatibleTest { tokioTest("should_parse_code_from_payload") { rustTemplate( """ - let response = |_: http::Request<#{SdkBody}>| { - http::Response::builder() + let response = |_: #{http_1x}::Request<#{SdkBody}>| { + #{http_1x}::Response::builder() .status(400) .body( #{SdkBody}::from( @@ -152,8 +153,9 @@ class AwsQueryCompatibleTest { *RuntimeType.preludeScope, "SdkBody" to RuntimeType.sdkBody(context.runtimeConfig), "infallible_client_fn" to - CargoDependency.smithyRuntimeTestUtil(context.runtimeConfig) - .toType().resolve("client::http::test_util::infallible_client_fn"), + CargoDependency.smithyHttpClientTestUtil(context.runtimeConfig) + .toType().resolve("test_util::infallible_client_fn"), + "http_1x" to CargoDependency.Http1x.toType(), ) } } diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/eventstream/ClientEventStreamUnmarshallerGeneratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/eventstream/ClientEventStreamUnmarshallerGeneratorTest.kt index d3e12fae5..19b4d72ce 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/eventstream/ClientEventStreamUnmarshallerGeneratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/eventstream/ClientEventStreamUnmarshallerGeneratorTest.kt @@ -127,7 +127,7 @@ class ClientEventStreamUnmarshallerGeneratorTest { #{event_stream:W} let (http_client, _r) = #{capture_request}(Some( - http::Response::builder() + #{http_1x}::Response::builder() .status(200) .body(SdkBody::from_body_0_4( hyper::Body::wrap_stream(event_stream), @@ -162,6 +162,7 @@ class ClientEventStreamUnmarshallerGeneratorTest { "handle_send_result" to sendResultHandler, "initial_response_stream" to initialResponseStreamGenerator, "receive_event_stream" to eventStreamReceiver, + "http_1x" to CargoDependency.Http1x.toType(), ) } diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt index e0c59f30d..1de9568b5 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt @@ -186,7 +186,7 @@ fun InlineDependency.toType() = RuntimeType(module.fullyQualifiedPath(), this) data class Feature(val name: String, val default: Boolean, val deps: List) -val DEV_ONLY_FEATURES = setOf("test-util") +val DEV_ONLY_FEATURES = setOf("test-util", "legacy-test-util") /** * A dependency on an internal or external Cargo crate @@ -347,7 +347,7 @@ data class CargoDependency( val HyperWithStream: CargoDependency = Hyper.withFeature("stream") // Hyper 1.x types - val Http1x: CargoDependency = CargoDependency("http-1x", CratesIo("1"), `package` = "http", optional = true) + val Http1x: CargoDependency = CargoDependency("http-1x", CratesIo("1"), `package` = "http") val HttpBody1x: CargoDependency = CargoDependency("http-body-1x", CratesIo("1"), `package` = "http-body", optional = true) @@ -363,6 +363,11 @@ data class CargoDependency( fun smithyHttp(runtimeConfig: RuntimeConfig) = runtimeConfig.smithyRuntimeCrate("smithy-http") + fun smithyHttpClient(runtimeConfig: RuntimeConfig) = runtimeConfig.smithyRuntimeCrate("smithy-http-client") + + fun smithyHttpClientTestUtil(runtimeConfig: RuntimeConfig) = + smithyHttpClient(runtimeConfig).toDevDependency().withFeature("test-util") + fun smithyJson(runtimeConfig: RuntimeConfig) = runtimeConfig.smithyRuntimeCrate("smithy-json") fun smithyProtocolTestHelpers(runtimeConfig: RuntimeConfig) = @@ -374,10 +379,6 @@ data class CargoDependency( runtimeConfig.smithyRuntimeCrate("smithy-runtime") .withFeature("client") - fun smithyExperimental(runtimeConfig: RuntimeConfig) = - runtimeConfig.smithyRuntimeCrate("smithy-experimental") - .withFeature("crypto-ring") - fun smithyRuntimeTestUtil(runtimeConfig: RuntimeConfig) = smithyRuntime(runtimeConfig).toDevDependency().withFeature("test-util") diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RuntimeType.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RuntimeType.kt index 7ad456b02..5cd8b5648 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RuntimeType.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RuntimeType.kt @@ -498,11 +498,8 @@ data class RuntimeType(val path: String, val dependency: RustDependency? = null) return smithyTypes(runtimeConfig).resolve("date_time::Format::$timestampFormat") } - fun smithyRuntimeTestUtil(runtimeConfig: RuntimeConfig) = - CargoDependency.smithyRuntimeTestUtil(runtimeConfig).toType().resolve("client::http::test_util") - fun captureRequest(runtimeConfig: RuntimeConfig) = - smithyRuntimeTestUtil(runtimeConfig).resolve("capture_request") + CargoDependency.smithyHttpClientTestUtil(runtimeConfig).toType().resolve("test_util::capture_request") fun forInlineDependency(inlineDependency: InlineDependency) = RuntimeType("crate::${inlineDependency.name}", inlineDependency) diff --git a/design/src/rfcs/rfc0037_http_wrapper.md b/design/src/rfcs/rfc0037_http_wrapper.md index 6c1e1ac14..e8322a1a5 100644 --- a/design/src/rfcs/rfc0037_http_wrapper.md +++ b/design/src/rfcs/rfc0037_http_wrapper.md @@ -95,7 +95,7 @@ This also enables supporting request extensions for different downstream provide Proposed Implementation of `request` ```rust,ignore -{{#include ../../../rust-runtime/aws-smithy-runtime-api/src/client/http/request.rs}} +{{#include ../../../rust-runtime/aws-smithy-runtime-api/src/http/request.rs}} ``` diff --git a/design/src/server/instrumentation.md b/design/src/server/instrumentation.md index ac5c2c56a..7646add98 100644 --- a/design/src/server/instrumentation.md +++ b/design/src/server/instrumentation.md @@ -19,7 +19,7 @@ RUST_LOG=aws_smithy_http_server=warn,aws_smithy_http_server_python=error and -```rust +```rust,ignore # extern crate tracing_subscriber; # extern crate tracing; # use tracing_subscriber::filter; @@ -88,7 +88,7 @@ let app = PokemonService::builder(config) The Pokémon service example, located at `/examples/pokemon-service`, sets up a `tracing` `Subscriber` as follows: -```rust +```rust,ignore # extern crate tracing_subscriber; use tracing_subscriber::{prelude::*, EnvFilter}; diff --git a/design/src/server/middleware.md b/design/src/server/middleware.md index 67802317b..2bac52c9e 100644 --- a/design/src/server/middleware.md +++ b/design/src/server/middleware.md @@ -58,7 +58,7 @@ pub struct NewService { and a complementary -```rust +```rust,ignore # extern crate tower; # pub struct NewService { inner: S } use tower::{Layer, Service}; @@ -137,7 +137,7 @@ where `UpgradeLayer` is the `Layer` converting Smithy model structures to HTTP s The output of the Smithy service builder provides the user with a `Service` implementation. A `Layer` can be applied around the entire `Service`. -```rust,no_run +```rust,ignore # extern crate aws_smithy_http_server; # extern crate pokemon_service_server_sdk; # extern crate tower; @@ -175,7 +175,7 @@ A _single_ layer can be applied to _all_ routes inside the `Router`. This exists as a method on the `PokemonServiceConfig` builder object, which is passed into the service builder. -```rust,no_run +```rust,ignore # extern crate tower; # extern crate pokemon_service_server_sdk; # extern crate aws_smithy_http_server; @@ -209,7 +209,7 @@ Note that requests pass through this middleware immediately _after_ routing succ A "HTTP layer" can be applied to specific operations. -```rust,no_run +```rust,ignore # extern crate tower; # extern crate pokemon_service_server_sdk; # extern crate aws_smithy_http_server; @@ -253,7 +253,7 @@ This middleware transforms the operations HTTP requests and responses. A "model layer" can be applied to specific operations. -```rust,no_run +```rust,ignore # extern crate tower; # extern crate pokemon_service_server_sdk; # extern crate aws_smithy_http_server; @@ -296,7 +296,7 @@ Suppose we want to apply a different `Layer` to every operation. In this case, p Consider the following middleware: -```rust,no_run +```rust,ignore # extern crate aws_smithy_http_server; # extern crate tower; use aws_smithy_http_server::shape_id::ShapeId; diff --git a/examples/pokemon-service-common/Cargo.toml b/examples/pokemon-service-common/Cargo.toml index d7b3f5015..04cf0e8c1 100644 --- a/examples/pokemon-service-common/Cargo.toml +++ b/examples/pokemon-service-common/Cargo.toml @@ -16,7 +16,7 @@ tokio = { version = "1", default-features = false, features = ["time"] } tower = "0.4" # Local paths -aws-smithy-runtime = { path = "../../rust-runtime/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x"] } +aws-smithy-runtime = { path = "../../rust-runtime/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x", "tls-rustls"] } aws-smithy-runtime-api = { path = "../../rust-runtime/aws-smithy-runtime-api", features = ["client"] } pokemon-service-client = { path = "../pokemon-service-client/", features = [ "behavior-version-latest", diff --git a/rust-runtime/Cargo.lock b/rust-runtime/Cargo.lock index 7eba80108..c6ddcad8e 100644 --- a/rust-runtime/Cargo.lock +++ b/rust-runtime/Cargo.lock @@ -128,7 +128,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix", + "rustix 0.38.44", "slab", "tracing", "windows-sys 0.59.0", @@ -160,7 +160,7 @@ dependencies = [ "cfg-if", "event-listener 5.4.0", "futures-lite", - "rustix", + "rustix 0.38.44", "tracing", ] @@ -176,7 +176,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix", + "rustix 0.38.44", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -228,7 +228,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -239,13 +239,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -288,21 +288,22 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.12.2" +version = "1.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" +checksum = "5e4e8200b9a4a5801a769d50eeabc05670fec7e959a8cb7a63a93e4e519942ae" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", "paste", + "untrusted 0.7.1", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ac4f13dad353b209b34cbec082338202cbc01c8f00336b55c750c13ac91f8f" +checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43" dependencies = [ "bindgen", "cc", @@ -314,7 +315,7 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.5" dependencies = [ "futures-util", "pin-project-lite", @@ -334,7 +335,7 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.63.0" +version = "0.63.1" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -362,7 +363,7 @@ version = "0.60.3" [[package]] name = "aws-smithy-compression" -version = "0.0.2" +version = "0.0.3" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -395,28 +396,11 @@ dependencies = [ [[package]] name = "aws-smithy-experimental" -version = "0.1.5" -dependencies = [ - "aws-smithy-async", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "h2 0.4.8", - "http 1.2.0", - "hyper 1.6.0", - "hyper-rustls 0.27.5", - "hyper-util", - "once_cell", - "pin-project-lite", - "rustls 0.23.23", - "tokio", - "tower", - "tracing", -] +version = "0.2.0" [[package]] name = "aws-smithy-http" -version = "0.61.1" +version = "0.62.0" dependencies = [ "async-stream", "aws-smithy-eventstream", @@ -427,6 +411,7 @@ dependencies = [ "futures-core", "futures-util", "http 0.2.12", + "http 1.2.0", "http-body 0.4.6", "hyper 0.14.32", "once_cell", @@ -442,9 +427,46 @@ dependencies = [ name = "aws-smithy-http-auth" version = "0.60.3" +[[package]] +name = "aws-smithy-http-client" +version = "1.0.0" +dependencies = [ + "aws-smithy-async", + "aws-smithy-protocol-test", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "h2 0.4.8", + "http 0.2.12", + "http 1.2.0", + "http-body 0.4.6", + "http-body 1.0.1", + "http-body-util", + "hyper 0.14.32", + "hyper 1.6.0", + "hyper-rustls 0.24.2", + "hyper-rustls 0.27.5", + "hyper-util", + "indexmap 2.7.1", + "pin-project-lite", + "rustls 0.21.12", + "rustls 0.23.23", + "rustls-native-certs 0.8.1", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "s2n-tls", + "s2n-tls-hyper", + "serde", + "serde_json", + "tokio", + "tokio-rustls 0.26.2", + "tower 0.5.2", + "tracing", +] + [[package]] name = "aws-smithy-http-server" -version = "0.63.4" +version = "0.63.5" dependencies = [ "aws-smithy-cbor", "aws-smithy-http", @@ -467,7 +489,7 @@ dependencies = [ "serde_urlencoded", "thiserror", "tokio", - "tower", + "tower 0.4.13", "tower-http", "tracing", "uuid", @@ -475,7 +497,7 @@ dependencies = [ [[package]] name = "aws-smithy-http-server-python" -version = "0.63.2" +version = "0.63.3" dependencies = [ "aws-smithy-http", "aws-smithy-http-server", @@ -496,7 +518,7 @@ dependencies = [ "pyo3", "pyo3-asyncio", "rcgen", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "signal-hook", "socket2", "thiserror", @@ -505,7 +527,7 @@ dependencies = [ "tokio-rustls 0.24.1", "tokio-stream", "tokio-test", - "tower", + "tower 0.4.13", "tower-test", "tracing", "tracing-appender", @@ -518,7 +540,7 @@ version = "0.60.3" [[package]] name = "aws-smithy-json" -version = "0.61.2" +version = "0.61.3" dependencies = [ "aws-smithy-types", "proptest", @@ -536,7 +558,7 @@ dependencies = [ [[package]] name = "aws-smithy-observability" -version = "0.1.0" +version = "0.1.1" dependencies = [ "aws-smithy-runtime-api", "once_cell", @@ -560,7 +582,7 @@ dependencies = [ [[package]] name = "aws-smithy-protocol-test" -version = "0.63.0" +version = "0.63.1" dependencies = [ "assert-json-diff", "aws-smithy-runtime-api", @@ -585,33 +607,26 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.8" +version = "1.8.0" dependencies = [ "approx", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-protocol-test", + "aws-smithy-http-client", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", "futures-util", - "h2 0.3.26", "http 0.2.12", "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", - "httparse", "hyper 0.14.32", - "hyper-rustls 0.24.2", - "indexmap 2.7.1", "once_cell", "pin-project-lite", "pin-utils", "pretty_assertions", - "rustls 0.21.12", - "serde", - "serde_json", "tokio", "tracing", "tracing-subscriber", @@ -620,7 +635,7 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.7.4" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -636,7 +651,7 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.13" +version = "1.3.0" dependencies = [ "base64 0.13.1", "base64-simd", @@ -670,7 +685,7 @@ dependencies = [ [[package]] name = "aws-smithy-types-convert" -version = "0.60.8" +version = "0.60.9" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -681,7 +696,7 @@ dependencies = [ [[package]] name = "aws-smithy-wasm" -version = "0.1.3" +version = "0.1.4" dependencies = [ "aws-smithy-http", "aws-smithy-runtime-api", @@ -767,7 +782,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -780,7 +795,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.98", + "syn 2.0.99", "which", ] @@ -807,9 +822,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -856,9 +871,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] @@ -900,9 +915,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -926,9 +941,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "num-traits", ] @@ -988,18 +1003,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstyle", "clap_lex 0.7.4", @@ -1124,7 +1139,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.30", + "clap 4.5.31", "criterion-plot", "futures", "is-terminal", @@ -1226,7 +1241,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1253,7 +1268,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1264,9 +1279,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "encoding_rs" @@ -1340,9 +1355,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -1438,7 +1453,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -1609,6 +1624,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hermit-abi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" + [[package]] name = "hex" version = "0.4.3" @@ -1698,9 +1719,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1745,6 +1766,7 @@ dependencies = [ "http 1.2.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1782,7 +1804,7 @@ dependencies = [ "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.1", + "tokio-rustls 0.26.2", "tower-service", ] @@ -1920,7 +1942,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2001,20 +2023,20 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b12ebb6799019b044deaf431eadfe23245b259bba5a2c0796acec3943a3cdb" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" dependencies = [ "rustversion", ] [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi 0.5.0", "libc", "windows-sys 0.59.0", ] @@ -2039,9 +2061,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" @@ -2115,7 +2137,7 @@ dependencies = [ "serde_path_to_error", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", ] @@ -2145,9 +2167,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libloading" @@ -2165,11 +2187,17 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -2183,9 +2211,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" dependencies = [ "value-bag", ] @@ -2248,7 +2276,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2259,9 +2287,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -2485,22 +2513,22 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2564,7 +2592,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] @@ -2596,12 +2624,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" dependencies = [ "proc-macro2", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -2630,9 +2658,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -2645,7 +2673,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.8.0", + "bitflags 2.9.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -2764,9 +2792,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -2789,8 +2817,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.1", - "zerocopy 0.8.18", + "rand_core 0.9.3", + "zerocopy 0.8.23", ] [[package]] @@ -2810,7 +2838,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.1", + "rand_core 0.9.3", ] [[package]] @@ -2824,12 +2852,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.18", ] [[package]] @@ -2875,11 +2902,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -2949,9 +2976,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", @@ -2997,10 +3024,23 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" +dependencies = [ + "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.2", "windows-sys 0.59.0", ] @@ -3011,7 +3051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.9", + "ring 0.17.13", "rustls-webpki 0.101.7", "sct", ] @@ -3023,8 +3063,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "aws-lc-rs", + "log", "once_cell", - "ring 0.17.9", + "ring 0.17.13", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -3038,7 +3079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework 2.11.1", ] @@ -3064,6 +3105,15 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.11.0" @@ -3076,7 +3126,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.9", + "ring 0.17.13", "untrusted 0.9.0", ] @@ -3087,16 +3137,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", - "ring 0.17.9", + "ring 0.17.13", "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rusty-fork" @@ -3112,9 +3162,60 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "s2n-tls" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca784a7bd2303b31dee13fe5d8617bd27c9e983342b6f07277d7bc07a2f32ea" +dependencies = [ + "errno", + "hex", + "libc", + "pin-project-lite", + "s2n-tls-sys", +] + +[[package]] +name = "s2n-tls-hyper" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de97dea004ba2d03d6f1618f0ee770b4a63e3ba98d1764a0fecd2e520123f9ec" +dependencies = [ + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", + "s2n-tls", + "s2n-tls-tokio", + "tower-service", +] + +[[package]] +name = "s2n-tls-sys" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac0a964de7522dd815253bea5f17e70fd382920ab20c69783ad5294519f4712" +dependencies = [ + "aws-lc-rs", + "cc", + "libc", +] + +[[package]] +name = "s2n-tls-tokio" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef2b3f1b676575bf221cb8fe5c0bb5720736b98957e7dc9d873cd50412cbc7a" +dependencies = [ + "errno", + "libc", + "pin-project-lite", + "s2n-tls", + "tokio", +] [[package]] name = "same-file" @@ -3155,7 +3256,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.9", + "ring 0.17.13", "untrusted 0.9.0", ] @@ -3171,7 +3272,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3184,7 +3285,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -3203,9 +3304,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "separator" @@ -3215,29 +3316,29 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "indexmap 2.7.1", "itoa", @@ -3248,9 +3349,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ "itoa", "serde", @@ -3290,7 +3391,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3418,9 +3519,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -3435,7 +3536,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3446,15 +3547,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.17.1" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 1.0.0", "windows-sys 0.59.0", ] @@ -3469,9 +3570,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" [[package]] name = "thiserror" @@ -3490,7 +3591,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3505,9 +3606,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "itoa", @@ -3520,15 +3621,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -3556,9 +3657,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -3609,7 +3710,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3624,9 +3725,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls 0.23.23", "tokio", @@ -3685,6 +3786,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "tower-layer", + "tower-service", +] + [[package]] name = "tower-http" version = "0.3.5" @@ -3761,7 +3872,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3834,7 +3945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] @@ -3857,9 +3968,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unindent" @@ -3910,9 +4021,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f41ffb7cf259f1ecc2876861a17e7142e63ead296f671f81f6ae85903e0d6" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" dependencies = [ "getrandom 0.3.1", "rand 0.9.0", @@ -4016,7 +4127,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-shared", ] @@ -4051,7 +4162,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4084,7 +4195,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -4206,7 +4317,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b37d270da94012e0ac490ac633ad5bdd76a10a3fb15069edb033c1b771ce931f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -4215,7 +4326,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -4271,7 +4382,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -4287,11 +4398,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.18" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79386d31a42a4996e3336b0919ddb90f81112af416270cff95b5f5af22b839c2" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" dependencies = [ - "zerocopy-derive 0.8.18", + "zerocopy-derive 0.8.23", ] [[package]] @@ -4302,38 +4413,38 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "zerocopy-derive" -version = "0.8.18" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76331675d372f91bf8d17e13afbd5fe639200b73d01f0fc748bb059f9cca2db7" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", "synstructure", ] @@ -4362,5 +4473,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.99", ] diff --git a/rust-runtime/Cargo.toml b/rust-runtime/Cargo.toml index 4c8b6ffed..44192bf3f 100644 --- a/rust-runtime/Cargo.toml +++ b/rust-runtime/Cargo.toml @@ -10,6 +10,7 @@ members = [ "aws-smithy-eventstream", "aws-smithy-http", "aws-smithy-http-auth", + "aws-smithy-http-client", "aws-smithy-http-server", "aws-smithy-http-server-python", "aws-smithy-http-tower", diff --git a/rust-runtime/aws-smithy-async/Cargo.toml b/rust-runtime/aws-smithy-async/Cargo.toml index cebeec289..c2cde40d5 100644 --- a/rust-runtime/aws-smithy-async/Cargo.toml +++ b/rust-runtime/aws-smithy-async/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.5" authors = ["AWS Rust SDK Team ", "John DiSanti "] description = "Async runtime agnostic abstractions for smithy-rs." edition = "2021" @@ -12,8 +12,8 @@ rt-tokio = ["tokio/time"] test-util = ["rt-tokio", "tokio/rt"] [dependencies] -pin-project-lite = "0.2" -tokio = { version = "1.23.1", features = ["sync"] } +pin-project-lite = "0.2.14" +tokio = { version = "1.40.0", features = ["sync"] } futures-util = { version = "0.3.29", default-features = false } [dev-dependencies] diff --git a/rust-runtime/aws-smithy-checksums/Cargo.toml b/rust-runtime/aws-smithy-checksums/Cargo.toml index e5cdbe6e0..0fb928c97 100644 --- a/rust-runtime/aws-smithy-checksums/Cargo.toml +++ b/rust-runtime/aws-smithy-checksums/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-checksums" -version = "0.63.0" +version = "0.63.1" authors = [ "AWS Rust SDK Team ", "Zelda Hessler ", @@ -15,17 +15,17 @@ repository = "https://github.com/smithy-lang/smithy-rs" [dependencies] aws-smithy-http = { path = "../aws-smithy-http" } aws-smithy-types = { path = "../aws-smithy-types" } -bytes = "1" +bytes = "1.10.0" crc32c = "0.6.8" crc32fast = "1.3" hex = "0.4.3" -http = "0.2.8" -http-body = "0.4.4" +http = "0.2.9" +http-body = "0.4.5" md-5 = "0.10" -pin-project-lite = "0.2.9" +pin-project-lite = "0.2.14" sha1 = "0.10" sha2 = "0.10" -tracing = "0.1" +tracing = "0.1.40" crc64fast-nvme = "1.2.0" [dev-dependencies] diff --git a/rust-runtime/aws-smithy-compression/Cargo.toml b/rust-runtime/aws-smithy-compression/Cargo.toml index 3d8552d45..b82a16e39 100644 --- a/rust-runtime/aws-smithy-compression/Cargo.toml +++ b/rust-runtime/aws-smithy-compression/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-compression" -version = "0.0.2" +version = "0.0.3" authors = [ "AWS Rust SDK Team ", "Zelda Hessler ", @@ -28,14 +28,14 @@ http-body-1-x = [ [dependencies] aws-smithy-types = { path = "../aws-smithy-types" } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api" } -bytes = "1.4.0" +bytes = "1.10.0" flate2 = "1.0.30" futures-util = "0.3" http-0-2 = { package = "http", version = "0.2.9", optional = true } http-1-0 = { package = "http", version = "1", optional = true } http-body-0-4 = { package = "http-body", version = "0.4.5", optional = true } http-body-1-0 = { package = "http-body", version = "1", optional = true } -http-body-util = { version = "0.1.1", optional = true } +http-body-util = { version = "0.1.2", optional = true } pin-project-lite = "0.2.14" tracing = "0.1.40" diff --git a/rust-runtime/aws-smithy-eventstream/Cargo.toml b/rust-runtime/aws-smithy-eventstream/Cargo.toml index 9bc2543f6..a9c39e5ed 100644 --- a/rust-runtime/aws-smithy-eventstream/Cargo.toml +++ b/rust-runtime/aws-smithy-eventstream/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aws-smithy-eventstream" # Only patch releases can be made to this runtime crate until https://github.com/smithy-lang/smithy-rs/issues/3370 is resolved -version = "0.60.7" +version = "0.60.8" # authors = ["AWS Rust SDK Team ", "John DiSanti "] description = "Event stream logic for smithy-rs." @@ -16,7 +16,7 @@ test-util = [] [dependencies] arbitrary = { version = "1.3", optional = true } aws-smithy-types = { path = "../aws-smithy-types" } -bytes = "1" +bytes = "1.10.0" crc32fast = "1.3" derive_arbitrary = { version = "1.3", optional = true } diff --git a/rust-runtime/aws-smithy-experimental/Cargo.toml b/rust-runtime/aws-smithy-experimental/Cargo.toml index 21e30de1a..4d3a891e4 100644 --- a/rust-runtime/aws-smithy-experimental/Cargo.toml +++ b/rust-runtime/aws-smithy-experimental/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-experimental" -version = "0.1.5" +version = "0.2.0" authors = ["AWS Rust SDK Team "] description = "Experiments for the smithy-rs ecosystem" edition = "2021" @@ -8,46 +8,11 @@ license = "Apache-2.0" repository = "https://github.com/smithy-lang/smithy-rs" [features] -crypto-ring = ["rustls/ring"] -crypto-aws-lc = ["rustls/aws_lc_rs"] -crypto-aws-lc-fips = ["rustls/fips"] +crypto-ring = [] [dependencies] -aws-smithy-types = { path = "../aws-smithy-types", features = ["http-body-1-x"] } -aws-smithy-runtime-api = { features = ["client", "http-1x"], path = "../aws-smithy-runtime-api" } -aws-smithy-runtime = { features = ["client"], path = "../aws-smithy-runtime" } -aws-smithy-async = { path = "../aws-smithy-async" } -hyper = { version = "1", features = ["client", "http1", "http2"] } -pin-project-lite = "0.2.13" -hyper-util = "0.1.7" -http = "1" -tokio = "1" -hyper-rustls = { version = "0.27", features = ["http2", "http1", "native-tokio", "tls12"], default-features = false } -rustls = { version = "0.23", default-features = false } -h2 = "0.4" -once_cell = "1.18.0" -tracing = "0.1.40" -tower = "0.4.1" [dev-dependencies] -aws-smithy-async = { path = "../aws-smithy-async", features = ["rt-tokio", "test-util"] } -aws-smithy-runtime = { path = "../aws-smithy-runtime", features = ["client", "test-util", "connector-hyper-0-14-x"]} -tokio = { version = "1", features = ["full", "test-util"]} - -[[example]] -name = "client-ring" -required-features = ["crypto-ring"] -doc-scrape-examples = true - -[[example]] -name = "client-aws-lc" -required-features = ["crypto-aws-lc", "crypto-aws-lc-fips"] -doc-scrape-examples = true - -[[example]] -name = "custom-dns" -required-features = ["crypto-ring"] -doc-scrape-examples = true [package.metadata.docs.rs] all-features = true @@ -55,10 +20,3 @@ targets = ["x86_64-unknown-linux-gnu"] cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] rustdoc-args = ["--cfg", "docsrs"] # End of docs.rs metadata - -[package.metadata.cargo-udeps.ignore] -# used only in doc strings -normal = ["fs_extra"] - -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(crypto_unstable)'] } diff --git a/rust-runtime/aws-smithy-experimental/examples/client-aws-lc.rs b/rust-runtime/aws-smithy-experimental/examples/client-aws-lc.rs deleted file mode 100644 index a4036e2dd..000000000 --- a/rust-runtime/aws-smithy-experimental/examples/client-aws-lc.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_experimental::hyper_1_0::{CryptoMode, HyperClientBuilder}; -#[tokio::main] - -async fn main() { - // feature = crypto-aws-lc - let _client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::AwsLc) - .build_https(); - - // feature = crypto-aws-lc-fips - // A FIPS client can also be created. Note that this has a more complex build environment required. - let _client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::AwsLcFips) - .build_https(); -} diff --git a/rust-runtime/aws-smithy-experimental/examples/client-ring.rs b/rust-runtime/aws-smithy-experimental/examples/client-ring.rs deleted file mode 100644 index f7919ceaf..000000000 --- a/rust-runtime/aws-smithy-experimental/examples/client-ring.rs +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_experimental::hyper_1_0::{CryptoMode, HyperClientBuilder}; - -fn main() { - let _client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::Ring) - .build_https(); -} diff --git a/rust-runtime/aws-smithy-experimental/external-types.toml b/rust-runtime/aws-smithy-experimental/external-types.toml deleted file mode 100644 index 42f43601b..000000000 --- a/rust-runtime/aws-smithy-experimental/external-types.toml +++ /dev/null @@ -1,4 +0,0 @@ -allowed_external_types = [ - "aws_smithy_runtime_api::*", - "aws_smithy_async::*" -] diff --git a/rust-runtime/aws-smithy-experimental/src/hyper_1_0.rs b/rust-runtime/aws-smithy-experimental/src/hyper_1_0.rs deleted file mode 100644 index 82253dc1c..000000000 --- a/rust-runtime/aws-smithy-experimental/src/hyper_1_0.rs +++ /dev/null @@ -1,1246 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use aws_smithy_async::future::timeout::TimedOutError; -use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep}; -use aws_smithy_runtime::client::http::connection_poisoning::CaptureSmithyConnection; -use aws_smithy_runtime_api::box_error::BoxError; -use aws_smithy_runtime_api::client::connection::ConnectionMetadata; -use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; -use aws_smithy_runtime_api::client::dns::ResolveDns; -use aws_smithy_runtime_api::client::http::{ - HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient, - SharedHttpConnector, -}; -use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; -use aws_smithy_runtime_api::client::result::ConnectorError; -use aws_smithy_runtime_api::client::runtime_components::{ - RuntimeComponents, RuntimeComponentsBuilder, -}; -use aws_smithy_runtime_api::shared::IntoShared; -use aws_smithy_types::body::SdkBody; -use aws_smithy_types::config_bag::ConfigBag; -use aws_smithy_types::error::display::DisplayErrorContext; -use aws_smithy_types::retry::ErrorKind; -use client::connect::Connection; -use h2::Reason; -use http::{Extensions, Uri}; -use hyper::rt::{Read, Write}; -use hyper_util::client::legacy as client; -use hyper_util::client::legacy::connect::dns::Name; -use hyper_util::client::legacy::connect::{ - capture_connection, CaptureConnection, Connect, HttpInfo, -}; -use hyper_util::rt::TokioExecutor; -use rustls::crypto::CryptoProvider; -use std::borrow::Cow; -use std::collections::HashMap; -use std::error::Error; -use std::future::Future; -use std::net::SocketAddr; -use std::pin::Pin; -use std::sync::RwLock; -use std::task::{Context, Poll}; -use std::time::Duration; -use std::{fmt, vec}; - -#[derive(Debug, Eq, PartialEq, Clone, Copy)] -#[non_exhaustive] -pub enum CryptoMode { - #[cfg(feature = "crypto-ring")] - Ring, - #[cfg(feature = "crypto-aws-lc")] - AwsLc, - #[cfg(feature = "crypto-aws-lc-fips")] - AwsLcFips, -} - -impl CryptoMode { - fn provider(self) -> CryptoProvider { - match self { - #[cfg(feature = "crypto-aws-lc")] - CryptoMode::AwsLc => rustls::crypto::aws_lc_rs::default_provider(), - - #[cfg(feature = "crypto-ring")] - CryptoMode::Ring => rustls::crypto::ring::default_provider(), - - #[cfg(feature = "crypto-aws-lc-fips")] - CryptoMode::AwsLcFips => { - let provider = rustls::crypto::default_fips_provider(); - assert!( - provider.fips(), - "FIPS was requested but the provider did not support FIPS" - ); - provider - } - } - } -} - -/// A bridge that allows our `ResolveDns` trait to work with Hyper's `Resolver` interface (based on tower) -#[derive(Clone)] -struct HyperUtilResolver { - resolver: R, -} - -impl tower::Service for HyperUtilResolver { - type Response = vec::IntoIter; - type Error = Box; - type Future = Pin> + Send>>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, req: Name) -> Self::Future { - let resolver = self.resolver.clone(); - Box::pin(async move { - let dns_entries = resolver.resolve_dns(req.as_str()).await?; - Ok(dns_entries - .into_iter() - .map(|ip_addr| SocketAddr::new(ip_addr, 0)) - .collect::>() - .into_iter()) - }) - } -} - -#[allow(unused_imports)] -mod cached_connectors { - use client::connect::HttpConnector; - use hyper_util::client::legacy as client; - use hyper_util::client::legacy::connect::dns::GaiResolver; - - use crate::hyper_1_0::build_connector::make_tls; - use crate::hyper_1_0::{CryptoMode, Inner}; - - #[cfg(feature = "crypto-ring")] - pub(crate) static HTTPS_NATIVE_ROOTS_RING: once_cell::sync::Lazy< - hyper_rustls::HttpsConnector, - > = once_cell::sync::Lazy::new(|| make_tls(GaiResolver::new(), CryptoMode::Ring.provider())); - - #[cfg(feature = "crypto-aws-lc")] - pub(crate) static HTTPS_NATIVE_ROOTS_AWS_LC: once_cell::sync::Lazy< - hyper_rustls::HttpsConnector, - > = once_cell::sync::Lazy::new(|| make_tls(GaiResolver::new(), CryptoMode::AwsLc.provider())); - - #[cfg(feature = "crypto-aws-lc-fips")] - pub(crate) static HTTPS_NATIVE_ROOTS_AWS_LC_FIPS: once_cell::sync::Lazy< - hyper_rustls::HttpsConnector, - > = once_cell::sync::Lazy::new(|| { - make_tls(GaiResolver::new(), CryptoMode::AwsLcFips.provider()) - }); - - pub(super) fn cached_https(mode: Inner) -> hyper_rustls::HttpsConnector { - match mode { - #[cfg(feature = "crypto-ring")] - Inner::Standard(CryptoMode::Ring) => HTTPS_NATIVE_ROOTS_RING.clone(), - #[cfg(feature = "crypto-aws-lc")] - Inner::Standard(CryptoMode::AwsLc) => HTTPS_NATIVE_ROOTS_AWS_LC.clone(), - #[cfg(feature = "crypto-aws-lc-fips")] - Inner::Standard(CryptoMode::AwsLcFips) => HTTPS_NATIVE_ROOTS_AWS_LC_FIPS.clone(), - #[allow(unreachable_patterns)] - Inner::Standard(_) => unreachable!("unexpected mode"), - Inner::Custom(provider) => make_tls(GaiResolver::new(), provider), - } - } -} - -mod build_connector { - use crate::hyper_1_0::{HyperUtilResolver, Inner}; - use aws_smithy_runtime_api::client::dns::ResolveDns; - use client::connect::HttpConnector; - use hyper_util::client::legacy as client; - use rustls::crypto::CryptoProvider; - use std::sync::Arc; - - fn restrict_ciphers(base: CryptoProvider) -> CryptoProvider { - let suites = &[ - rustls::CipherSuite::TLS13_AES_256_GCM_SHA384, - rustls::CipherSuite::TLS13_AES_128_GCM_SHA256, - // TLS1.2 suites - rustls::CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - rustls::CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - rustls::CipherSuite::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - rustls::CipherSuite::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - rustls::CipherSuite::TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, - ]; - let supported_suites = suites - .iter() - .flat_map(|suite| { - base.cipher_suites - .iter() - .find(|s| &s.suite() == suite) - .cloned() - }) - .collect::>(); - CryptoProvider { - cipher_suites: supported_suites, - ..base - } - } - - pub(crate) fn make_tls( - resolver: R, - crypto_provider: CryptoProvider, - ) -> hyper_rustls::HttpsConnector> { - use hyper_rustls::ConfigBuilderExt; - let mut base_connector = HttpConnector::new_with_resolver(resolver); - base_connector.enforce_http(false); - hyper_rustls::HttpsConnectorBuilder::new() - .with_tls_config( - rustls::ClientConfig::builder_with_provider(Arc::new(restrict_ciphers(crypto_provider))) - .with_safe_default_protocol_versions() - .expect("Error with the TLS configuration. Please file a bug report under https://github.com/smithy-lang/smithy-rs/issues.") - .with_native_roots().expect("error with TLS configuration.") - .with_no_client_auth() - ) - .https_or_http() - .enable_http1() - .enable_http2() - .wrap_connector(base_connector) - } - - pub(super) fn https_with_resolver( - crypto_provider: Inner, - resolver: R, - ) -> hyper_rustls::HttpsConnector>> { - make_tls(HyperUtilResolver { resolver }, crypto_provider.provider()) - } -} - -/// [`HttpConnector`] that uses [`hyper`] to make HTTP requests. -/// -/// This connector also implements socket connect and read timeouts. -/// -/// This shouldn't be used directly in most cases. -/// See the docs on [`HyperClientBuilder`] for examples of how -/// to customize the Hyper client. -#[derive(Debug)] -pub struct HyperConnector { - adapter: Box, -} - -impl HyperConnector { - /// Builder for a Hyper connector. - pub fn builder() -> HyperConnectorBuilder { - Default::default() - } -} - -impl HttpConnector for HyperConnector { - fn call(&self, request: HttpRequest) -> HttpConnectorFuture { - self.adapter.call(request) - } -} - -/// Builder for [`HyperConnector`]. -#[derive(Default, Debug)] -pub struct HyperConnectorBuilder { - connector_settings: Option, - sleep_impl: Option, - client_builder: Option, - #[allow(unused)] - crypto: Crypto, -} - -#[derive(Default)] -#[non_exhaustive] -pub struct CryptoUnset {} - -pub struct CryptoProviderSelected { - crypto_provider: Inner, -} - -#[derive(Clone)] -enum Inner { - Standard(CryptoMode), - #[allow(dead_code)] - Custom(CryptoProvider), -} - -impl Inner { - fn provider(&self) -> CryptoProvider { - match self { - Inner::Standard(mode) => mode.provider(), - Inner::Custom(provider) => provider.clone(), - } - } -} - -#[cfg(any(feature = "crypto-aws-lc", feature = "crypto-ring"))] -impl HyperConnectorBuilder { - pub fn build_from_resolver( - self, - resolver: R, - ) -> HyperConnector { - let connector = - build_connector::https_with_resolver(self.crypto.crypto_provider.clone(), resolver); - self.build(connector) - } -} - -impl HyperConnectorBuilder { - /// Create a [`HyperConnector`] from this builder and a given connector. - pub(crate) fn build(self, tcp_connector: C) -> HyperConnector - where - C: Send + Sync + 'static, - C: Clone, - C: tower::Service, - C::Response: Read + Write + Connection + Send + Sync + Unpin, - C: Connect, - C::Future: Unpin + Send + 'static, - C::Error: Into, - { - let client_builder = - self.client_builder - .unwrap_or(hyper_util::client::legacy::Builder::new( - TokioExecutor::new(), - )); - let sleep_impl = self.sleep_impl.or_else(default_async_sleep); - let (connect_timeout, read_timeout) = self - .connector_settings - .map(|c| (c.connect_timeout(), c.read_timeout())) - .unwrap_or((None, None)); - - let connector = match connect_timeout { - Some(duration) => timeout_middleware::ConnectTimeout::new( - tcp_connector, - sleep_impl - .clone() - .expect("a sleep impl must be provided in order to have a connect timeout"), - duration, - ), - None => timeout_middleware::ConnectTimeout::no_timeout(tcp_connector), - }; - let base = client_builder.build(connector); - let read_timeout = match read_timeout { - Some(duration) => timeout_middleware::HttpReadTimeout::new( - base, - sleep_impl.expect("a sleep impl must be provided in order to have a read timeout"), - duration, - ), - None => timeout_middleware::HttpReadTimeout::no_timeout(base), - }; - HyperConnector { - adapter: Box::new(Adapter { - client: read_timeout, - }), - } - } - - /// Set the async sleep implementation used for timeouts - /// - /// Calling this is only necessary for testing or to use something other than - /// [`default_async_sleep`]. - pub fn sleep_impl(mut self, sleep_impl: impl AsyncSleep + 'static) -> Self { - self.sleep_impl = Some(sleep_impl.into_shared()); - self - } - - /// Set the async sleep implementation used for timeouts - /// - /// Calling this is only necessary for testing or to use something other than - /// [`default_async_sleep`]. - pub fn set_sleep_impl(&mut self, sleep_impl: Option) -> &mut Self { - self.sleep_impl = sleep_impl; - self - } - - /// Configure the HTTP settings for the `HyperAdapter` - pub fn connector_settings(mut self, connector_settings: HttpConnectorSettings) -> Self { - self.connector_settings = Some(connector_settings); - self - } - - /// Configure the HTTP settings for the `HyperAdapter` - pub fn set_connector_settings( - &mut self, - connector_settings: Option, - ) -> &mut Self { - self.connector_settings = connector_settings; - self - } - - /// Override the Hyper client [`Builder`](hyper_util::client::legacy::Builder) used to construct this client. - /// - /// This enables changing settings like forcing HTTP2 and modifying other default client behavior. - pub(crate) fn hyper_builder( - mut self, - hyper_builder: hyper_util::client::legacy::Builder, - ) -> Self { - self.set_hyper_builder(Some(hyper_builder)); - self - } - - /// Override the Hyper client [`Builder`](hyper_util::client::legacy::Builder) used to construct this client. - /// - /// This enables changing settings like forcing HTTP2 and modifying other default client behavior. - pub(crate) fn set_hyper_builder( - &mut self, - hyper_builder: Option, - ) -> &mut Self { - self.client_builder = hyper_builder; - self - } -} - -/// Adapter to use a Hyper 1.0-based Client as an `HttpConnector` -/// -/// This adapter also enables TCP `CONNECT` and HTTP `READ` timeouts via [`HyperConnector::builder`]. -struct Adapter { - client: timeout_middleware::HttpReadTimeout< - hyper_util::client::legacy::Client, SdkBody>, - >, -} - -impl fmt::Debug for Adapter { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Adapter") - .field("client", &"** hyper client **") - .finish() - } -} - -/// Extract a smithy connection from a hyper CaptureConnection -fn extract_smithy_connection(capture_conn: &CaptureConnection) -> Option { - let capture_conn = capture_conn.clone(); - if let Some(conn) = capture_conn.clone().connection_metadata().as_ref() { - let mut extensions = Extensions::new(); - conn.get_extras(&mut extensions); - let http_info = extensions.get::(); - let mut builder = ConnectionMetadata::builder() - .proxied(conn.is_proxied()) - .poison_fn(move || match capture_conn.connection_metadata().as_ref() { - Some(conn) => conn.poison(), - None => tracing::trace!("no connection existed to poison"), - }); - - builder - .set_local_addr(http_info.map(|info| info.local_addr())) - .set_remote_addr(http_info.map(|info| info.remote_addr())); - - let smithy_connection = builder.build(); - - Some(smithy_connection) - } else { - None - } -} - -impl HttpConnector for Adapter -where - C: Clone + Send + Sync + 'static, - C: tower::Service, - C::Response: Connection + Read + Write + Unpin + 'static, - timeout_middleware::ConnectTimeout: Connect, - C::Future: Unpin + Send + 'static, - C::Error: Into, -{ - fn call(&self, request: HttpRequest) -> HttpConnectorFuture { - let mut request = match request.try_into_http1x() { - Ok(request) => request, - Err(err) => { - return HttpConnectorFuture::ready(Err(ConnectorError::user(err.into()))); - } - }; - let capture_connection = capture_connection(&mut request); - if let Some(capture_smithy_connection) = - request.extensions().get::() - { - capture_smithy_connection - .set_connection_retriever(move || extract_smithy_connection(&capture_connection)); - } - let mut client = self.client.clone(); - use tower::Service; - let fut = client.call(request); - HttpConnectorFuture::new(async move { - let response = fut - .await - .map_err(downcast_error)? - .map(SdkBody::from_body_1_x); - match HttpResponse::try_from(response) { - Ok(response) => Ok(response), - Err(err) => Err(ConnectorError::other(err.into(), None)), - } - }) - } -} - -/// Downcast errors coming out of hyper into an appropriate `ConnectorError` -fn downcast_error(err: BoxError) -> ConnectorError { - // is a `TimedOutError` (from aws_smithy_async::timeout) in the chain? if it is, this is a timeout - if find_source::(err.as_ref()).is_some() { - return ConnectorError::timeout(err); - } - // is the top of chain error actually already a `ConnectorError`? return that directly - let err = match err.downcast::() { - Ok(connector_error) => return *connector_error, - Err(box_error) => box_error, - }; - // generally, the top of chain will probably be a hyper error. Go through a set of hyper specific - // error classifications - let err = match find_source::(err.as_ref()) { - Some(hyper_error) => return to_connector_error(hyper_error)(err), - None => err, - }; - - // otherwise, we have no idea! - ConnectorError::other(err, None) -} - -/// Convert a [`hyper::Error`] into a [`ConnectorError`] -fn to_connector_error(err: &hyper::Error) -> fn(BoxError) -> ConnectorError { - if err.is_timeout() || find_source::(err).is_some() { - return ConnectorError::timeout; - } - if err.is_user() { - return ConnectorError::user; - } - if err.is_closed() || err.is_canceled() || find_source::(err).is_some() { - return ConnectorError::io; - } - // We sometimes receive this from S3: hyper::Error(IncompleteMessage) - if err.is_incomplete_message() { - return |err: BoxError| ConnectorError::other(err, Some(ErrorKind::TransientError)); - } - - if let Some(h2_err) = find_source::(err) { - if h2_err.is_go_away() - || (h2_err.is_reset() && h2_err.reason() == Some(Reason::REFUSED_STREAM)) - { - return ConnectorError::io; - } - } - - tracing::warn!(err = %DisplayErrorContext(&err), "unrecognized error from Hyper. If this error should be retried, please file an issue."); - |err: BoxError| ConnectorError::other(err, None) -} - -fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option<&'a E> { - let mut next = Some(err); - while let Some(err) = next { - if let Some(matching_err) = err.downcast_ref::() { - return Some(matching_err); - } - next = err.source(); - } - None -} - -// TODO(https://github.com/awslabs/aws-sdk-rust/issues/1090): CacheKey must also include ptr equality to any -// runtime components that are used—sleep_impl as a base (unless we prohibit overriding sleep impl) -// If we decide to put a DnsResolver in RuntimeComponents, then we'll need to handle that as well. -#[derive(Clone, Debug, Eq, PartialEq, Hash)] -struct CacheKey { - connect_timeout: Option, - read_timeout: Option, -} - -impl From<&HttpConnectorSettings> for CacheKey { - fn from(value: &HttpConnectorSettings) -> Self { - Self { - connect_timeout: value.connect_timeout(), - read_timeout: value.read_timeout(), - } - } -} - -struct HyperClient { - connector_cache: RwLock>, - client_builder: hyper_util::client::legacy::Builder, - tcp_connector_fn: F, -} - -impl fmt::Debug for HyperClient { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("HyperClient") - .field("connector_cache", &self.connector_cache) - .field("client_builder", &self.client_builder) - .finish() - } -} - -impl HttpClient for HyperClient -where - F: Fn() -> C + Send + Sync, - C: Clone + Send + Sync + 'static, - C: tower::Service, - C::Response: Connection + Read + Write + Send + Sync + Unpin + 'static, - C::Future: Unpin + Send + 'static, - C::Error: Into, -{ - fn http_connector( - &self, - settings: &HttpConnectorSettings, - components: &RuntimeComponents, - ) -> SharedHttpConnector { - let key = CacheKey::from(settings); - let mut connector = self.connector_cache.read().unwrap().get(&key).cloned(); - if connector.is_none() { - let mut cache = self.connector_cache.write().unwrap(); - // Short-circuit if another thread already wrote a connector to the cache for this key - if !cache.contains_key(&key) { - let mut builder = HyperConnector::builder() - .hyper_builder(self.client_builder.clone()) - .connector_settings(settings.clone()); - builder.set_sleep_impl(components.sleep_impl()); - - let start = components.time_source().map(|ts| ts.now()); - let tcp_connector = (self.tcp_connector_fn)(); - let end = components.time_source().map(|ts| ts.now()); - if let (Some(start), Some(end)) = (start, end) { - if let Ok(elapsed) = end.duration_since(start) { - tracing::debug!("new TCP connector created in {:?}", elapsed); - } - } - let connector = SharedHttpConnector::new(builder.build(tcp_connector)); - cache.insert(key.clone(), connector); - } - connector = cache.get(&key).cloned(); - } - - connector.expect("cache populated above") - } - - fn validate_base_client_config( - &self, - _: &RuntimeComponentsBuilder, - _: &ConfigBag, - ) -> Result<(), BoxError> { - // Initialize the TCP connector at this point so that native certs load - // at client initialization time instead of upon first request. We do it - // here rather than at construction so that it won't run if this is not - // the selected HTTP client for the base config (for example, if this was - // the default HTTP client, and it was overridden by a later plugin). - let _ = (self.tcp_connector_fn)(); - Ok(()) - } - - fn connector_metadata(&self) -> Option { - Some(ConnectorMetadata::new("hyper", Some(Cow::Borrowed("1.x")))) - } -} - -/// Builder for a hyper-backed [`HttpClient`] implementation. -/// -/// This builder can be used to customize the underlying TCP connector used, as well as -/// hyper client configuration. -/// -/// # Examples -/// -/// Construct a Hyper client with the RusTLS TLS implementation. -/// This can be useful when you want to share a Hyper connector between multiple -/// generated Smithy clients. -#[derive(Clone, Default, Debug)] -pub struct HyperClientBuilder { - client_builder: Option, - crypto_provider: Crypto, -} - -impl HyperClientBuilder { - /// Create a hyper client using RusTLS for TLS - /// - /// The trusted certificates will be loaded later when this becomes the selected - /// HTTP client for a Smithy client. - pub fn build_https(self) -> SharedHttpClient { - let crypto = self.crypto_provider.crypto_provider; - build_with_fn(self.client_builder, move || { - cached_connectors::cached_https(crypto.clone()) - }) - } - - /// Create a hyper client using a custom DNS resolver - pub fn build_with_resolver( - self, - resolver: impl ResolveDns + Clone + 'static, - ) -> SharedHttpClient { - build_with_fn(self.client_builder, move || { - build_connector::https_with_resolver( - self.crypto_provider.crypto_provider.clone(), - resolver.clone(), - ) - }) - } -} - -impl HyperClientBuilder { - /// Creates a new builder. - pub fn new() -> Self { - Self::default() - } - - pub fn crypto_mode(self, provider: CryptoMode) -> HyperClientBuilder { - HyperClientBuilder { - client_builder: self.client_builder, - crypto_provider: CryptoProviderSelected { - crypto_provider: Inner::Standard(provider), - }, - } - } - - /// This interface will be broken in the future - /// - /// This exposes `CryptoProvider` from `rustls` directly and this API has no stability guarantee. - #[cfg(crypto_unstable)] - pub fn crypto_provider_unstable( - self, - provider: CryptoProvider, - ) -> HyperClientBuilder { - HyperClientBuilder { - client_builder: self.client_builder, - crypto_provider: CryptoProviderSelected { - crypto_provider: Inner::Custom(provider), - }, - } - } -} - -fn build_with_fn( - client_builder: Option, - tcp_connector_fn: F, -) -> SharedHttpClient -where - F: Fn() -> C + Send + Sync + 'static, - C: Clone + Send + Sync + 'static, - C: tower::Service, - C::Response: Connection + Read + Write + Send + Sync + Unpin + 'static, - C::Future: Unpin + Send + 'static, - C::Error: Into, - C: Connect, -{ - SharedHttpClient::new(HyperClient { - connector_cache: RwLock::new(HashMap::new()), - client_builder: client_builder - .unwrap_or_else(|| hyper_util::client::legacy::Builder::new(TokioExecutor::new())), - tcp_connector_fn, - }) -} - -mod timeout_middleware { - use std::error::Error; - use std::fmt::Formatter; - use std::future::Future; - use std::pin::Pin; - use std::task::{Context, Poll}; - use std::time::Duration; - - use http::Uri; - use pin_project_lite::pin_project; - - use aws_smithy_async::future::timeout::{TimedOutError, Timeout}; - use aws_smithy_async::rt::sleep::Sleep; - use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep}; - use aws_smithy_runtime_api::box_error::BoxError; - - #[derive(Debug)] - pub(crate) struct HttpTimeoutError { - kind: &'static str, - duration: Duration, - } - - impl std::fmt::Display for HttpTimeoutError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{} timeout occurred after {:?}", - self.kind, self.duration - ) - } - } - - impl Error for HttpTimeoutError { - // We implement the `source` function as returning a `TimedOutError` because when `downcast_error` - // or `find_source` is called with an `HttpTimeoutError` (or another error wrapping an `HttpTimeoutError`) - // this method will be checked to determine if it's a timeout-related error. - fn source(&self) -> Option<&(dyn Error + 'static)> { - Some(&TimedOutError) - } - } - - /// Timeout wrapper that will timeout on the initial TCP connection - /// - /// # Stability - /// This interface is unstable. - #[derive(Clone, Debug)] - pub(super) struct ConnectTimeout { - inner: I, - timeout: Option<(SharedAsyncSleep, Duration)>, - } - - impl ConnectTimeout { - /// Create a new `ConnectTimeout` around `inner`. - /// - /// Typically, `I` will implement [`hyper_util::client::legacy::connect::Connect`]. - pub(crate) fn new(inner: I, sleep: SharedAsyncSleep, timeout: Duration) -> Self { - Self { - inner, - timeout: Some((sleep, timeout)), - } - } - - pub(crate) fn no_timeout(inner: I) -> Self { - Self { - inner, - timeout: None, - } - } - } - - #[derive(Clone, Debug)] - pub(crate) struct HttpReadTimeout { - inner: I, - timeout: Option<(SharedAsyncSleep, Duration)>, - } - - impl HttpReadTimeout { - /// Create a new `HttpReadTimeout` around `inner`. - /// - /// Typically, `I` will implement [`tower::Service>`]. - pub(crate) fn new(inner: I, sleep: SharedAsyncSleep, timeout: Duration) -> Self { - Self { - inner, - timeout: Some((sleep, timeout)), - } - } - - pub(crate) fn no_timeout(inner: I) -> Self { - Self { - inner, - timeout: None, - } - } - } - - pin_project! { - /// Timeout future for Tower services - /// - /// Timeout future to handle timing out, mapping errors, and the possibility of not timing out - /// without incurring an additional allocation for each timeout layer. - #[project = MaybeTimeoutFutureProj] - pub enum MaybeTimeoutFuture { - Timeout { - #[pin] - timeout: Timeout, - error_type: &'static str, - duration: Duration, - }, - NoTimeout { - #[pin] - future: F - } - } - } - - impl Future for MaybeTimeoutFuture - where - F: Future>, - E: Into, - { - type Output = Result; - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let (timeout_future, kind, &mut duration) = match self.project() { - MaybeTimeoutFutureProj::NoTimeout { future } => { - return future.poll(cx).map_err(|err| err.into()); - } - MaybeTimeoutFutureProj::Timeout { - timeout, - error_type, - duration, - } => (timeout, error_type, duration), - }; - match timeout_future.poll(cx) { - Poll::Ready(Ok(response)) => Poll::Ready(response.map_err(|err| err.into())), - Poll::Ready(Err(_timeout)) => { - Poll::Ready(Err(HttpTimeoutError { kind, duration }.into())) - } - Poll::Pending => Poll::Pending, - } - } - } - - impl tower::Service for ConnectTimeout - where - I: tower::Service, - I::Error: Into, - { - type Response = I::Response; - type Error = BoxError; - type Future = MaybeTimeoutFuture; - - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - self.inner.poll_ready(cx).map_err(|err| err.into()) - } - - fn call(&mut self, req: Uri) -> Self::Future { - match &self.timeout { - Some((sleep, duration)) => { - let sleep = sleep.sleep(*duration); - MaybeTimeoutFuture::Timeout { - timeout: Timeout::new(self.inner.call(req), sleep), - error_type: "HTTP connect", - duration: *duration, - } - } - None => MaybeTimeoutFuture::NoTimeout { - future: self.inner.call(req), - }, - } - } - } - - impl tower::Service> for HttpReadTimeout - where - I: tower::Service>, - I::Error: Send + Sync + Error + 'static, - { - type Response = I::Response; - type Error = BoxError; - type Future = MaybeTimeoutFuture; - - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - self.inner.poll_ready(cx).map_err(|err| err.into()) - } - - fn call(&mut self, req: http::Request) -> Self::Future { - match &self.timeout { - Some((sleep, duration)) => { - let sleep = sleep.sleep(*duration); - MaybeTimeoutFuture::Timeout { - timeout: Timeout::new(self.inner.call(req), sleep), - error_type: "HTTP read", - duration: *duration, - } - } - None => MaybeTimeoutFuture::NoTimeout { - future: self.inner.call(req), - }, - } - } - } - - #[cfg(test)] - pub(crate) mod test { - use std::time::Duration; - - use hyper::rt::ReadBufCursor; - use hyper_util::client::legacy::connect::Connected; - use hyper_util::rt::TokioIo; - use tokio::net::TcpStream; - - use aws_smithy_async::assert_elapsed; - use aws_smithy_async::future::never::Never; - use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; - use aws_smithy_types::error::display::DisplayErrorContext; - - use super::super::*; - - #[allow(unused)] - fn connect_timeout_is_correct() { - is_send_sync::>(); - } - - #[allow(unused)] - fn is_send_sync() {} - - /// A service that will never return whatever it is you want - /// - /// Returned futures will return Pending forever - #[non_exhaustive] - #[derive(Clone, Default, Debug)] - pub(crate) struct NeverConnects; - impl tower::Service for NeverConnects { - type Response = TokioIo; - type Error = ConnectorError; - type Future = Pin> + Send>>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, _uri: Uri) -> Self::Future { - Box::pin(async move { - Never::new().await; - unreachable!() - }) - } - } - - /// A service that will connect but never send any data - #[derive(Clone, Debug, Default)] - struct NeverReplies; - impl tower::Service for NeverReplies { - type Response = EmptyStream; - type Error = BoxError; - type Future = std::future::Ready>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, _req: Uri) -> Self::Future { - std::future::ready(Ok(EmptyStream)) - } - } - - /// A stream that will never return or accept any data - #[non_exhaustive] - #[derive(Debug, Default)] - struct EmptyStream; - impl Read for EmptyStream { - fn poll_read( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - _buf: ReadBufCursor<'_>, - ) -> Poll> { - Poll::Pending - } - } - impl Write for EmptyStream { - fn poll_write( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - _buf: &[u8], - ) -> Poll> { - Poll::Pending - } - - fn poll_flush( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Pending - } - - fn poll_shutdown( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Pending - } - } - impl Connection for EmptyStream { - fn connected(&self) -> Connected { - Connected::new() - } - } - - #[tokio::test] - async fn http_connect_timeout_works() { - let tcp_connector = NeverConnects::default(); - let connector_settings = HttpConnectorSettings::builder() - .connect_timeout(Duration::from_secs(1)) - .build(); - let hyper = HyperConnector::builder() - .connector_settings(connector_settings) - .sleep_impl(SharedAsyncSleep::new(TokioSleep::new())) - .build(tcp_connector) - .adapter; - let now = tokio::time::Instant::now(); - tokio::time::pause(); - let resp = hyper - .call(HttpRequest::get("https://static-uri.com").unwrap()) - .await - .unwrap_err(); - assert!( - resp.is_timeout(), - "expected resp.is_timeout() to be true but it was false, resp == {:?}", - resp - ); - let message = DisplayErrorContext(&resp).to_string(); - let expected = - "timeout: client error (Connect): HTTP connect timeout occurred after 1s"; - assert!( - message.contains(expected), - "expected '{message}' to contain '{expected}'" - ); - assert_elapsed!(now, Duration::from_secs(1)); - } - - #[tokio::test] - async fn http_read_timeout_works() { - let tcp_connector = NeverReplies; - let connector_settings = HttpConnectorSettings::builder() - .connect_timeout(Duration::from_secs(1)) - .read_timeout(Duration::from_secs(2)) - .build(); - let hyper = HyperConnector::builder() - .connector_settings(connector_settings) - .sleep_impl(SharedAsyncSleep::new(TokioSleep::new())) - .build(tcp_connector) - .adapter; - let now = tokio::time::Instant::now(); - tokio::time::pause(); - let err = hyper - .call(HttpRequest::get("https://fake-uri.com").unwrap()) - .await - .unwrap_err(); - assert!( - err.is_timeout(), - "expected err.is_timeout() to be true but it was false, err == {err:?}", - ); - let message = format!("{}", DisplayErrorContext(&err)); - let expected = "timeout: HTTP read timeout occurred after 2s"; - assert!( - message.contains(expected), - "expected '{message}' to contain '{expected}'" - ); - assert_elapsed!(now, Duration::from_secs(2)); - } - } -} - -#[cfg(test)] -mod test { - use std::io::{Error, ErrorKind}; - use std::pin::Pin; - use std::sync::atomic::{AtomicU32, Ordering}; - use std::sync::Arc; - use std::task::{Context, Poll}; - - use http::Uri; - use hyper::rt::ReadBufCursor; - use hyper_util::client::legacy::connect::Connected; - - use aws_smithy_async::time::SystemTimeSource; - use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; - - use crate::hyper_1_0::timeout_middleware::test::NeverConnects; - - use super::*; - - #[tokio::test] - async fn connector_selection() { - // Create a client that increments a count every time it creates a new HyperConnector - let creation_count = Arc::new(AtomicU32::new(0)); - let http_client = build_with_fn(None, { - let count = creation_count.clone(); - move || { - count.fetch_add(1, Ordering::Relaxed); - NeverConnects - } - }); - - // This configuration should result in 4 separate connectors with different timeout settings - let settings = [ - HttpConnectorSettings::builder() - .connect_timeout(Duration::from_secs(3)) - .build(), - HttpConnectorSettings::builder() - .read_timeout(Duration::from_secs(3)) - .build(), - HttpConnectorSettings::builder() - .connect_timeout(Duration::from_secs(3)) - .read_timeout(Duration::from_secs(3)) - .build(), - HttpConnectorSettings::builder() - .connect_timeout(Duration::from_secs(5)) - .read_timeout(Duration::from_secs(3)) - .build(), - ]; - - // Kick off thousands of parallel tasks that will try to create a connector - let components = RuntimeComponentsBuilder::for_tests() - .with_time_source(Some(SystemTimeSource::new())) - .build() - .unwrap(); - let mut handles = Vec::new(); - for setting in &settings { - for _ in 0..1000 { - let client = http_client.clone(); - handles.push(tokio::spawn({ - let setting = setting.clone(); - let components = components.clone(); - async move { - let _ = client.http_connector(&setting, &components); - } - })); - } - } - for handle in handles { - handle.await.unwrap(); - } - - // Verify only 4 connectors were created amidst the chaos - assert_eq!(4, creation_count.load(Ordering::Relaxed)); - } - - #[tokio::test] - async fn hyper_io_error() { - let connector = TestConnection { - inner: HangupStream, - }; - let adapter = HyperConnector::builder().build(connector).adapter; - let err = adapter - .call(HttpRequest::get("https://socket-hangup.com").unwrap()) - .await - .expect_err("socket hangup"); - assert!(err.is_io(), "unexpected error type: {:?}", err); - } - - // ---- machinery to make a Hyper connector that responds with an IO Error - #[derive(Clone)] - struct HangupStream; - - impl Connection for HangupStream { - fn connected(&self) -> Connected { - Connected::new() - } - } - - impl Read for HangupStream { - fn poll_read( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - _buf: ReadBufCursor<'_>, - ) -> Poll> { - Poll::Ready(Err(Error::new( - ErrorKind::ConnectionReset, - "connection reset", - ))) - } - } - - impl Write for HangupStream { - fn poll_write( - self: Pin<&mut Self>, - _cx: &mut Context<'_>, - _buf: &[u8], - ) -> Poll> { - Poll::Pending - } - - fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { - Poll::Pending - } - - fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { - Poll::Pending - } - } - - #[derive(Clone)] - struct TestConnection { - inner: T, - } - - impl tower::Service for TestConnection - where - T: Clone + Connection, - { - type Response = T; - type Error = BoxError; - type Future = std::future::Ready>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, _req: Uri) -> Self::Future { - std::future::ready(Ok(self.inner.clone())) - } - } -} diff --git a/rust-runtime/aws-smithy-experimental/src/lib.rs b/rust-runtime/aws-smithy-experimental/src/lib.rs index fc0bf781e..fe8cdbda8 100644 --- a/rust-runtime/aws-smithy-experimental/src/lib.rs +++ b/rust-runtime/aws-smithy-experimental/src/lib.rs @@ -7,4 +7,8 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] /* End of automatically managed default lints */ -pub mod hyper_1_0; +#[deprecated( + since = "0.2.0", + note = "support for hyper-1.x is now enabled by the `aws-smithy-http-client` crate" +)] +pub mod hyper_1_0 {} diff --git a/rust-runtime/aws-smithy-http-client/Cargo.toml b/rust-runtime/aws-smithy-http-client/Cargo.toml new file mode 100644 index 000000000..913b7e60a --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/Cargo.toml @@ -0,0 +1,159 @@ +[package] +name = "aws-smithy-http-client" +authors = ["AWS Rust SDK Team "] +description = "HTTP client abstractions for generated smithy clients" +version = "1.0.0" +license = "Apache-2.0" +edition = "2021" +repository = "https://github.com/smithy-lang/smithy-rs" + +[features] +hyper-014 = [ + "aws-smithy-runtime-api/http-02x", + "aws-smithy-types/http-body-0-4-x", + "dep:http-02x", + "dep:http-body-04x", + "dep:hyper-0-14", +] + +default-client = [ + "aws-smithy-runtime-api/http-1x", + "aws-smithy-types/http-body-1-x", + "dep:hyper", + "dep:hyper-util", + "hyper-util?/client-legacy", + "dep:http-1x", + "dep:tower", + "dep:rustls-pki-types", + "dep:rustls-native-certs" +] + +wire-mock = [ + "test-util", + "default-client", + "hyper-util?/server", + "hyper-util?/server-auto", + "hyper-util?/service", + "hyper-util?/server-graceful", + "tokio/macros", + "dep:http-body-util", +] + +test-util = [ + "dep:aws-smithy-protocol-test", + "dep:serde", + "dep:serde_json", + "dep:indexmap", + "dep:bytes", + # for capture_request + "dep:http-1x", + "aws-smithy-runtime-api/http-1x", + # for dvr + "dep:http-body-1x", + "aws-smithy-types/http-body-1-x", +] + +legacy-test-util = [ + "test-util", + "dep:http-02x", + "aws-smithy-runtime-api/http-02x", + "aws-smithy-types/http-body-0-4-x", +] + +legacy-rustls-ring = ["dep:legacy-hyper-rustls", "dep:legacy-rustls", "hyper-014"] + +rustls-ring = ["dep:rustls", "rustls?/ring", "dep:hyper-rustls", "default-client"] +rustls-aws-lc = ["dep:rustls", "rustls?/aws_lc_rs", "dep:hyper-rustls", "default-client"] +rustls-aws-lc-fips = ["dep:rustls", "rustls?/fips", "dep:hyper-rustls", "default-client"] +s2n-tls = ["dep:s2n-tls", "dep:s2n-tls-hyper", "default-client"] + +[dependencies] +aws-smithy-async = { path = "../aws-smithy-async" } +aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["client"] } +aws-smithy-types = { path = "../aws-smithy-types" } +aws-smithy-protocol-test = { path = "../aws-smithy-protocol-test", optional = true } +h2 = { version = "0.4.2", default-features = false } +tokio = { version = "1.40", features = [] } +pin-project-lite = "0.2.14" +tracing = "0.1.40" + +# hyper 1.x stack +hyper = { version = "1.6.0", features = ["client", "http1", "http2"], optional = true } +hyper-util = { version = "0.1.10", features = ["http1", "http2"], optional = true } +http-1x = { package = "http", version = "1" , optional = true } +http-body-1x = { package = "http-body", version = "1", optional = true} +hyper-rustls = { version = "0.27", features = ["http2", "http1", "native-tokio", "tls12"], default-features = false, optional = true } +rustls = { version = "0.23", default-features = false, optional = true } +# TODO(hyper1): add a way to enable the fips feature flag in s2n-tls +s2n-tls-hyper = { version = "0.0.4", optional = true } +s2n-tls = { version = "0.3.12", optional = true } +tower = { version = "0.5.2", optional = true } +rustls-pki-types = { version = "1.11.0", features = ["std"], optional = true } +rustls-native-certs = { version = "0.8.1", optional = true } +# end hyper 1.x stack deps + +# legacy hyper-0.14.x stack the SDK/runtime GA'd with +http-02x = { package = "http", version = "0.2.9", optional = true} +http-body-04x = { package = "http-body", version = "0.4.5" , optional = true} +hyper-0-14 = { package = "hyper", version = "0.14.26", default-features = false, features = ["client", "http1", "http2", "tcp", "stream"], optional = true } +legacy-hyper-rustls = { package = "hyper-rustls", version = "0.24", features = ["rustls-native-certs", "http2"], optional = true } +legacy-rustls = { package = "rustls", version = "0.21.8", optional = true } +# end legacy stack deps + +# test util stack +bytes = { version = "1.10.0", optional = true } +serde = { version = "1.0.210", features = ["derive"], optional = true } +serde_json = { version = "1.0.128", features = ["preserve_order"], optional = true } +indexmap = { version = "2.6.0", features = ["serde"], optional = true } +http-body-util = { version = "0.1.2", optional = true } +# end test util stack + +[dev-dependencies] +aws-smithy-async = { path = "../aws-smithy-async", features = ["rt-tokio", "test-util"] } +aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["test-util"] } +aws-smithy-types = { path = "../aws-smithy-types", features = ["http-body-0-4-x", "test-util"] } +http-body-util = { version = "0.1.2" } +hyper-util = { version = "0.1.7", features = ["full"] } +rustls-pemfile = "2.2.0" +rustls-pki-types = { version = "1.11.0", features = ["std"] } +tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "test-util", "full"] } +tokio-rustls = "0.26.1" + + +[[example]] +name = "client-ring" +required-features = ["rustls-ring"] +doc-scrape-examples = true + +[[example]] +name = "client-aws-lc" +required-features = ["rustls-aws-lc", "rustls-aws-lc-fips"] +doc-scrape-examples = true + +[[example]] +name = "client-s2n-tls" +required-features = ["s2n-tls"] +doc-scrape-examples = true + +[[example]] +name = "custom-dns" +required-features = ["rustls-ring"] +doc-scrape-examples = true + +[package.metadata.smithy-rs-release-tooling] +stable = true + +[package.metadata.docs.rs] +all-features = false +features = [ + "default-client ", + "wire-mock", + "test-util", + "rustls-ring", + "rustls-aws-lc", +] + +targets = ["x86_64-unknown-linux-gnu"] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +rustdoc-args = ["--cfg", "docsrs"] +# End of docs.rs metadata diff --git a/rust-runtime/aws-smithy-http-client/LICENSE b/rust-runtime/aws-smithy-http-client/LICENSE new file mode 100644 index 000000000..67db85882 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/rust-runtime/aws-smithy-http-client/README.md b/rust-runtime/aws-smithy-http-client/README.md new file mode 100644 index 000000000..261a84b86 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/README.md @@ -0,0 +1,7 @@ +# aws-smithy-http-client + +HTTP client abstractions for generated smithy clients. + + +This crate is part of the [AWS SDK for Rust](https://awslabs.github.io/aws-sdk-rust/) and the [smithy-rs](https://github.com/smithy-lang/smithy-rs) code generator. In most cases, it should not be used directly. + diff --git a/rust-runtime/aws-smithy-http-client/examples/client-aws-lc.rs b/rust-runtime/aws-smithy-http-client/examples/client-aws-lc.rs new file mode 100644 index 000000000..462ab5e88 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/examples/client-aws-lc.rs @@ -0,0 +1,23 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_http_client::{ + tls::{self, rustls_provider::CryptoMode}, + Builder, +}; + +#[tokio::main] +async fn main() { + // feature = rustls-aws-lc + let _client = Builder::new() + .tls_provider(tls::Provider::Rustls(CryptoMode::AwsLc)) + .build_https(); + + // feature = rustls-aws-lc-fips + // A FIPS client can also be created. Note that this has a more complex build environment required. + let _client = Builder::new() + .tls_provider(tls::Provider::Rustls(CryptoMode::AwsLcFips)) + .build_https(); +} diff --git a/rust-runtime/aws-smithy-http-client/examples/client-ring.rs b/rust-runtime/aws-smithy-http-client/examples/client-ring.rs new file mode 100644 index 000000000..790446972 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/examples/client-ring.rs @@ -0,0 +1,15 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_http_client::{ + tls::{self, rustls_provider::CryptoMode}, + Builder, +}; + +fn main() { + let _client = Builder::new() + .tls_provider(tls::Provider::Rustls(CryptoMode::Ring)) + .build_https(); +} diff --git a/rust-runtime/aws-smithy-http-client/examples/client-s2n-tls.rs b/rust-runtime/aws-smithy-http-client/examples/client-s2n-tls.rs new file mode 100644 index 000000000..e9991db7d --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/examples/client-s2n-tls.rs @@ -0,0 +1,12 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_http_client::{tls, Builder}; + +fn main() { + let _client = Builder::new() + .tls_provider(tls::Provider::S2nTls) + .build_https(); +} diff --git a/rust-runtime/aws-smithy-experimental/examples/custom-dns.rs b/rust-runtime/aws-smithy-http-client/examples/custom-dns.rs similarity index 73% rename from rust-runtime/aws-smithy-experimental/examples/custom-dns.rs rename to rust-runtime/aws-smithy-http-client/examples/custom-dns.rs index 45768e5fc..627bf5c39 100644 --- a/rust-runtime/aws-smithy-experimental/examples/custom-dns.rs +++ b/rust-runtime/aws-smithy-http-client/examples/custom-dns.rs @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -use aws_smithy_experimental::hyper_1_0::{CryptoMode, HyperClientBuilder}; +use aws_smithy_http_client::{ + tls::{self, rustls_provider::CryptoMode}, + Builder, +}; use aws_smithy_runtime_api::client::dns::{DnsFuture, ResolveDns}; use std::net::{IpAddr, Ipv4Addr}; @@ -17,7 +20,7 @@ impl ResolveDns for StaticResolver { } fn main() { - let _client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::Ring) + let _client = Builder::new() + .tls_provider(tls::Provider::Rustls(CryptoMode::Ring)) .build_with_resolver(StaticResolver); } diff --git a/rust-runtime/aws-smithy-http-client/external-types.toml b/rust-runtime/aws-smithy-http-client/external-types.toml new file mode 100644 index 000000000..368c5b8c1 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/external-types.toml @@ -0,0 +1,24 @@ +allowed_external_types = [ + "aws_smithy_runtime_api::*", + "aws_smithy_async::*", + "aws_smithy_types::*", + + # TODO(https://github.com/smithy-lang/smithy-rs/issues/1193): Once tooling permits it, only allow the following types based on the feature that exposes them + "hyper::client::client::Builder", + "hyper::client::connect::Connection", + "tokio::io::async_read::AsyncRead", + "tokio::io::async_write::AsyncWrite", + "http::uri::Uri", + # Used in trait bounds for legacy hyper connector build method + "tower_service::Service", + + "bytes::bytes::Bytes", + "serde::ser::Serialize", + "serde::de::Deserialize", + "hyper::client::connect::dns::Name", + "http::request::Request", + "http::response::Response", + "http::uri::Uri", + "tokio::net::tcp::stream::TcpStream", + "hyper_util::rt::tokio::TokioIo", +] diff --git a/rust-runtime/aws-smithy-http-client/src/client.rs b/rust-runtime/aws-smithy-http-client/src/client.rs new file mode 100644 index 000000000..c15bbf216 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/client.rs @@ -0,0 +1,1003 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +mod timeout; +/// TLS connector(s) +pub mod tls; + +use crate::cfg::cfg_tls; +use crate::tls::TlsContext; +use aws_smithy_async::future::timeout::TimedOutError; +use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep}; +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::connection::CaptureSmithyConnection; +use aws_smithy_runtime_api::client::connection::ConnectionMetadata; +use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; +use aws_smithy_runtime_api::client::http::{ + HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient, + SharedHttpConnector, +}; +use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; +use aws_smithy_runtime_api::client::result::ConnectorError; +use aws_smithy_runtime_api::client::runtime_components::{ + RuntimeComponents, RuntimeComponentsBuilder, +}; +use aws_smithy_runtime_api::shared::IntoShared; +use aws_smithy_types::body::SdkBody; +use aws_smithy_types::config_bag::ConfigBag; +use aws_smithy_types::error::display::DisplayErrorContext; +use aws_smithy_types::retry::ErrorKind; +use client::connect::Connection; +use h2::Reason; +use http_1x::{Extensions, Uri}; +use hyper::rt::{Read, Write}; +use hyper_util::client::legacy as client; +use hyper_util::client::legacy::connect::dns::GaiResolver; +use hyper_util::client::legacy::connect::{ + capture_connection, CaptureConnection, Connect, HttpConnector as HyperHttpConnector, HttpInfo, +}; +use hyper_util::rt::TokioExecutor; +use std::borrow::Cow; +use std::collections::HashMap; +use std::error::Error; +use std::fmt; +use std::sync::RwLock; +use std::time::Duration; + +/// Given `HttpConnectorSettings` and an `SharedAsyncSleep`, create a `SharedHttpConnector` from defaults depending on what cargo features are activated. +pub fn default_connector( + settings: &HttpConnectorSettings, + sleep: Option, +) -> Option { + #[cfg(feature = "rustls-aws-lc")] + { + tracing::trace!(settings = ?settings, sleep = ?sleep, "creating a new default connector"); + let mut conn_builder = Connector::builder().connector_settings(settings.clone()); + + if let Some(sleep) = sleep { + conn_builder = conn_builder.sleep_impl(sleep); + } + + let conn = conn_builder + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) + .build(); + Some(SharedHttpConnector::new(conn)) + } + #[cfg(not(feature = "rustls-aws-lc"))] + { + tracing::trace!(settings = ?settings, sleep = ?sleep, "no default connector available"); + None + } +} + +/// [`HttpConnector`] used to make HTTP requests. +/// +/// This connector also implements socket connect and read timeouts. +/// +/// This shouldn't be used directly in most cases. +/// See the docs on [`Builder`] for examples of how to customize the HTTP client. +#[derive(Debug)] +pub struct Connector { + adapter: Box, +} + +impl Connector { + /// Builder for an HTTP connector. + pub fn builder() -> ConnectorBuilder { + ConnectorBuilder { + enable_tcp_nodelay: true, + ..Default::default() + } + } +} + +impl HttpConnector for Connector { + fn call(&self, request: HttpRequest) -> HttpConnectorFuture { + self.adapter.call(request) + } +} + +/// Builder for [`Connector`]. +#[derive(Default, Debug)] +pub struct ConnectorBuilder { + connector_settings: Option, + sleep_impl: Option, + client_builder: Option, + enable_tcp_nodelay: bool, + interface: Option, + #[allow(unused)] + tls: Tls, +} + +/// Initial builder state, `TlsProvider` choice required +#[derive(Default)] +#[non_exhaustive] +pub struct TlsUnset {} + +/// TLS implementation selected +pub struct TlsProviderSelected { + #[allow(unused)] + provider: tls::Provider, + #[allow(unused)] + context: TlsContext, +} + +impl ConnectorBuilder { + /// Set the TLS implementation to use for this connector + pub fn tls_provider(self, provider: tls::Provider) -> ConnectorBuilder { + ConnectorBuilder { + connector_settings: self.connector_settings, + sleep_impl: self.sleep_impl, + client_builder: self.client_builder, + enable_tcp_nodelay: self.enable_tcp_nodelay, + interface: self.interface, + tls: TlsProviderSelected { + provider, + context: TlsContext::default(), + }, + } + } + + /// Build an HTTP connector sans TLS + #[doc(hidden)] + pub fn build_http(self) -> Connector { + let base = self.base_connector(); + self.wrap_connector(base) + } +} + +impl ConnectorBuilder { + /// Create a [`Connector`] from this builder and a given connector. + pub(crate) fn wrap_connector(self, tcp_connector: C) -> Connector + where + C: Send + Sync + 'static, + C: Clone, + C: tower::Service, + C::Response: Read + Write + Connection + Send + Sync + Unpin, + C: Connect, + C::Future: Unpin + Send + 'static, + C::Error: Into, + { + let client_builder = + self.client_builder + .unwrap_or(hyper_util::client::legacy::Builder::new( + TokioExecutor::new(), + )); + let sleep_impl = self.sleep_impl.or_else(default_async_sleep); + let (connect_timeout, read_timeout) = self + .connector_settings + .map(|c| (c.connect_timeout(), c.read_timeout())) + .unwrap_or((None, None)); + + let connector = match connect_timeout { + Some(duration) => timeout::ConnectTimeout::new( + tcp_connector, + sleep_impl + .clone() + .expect("a sleep impl must be provided in order to have a connect timeout"), + duration, + ), + None => timeout::ConnectTimeout::no_timeout(tcp_connector), + }; + let base = client_builder.build(connector); + let read_timeout = match read_timeout { + Some(duration) => timeout::HttpReadTimeout::new( + base, + sleep_impl.expect("a sleep impl must be provided in order to have a read timeout"), + duration, + ), + None => timeout::HttpReadTimeout::no_timeout(base), + }; + Connector { + adapter: Box::new(Adapter { + client: read_timeout, + }), + } + } + + /// Get the base TCP connector by mapping our config to the underlying `HttpConnector` from hyper + /// (which is a base TCP connector with no TLS or any wrapping) + fn base_connector(&self) -> HyperHttpConnector { + self.base_connector_with_resolver(GaiResolver::new()) + } + + /// Get the base TCP connector by mapping our config to the underlying `HttpConnector` from hyper + /// using the given resolver `R` + fn base_connector_with_resolver(&self, resolver: R) -> HyperHttpConnector { + let mut conn = HyperHttpConnector::new_with_resolver(resolver); + conn.set_nodelay(self.enable_tcp_nodelay); + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + if let Some(interface) = &self.interface { + conn.set_interface(interface); + } + conn + } + + /// Set the async sleep implementation used for timeouts + /// + /// Calling this is only necessary for testing or to use something other than + /// [`default_async_sleep`]. + pub fn sleep_impl(mut self, sleep_impl: impl AsyncSleep + 'static) -> Self { + self.sleep_impl = Some(sleep_impl.into_shared()); + self + } + + /// Set the async sleep implementation used for timeouts + /// + /// Calling this is only necessary for testing or to use something other than + /// [`default_async_sleep`]. + pub fn set_sleep_impl(&mut self, sleep_impl: Option) -> &mut Self { + self.sleep_impl = sleep_impl; + self + } + + /// Configure the HTTP settings for the `HyperAdapter` + pub fn connector_settings(mut self, connector_settings: HttpConnectorSettings) -> Self { + self.connector_settings = Some(connector_settings); + self + } + + /// Configure the HTTP settings for the `HyperAdapter` + pub fn set_connector_settings( + &mut self, + connector_settings: Option, + ) -> &mut Self { + self.connector_settings = connector_settings; + self + } + + /// Configure `SO_NODELAY` for all sockets to the supplied value `nodelay` + pub fn enable_tcp_nodelay(mut self, nodelay: bool) -> Self { + self.enable_tcp_nodelay = nodelay; + self + } + + /// Configure `SO_NODELAY` for all sockets to the supplied value `nodelay` + pub fn set_enable_tcp_nodelay(&mut self, nodelay: bool) -> &mut Self { + self.enable_tcp_nodelay = nodelay; + self + } + + /// Sets the value for the `SO_BINDTODEVICE` option on this socket. + /// + /// If a socket is bound to an interface, only packets received from that particular + /// interface are processed by the socket. Note that this only works for some socket + /// types (e.g. `AF_INET` sockets). + /// + /// On Linux it can be used to specify a [VRF], but the binary needs to either have + /// `CAP_NET_RAW` capability set or be run as root. + /// + /// This function is only available on Android, Fuchsia, and Linux. + /// + /// [VRF]: https://www.kernel.org/doc/Documentation/networking/vrf.txt + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + pub fn set_interface>(&mut self, interface: S) -> &mut Self { + self.interface = Some(interface.into()); + self + } + + /// Override the Hyper client [`Builder`](hyper_util::client::legacy::Builder) used to construct this client. + /// + /// This enables changing settings like forcing HTTP2 and modifying other default client behavior. + pub(crate) fn hyper_builder( + mut self, + hyper_builder: hyper_util::client::legacy::Builder, + ) -> Self { + self.set_hyper_builder(Some(hyper_builder)); + self + } + + /// Override the Hyper client [`Builder`](hyper_util::client::legacy::Builder) used to construct this client. + /// + /// This enables changing settings like forcing HTTP2 and modifying other default client behavior. + pub(crate) fn set_hyper_builder( + &mut self, + hyper_builder: Option, + ) -> &mut Self { + self.client_builder = hyper_builder; + self + } +} + +/// Adapter to use a Hyper 1.0-based Client as an `HttpConnector` +/// +/// This adapter also enables TCP `CONNECT` and HTTP `READ` timeouts via [`Connector::builder`]. +struct Adapter { + client: timeout::HttpReadTimeout< + hyper_util::client::legacy::Client, SdkBody>, + >, +} + +impl fmt::Debug for Adapter { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Adapter") + .field("client", &"** hyper client **") + .finish() + } +} + +/// Extract a smithy connection from a hyper CaptureConnection +fn extract_smithy_connection(capture_conn: &CaptureConnection) -> Option { + let capture_conn = capture_conn.clone(); + if let Some(conn) = capture_conn.clone().connection_metadata().as_ref() { + let mut extensions = Extensions::new(); + conn.get_extras(&mut extensions); + let http_info = extensions.get::(); + let mut builder = ConnectionMetadata::builder() + .proxied(conn.is_proxied()) + .poison_fn(move || match capture_conn.connection_metadata().as_ref() { + Some(conn) => conn.poison(), + None => tracing::trace!("no connection existed to poison"), + }); + + builder + .set_local_addr(http_info.map(|info| info.local_addr())) + .set_remote_addr(http_info.map(|info| info.remote_addr())); + + let smithy_connection = builder.build(); + + Some(smithy_connection) + } else { + None + } +} + +impl HttpConnector for Adapter +where + C: Clone + Send + Sync + 'static, + C: tower::Service, + C::Response: Connection + Read + Write + Unpin + 'static, + timeout::ConnectTimeout: Connect, + C::Future: Unpin + Send + 'static, + C::Error: Into, +{ + fn call(&self, request: HttpRequest) -> HttpConnectorFuture { + let mut request = match request.try_into_http1x() { + Ok(request) => request, + Err(err) => { + return HttpConnectorFuture::ready(Err(ConnectorError::user(err.into()))); + } + }; + let capture_connection = capture_connection(&mut request); + if let Some(capture_smithy_connection) = + request.extensions().get::() + { + capture_smithy_connection + .set_connection_retriever(move || extract_smithy_connection(&capture_connection)); + } + let mut client = self.client.clone(); + use tower::Service; + let fut = client.call(request); + HttpConnectorFuture::new(async move { + let response = fut + .await + .map_err(downcast_error)? + .map(SdkBody::from_body_1_x); + match HttpResponse::try_from(response) { + Ok(response) => Ok(response), + Err(err) => Err(ConnectorError::other(err.into(), None)), + } + }) + } +} + +/// Downcast errors coming out of hyper into an appropriate `ConnectorError` +fn downcast_error(err: BoxError) -> ConnectorError { + // is a `TimedOutError` (from aws_smithy_async::timeout) in the chain? if it is, this is a timeout + if find_source::(err.as_ref()).is_some() { + return ConnectorError::timeout(err); + } + // is the top of chain error actually already a `ConnectorError`? return that directly + let err = match err.downcast::() { + Ok(connector_error) => return *connector_error, + Err(box_error) => box_error, + }; + // generally, the top of chain will probably be a hyper error. Go through a set of hyper specific + // error classifications + let err = match find_source::(err.as_ref()) { + Some(hyper_error) => return to_connector_error(hyper_error)(err), + None => err, + }; + + // otherwise, we have no idea! + ConnectorError::other(err, None) +} + +/// Convert a [`hyper::Error`] into a [`ConnectorError`] +fn to_connector_error(err: &hyper::Error) -> fn(BoxError) -> ConnectorError { + if err.is_timeout() || find_source::(err).is_some() { + return ConnectorError::timeout; + } + if err.is_user() { + return ConnectorError::user; + } + if err.is_closed() || err.is_canceled() || find_source::(err).is_some() { + return ConnectorError::io; + } + // We sometimes receive this from S3: hyper::Error(IncompleteMessage) + if err.is_incomplete_message() { + return |err: BoxError| ConnectorError::other(err, Some(ErrorKind::TransientError)); + } + + if let Some(h2_err) = find_source::(err) { + if h2_err.is_go_away() + || (h2_err.is_reset() && h2_err.reason() == Some(Reason::REFUSED_STREAM)) + { + return ConnectorError::io; + } + } + + tracing::warn!(err = %DisplayErrorContext(&err), "unrecognized error from Hyper. If this error should be retried, please file an issue."); + |err: BoxError| ConnectorError::other(err, None) +} + +fn find_source<'a, E: Error + 'static>(err: &'a (dyn Error + 'static)) -> Option<&'a E> { + let mut next = Some(err); + while let Some(err) = next { + if let Some(matching_err) = err.downcast_ref::() { + return Some(matching_err); + } + next = err.source(); + } + None +} + +// TODO(https://github.com/awslabs/aws-sdk-rust/issues/1090): CacheKey must also include ptr equality to any +// runtime components that are used—sleep_impl as a base (unless we prohibit overriding sleep impl) +// If we decide to put a DnsResolver in RuntimeComponents, then we'll need to handle that as well. +#[derive(Clone, Debug, Eq, PartialEq, Hash)] +struct CacheKey { + connect_timeout: Option, + read_timeout: Option, +} + +impl From<&HttpConnectorSettings> for CacheKey { + fn from(value: &HttpConnectorSettings) -> Self { + Self { + connect_timeout: value.connect_timeout(), + read_timeout: value.read_timeout(), + } + } +} + +struct HyperClient { + connector_cache: RwLock>, + client_builder: hyper_util::client::legacy::Builder, + connector_fn: F, +} + +impl fmt::Debug for HyperClient { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("HyperClient") + .field("connector_cache", &self.connector_cache) + .field("client_builder", &self.client_builder) + .finish() + } +} + +impl HttpClient for HyperClient +where + F: Fn( + hyper_util::client::legacy::Builder, + Option<&HttpConnectorSettings>, + Option<&RuntimeComponents>, + ) -> Connector + + Send + + Sync + + 'static, +{ + fn http_connector( + &self, + settings: &HttpConnectorSettings, + components: &RuntimeComponents, + ) -> SharedHttpConnector { + let key = CacheKey::from(settings); + let mut connector = self.connector_cache.read().unwrap().get(&key).cloned(); + if connector.is_none() { + let mut cache = self.connector_cache.write().unwrap(); + // Short-circuit if another thread already wrote a connector to the cache for this key + if !cache.contains_key(&key) { + let start = components.time_source().map(|ts| ts.now()); + let connector = (self.connector_fn)( + self.client_builder.clone(), + Some(settings), + Some(components), + ); + let end = components.time_source().map(|ts| ts.now()); + if let (Some(start), Some(end)) = (start, end) { + if let Ok(elapsed) = end.duration_since(start) { + tracing::debug!("new connector created in {:?}", elapsed); + } + } + let connector = SharedHttpConnector::new(connector); + cache.insert(key.clone(), connector); + } + connector = cache.get(&key).cloned(); + } + + connector.expect("cache populated above") + } + + fn validate_base_client_config( + &self, + _: &RuntimeComponentsBuilder, + _: &ConfigBag, + ) -> Result<(), BoxError> { + // Initialize the TCP connector at this point so that native certs load + // at client initialization time instead of upon first request. We do it + // here rather than at construction so that it won't run if this is not + // the selected HTTP client for the base config (for example, if this was + // the default HTTP client, and it was overridden by a later plugin). + let _ = (self.connector_fn)(self.client_builder.clone(), None, None); + Ok(()) + } + + fn connector_metadata(&self) -> Option { + Some(ConnectorMetadata::new("hyper", Some(Cow::Borrowed("1.x")))) + } +} + +/// Builder for a hyper-backed [`HttpClient`] implementation. +/// +/// This builder can be used to customize the underlying TCP connector used, as well as +/// hyper client configuration. +/// +/// # Examples +/// +/// Construct a Hyper client with the RusTLS TLS implementation. +/// This can be useful when you want to share a Hyper connector between multiple +/// generated Smithy clients. +#[derive(Clone, Default, Debug)] +pub struct Builder { + client_builder: Option, + #[allow(unused)] + tls_provider: Tls, +} + +cfg_tls! { + mod dns; + use aws_smithy_runtime_api::client::dns::ResolveDns; + + impl ConnectorBuilder { + /// Build a [`Connector`] that will use the default DNS resolver implementation. + pub fn build(self) -> Connector { + let http_connector = self.base_connector(); + self.build_https(http_connector) + } + + /// Configure the TLS context + pub fn tls_context(mut self, ctx: TlsContext) -> Self { + self.tls.context = ctx; + self + } + + /// Configure the TLS context + pub fn set_tls_context(&mut self, ctx: TlsContext) -> &mut Self { + self.tls.context = ctx; + self + } + + /// Build a [`Connector`] that will use the given DNS resolver implementation. + pub fn build_with_resolver(self, resolver: R) -> Connector { + use crate::client::dns::HyperUtilResolver; + let http_connector = self.base_connector_with_resolver(HyperUtilResolver { resolver }); + self.build_https(http_connector) + } + + fn build_https(self, http_connector: HyperHttpConnector) -> Connector + where + R: Clone + Send + Sync + 'static, + R: tower::Service, + R::Response: Iterator, + R::Future: Send, + R::Error: Into>, + { + match &self.tls.provider { + // TODO(hyper1) - fix cfg_rustls! to allow matching on patterns so we can re-use it and not duplicate these cfg matches everywhere + #[cfg(any( + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "rustls-ring" + ))] + tls::Provider::Rustls(crypto_mode) => { + let https_connector = tls::rustls_provider::build_connector::wrap_connector( + http_connector, + crypto_mode.clone(), + &self.tls.context, + ); + self.wrap_connector(https_connector) + }, + #[cfg(feature = "s2n-tls")] + tls::Provider::S2nTls => { + let https_connector = tls::s2n_tls_provider::build_connector::wrap_connector(http_connector, &self.tls.context); + self.wrap_connector(https_connector) + } + } + } + } + + impl Builder { + /// Create an HTTPS client with the selected TLS provider. + /// + /// The trusted certificates will be loaded later when this becomes the selected + /// HTTP client for a Smithy client. + pub fn build_https(self) -> SharedHttpClient { + build_with_conn_fn( + self.client_builder, + move |client_builder, settings, runtime_components| { + let builder = new_conn_builder(client_builder, settings, runtime_components) + .tls_provider(self.tls_provider.provider.clone()) + .tls_context(self.tls_provider.context.clone()); + builder.build() + }, + ) + } + + /// Create an HTTPS client using a custom DNS resolver + pub fn build_with_resolver( + self, + resolver: impl ResolveDns + Clone + 'static, + ) -> SharedHttpClient { + build_with_conn_fn( + self.client_builder, + move |client_builder, settings, runtime_components| { + let builder = new_conn_builder(client_builder, settings, runtime_components) + .tls_provider(self.tls_provider.provider.clone()) + .tls_context(self.tls_provider.context.clone()); + builder.build_with_resolver(resolver.clone()) + }, + ) + } + + /// Configure the TLS context + pub fn tls_context(mut self, ctx: TlsContext) -> Self { + self.tls_provider.context = ctx; + self + } + } +} + +impl Builder { + /// Creates a new builder. + pub fn new() -> Self { + Self::default() + } + + /// Build a new HTTP client without TLS enabled + #[doc(hidden)] + pub fn build_http(self) -> SharedHttpClient { + build_with_conn_fn( + self.client_builder, + move |client_builder, settings, runtime_components| { + let builder = new_conn_builder(client_builder, settings, runtime_components); + builder.build_http() + }, + ) + } + + /// Set the TLS implementation to use + pub fn tls_provider(self, provider: tls::Provider) -> Builder { + Builder { + client_builder: self.client_builder, + tls_provider: TlsProviderSelected { + provider, + context: TlsContext::default(), + }, + } + } +} + +pub(crate) fn build_with_conn_fn( + client_builder: Option, + connector_fn: F, +) -> SharedHttpClient +where + F: Fn( + hyper_util::client::legacy::Builder, + Option<&HttpConnectorSettings>, + Option<&RuntimeComponents>, + ) -> Connector + + Send + + Sync + + 'static, +{ + SharedHttpClient::new(HyperClient { + connector_cache: RwLock::new(HashMap::new()), + client_builder: client_builder + .unwrap_or_else(|| hyper_util::client::legacy::Builder::new(TokioExecutor::new())), + connector_fn, + }) +} + +#[allow(dead_code)] +pub(crate) fn build_with_tcp_conn_fn( + client_builder: Option, + tcp_connector_fn: F, +) -> SharedHttpClient +where + F: Fn() -> C + Send + Sync + 'static, + C: Clone + Send + Sync + 'static, + C: tower::Service, + C::Response: Connection + Read + Write + Send + Sync + Unpin + 'static, + C::Future: Unpin + Send + 'static, + C::Error: Into, + C: Connect, +{ + build_with_conn_fn( + client_builder, + move |client_builder, settings, runtime_components| { + let builder = new_conn_builder(client_builder, settings, runtime_components); + builder.wrap_connector(tcp_connector_fn()) + }, + ) +} + +fn new_conn_builder( + client_builder: hyper_util::client::legacy::Builder, + settings: Option<&HttpConnectorSettings>, + runtime_components: Option<&RuntimeComponents>, +) -> ConnectorBuilder { + let mut builder = Connector::builder().hyper_builder(client_builder); + builder.set_connector_settings(settings.cloned()); + if let Some(components) = runtime_components { + builder.set_sleep_impl(components.sleep_impl()); + } + builder +} + +#[cfg(test)] +mod test { + use std::io::{Error, ErrorKind}; + use std::pin::Pin; + use std::sync::atomic::{AtomicU32, Ordering}; + use std::sync::Arc; + use std::task::{Context, Poll}; + + use aws_smithy_async::assert_elapsed; + use aws_smithy_async::rt::sleep::TokioSleep; + use aws_smithy_async::time::SystemTimeSource; + use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; + use http_1x::Uri; + use hyper::rt::ReadBufCursor; + use hyper_util::client::legacy::connect::Connected; + + use crate::client::timeout::test::NeverConnects; + + use super::*; + + #[tokio::test] + async fn connector_selection() { + // Create a client that increments a count every time it creates a new Connector + let creation_count = Arc::new(AtomicU32::new(0)); + let http_client = build_with_tcp_conn_fn(None, { + let count = creation_count.clone(); + move || { + count.fetch_add(1, Ordering::Relaxed); + NeverConnects + } + }); + + // This configuration should result in 4 separate connectors with different timeout settings + let settings = [ + HttpConnectorSettings::builder() + .connect_timeout(Duration::from_secs(3)) + .build(), + HttpConnectorSettings::builder() + .read_timeout(Duration::from_secs(3)) + .build(), + HttpConnectorSettings::builder() + .connect_timeout(Duration::from_secs(3)) + .read_timeout(Duration::from_secs(3)) + .build(), + HttpConnectorSettings::builder() + .connect_timeout(Duration::from_secs(5)) + .read_timeout(Duration::from_secs(3)) + .build(), + ]; + + // Kick off thousands of parallel tasks that will try to create a connector + let components = RuntimeComponentsBuilder::for_tests() + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let mut handles = Vec::new(); + for setting in &settings { + for _ in 0..1000 { + let client = http_client.clone(); + handles.push(tokio::spawn({ + let setting = setting.clone(); + let components = components.clone(); + async move { + let _ = client.http_connector(&setting, &components); + } + })); + } + } + for handle in handles { + handle.await.unwrap(); + } + + // Verify only 4 connectors were created amidst the chaos + assert_eq!(4, creation_count.load(Ordering::Relaxed)); + } + + #[tokio::test] + async fn hyper_io_error() { + let connector = TestConnection { + inner: HangupStream, + }; + let adapter = Connector::builder().wrap_connector(connector).adapter; + let err = adapter + .call(HttpRequest::get("https://socket-hangup.com").unwrap()) + .await + .expect_err("socket hangup"); + assert!(err.is_io(), "unexpected error type: {:?}", err); + } + + // ---- machinery to make a Hyper connector that responds with an IO Error + #[derive(Clone)] + struct HangupStream; + + impl Connection for HangupStream { + fn connected(&self) -> Connected { + Connected::new() + } + } + + impl Read for HangupStream { + fn poll_read( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _buf: ReadBufCursor<'_>, + ) -> Poll> { + Poll::Ready(Err(Error::new( + ErrorKind::ConnectionReset, + "connection reset", + ))) + } + } + + impl Write for HangupStream { + fn poll_write( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _buf: &[u8], + ) -> Poll> { + Poll::Pending + } + + fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Pending + } + + fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Pending + } + } + + #[derive(Clone)] + struct TestConnection { + inner: T, + } + + impl tower::Service for TestConnection + where + T: Clone + Connection, + { + type Response = T; + type Error = BoxError; + type Future = std::future::Ready>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _req: Uri) -> Self::Future { + std::future::ready(Ok(self.inner.clone())) + } + } + + #[tokio::test] + async fn http_connect_timeout_works() { + let tcp_connector = NeverConnects::default(); + let connector_settings = HttpConnectorSettings::builder() + .connect_timeout(Duration::from_secs(1)) + .build(); + let hyper = Connector::builder() + .connector_settings(connector_settings) + .sleep_impl(SharedAsyncSleep::new(TokioSleep::new())) + .wrap_connector(tcp_connector) + .adapter; + let now = tokio::time::Instant::now(); + tokio::time::pause(); + let resp = hyper + .call(HttpRequest::get("https://static-uri.com").unwrap()) + .await + .unwrap_err(); + assert!( + resp.is_timeout(), + "expected resp.is_timeout() to be true but it was false, resp == {:?}", + resp + ); + let message = DisplayErrorContext(&resp).to_string(); + let expected = "timeout: client error (Connect): HTTP connect timeout occurred after 1s"; + assert!( + message.contains(expected), + "expected '{message}' to contain '{expected}'" + ); + assert_elapsed!(now, Duration::from_secs(1)); + } + + #[tokio::test] + async fn http_read_timeout_works() { + let tcp_connector = crate::client::timeout::test::NeverReplies; + let connector_settings = HttpConnectorSettings::builder() + .connect_timeout(Duration::from_secs(1)) + .read_timeout(Duration::from_secs(2)) + .build(); + let hyper = Connector::builder() + .connector_settings(connector_settings) + .sleep_impl(SharedAsyncSleep::new(TokioSleep::new())) + .wrap_connector(tcp_connector) + .adapter; + let now = tokio::time::Instant::now(); + tokio::time::pause(); + let err = hyper + .call(HttpRequest::get("https://fake-uri.com").unwrap()) + .await + .unwrap_err(); + assert!( + err.is_timeout(), + "expected err.is_timeout() to be true but it was false, err == {err:?}", + ); + let message = format!("{}", DisplayErrorContext(&err)); + let expected = "timeout: HTTP read timeout occurred after 2s"; + assert!( + message.contains(expected), + "expected '{message}' to contain '{expected}'" + ); + assert_elapsed!(now, Duration::from_secs(2)); + } + + #[cfg(feature = "s2n-tls")] + #[tokio::test] + async fn s2n_tls_provider() { + // Create an HttpConnector with the s2n-tls provider. + let client = Builder::new() + .tls_provider(tls::Provider::S2nTls) + .build_https(); + let connector_settings = HttpConnectorSettings::builder().build(); + + // HyperClient::http_connector invokes TimeSource::now to determine how long it takes to + // create new HttpConnectors. As such, a real time source must be provided. + let runtime_components = RuntimeComponentsBuilder::for_tests() + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + + let connector = client.http_connector(&connector_settings, &runtime_components); + + // Ensure that s2n-tls is used as the underlying TLS provider when selected. + // + // s2n-tls-hyper will error when given an invalid scheme. Ensure that this error is produced + // from s2n-tls-hyper, and not another TLS provider. + let error = connector + .call(HttpRequest::get("notascheme://amazon.com").unwrap()) + .await + .unwrap_err(); + let error = error.into_source(); + let s2n_error = error + .source() + .unwrap() + .downcast_ref::() + .unwrap(); + assert!(matches!( + s2n_error, + s2n_tls_hyper::error::Error::InvalidScheme + )); + } +} diff --git a/rust-runtime/aws-smithy-http-client/src/client/dns.rs b/rust-runtime/aws-smithy-http-client/src/client/dns.rs new file mode 100644 index 000000000..82c566c16 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/client/dns.rs @@ -0,0 +1,40 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +use aws_smithy_runtime_api::client::dns::ResolveDns; +use hyper_util::client::legacy::connect::dns::Name; +use std::error::Error; +use std::future::Future; +use std::net::SocketAddr; +use std::pin::Pin; +use std::task::{Context, Poll}; +use std::vec; + +/// A bridge that allows our `ResolveDns` trait to work with Hyper's `Resolver` interface (based on tower) +#[derive(Clone)] +pub(crate) struct HyperUtilResolver { + pub(crate) resolver: R, +} + +impl tower::Service for HyperUtilResolver { + type Response = vec::IntoIter; + type Error = Box; + type Future = Pin> + Send>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, req: Name) -> Self::Future { + let resolver = self.resolver.clone(); + Box::pin(async move { + let dns_entries = resolver.resolve_dns(req.as_str()).await?; + Ok(dns_entries + .into_iter() + .map(|ip_addr| SocketAddr::new(ip_addr, 0)) + .collect::>() + .into_iter()) + }) + } +} diff --git a/rust-runtime/aws-smithy-http-client/src/client/timeout.rs b/rust-runtime/aws-smithy-http-client/src/client/timeout.rs new file mode 100644 index 000000000..56c3f153d --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/client/timeout.rs @@ -0,0 +1,316 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::error::Error; +use std::fmt::Formatter; +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; +use std::time::Duration; + +use http_1x::Uri; +use pin_project_lite::pin_project; + +use aws_smithy_async::future::timeout::{TimedOutError, Timeout}; +use aws_smithy_async::rt::sleep::Sleep; +use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep}; +use aws_smithy_runtime_api::box_error::BoxError; + +#[derive(Debug)] +pub(crate) struct HttpTimeoutError { + kind: &'static str, + duration: Duration, +} + +impl std::fmt::Display for HttpTimeoutError { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{} timeout occurred after {:?}", + self.kind, self.duration + ) + } +} + +impl Error for HttpTimeoutError { + // We implement the `source` function as returning a `TimedOutError` because when `downcast_error` + // or `find_source` is called with an `HttpTimeoutError` (or another error wrapping an `HttpTimeoutError`) + // this method will be checked to determine if it's a timeout-related error. + fn source(&self) -> Option<&(dyn Error + 'static)> { + Some(&TimedOutError) + } +} + +/// Timeout wrapper that will timeout on the initial TCP connection +/// +/// # Stability +/// This interface is unstable. +#[derive(Clone, Debug)] +pub(crate) struct ConnectTimeout { + inner: I, + timeout: Option<(SharedAsyncSleep, Duration)>, +} + +impl ConnectTimeout { + /// Create a new `ConnectTimeout` around `inner`. + /// + /// Typically, `I` will implement [`hyper_util::client::legacy::connect::Connect`]. + pub(crate) fn new(inner: I, sleep: SharedAsyncSleep, timeout: Duration) -> Self { + Self { + inner, + timeout: Some((sleep, timeout)), + } + } + + pub(crate) fn no_timeout(inner: I) -> Self { + Self { + inner, + timeout: None, + } + } +} + +#[derive(Clone, Debug)] +pub(crate) struct HttpReadTimeout { + inner: I, + timeout: Option<(SharedAsyncSleep, Duration)>, +} + +impl HttpReadTimeout { + /// Create a new `HttpReadTimeout` around `inner`. + /// + /// Typically, `I` will implement [`tower::Service>`]. + pub(crate) fn new(inner: I, sleep: SharedAsyncSleep, timeout: Duration) -> Self { + Self { + inner, + timeout: Some((sleep, timeout)), + } + } + + pub(crate) fn no_timeout(inner: I) -> Self { + Self { + inner, + timeout: None, + } + } +} + +pin_project! { + /// Timeout future for Tower services + /// + /// Timeout future to handle timing out, mapping errors, and the possibility of not timing out + /// without incurring an additional allocation for each timeout layer. + #[project = MaybeTimeoutFutureProj] + pub enum MaybeTimeoutFuture { + Timeout { + #[pin] + timeout: Timeout, + error_type: &'static str, + duration: Duration, + }, + NoTimeout { + #[pin] + future: F + } + } +} + +impl Future for MaybeTimeoutFuture +where + F: Future>, + E: Into, +{ + type Output = Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let (timeout_future, kind, &mut duration) = match self.project() { + MaybeTimeoutFutureProj::NoTimeout { future } => { + return future.poll(cx).map_err(|err| err.into()); + } + MaybeTimeoutFutureProj::Timeout { + timeout, + error_type, + duration, + } => (timeout, error_type, duration), + }; + match timeout_future.poll(cx) { + Poll::Ready(Ok(response)) => Poll::Ready(response.map_err(|err| err.into())), + Poll::Ready(Err(_timeout)) => { + Poll::Ready(Err(HttpTimeoutError { kind, duration }.into())) + } + Poll::Pending => Poll::Pending, + } + } +} + +impl tower::Service for ConnectTimeout +where + I: tower::Service, + I::Error: Into, +{ + type Response = I::Response; + type Error = BoxError; + type Future = MaybeTimeoutFuture; + + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + self.inner.poll_ready(cx).map_err(|err| err.into()) + } + + fn call(&mut self, req: Uri) -> Self::Future { + match &self.timeout { + Some((sleep, duration)) => { + let sleep = sleep.sleep(*duration); + MaybeTimeoutFuture::Timeout { + timeout: Timeout::new(self.inner.call(req), sleep), + error_type: "HTTP connect", + duration: *duration, + } + } + None => MaybeTimeoutFuture::NoTimeout { + future: self.inner.call(req), + }, + } + } +} + +impl tower::Service> for HttpReadTimeout +where + I: tower::Service>, + I::Error: Send + Sync + Error + 'static, +{ + type Response = I::Response; + type Error = BoxError; + type Future = MaybeTimeoutFuture; + + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + self.inner.poll_ready(cx).map_err(|err| err.into()) + } + + fn call(&mut self, req: http_1x::Request) -> Self::Future { + match &self.timeout { + Some((sleep, duration)) => { + let sleep = sleep.sleep(*duration); + MaybeTimeoutFuture::Timeout { + timeout: Timeout::new(self.inner.call(req), sleep), + error_type: "HTTP read", + duration: *duration, + } + } + None => MaybeTimeoutFuture::NoTimeout { + future: self.inner.call(req), + }, + } + } +} + +#[cfg(test)] +pub(crate) mod test { + use hyper::rt::ReadBufCursor; + use hyper_util::client::legacy::connect::{Connected, Connection}; + use hyper_util::rt::TokioIo; + use tokio::net::TcpStream; + + use aws_smithy_async::future::never::Never; + + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::result::ConnectorError; + use http::Uri; + use hyper::http; + use hyper::rt::{Read, Write}; + use std::future::Future; + use std::pin::Pin; + use std::task::{Context, Poll}; + + #[allow(unused)] + fn connect_timeout_is_correct() { + is_send_sync::>(); + } + + #[allow(unused)] + fn is_send_sync() {} + + /// A service that will never return whatever it is you want + /// + /// Returned futures will return Pending forever + #[non_exhaustive] + #[derive(Clone, Default, Debug)] + pub(crate) struct NeverConnects; + impl tower::Service for NeverConnects { + type Response = TokioIo; + type Error = ConnectorError; + type Future = Pin> + Send>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _uri: Uri) -> Self::Future { + Box::pin(async move { + Never::new().await; + unreachable!() + }) + } + } + + /// A service that will connect but never send any data + #[derive(Clone, Debug, Default)] + pub(crate) struct NeverReplies; + impl tower::Service for NeverReplies { + type Response = EmptyStream; + type Error = BoxError; + type Future = std::future::Ready>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _req: Uri) -> Self::Future { + std::future::ready(Ok(EmptyStream)) + } + } + + /// A stream that will never return or accept any data + #[non_exhaustive] + #[derive(Debug, Default)] + pub(crate) struct EmptyStream; + impl Read for EmptyStream { + fn poll_read( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _buf: ReadBufCursor<'_>, + ) -> Poll> { + Poll::Pending + } + } + impl Write for EmptyStream { + fn poll_write( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + _buf: &[u8], + ) -> Poll> { + Poll::Pending + } + + fn poll_flush( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Pending + } + + fn poll_shutdown( + self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Pending + } + } + + impl Connection for EmptyStream { + fn connected(&self) -> Connected { + Connected::new() + } + } +} diff --git a/rust-runtime/aws-smithy-http-client/src/client/tls.rs b/rust-runtime/aws-smithy-http-client/src/client/tls.rs new file mode 100644 index 000000000..d751375f8 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/client/tls.rs @@ -0,0 +1,354 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +use crate::cfg::{cfg_rustls, cfg_s2n_tls}; +use crate::HttpClientError; + +/// Choice of underlying cryptography library +#[derive(Debug, Eq, PartialEq, Clone)] +#[non_exhaustive] +pub enum Provider { + #[cfg(any( + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "rustls-ring" + ))] + /// TLS provider based on [rustls](https://github.com/rustls/rustls) + Rustls(rustls_provider::CryptoMode), + /// TLS provider based on [s2n-tls](https://github.com/aws/s2n-tls) + #[cfg(feature = "s2n-tls")] + S2nTls, +} + +/// TLS related configuration object +#[derive(Debug, Clone)] +pub struct TlsContext { + #[allow(unused)] + trust_store: TrustStore, +} + +impl TlsContext { + /// Create a new [TlsContext] builder + pub fn builder() -> TlsContextBuilder { + TlsContextBuilder::new() + } +} + +impl Default for TlsContext { + fn default() -> Self { + TlsContext::builder().build().expect("valid default config") + } +} + +/// Builder for TLS related configuration +#[derive(Debug)] +pub struct TlsContextBuilder { + trust_store: TrustStore, +} + +impl TlsContextBuilder { + fn new() -> Self { + TlsContextBuilder { + trust_store: TrustStore::default(), + } + } + + /// Configure the trust store to use for the TLS context + pub fn with_trust_store(mut self, trust_store: TrustStore) -> Self { + self.trust_store = trust_store; + self + } + + /// Build a new [TlsContext] + pub fn build(self) -> Result { + Ok(TlsContext { + trust_store: self.trust_store, + }) + } +} + +/// PEM encoded certificate +#[allow(unused)] +#[derive(Debug, Clone)] +struct CertificatePEM(Vec); + +impl From<&[u8]> for CertificatePEM { + fn from(value: &[u8]) -> Self { + CertificatePEM(value.to_vec()) + } +} + +/// Container for root certificates able to provide a root-of-trust for connection authentication +/// +/// Platform native root certificates are enabled by default. To start with a clean trust +/// store use [TrustStore::empty] +#[derive(Debug, Clone)] +pub struct TrustStore { + enable_native_roots: bool, + custom_certs: Vec, +} + +impl TrustStore { + /// Create a new empty trust store + pub fn empty() -> Self { + Self { + enable_native_roots: false, + custom_certs: Vec::new(), + } + } + + /// Enable or disable using the platform's native trusted root certificate store + /// + /// Default: true + pub fn with_native_roots(mut self, enable_native_roots: bool) -> Self { + self.enable_native_roots = enable_native_roots; + self + } + + /// Add the PEM encoded certificate to the trust store + /// + /// This may be called more than once to add multiple certificates. + /// NOTE: PEM certificate contents are not validated until passed to the configured + /// TLS provider. + pub fn with_pem_certificate(mut self, pem_bytes: impl Into>) -> Self { + // ideally we'd validate here but rustls-pki-types converts to DER when loading and S2N + // still expects PEM encoding. Store the raw bytes and let the TLS implementation validate + self.custom_certs.push(CertificatePEM(pem_bytes.into())); + self + } + + /// Add the PEM encoded certificate to the trust store + /// + /// This may be called more than once to add multiple certificates. + /// NOTE: PEM certificate contents are not validated until passed to the configured + /// TLS provider. + pub fn add_pem_certificate(&mut self, pem_bytes: impl Into>) -> &mut Self { + self.custom_certs.push(CertificatePEM(pem_bytes.into())); + self + } +} + +impl Default for TrustStore { + fn default() -> Self { + Self { + enable_native_roots: true, + custom_certs: Vec::new(), + } + } +} + +cfg_rustls! { + /// rustls based support and adapters + pub mod rustls_provider { + use crate::client::tls::Provider; + use rustls::crypto::CryptoProvider; + + /// Choice of underlying cryptography library (this only applies to rustls) + #[derive(Debug, Eq, PartialEq, Clone)] + #[non_exhaustive] + pub enum CryptoMode { + /// Crypto based on [ring](https://github.com/briansmith/ring) + #[cfg(feature = "rustls-ring")] + Ring, + /// Crypto based on [aws-lc](https://github.com/aws/aws-lc-rs) + #[cfg(feature = "rustls-aws-lc")] + AwsLc, + /// FIPS compliant variant of [aws-lc](https://github.com/aws/aws-lc-rs) + #[cfg(feature = "rustls-aws-lc-fips")] + AwsLcFips, + } + + impl CryptoMode { + fn provider(self) -> CryptoProvider { + match self { + #[cfg(feature = "rustls-aws-lc")] + CryptoMode::AwsLc => rustls::crypto::aws_lc_rs::default_provider(), + + #[cfg(feature = "rustls-ring")] + CryptoMode::Ring => rustls::crypto::ring::default_provider(), + + #[cfg(feature = "rustls-aws-lc-fips")] + CryptoMode::AwsLcFips => { + let provider = rustls::crypto::default_fips_provider(); + assert!( + provider.fips(), + "FIPS was requested but the provider did not support FIPS" + ); + provider + } + } + } + } + + impl Provider { + /// Create a TLS provider based on [rustls](https://github.com/rustls/rustls) + /// and the given [`CryptoMode`] + pub fn rustls(mode: CryptoMode) -> Provider { + Provider::Rustls(mode) + } + } + + pub(crate) mod build_connector { + use crate::client::tls::rustls_provider::CryptoMode; + use crate::tls::TlsContext; + use hyper_util::client::legacy as client; + use client::connect::HttpConnector; + use rustls::crypto::CryptoProvider; + use std::sync::Arc; + use rustls_pki_types::CertificateDer; + use rustls_pki_types::pem::PemObject; + use rustls_native_certs::CertificateResult; + use std::sync::LazyLock; + + /// Cached native certificates + /// + /// Creating a `with_native_roots()` hyper_rustls client re-loads system certs + /// each invocation (which can take 300ms on OSx). Cache the loaded certs + /// to avoid repeatedly incurring that cost. + pub(crate) static NATIVE_ROOTS: LazyLock>> = LazyLock::new(|| { + let CertificateResult { certs, errors, .. } = rustls_native_certs::load_native_certs(); + if !errors.is_empty() { + tracing::warn!("native root CA certificate loading errors: {errors:?}") + } + + if certs.is_empty() { + tracing::warn!("no native root CA certificates found!"); + } + + // NOTE: unlike hyper-rustls::with_native_roots we don't validate here, we'll do that later + // for now we have a collection of certs that may or may not be valid. + certs + }); + + fn restrict_ciphers(base: CryptoProvider) -> CryptoProvider { + let suites = &[ + rustls::CipherSuite::TLS13_AES_256_GCM_SHA384, + rustls::CipherSuite::TLS13_AES_128_GCM_SHA256, + // TLS1.2 suites + rustls::CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + rustls::CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + rustls::CipherSuite::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + rustls::CipherSuite::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + rustls::CipherSuite::TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + ]; + let supported_suites = suites + .iter() + .flat_map(|suite| { + base.cipher_suites + .iter() + .find(|s| &s.suite() == suite) + .cloned() + }) + .collect::>(); + CryptoProvider { + cipher_suites: supported_suites, + ..base + } + } + + impl TlsContext { + fn rustls_root_certs(&self) -> rustls::RootCertStore { + let mut roots = rustls::RootCertStore::empty(); + if self.trust_store.enable_native_roots { + let (valid, _invalid) = roots.add_parsable_certificates( + NATIVE_ROOTS.clone() + ); + debug_assert!(valid > 0, "TrustStore configured to enable native roots but no valid root certificates parsed!"); + } + + for pem_cert in &self.trust_store.custom_certs { + let ders = CertificateDer::pem_slice_iter(&pem_cert.0).collect::, _> >().expect("valid PEM certificate"); + for cert in ders { + roots.add(cert).expect("cert parsable") + } + } + + roots + } + } + + pub(crate) fn wrap_connector( + mut conn: HttpConnector, + crypto_mode: CryptoMode, + tls_context: &TlsContext, + ) -> hyper_rustls::HttpsConnector> { + let root_certs = tls_context.rustls_root_certs(); + conn.enforce_http(false); + hyper_rustls::HttpsConnectorBuilder::new() + .with_tls_config( + rustls::ClientConfig::builder_with_provider(Arc::new(restrict_ciphers(crypto_mode.provider()))) + .with_safe_default_protocol_versions() + .expect("Error with the TLS configuration. Please file a bug report under https://github.com/smithy-lang/smithy-rs/issues.") + .with_root_certificates(root_certs) + .with_no_client_auth() + ) + .https_or_http() + .enable_http1() + .enable_http2() + .wrap_connector(conn) + } + } + } +} + +cfg_s2n_tls! { + /// s2n-tls based support and adapters + pub(crate) mod s2n_tls_provider { + pub(crate) mod build_connector { + use hyper_util::client::legacy as client; + use client::connect::HttpConnector; + use s2n_tls::security::Policy; + use crate::tls::TlsContext; + use std::sync::LazyLock; + + // Default S2N security policy which sets protocol versions and cipher suites + // See https://aws.github.io/s2n-tls/usage-guide/ch06-security-policies.html + const S2N_POLICY_VERSION: &str = "20230317"; + + fn base_config() -> s2n_tls::config::Builder { + let mut builder = s2n_tls::config::Config::builder(); + let policy = Policy::from_version(S2N_POLICY_VERSION).unwrap(); + builder.set_security_policy(&policy).expect("valid s2n security policy"); + // default is true + builder.with_system_certs(false).unwrap(); + builder + } + + static CACHED_CONFIG: LazyLock = LazyLock::new(|| { + let mut config = base_config(); + config.with_system_certs(true).unwrap(); + // actually loads the system certs + config.build().expect("valid s2n config") + }); + + impl TlsContext { + fn s2n_config(&self) -> s2n_tls::config::Config { + // TODO(s2n-tls): s2n does not support turning a config back into a builder or a way to load a trust store and re-use it + // instead if we are only using the defaults then use a cached config, otherwise pay the cost to build a new one + if self.trust_store.enable_native_roots && self.trust_store.custom_certs.is_empty() { + CACHED_CONFIG.clone() + } else { + let mut config = base_config(); + config.with_system_certs(self.trust_store.enable_native_roots).unwrap(); + for pem_cert in &self.trust_store.custom_certs { + config.trust_pem(pem_cert.0.as_slice()).expect("valid certificate"); + } + config.build().expect("valid s2n config") + } + } + } + + pub(crate) fn wrap_connector( + mut http_connector: HttpConnector, + tls_context: &TlsContext, + ) -> s2n_tls_hyper::connector::HttpsConnector> { + let config = tls_context.s2n_config(); + http_connector.enforce_http(false); + let mut builder = s2n_tls_hyper::connector::HttpsConnector::builder_with_http(http_connector, config); + builder.with_plaintext_http(true); + builder.build() + } + } + } +} diff --git a/rust-runtime/aws-smithy-http-client/src/error.rs b/rust-runtime/aws-smithy-http-client/src/error.rs new file mode 100644 index 000000000..e8e04a549 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/error.rs @@ -0,0 +1,26 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +use aws_smithy_runtime_api::box_error::BoxError; +use std::fmt; + +/// HTTP client errors +/// +/// This is normally due to configuration issues, internal SDK bugs, or other user error. +#[derive(Debug)] +pub struct HttpClientError { + source: Option, +} + +impl fmt::Display for HttpClientError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "unknown HTTP client error") + } +} + +impl std::error::Error for HttpClientError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + self.source.as_ref().map(|err| err.as_ref() as _) + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/hyper_014.rs b/rust-runtime/aws-smithy-http-client/src/hyper_legacy.rs similarity index 97% rename from rust-runtime/aws-smithy-runtime/src/client/http/hyper_014.rs rename to rust-runtime/aws-smithy-http-client/src/hyper_legacy.rs index 337fb00f2..85935028a 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/hyper_014.rs +++ b/rust-runtime/aws-smithy-http-client/src/hyper_legacy.rs @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -use crate::client::http::connection_poisoning::CaptureSmithyConnection; -use crate::client::http::hyper_014::timeout_middleware::HttpTimeoutError; +use crate::hyper_legacy::timeout_middleware::HttpTimeoutError; use aws_smithy_async::future::timeout::TimedOutError; use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep}; use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::connection::CaptureSmithyConnection; use aws_smithy_runtime_api::client::connection::ConnectionMetadata; use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; use aws_smithy_runtime_api::client::http::{ @@ -34,16 +34,19 @@ use std::sync::RwLock; use std::time::Duration; use tokio::io::{AsyncRead, AsyncWrite}; -#[cfg(feature = "tls-rustls")] +#[cfg(feature = "legacy-rustls-ring")] mod default_connector { use aws_smithy_async::rt::sleep::SharedAsyncSleep; use aws_smithy_runtime_api::client::http::HttpConnectorSettings; + use legacy_hyper_rustls as hyper_rustls; + use legacy_rustls as rustls; + use std::sync::LazyLock; // Creating a `with_native_roots` HTTP client takes 300ms on OS X. Cache this so that we // don't need to repeatedly incur that cost. - pub(crate) static HTTPS_NATIVE_ROOTS: once_cell::sync::Lazy< + pub(crate) static HTTPS_NATIVE_ROOTS: LazyLock< hyper_rustls::HttpsConnector, - > = once_cell::sync::Lazy::new(default_tls); + > = LazyLock::new(default_tls); fn default_tls() -> hyper_rustls::HttpsConnector { use hyper_rustls::ConfigBuilderExt; @@ -98,13 +101,13 @@ pub fn default_connector( settings: &HttpConnectorSettings, sleep: Option, ) -> Option { - #[cfg(feature = "tls-rustls")] + #[cfg(feature = "legacy-rustls-ring")] { tracing::trace!(settings = ?settings, sleep = ?sleep, "creating a new default connector"); let hyper = default_connector::base(settings, sleep).build_https(); Some(SharedHttpConnector::new(hyper)) } - #[cfg(not(feature = "tls-rustls"))] + #[cfg(not(feature = "legacy-rustls-ring"))] { tracing::trace!(settings = ?settings, sleep = ?sleep, "no default connector available"); None @@ -113,12 +116,12 @@ pub fn default_connector( /// Creates a hyper-backed HTTPS client from defaults depending on what cargo features are activated. pub fn default_client() -> Option { - #[cfg(feature = "tls-rustls")] + #[cfg(feature = "legacy-rustls-ring")] { tracing::trace!("creating a new default hyper 0.14.x client"); Some(HyperClientBuilder::new().build_https()) } - #[cfg(not(feature = "tls-rustls"))] + #[cfg(not(feature = "legacy-rustls-ring"))] { tracing::trace!("no default connector available"); None @@ -202,7 +205,7 @@ impl HyperConnectorBuilder { } /// Create a [`HyperConnector`] with the default rustls HTTPS implementation. - #[cfg(feature = "tls-rustls")] + #[cfg(feature = "legacy-rustls-ring")] pub fn build_https(self) -> HyperConnector { self.build(default_connector::https()) } @@ -505,7 +508,7 @@ where /// generated Smithy clients. /// /// ```no_run,ignore -/// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; +/// use aws_smithy_http_client::hyper_014::HyperClientBuilder; /// /// let http_client = HyperClientBuilder::new().build_https(); /// @@ -529,7 +532,7 @@ where /// - CA trust root certificates (illustrated using WebPKI below) /// /// ```no_run,ignore -/// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; +/// use aws_smithy_http_client::hyper_014::HyperClientBuilder; /// /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new() /// .with_webpki_roots() @@ -580,7 +583,7 @@ impl HyperClientBuilder { /// /// The trusted certificates will be loaded later when this becomes the selected /// HTTP client for a Smithy client. - #[cfg(feature = "tls-rustls")] + #[cfg(feature = "legacy-rustls-ring")] pub fn build_https(self) -> SharedHttpClient { self.build_with_fn(default_connector::https) } @@ -588,7 +591,7 @@ impl HyperClientBuilder { /// Create a [`SharedHttpClient`] from this builder and a given connector. /// #[cfg_attr( - feature = "tls-rustls", + feature = "legacy-rustls-ring", doc = "Use [`build_https`](HyperClientBuilder::build_https) if you don't want to provide a custom TCP connector." )] pub fn build(self, tcp_connector: C) -> SharedHttpClient @@ -819,8 +822,8 @@ mod timeout_middleware { } #[cfg(test)] - mod test { - use crate::client::http::hyper_014::HyperConnector; + pub(crate) mod test { + use crate::hyper_014::HyperConnector; use aws_smithy_async::assert_elapsed; use aws_smithy_async::future::never::Never; use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; @@ -851,7 +854,7 @@ mod timeout_middleware { /// Returned futures will return Pending forever #[non_exhaustive] #[derive(Clone, Default, Debug)] - struct NeverConnects; + pub(crate) struct NeverConnects; impl hyper_0_14::service::Service for NeverConnects { type Response = TcpStream; type Error = ConnectorError; @@ -993,10 +996,10 @@ mod timeout_middleware { } } -#[cfg(all(test, feature = "test-util"))] +#[cfg(test)] mod test { - use crate::client::http::hyper_014::{HyperClientBuilder, HyperConnector}; - use crate::client::http::test_util::NeverTcpConnector; + use crate::hyper_legacy::timeout_middleware::test::NeverConnects; + use crate::hyper_legacy::{HyperClientBuilder, HyperConnector}; use aws_smithy_async::time::SystemTimeSource; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnectorSettings}; @@ -1019,7 +1022,7 @@ mod test { let count = creation_count.clone(); move || { count.fetch_add(1, Ordering::Relaxed); - NeverTcpConnector::new() + NeverConnects::default() } }); diff --git a/rust-runtime/aws-smithy-http-client/src/lib.rs b/rust-runtime/aws-smithy-http-client/src/lib.rs new file mode 100644 index 000000000..145f64686 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/lib.rs @@ -0,0 +1,106 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Automatically managed default lints */ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +/* End of automatically managed default lints */ + +//! HTTP client implementation for smithy-rs generated code. +//! +//! # Crate Features +//! +//! - `default-client`: Enable default HTTP client implementation (based on hyper 1.x). +//! - `rustls-ring`: Enable TLS provider based on `rustls` using `ring` as the crypto provider +//! - `rustls-aws-lc`: Enable TLS provider based on `rustls` using `aws-lc` as the crypto provider +//! - `rustls-aws-lc-fips`: Same as `rustls-aws-lc` feature but using a FIPS compliant version of `aws-lc` +//! - `s2n-tls`: Enable TLS provider based on `s2n-tls` using `aws-lc` as the crypto provider. +//! - `hyper-014`: (Deprecated) HTTP client implementation based on hyper-0.14.x. +//! - `test-util`: Enables utilities for unit tests. DO NOT ENABLE IN PRODUCTION. + +#![warn( + missing_docs, + rustdoc::missing_crate_level_docs, + unreachable_pub, + rust_2018_idioms +)] +#![cfg_attr(docsrs, feature(doc_cfg))] + +// ideally hyper_014 would just be exposed as is but due to +// https://github.com/rust-lang/rust/issues/47238 we get clippy warnings we can't suppress +#[cfg(feature = "hyper-014")] +pub(crate) mod hyper_legacy; + +/// Legacy HTTP and TLS connectors that use hyper 0.14.x and rustls. +#[cfg(feature = "hyper-014")] +#[deprecated = "hyper 0.14.x support is deprecated, please migrate to 1.x client"] +pub mod hyper_014 { + pub use crate::hyper_legacy::*; +} + +/// Default HTTP and TLS connectors +#[cfg(feature = "default-client")] +pub(crate) mod client; +#[cfg(feature = "default-client")] +pub use client::{default_connector, tls, Builder, Connector, ConnectorBuilder}; + +#[cfg(feature = "test-util")] +pub mod test_util; + +mod error; +pub use error::HttpClientError; + +#[allow(unused_macros, unused_imports)] +#[macro_use] +pub(crate) mod cfg { + /// Any TLS provider enabled + macro_rules! cfg_tls { + ($($item:item)*) => { + $( + #[cfg(any( + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "rustls-ring", + feature = "s2n-tls", + ))] + #[cfg_attr(docsrs, doc(cfg(any( + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "rustls-ring", + feature = "s2n-tls", + ))))] + $item + )* + } + } + + /// Any rustls provider enabled + macro_rules! cfg_rustls { + ($($item:item)*) => { + $( + #[cfg(any( + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "rustls-ring" + ))] + #[cfg_attr(docsrs, doc(cfg(any(feature = "rustls-aws-lc", feature = "rustls-aws-lc-fips", feature = "rustls-ring"))))] + $item + )* + } + } + + macro_rules! cfg_s2n_tls { + ($($item:item)*) => { + $( + #[cfg(feature = "s2n-tls")] + #[cfg_attr(docsrs, doc(cfg(feature = "s2n-tls")))] + $item + )* + } + } + + pub(crate) use cfg_rustls; + pub(crate) use cfg_s2n_tls; + pub(crate) use cfg_tls; +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs b/rust-runtime/aws-smithy-http-client/src/test_util.rs similarity index 82% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs rename to rust-runtime/aws-smithy-http-client/src/test_util.rs index a1c4250fb..3f2e78bce 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util.rs @@ -12,7 +12,7 @@ //! respond with a given response, then capture request can also be useful since //! you can optionally give it a response to return. #![cfg_attr( - feature = "connector-hyper-0-14-x", + feature = "default-client", doc = "- [`dvr`]: If you want to record real-world traffic and then replay it later, then DVR's" )] //! [`RecordingClient`](dvr::RecordingClient) and [`ReplayingClient`](dvr::ReplayingClient) @@ -29,17 +29,20 @@ //! - [`NeverClient`]: Useful for testing timeouts, where you want the client to never respond. //! #![cfg_attr( - feature = "connector-hyper-0-14-x", + any(feature = "hyper-014", feature = "default-client"), doc = " There is also the [`NeverTcpConnector`], which makes it easy to test connect/read timeouts. Finally, for socket-level mocking, see the [`wire`] module. " )] + mod capture_request; pub use capture_request::{capture_request, CaptureRequestHandler, CaptureRequestReceiver}; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(feature = "legacy-test-util")] +pub use capture_request::legacy_capture_request; + pub mod dvr; mod replay; @@ -48,11 +51,17 @@ pub use replay::{ReplayEvent, StaticReplayClient}; mod infallible; pub use infallible::infallible_client_fn; +// infallible based on http_02x stack had to be duplicated to avoid breaking API changes +#[allow(missing_docs)] +#[cfg(feature = "legacy-test-util")] +pub mod legacy_infallible; + mod never; pub use never::NeverClient; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "default-client"))] pub use never::NeverTcpConnector; -#[cfg(all(feature = "connector-hyper-0-14-x", feature = "wire-mock"))] +mod body; +#[cfg(all(feature = "default-client", feature = "wire-mock"))] pub mod wire; diff --git a/rust-runtime/aws-smithy-http-client/src/test_util/body.rs b/rust-runtime/aws-smithy-http-client/src/test_util/body.rs new file mode 100644 index 000000000..031e1a790 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/test_util/body.rs @@ -0,0 +1,95 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_types::body::SdkBody; +use bytes::Bytes; +use http_body_1x::{Frame, SizeHint}; +use pin_project_lite::pin_project; +use std::future::poll_fn; +use std::pin::{pin, Pin}; +use std::task::{Context, Poll}; +use tokio::sync::mpsc; + +/// Create a `SdkBody` with an associated sender half. +/// +/// Useful for sending data from another thread/task and test scenarios. +pub(crate) fn channel_body() -> (Sender, SdkBody) { + let (tx, rx) = mpsc::channel(1); + let sender = Sender { tx }; + let ch_body = ChannelBody { rx }; + (sender, SdkBody::from_body_1_x(ch_body)) +} + +/// Sender half of channel based `SdkBody` implementation useful for testing. +/// +/// Roughly a replacement for hyper 0.14.x `Sender` body. +/// +/// ## Body Closing +/// +/// The request body will always be closed normally when the sender is dropped. If you +/// want to close the connection with an incomplete response, call [`Sender::abort()`] method to +/// abort the body in an abnormal fashion. +#[derive(Debug)] +pub(crate) struct Sender { + tx: mpsc::Sender, BoxError>>, +} + +impl Sender { + /// Send data on data channel when it's ready + pub(crate) async fn send_data(&mut self, chunk: Bytes) -> Result<(), BoxError> { + let frame = Frame::data(chunk); + self.tx.send(Ok(frame)).await.map_err(|e| e.into()) + } + + // TODO(test-utils): we can add support for trailers if needed in the future + + /// Abort the body in an abnormal fashion + pub(crate) fn abort(self) { + let _ = self.tx.clone().try_send(Err("body write aborted".into())); + } +} + +pin_project! { + struct ChannelBody { + rx: mpsc::Receiver, BoxError>> + } +} + +impl http_body_1x::Body for ChannelBody { + type Data = Bytes; + type Error = BoxError; + + fn poll_frame( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll, Self::Error>>> { + let this = self.project(); + this.rx.poll_recv(cx) + } + + fn is_end_stream(&self) -> bool { + self.rx.is_closed() + } + + fn size_hint(&self) -> SizeHint { + SizeHint::default() + } +} + +pub(crate) async fn next_data_frame(body: &mut SdkBody) -> Option> { + use http_body_1x::Body; + let mut pinned = pin!(body); + match poll_fn(|cx| pinned.as_mut().poll_frame(cx)).await? { + Ok(frame) => { + if frame.is_data() { + Some(Ok(frame.into_data().unwrap())) + } else { + None + } + } + Err(err) => Some(Err(err)), + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs b/rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs similarity index 60% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs index 70836808a..ca0da601f 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/capture_request.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/capture_request.rs @@ -7,8 +7,9 @@ use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; use aws_smithy_runtime_api::client::http::{ HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector, }; -use aws_smithy_runtime_api::client::orchestrator::HttpRequest; +use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +use aws_smithy_runtime_api::http::HttpError; use aws_smithy_runtime_api::shared::IntoShared; use aws_smithy_types::body::SdkBody; use std::fmt::Debug; @@ -17,7 +18,7 @@ use tokio::sync::oneshot; #[derive(Debug)] struct Inner { - response: Option>, + response: Option, sender: Option>, } @@ -34,9 +35,7 @@ impl HttpConnector for CaptureRequestHandler { HttpConnectorFuture::ready(Ok(inner .response .take() - .expect("could not handle second request") - .try_into() - .unwrap())) + .expect("could not handle second request"))) } } @@ -101,19 +100,73 @@ impl CaptureRequestReceiver { /// ); /// ``` pub fn capture_request( - response: Option>, + response: Option>, +) -> (CaptureRequestHandler, CaptureRequestReceiver) { + capture_request_inner(response) +} + +fn capture_request_inner( + response: Option>, ) -> (CaptureRequestHandler, CaptureRequestReceiver) { let (tx, rx) = oneshot::channel(); + let http_resp: HttpResponse = match response { + Some(resp) => resp.try_into().expect("valid HttpResponse"), + None => http_1x::Response::builder() + .status(200) + .body(SdkBody::empty()) + .expect("unreachable") + .try_into() + .expect("unreachable"), + }; ( CaptureRequestHandler(Arc::new(Mutex::new(Inner { - response: Some(response.unwrap_or_else(|| { - http_02x::Response::builder() - .status(200) - .body(SdkBody::empty()) - .expect("unreachable") - })), + response: Some(http_resp), sender: Some(tx), }))), CaptureRequestReceiver { receiver: rx }, ) } + +#[allow(missing_docs)] +#[cfg(feature = "legacy-test-util")] +pub fn legacy_capture_request( + response: Option>, +) -> (CaptureRequestHandler, CaptureRequestReceiver) { + capture_request_inner(response) +} + +#[cfg(test)] +mod test { + use aws_smithy_runtime_api::client::http::HttpConnector; + use aws_smithy_runtime_api::client::orchestrator::HttpRequest; + use aws_smithy_types::body::SdkBody; + + #[cfg(feature = "legacy-test-util")] + #[tokio::test] + async fn test_can_plug_in_http_02x() { + use super::legacy_capture_request; + let (capture_client, _request) = legacy_capture_request(Some( + http_02x::Response::builder() + .status(202) + .body(SdkBody::empty()) + .expect("unreachable"), + )); + + let resp = capture_client.call(HttpRequest::empty()).await.unwrap(); + assert_eq!(202, resp.status().as_u16()); + } + + #[tokio::test] + async fn test_can_plug_in_http_1x() { + use super::capture_request; + let (capture_client, _request) = capture_request(Some( + http_1x::Response::builder() + .status(202) + .body(SdkBody::empty()) + .expect("unreachable"), + )); + + let resp = capture_client.call(HttpRequest::empty()).await.unwrap(); + assert_eq!(202, resp.status().as_u16()); + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs similarity index 90% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs index 181c34090..e0fd982d6 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr.rs @@ -128,6 +128,7 @@ pub struct Response { headers: IndexMap>, } +#[cfg(feature = "legacy-test-util")] impl From<&Request> for http_02x::Request<()> { fn from(request: &Request) -> Self { let mut builder = http_02x::Request::builder().uri(request.uri.as_str()); @@ -140,6 +141,18 @@ impl From<&Request> for http_02x::Request<()> { } } +impl From<&Request> for http_1x::Request<()> { + fn from(request: &Request) -> Self { + let mut builder = http_1x::Request::builder().uri(request.uri.as_str()); + for (k, values) in request.headers.iter() { + for v in values { + builder = builder.header(k, v); + } + } + builder.method(request.method.as_str()).body(()).unwrap() + } +} + impl<'a> From<&'a HttpRequest> for Request { fn from(req: &'a HttpRequest) -> Self { let uri = req.uri().to_string(); @@ -162,7 +175,7 @@ fn headers_to_map_http(headers: &Headers) -> IndexMap> { out } -fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap> { +fn headers_to_map(headers: &Headers) -> IndexMap> { let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); for (header_name, header_value) in headers.iter() { let entry = out.entry(header_name.to_string()).or_default(); @@ -175,7 +188,8 @@ fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap IndexMap> { +#[cfg(feature = "legacy-test-util")] +fn headers_to_map_02x(headers: &http_02x::HeaderMap) -> IndexMap> { let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); for (header_name, header_value) in headers.iter() { let entry = out.entry(header_name.to_string()).or_default(); @@ -188,6 +202,7 @@ fn headers_to_map(headers: &Headers) -> IndexMap> { out } +#[cfg(feature = "legacy-test-util")] impl<'a, B> From<&'a http_02x::Response> for Response { fn from(resp: &'a http_02x::Response) -> Self { let status = resp.status().as_u16(); @@ -196,6 +211,27 @@ impl<'a, B> From<&'a http_02x::Response> for Response { } } +fn headers_to_map_1x(headers: &http_1x::HeaderMap) -> IndexMap> { + let mut out: IndexMap<_, Vec<_>> = IndexMap::new(); + for (header_name, header_value) in headers.iter() { + let entry = out.entry(header_name.to_string()).or_default(); + entry.push( + std::str::from_utf8(header_value.as_ref()) + .unwrap() + .to_string(), + ); + } + out +} + +impl<'a, B> From<&'a http_1x::Response> for Response { + fn from(resp: &'a http_1x::Response) -> Self { + let status = resp.status().as_u16(); + let headers = headers_to_map_1x(resp.headers()); + Self { status, headers } + } +} + impl From<&HttpResponse> for Response { fn from(resp: &HttpResponse) -> Self { Self { @@ -343,6 +379,7 @@ mod tests { Ok(()) } + #[cfg(feature = "legacy-test-util")] #[tokio::test] async fn turtles_all_the_way_down() -> Result<(), Box> { // create a replaying connection from a recording, wrap a recording connection around it, diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs similarity index 95% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs index b06f23345..51759dfeb 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/record.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/record.rs @@ -15,7 +15,6 @@ use aws_smithy_runtime_api::client::orchestrator::HttpRequest; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_runtime_api::shared::IntoShared; use aws_smithy_types::body::SdkBody; -use http_body_04x::Body; use std::path::Path; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex, MutexGuard}; @@ -31,7 +30,7 @@ use tokio::task::JoinHandle; /// ```rust,ignore /// use aws_smithy_async::rt::sleep::default_async_sleep; /// use aws_smithy_runtime::client::http::hyper_014::default_connector; -/// use aws_smithy_runtime::client::http::test_util::dvr::RecordingClient; +/// use aws_smithy_http_client::test_util::dvr::RecordingClient; /// use aws_smithy_runtime_api::client::http::HttpConnectorSettingsBuilder; /// use aws_sdk_s3::{Client, Config}; /// @@ -74,14 +73,16 @@ pub struct RecordingClient { pub(crate) inner: SharedHttpConnector, } -#[cfg(feature = "tls-rustls")] +#[cfg(feature = "legacy-rustls-ring")] impl RecordingClient { /// Construct a recording connection wrapping a default HTTPS implementation without any timeouts. pub fn https() -> Self { - use crate::client::http::hyper_014::HyperConnector; + #[allow(deprecated)] + use crate::hyper_014::HyperConnector; Self { data: Default::default(), num_events: Arc::new(AtomicUsize::new(0)), + #[allow(deprecated)] inner: SharedHttpConnector::new(HyperConnector::builder().build_https()), } } @@ -130,13 +131,13 @@ fn record_body( direction: Direction, event_bus: Arc>>, ) -> JoinHandle<()> { - let (sender, output_body) = hyper_0_14::Body::channel(); - let real_body = std::mem::replace(body, SdkBody::from_body_0_4(output_body)); + let (sender, output_body) = crate::test_util::body::channel_body(); + let real_body = std::mem::replace(body, output_body); tokio::spawn(async move { let mut real_body = real_body; let mut sender = sender; loop { - let data = real_body.data().await; + let data = crate::test_util::body::next_data_frame(&mut real_body).await; match data { Some(Ok(data)) => { event_bus.lock().unwrap().push(Event { diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs similarity index 92% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs index 37090563e..0bf866a33 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/dvr/replay.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/dvr/replay.rs @@ -4,7 +4,7 @@ */ use super::{Action, ConnectionId, Direction, Event, NetworkTraffic}; -use crate::client::http::test_util::replay::DEFAULT_RELAXED_HEADERS; +use crate::test_util::replay::DEFAULT_RELAXED_HEADERS; use aws_smithy_protocol_test::MediaType; use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; use aws_smithy_runtime_api::client::http::{ @@ -55,9 +55,9 @@ impl Waitable { #[derive(Clone)] pub struct ReplayingClient { live_events: Arc>>>, - verifiable_events: Arc>>, + verifiable_events: Arc>>, num_events: Arc, - recorded_requests: Arc>>>>, + recorded_requests: Arc>>>>, } // Ideally, this would just derive Debug, but that makes the tests in aws-config think they found AWS secrets @@ -207,6 +207,7 @@ impl ReplayingClient { } /// Return all the recorded requests for further analysis + #[cfg(feature = "legacy-test-util")] pub async fn take_requests(self) -> Vec> { let mut recorded_requests = std::mem::take(self.recorded_requests.lock().unwrap().deref_mut()); @@ -220,7 +221,17 @@ impl ReplayingClient { .await, ) } - out + out.into_iter() + .map(|v1r| { + let mut builder = http_02x::Request::builder() + .uri(v1r.uri().to_string()) + .method(v1r.method().as_str()); + for (k, v) in v1r.headers().iter() { + builder = builder.header(k.as_str(), v.as_bytes()) + } + builder.body(v1r.into_body()).expect("valid conversion") + }) + .collect() } /// Build a replay connection from a JSON file @@ -253,7 +264,7 @@ impl ReplayingClient { let initial_request = events.iter().next().expect("must have one event"); let request = match &initial_request.action { Action::Request { request } => { - http_02x::Request::from(request).map(|_| Bytes::from(body)) + http_1x::Request::from(request).map(|_| Bytes::from(body)) } _ => panic!("invalid first event"), }; @@ -271,7 +282,7 @@ impl ReplayingClient { } } -async fn replay_body(events: VecDeque, mut sender: hyper_0_14::body::Sender) { +async fn replay_body(events: VecDeque, mut sender: crate::test_util::body::Sender) { for event in events { match event.action { Action::Request { .. } => panic!(), @@ -315,8 +326,6 @@ async fn replay_body(events: VecDeque, mut sender: hyper_0_14::body::Send impl HttpConnector for ReplayingClient { fn call(&self, mut request: HttpRequest) -> HttpConnectorFuture { - use http_body_04x::Body; - let event_id = self.next_id(); tracing::debug!("received event {}: {request:?}", event_id.0); let mut events = match self.live_events.lock().unwrap().remove(&event_id) { @@ -330,17 +339,17 @@ impl HttpConnector for ReplayingClient { }; let _initial_request = events.pop_front().unwrap(); - let (sender, response_body) = hyper_0_14::Body::channel(); - let body = SdkBody::from_body_0_4(response_body); + let (sender, body) = crate::test_util::body::channel_body(); let recording = self.recorded_requests.clone(); let recorded_request = tokio::spawn(async move { let mut data_read = vec![]; - while let Some(data) = request.body_mut().data().await { + while let Some(data) = crate::test_util::body::next_data_frame(request.body_mut()).await + { data_read .extend_from_slice(data.expect("in memory request should not fail").as_ref()) } request - .try_into_http02x() + .try_into_http1x() .unwrap() .map(|_body| Bytes::from(data_read)) }); @@ -366,7 +375,7 @@ impl HttpConnector for ReplayingClient { Action::Response { response: Ok(response), } => { - let mut builder = http_02x::Response::builder().status(response.status); + let mut builder = http_1x::Response::builder().status(response.status); for (name, values) in response.headers { for value in values { builder = builder.header(&name, &value); diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs b/rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs similarity index 78% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs index 0a9b925bd..a978962c2 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/infallible.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/infallible.rs @@ -21,11 +21,12 @@ use std::sync::Arc; /// # Examples /// /// ```rust -/// use aws_smithy_runtime::client::http::test_util::infallible_client_fn; -/// let http_client = infallible_client_fn(|_req| http_02x::Response::builder().status(200).body("OK!").unwrap()); +/// # use http_1x as http; +/// use aws_smithy_http_client::test_util::infallible_client_fn; +/// let http_client = infallible_client_fn(|_req| http::Response::builder().status(200).body("OK!").unwrap()); /// ``` pub fn infallible_client_fn( - f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + f: impl Fn(http_1x::Request) -> http_1x::Response + Send + Sync + 'static, ) -> SharedHttpClient where B: Into, @@ -37,7 +38,7 @@ where struct InfallibleClientFn { #[allow(clippy::type_complexity)] response: Arc< - dyn Fn(http_02x::Request) -> Result, ConnectorError> + dyn Fn(http_1x::Request) -> Result, ConnectorError> + Send + Sync, >, @@ -51,7 +52,7 @@ impl fmt::Debug for InfallibleClientFn { impl InfallibleClientFn { fn new>( - f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + f: impl Fn(http_1x::Request) -> http_1x::Response + Send + Sync + 'static, ) -> Self { Self { response: Arc::new(move |request| Ok(f(request).map(|b| b.into()))), @@ -62,7 +63,7 @@ impl InfallibleClientFn { impl HttpConnector for InfallibleClientFn { fn call(&self, request: HttpRequest) -> HttpConnectorFuture { HttpConnectorFuture::ready( - (self.response)(request.try_into_http02x().unwrap()) + (self.response)(request.try_into_http1x().unwrap()) .map(|res| HttpResponse::try_from(res).unwrap()), ) } diff --git a/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs b/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs new file mode 100644 index 000000000..a96488714 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/src/test_util/legacy_infallible.rs @@ -0,0 +1,83 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_runtime_api::client::connector_metadata::ConnectorMetadata; +use aws_smithy_runtime_api::client::http::{ + HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient, + SharedHttpConnector, +}; +use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; +use aws_smithy_runtime_api::client::result::ConnectorError; +use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +use aws_smithy_runtime_api::shared::IntoShared; +use aws_smithy_types::body::SdkBody; +use std::fmt; +use std::sync::Arc; + +/// Create a [`SharedHttpClient`] from `Fn(http:Request) -> http::Response` +/// +/// # Examples +/// +/// ```rust +/// use aws_smithy_http_client::test_util::legacy_infallible::infallible_client_fn; +/// let http_client = infallible_client_fn(|_req| http_02x::Response::builder().status(200).body("OK!").unwrap()); +/// ``` +pub fn infallible_client_fn( + f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, +) -> SharedHttpClient +where + B: Into, +{ + InfallibleClientFn::new(f).into_shared() +} + +#[derive(Clone)] +struct InfallibleClientFn { + #[allow(clippy::type_complexity)] + response: Arc< + dyn Fn(http_02x::Request) -> Result, ConnectorError> + + Send + + Sync, + >, +} + +impl fmt::Debug for InfallibleClientFn { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("InfallibleClientFn").finish() + } +} + +impl InfallibleClientFn { + fn new>( + f: impl Fn(http_02x::Request) -> http_02x::Response + Send + Sync + 'static, + ) -> Self { + Self { + response: Arc::new(move |request| Ok(f(request).map(|b| b.into()))), + } + } +} + +impl HttpConnector for InfallibleClientFn { + fn call(&self, request: HttpRequest) -> HttpConnectorFuture { + HttpConnectorFuture::ready( + (self.response)(request.try_into_http02x().unwrap()) + .map(|res| HttpResponse::try_from(res).unwrap()), + ) + } +} + +impl HttpClient for InfallibleClientFn { + fn http_connector( + &self, + _: &HttpConnectorSettings, + _: &RuntimeComponents, + ) -> SharedHttpConnector { + self.clone().into_shared() + } + + fn connector_metadata(&self) -> Option { + Some(ConnectorMetadata::new("infallible-client", None)) + } +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs b/rust-runtime/aws-smithy-http-client/src/test_util/never.rs similarity index 54% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/never.rs index 69e5dd487..4e1084d9a 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/never.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/never.rs @@ -62,11 +62,11 @@ impl HttpClient for NeverClient { /// A TCP connector that never connects. // In the future, this can be available for multiple hyper version feature flags, with the impls gated between individual features -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "default-client"))] #[derive(Clone, Debug, Default)] pub struct NeverTcpConnector; -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(any(feature = "hyper-014", feature = "default-client"))] impl NeverTcpConnector { /// Creates a new `NeverTcpConnector`. pub fn new() -> Self { @@ -74,9 +74,9 @@ impl NeverTcpConnector { } } -#[cfg(feature = "connector-hyper-0-14-x")] +#[cfg(feature = "hyper-014")] impl hyper_0_14::service::Service for NeverTcpConnector { - type Response = connection::NeverTcpConnection; + type Response = hyper_014_support::NeverTcpConnection; type Error = aws_smithy_runtime_api::box_error::BoxError; type Future = std::pin::Pin< Box> + Send + Sync>, @@ -97,8 +97,47 @@ impl hyper_0_14::service::Service for NeverTcpConnector { } } -#[cfg(feature = "connector-hyper-0-14-x")] -mod connection { +#[cfg(feature = "default-client")] +mod hyper1_support { + use super::NeverTcpConnector; + use aws_smithy_async::future::never::Never; + use aws_smithy_runtime_api::client::http::SharedHttpClient; + use aws_smithy_runtime_api::client::result::ConnectorError; + use http_1x::Uri; + use hyper_util::rt::TokioIo; + use std::future::Future; + use std::pin::Pin; + use std::task::{Context, Poll}; + use tokio::net::TcpStream; + + impl tower::Service for NeverTcpConnector { + type Response = TokioIo; + type Error = ConnectorError; + type Future = Pin> + Send>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _uri: Uri) -> Self::Future { + Box::pin(async move { + Never::new().await; + unreachable!() + }) + } + } + + impl NeverTcpConnector { + /// Convert this connector into a usable HTTP client for testing + #[doc(hidden)] + pub fn into_client(self) -> SharedHttpClient { + crate::client::build_with_tcp_conn_fn(None, NeverTcpConnector::new) + } + } +} + +#[cfg(feature = "hyper-014")] +mod hyper_014_support { use hyper_0_14::client::connect::{Connected, Connection}; use std::io::Error; use std::pin::Pin; @@ -145,32 +184,63 @@ mod connection { } } -#[cfg(all(test, feature = "connector-hyper-0-14-x"))] -#[tokio::test] -async fn never_tcp_connector_plugs_into_hyper_014() { - use crate::client::http::hyper_014::HyperClientBuilder; +#[cfg(test)] +mod test { use aws_smithy_async::rt::sleep::TokioSleep; use aws_smithy_async::time::SystemTimeSource; + use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnector, HttpConnectorSettings}; + use aws_smithy_runtime_api::client::orchestrator::HttpRequest; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; use std::time::Duration; - // it should compile - let client = HyperClientBuilder::new().build(NeverTcpConnector::new()); - let components = RuntimeComponentsBuilder::for_tests() - .with_sleep_impl(Some(TokioSleep::new())) - .with_time_source(Some(SystemTimeSource::new())) - .build() - .unwrap(); - let http_connector = client.http_connector( - &HttpConnectorSettings::builder() - .connect_timeout(Duration::from_millis(100)) - .build(), - &components, - ); - - let err = http_connector - .call(HttpRequest::get("http://fakeuri.com").unwrap()) - .await - .expect_err("it should time out"); - assert!(dbg!(err).is_timeout()); + #[cfg(feature = "hyper-014")] + #[tokio::test] + async fn never_tcp_connector_plugs_into_hyper_014() { + use super::NeverTcpConnector; + use crate::hyper_014::HyperClientBuilder; + + // it should compile + let client = HyperClientBuilder::new().build(NeverTcpConnector::new()); + let components = RuntimeComponentsBuilder::for_tests() + .with_sleep_impl(Some(TokioSleep::new())) + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let http_connector = client.http_connector( + &HttpConnectorSettings::builder() + .connect_timeout(Duration::from_millis(100)) + .build(), + &components, + ); + + let err = http_connector + .call(HttpRequest::get("http://fakeuri.com").unwrap()) + .await + .expect_err("it should time out"); + assert!(dbg!(err).is_timeout()); + } + + #[cfg(feature = "default-client")] + #[tokio::test] + async fn never_tcp_connector_plugs_into_hyper_1() { + use super::NeverTcpConnector; + let client = NeverTcpConnector::new().into_client(); + let components = RuntimeComponentsBuilder::for_tests() + .with_sleep_impl(Some(TokioSleep::new())) + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let http_connector = client.http_connector( + &HttpConnectorSettings::builder() + .connect_timeout(Duration::from_millis(100)) + .build(), + &components, + ); + + let err = http_connector + .call(HttpRequest::get("http://fakeuri.com").unwrap()) + .await + .expect_err("it should time out"); + assert!(dbg!(err).is_timeout()); + } } diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs b/rust-runtime/aws-smithy-http-client/src/test_util/replay.rs similarity index 95% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/replay.rs index adbd5aa5b..9d90a2d87 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/replay.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/replay.rs @@ -12,7 +12,7 @@ use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse}; use aws_smithy_runtime_api::client::result::ConnectorError; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_runtime_api::shared::IntoShared; -use http_02x::header::CONTENT_TYPE; +use http_1x::header::CONTENT_TYPE; use std::ops::Deref; use std::sync::{Arc, Mutex, MutexGuard}; @@ -119,7 +119,8 @@ impl ValidateRequest { /// # Example /// /// ```no_run -/// use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient}; +/// # use http_1x as http; +/// use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; /// use aws_smithy_types::body::SdkBody; /// /// let http_client = StaticReplayClient::new(vec![ @@ -127,9 +128,9 @@ impl ValidateRequest { /// ReplayEvent::new( /// // If `assert_requests_match` is called later, then this request will be matched /// // against the actual request that was made. -/// http_02x::Request::builder().uri("http://localhost:1234/foo").body(SdkBody::empty()).unwrap(), +/// http::Request::builder().uri("http://localhost:1234/foo").body(SdkBody::empty()).unwrap(), /// // This response will be given to the first request regardless of whether it matches the request above. -/// http_02x::Response::builder().status(200).body(SdkBody::empty()).unwrap(), +/// http::Response::builder().status(200).body(SdkBody::empty()).unwrap(), /// ), /// // The next ReplayEvent covers the second request/response pair... /// ]); @@ -148,7 +149,7 @@ impl ValidateRequest { /// ``` /// /// [`assert_requests_match`]: StaticReplayClient::assert_requests_match -/// [DVR]: crate::client::http::test_util::dvr +/// [DVR]: crate::test_util::dvr #[derive(Clone, Debug)] pub struct StaticReplayClient { data: Arc>, @@ -281,17 +282,17 @@ impl HttpClient for StaticReplayClient { #[cfg(test)] mod test { - use crate::client::http::test_util::{ReplayEvent, StaticReplayClient}; + use crate::test_util::{ReplayEvent, StaticReplayClient}; use aws_smithy_types::body::SdkBody; #[test] fn create_from_either_http_type() { let _client = StaticReplayClient::new(vec![ReplayEvent::new( - http1::Request::builder() + http_1x::Request::builder() .uri("test") .body(SdkBody::from("hello")) .unwrap(), - http1::Response::builder() + http_1x::Response::builder() .status(200) .body(SdkBody::from("hello")) .unwrap(), diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs b/rust-runtime/aws-smithy-http-client/src/test_util/wire.rs similarity index 53% rename from rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs rename to rust-runtime/aws-smithy-http-client/src/test_util/wire.rs index 9f43f2f19..5955d210b 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/test_util/wire.rs +++ b/rust-runtime/aws-smithy-http-client/src/test_util/wire.rs @@ -12,8 +12,8 @@ //! # Examples //! ```no_run //! use aws_smithy_runtime_api::client::http::HttpConnectorSettings; -//! use aws_smithy_runtime::client::http::test_util::wire::{check_matches, ReplayedEvent, WireMockServer}; -//! use aws_smithy_runtime::{match_events, ev}; +//! use aws_smithy_http_client::test_util::wire::{check_matches, ReplayedEvent, WireMockServer}; +//! use aws_smithy_http_client::{match_events, ev}; //! # async fn example() { //! //! // This connection binds to a local address @@ -39,23 +39,24 @@ #![allow(missing_docs)] -use crate::client::http::hyper_014::HyperClientBuilder; use aws_smithy_async::future::never::Never; use aws_smithy_async::future::BoxFuture; use aws_smithy_runtime_api::client::http::SharedHttpClient; -use aws_smithy_runtime_api::shared::IntoShared; use bytes::Bytes; -use hyper_0_14::client::connect::dns::Name; -use hyper_0_14::server::conn::AddrStream; -use hyper_0_14::service::{make_service_fn, service_fn, Service}; +use http_body_util::Full; +use hyper::service::service_fn; +use hyper_util::client::legacy::connect::dns::Name; +use hyper_util::rt::{TokioExecutor, TokioIo}; +use hyper_util::server::graceful::{GracefulConnection, GracefulShutdown}; use std::collections::HashSet; use std::convert::Infallible; use std::error::Error; +use std::future::Future; use std::iter::Once; -use std::net::{SocketAddr, TcpListener}; +use std::net::SocketAddr; use std::sync::{Arc, Mutex}; use std::task::{Context, Poll}; -use tokio::spawn; +use tokio::net::TcpListener; use tokio::sync::oneshot; /// An event recorded by [`WireMockServer`]. @@ -97,19 +98,14 @@ pub fn check_matches(events: &[RecordedEvent], matchers: &[Matcher]) { macro_rules! matcher { ($expect:tt) => { ( - Box::new( - |event: &$crate::client::http::test_util::wire::RecordedEvent| { - if !matches!(event, $expect) { - return Err(format!( - "expected `{}` but got {:?}", - stringify!($expect), - event - ) - .into()); - } - Ok(()) - }, - ), + Box::new(|event: &$crate::test_util::wire::RecordedEvent| { + if !matches!(event, $expect) { + return Err( + format!("expected `{}` but got {:?}", stringify!($expect), event).into(), + ); + } + Ok(()) + }), stringify!($expect), ) }; @@ -120,7 +116,7 @@ macro_rules! matcher { macro_rules! match_events { ($( $expect:pat),*) => { |events| { - $crate::client::http::test_util::wire::check_matches(events, &[$( $crate::matcher!($expect) ),*]); + $crate::test_util::wire::check_matches(events, &[$( $crate::matcher!($expect) ),*]); } }; } @@ -129,22 +125,22 @@ macro_rules! match_events { #[macro_export] macro_rules! ev { (http($status:expr)) => { - $crate::client::http::test_util::wire::RecordedEvent::Response( - $crate::client::http::test_util::wire::ReplayedEvent::HttpResponse { + $crate::test_util::wire::RecordedEvent::Response( + $crate::test_util::wire::ReplayedEvent::HttpResponse { status: $status, .. }, ) }; (dns) => { - $crate::client::http::test_util::wire::RecordedEvent::DnsLookup(_) + $crate::test_util::wire::RecordedEvent::DnsLookup(_) }; (connect) => { - $crate::client::http::test_util::wire::RecordedEvent::NewConnection + $crate::test_util::wire::RecordedEvent::NewConnection }; (timeout) => { - $crate::client::http::test_util::wire::RecordedEvent::Response( - $crate::client::http::test_util::wire::ReplayedEvent::Timeout, + $crate::test_util::wire::RecordedEvent::Response( + $crate::test_util::wire::ReplayedEvent::Timeout, ) }; } @@ -183,7 +179,7 @@ impl ReplayedEvent { /// Test server that binds to 127.0.0.1:0 /// -/// See the [module docs](crate::client::http::test_util::wire) for a usage example. +/// See the [module docs](crate::test_util::wire) for a usage example. /// /// Usage: /// - Call [`WireMockServer::start`] to start the server @@ -198,11 +194,40 @@ pub struct WireMockServer { shutdown_hook: oneshot::Sender<()>, } +#[derive(Debug, Clone)] +struct SharedGraceful { + graceful: Arc>>, +} + +impl SharedGraceful { + fn new() -> Self { + Self { + graceful: Arc::new(Mutex::new(Some(GracefulShutdown::new()))), + } + } + + fn watch(&self, conn: C) -> impl Future { + let graceful = self.graceful.lock().unwrap(); + graceful + .as_ref() + .expect("graceful not shutdown") + .watch(conn) + } + + async fn shutdown(&self) { + let graceful = { self.graceful.lock().unwrap().take() }; + + if let Some(graceful) = graceful { + graceful.shutdown().await; + } + } +} + impl WireMockServer { /// Start a wire mock server with the given events to replay. pub async fn start(mut response_events: Vec) -> Self { - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); - let (tx, rx) = oneshot::channel(); + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let (tx, mut rx) = oneshot::channel(); let listener_addr = listener.local_addr().unwrap(); response_events.reverse(); let response_events = Arc::new(Mutex::new(response_events)); @@ -210,48 +235,74 @@ impl WireMockServer { let wire_events = Arc::new(Mutex::new(vec![])); let wire_log_for_service = wire_events.clone(); let poisoned_conns: Arc>> = Default::default(); - let make_service = make_service_fn(move |connection: &AddrStream| { + let graceful = SharedGraceful::new(); + let conn_builder = Arc::new(hyper_util::server::conn::auto::Builder::new( + TokioExecutor::new(), + )); + + let server = async move { let poisoned_conns = poisoned_conns.clone(); let events = handler_events.clone(); let wire_log = wire_log_for_service.clone(); - let remote_addr = connection.remote_addr(); - tracing::info!("established connection: {:?}", connection); - wire_log.lock().unwrap().push(RecordedEvent::NewConnection); - async move { - Ok::<_, Infallible>(service_fn(move |_: http_02x::Request| { - if poisoned_conns.lock().unwrap().contains(&remote_addr) { - tracing::error!("poisoned connection {:?} was reused!", &remote_addr); - panic!("poisoned connection was reused!"); - } - let next_event = events.clone().lock().unwrap().pop(); - let wire_log = wire_log.clone(); - let poisoned_conns = poisoned_conns.clone(); - async move { - let next_event = next_event - .unwrap_or_else(|| panic!("no more events! Log: {:?}", wire_log)); - wire_log - .lock() - .unwrap() - .push(RecordedEvent::Response(next_event.clone())); - if next_event == ReplayedEvent::Timeout { - tracing::info!("{} is poisoned", remote_addr); - poisoned_conns.lock().unwrap().insert(remote_addr); - } - tracing::debug!("replying with {:?}", next_event); - let event = generate_response_event(next_event).await; - dbg!(event) + loop { + tokio::select! { + Ok((stream, remote_addr)) = listener.accept() => { + tracing::info!("established connection: {:?}", remote_addr); + let poisoned_conns = poisoned_conns.clone(); + let events = events.clone(); + let wire_log = wire_log.clone(); + wire_log.lock().unwrap().push(RecordedEvent::NewConnection); + let io = TokioIo::new(stream); + + let svc = service_fn(move |_req| { + let poisoned_conns = poisoned_conns.clone(); + let events = events.clone(); + let wire_log = wire_log.clone(); + if poisoned_conns.lock().unwrap().contains(&remote_addr) { + tracing::error!("poisoned connection {:?} was reused!", &remote_addr); + panic!("poisoned connection was reused!"); + } + let next_event = events.clone().lock().unwrap().pop(); + async move { + let next_event = next_event + .unwrap_or_else(|| panic!("no more events! Log: {:?}", wire_log)); + + wire_log + .lock() + .unwrap() + .push(RecordedEvent::Response(next_event.clone())); + + if next_event == ReplayedEvent::Timeout { + tracing::info!("{} is poisoned", remote_addr); + poisoned_conns.lock().unwrap().insert(remote_addr); + } + tracing::debug!("replying with {:?}", next_event); + let event = generate_response_event(next_event).await; + dbg!(event) + } + }); + + let conn_builder = conn_builder.clone(); + let graceful = graceful.clone(); + tokio::spawn(async move { + let conn = conn_builder.serve_connection(io, svc); + let fut = graceful.watch(conn); + if let Err(e) = fut.await { + panic!("Error serving connection: {:?}", e); + } + }); + }, + _ = &mut rx => { + tracing::info!("wire server: shutdown signalled"); + graceful.shutdown().await; + tracing::info!("wire server: shutdown complete!"); + break; } - })) + } } - }); - let server = hyper_0_14::Server::from_tcp(listener) - .unwrap() - .serve(make_service) - .with_graceful_shutdown(async { - rx.await.ok(); - tracing::info!("server shutdown!"); - }); - spawn(server); + }; + + tokio::spawn(server); Self { event_log: wire_events, bind_addr: listener_addr, @@ -271,21 +322,22 @@ impl WireMockServer { pub fn dns_resolver(&self) -> LoggingDnsResolver { let event_log = self.event_log.clone(); let bind_addr = self.bind_addr; - LoggingDnsResolver { + LoggingDnsResolver(InnerDnsResolver { log: event_log, socket_addr: bind_addr, - } + }) } /// Prebuilt [`HttpClient`](aws_smithy_runtime_api::client::http::HttpClient) with correctly wired DNS resolver. /// /// **Note**: This must be used in tandem with [`Self::dns_resolver`] pub fn http_client(&self) -> SharedHttpClient { - HyperClientBuilder::new() - .build(hyper_0_14::client::HttpConnector::new_with_resolver( - self.dns_resolver(), - )) - .into_shared() + let resolver = self.dns_resolver(); + crate::client::build_with_tcp_conn_fn(None, move || { + hyper_util::client::legacy::connect::HttpConnector::new_with_resolver( + resolver.clone().0, + ) + }) } /// Endpoint to use when connecting @@ -306,11 +358,11 @@ impl WireMockServer { async fn generate_response_event( event: ReplayedEvent, -) -> Result, Infallible> { +) -> Result>, Infallible> { let resp = match event { - ReplayedEvent::HttpResponse { status, body } => http_02x::Response::builder() + ReplayedEvent::HttpResponse { status, body } => http_1x::Response::builder() .status(status) - .body(hyper_0_14::Body::from(body)) + .body(Full::new(body)) .unwrap(), ReplayedEvent::Timeout => { Never::new().await; @@ -324,12 +376,16 @@ async fn generate_response_event( /// /// Regardless of what hostname is requested, it will always return the same socket address. #[derive(Clone, Debug)] -pub struct LoggingDnsResolver { +pub struct LoggingDnsResolver(InnerDnsResolver); + +// internal implementation so we don't have to expose hyper_util +#[derive(Clone, Debug)] +struct InnerDnsResolver { log: Arc>>, socket_addr: SocketAddr, } -impl Service for LoggingDnsResolver { +impl tower::Service for InnerDnsResolver { type Response = Once; type Error = Infallible; type Future = BoxFuture<'static, Self::Response, Self::Error>; @@ -350,3 +406,20 @@ impl Service for LoggingDnsResolver { }) } } + +#[cfg(all(feature = "legacy-test-util", feature = "hyper-014"))] +impl hyper_0_14::service::Service for LoggingDnsResolver { + type Response = Once; + type Error = Infallible; + type Future = BoxFuture<'static, Self::Response, Self::Error>; + + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + self.0.poll_ready(cx) + } + + fn call(&mut self, req: hyper_0_14::client::connect::dns::Name) -> Self::Future { + use std::str::FromStr; + let adapter = Name::from_str(req.as_str()).expect("valid conversion"); + self.0.call(adapter) + } +} diff --git a/rust-runtime/aws-smithy-runtime/test-data/example.com.json b/rust-runtime/aws-smithy-http-client/test-data/example.com.json similarity index 100% rename from rust-runtime/aws-smithy-runtime/test-data/example.com.json rename to rust-runtime/aws-smithy-http-client/test-data/example.com.json diff --git a/rust-runtime/aws-smithy-http-client/tests/openssl.cnf b/rust-runtime/aws-smithy-http-client/tests/openssl.cnf new file mode 100644 index 000000000..2e61c109a --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/tests/openssl.cnf @@ -0,0 +1,23 @@ +[ v3_end ] +basicConstraints = critical,CA:false +keyUsage = nonRepudiation, digitalSignature +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always +subjectAltName = @alt_names + +[ v3_client ] +basicConstraints = critical,CA:false +keyUsage = nonRepudiation, digitalSignature +extendedKeyUsage = critical, clientAuth +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always + +[ v3_inter ] +subjectKeyIdentifier = hash +extendedKeyUsage = critical, serverAuth, clientAuth +basicConstraints = CA:true +keyUsage = cRLSign, keyCertSign, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign + +[ alt_names ] +DNS.1 = sdktest.com +DNS.2 = localhost diff --git a/rust-runtime/aws-smithy-http-client/tests/regen-certificates.sh b/rust-runtime/aws-smithy-http-client/tests/regen-certificates.sh new file mode 100755 index 000000000..4c02f440d --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/tests/regen-certificates.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +# +set -xe + +# The files generated by this script are used in unit tests that create TLS +# connections between a localhost server and client. Run this script if any +# certificates used for tests are expired. + +# Files generated by this script: +# server.rsa - private RSA server key +# server.pem - certificate chain containing certificates [server, intermediate, CA] + +# generate the root CA certificate and key +openssl req -nodes \ + -x509 \ + -days 3650 \ + -newkey rsa:4096 \ + -keyout ca.key \ + -out ca.cert \ + -sha256 \ + -batch \ + -subj "/CN=SDK RSA CA" + +# generate intermediate authority cert and key +openssl req -nodes \ + -newkey rsa:3072 \ + -keyout inter.key \ + -out inter.req \ + -sha256 \ + -batch \ + -subj "/CN=SDK RSA level 2 intermediate" + +# generate key and signing request for server +openssl req -nodes \ + -newkey rsa:2048 \ + -keyout server.key \ + -out server.req \ + -sha256 \ + -batch \ + -subj "/CN=sdktest.com" + +openssl rsa \ + -in server.key \ + -out server.rsa + +# sign intermediate cert with CA root +openssl x509 -req \ + -in inter.req \ + -out inter.cert \ + -CA ca.cert \ + -CAkey ca.key \ + -sha256 \ + -days 3650 \ + -set_serial 123 \ + -extensions v3_inter -extfile openssl.cnf + +# sign server cert with intermediate +openssl x509 -req \ + -in server.req \ + -out server.cert \ + -CA inter.cert \ + -CAkey inter.key \ + -sha256 \ + -days 2000 \ + -set_serial 456 \ + -extensions v3_end -extfile openssl.cnf + +cat server.cert inter.cert ca.cert > server.pem +rm *.key *.cert *.req diff --git a/rust-runtime/aws-smithy-http-client/tests/server.pem b/rust-runtime/aws-smithy-http-client/tests/server.pem new file mode 100644 index 000000000..ba429d34d --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/tests/server.pem @@ -0,0 +1,80 @@ +-----BEGIN CERTIFICATE----- +MIID2TCCAkGgAwIBAgICAcgwDQYJKoZIhvcNAQELBQAwJzElMCMGA1UEAwwcU0RL +IFJTQSBsZXZlbCAyIGludGVybWVkaWF0ZTAeFw0yNTAyMTkxNDUzMDJaFw0zMDA4 +MTIxNDUzMDJaMBYxFDASBgNVBAMMC3Nka3Rlc3QuY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAq0qAhLP/7uVfR5zv8d41eciCEco2kKjqoN9NlUy8 +xt8fNUFvFdSqEsrPMyycyfPg9HBhJHhCBtVQSxmr/y/IEkvbf5P5aq2CnVKKMjGm +xlqUm+mHmtDYZkJp/2nnK3ZFm9/b1oqs6XvfEJ3R2eqFf454a8SRHX1gVdj+LFnm +EVfUkVBSZCMJm9EOL9HL2I6tDPzXvJpEZMzu/pHouMNeSBBeQDGQN7vZo36cb2wG +PCTwHCh/DjZpKtJK8eKRDipIbjQr3upNbLxva36/V70xM6rTy9ac+GT/IUh0Dh0q +nXgjntez5grtlz4DrQBBhNhGAAliOTGvk74kPjzHYFy8FQIDAQABo4GfMIGcMAwG +A1UdEwEB/wQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQWBBTF0O0/x6KcdOoqlv0T +//HVFq2RODA9BgNVHSMENjA0gBQFk2G/rf1Iob6rw0H6lQ/uzbfLaKEZpBcwFTET +MBEGA1UEAwwKU0RLIFJTQSBDQYIBezAhBgNVHREEGjAYggtzZGt0ZXN0LmNvbYIJ +bG9jYWxob3N0MA0GCSqGSIb3DQEBCwUAA4IBgQAHDCVmgHAuUkJCyNJefN+GLj9s +hCzoSScWSSuyUTOP+N2cT9SOIyjdBb0uLaj4E/Casf/fEvqd/qSz2pBZtXXG3udP +NOfO7ZXOuAW/DqMKL7B/JYvybr2ugJefB7+fVqEdJ/lKZ6DT517nO+V9BRZRrcyR +vx5gM4j46p2qkN9yiAvimE37hBUIkjKCdejXA4IVr90Z6kG2yGo1XIFp8fDAEoSm +u5h5ftuyGvy3kXg8e1quVs38yeh3Vcxk60g8MpFrbUBZjYd3mBN0wnQAOmsK592k +3mEJIDN5NfFvuap/Tl0SAqsP7vfIy7t3Wu5aJoH5VlepmKOhHVnbwhd61pd2ZeHs +zvo8dLsfgowGiSItvdw+pg0PUsozXG0JH7o8igzEfIiRJ237pX8U1/Lr1v5fKYhL +pfZoGVfpH2oK6uUE4TzAK7bf9tGCKkvqx0MhvQ1Y6tjbp3l/+vxDTSgoo5Oh4XJ+ +gRxRIoosMVJffwwy+sbfMs5rqCTC7DrqHoFb+3I= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEtjCCAp6gAwIBAgIBezANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApTREsg +UlNBIENBMB4XDTI1MDIxOTE0NTMwMloXDTM1MDIxNzE0NTMwMlowJzElMCMGA1UE +AwwcU0RLIFJTQSBsZXZlbCAyIGludGVybWVkaWF0ZTCCAaIwDQYJKoZIhvcNAQEB +BQADggGPADCCAYoCggGBALpfp+sVFpcJxmK7v/aCL5R5sjWzfkwUABhYNWsk+26x +ioayPUZ3IMnKYvzGXmX2a6pjPJeP5HpFIvFnezac/tHHEk8zgATVGGbC1gO6aKT+ +o1UYKICcwHuhwG6BZ3hoFqjuBY8wk+zIgV9pd+907E0oZOy+TutCtk3dHPBYYbJO +NS8pQDw804ckKpEa34NQcLN9D3FBsgMXX6/pYyvzpD2fDgo6X6lDOWVZ31mtgmwP +jV6Be/y2r7Z/aA9fePfSTxSZnsNpwS5tkVwVG8v42ph7rVNJ/zaBsfXfCbbRV0q8 +HjJAzWGtXbPH4Ojj6MEOSjGK+rusIOZmqQAbvJ0fMH4soW5FjYWsngEuDYOrWRlB +bkv4ixeMfaz8rwC0fkLIJWFOZnHt0nmVtEVsGRc0ndTrQDlaqIJq87cL0cYkqYZE +vn2I0lmkIgna9OTCDbvBUaglYrxLe8e41OSvvcVrFmSxvx1GcWjuU1Q08P3JcBmP +9uhhjW53TYoarFhKjrO+WQIDAQABo38wfTAdBgNVHQ4EFgQUBZNhv639SKG+q8NB ++pUP7s23y2gwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1Ud +EwQFMAMBAf8wCwYDVR0PBAQDAgH+MB8GA1UdIwQYMBaAFOCtnMCd873GJzp4HbZs +uuxho+wIMA0GCSqGSIb3DQEBCwUAA4ICAQBvCShvDdnp+pSRzK4sJS/AgElhIDVR +QrFfnhOxElVWxXSYEXVegwj1qKhgM+de9k9eKH/dM7mr5Ry9N6GfTjtRuf4fDp8W +Zj6bnqQoNz1vTPmX5ymnEipRwg5BeQtfmHVf++uor4Ch6Xx5lp9mlyCkZqEgHKkz +UietQNkZjalnIex/nBr+2kHD1dh2ZTefsTOHofnz+gsg3tNjjvzf+YMOw7aifQvI +2uoQVDjb2FBq24LSpBAc9r2sU2CKHD4/4Ei11QRI29gNgOJiiUArAV6P13mdCVMY +ue92chdLg3/AYctAUXE7NXMXeqZdOlST65GgEg36tays3l7JqlF+FaPqzuJnB+kt +pzYDdt1pFxV0Ep8RsyWm7TbYsRVqzx0eueReVKQQBBjM2+8uD8X3bZB/0QtPknBo +6x0S90g32BL4dPn/mHLLbKTNWPQ9dGmIBHvZocw5UxRYhiFLx+Wurw+V8CWmoU2g +kEiTAaA/5jiZNR02sz6H7CC70FN0vHYREiivqvNMhLbmWxORrCL/TdmwdwfEMCT4 +ozEzyGHFUVatCTUeiWxI2YXg1oNHLQU5gfy8gxfygNjG8r3A/L1SOoCsS2Cw/FcW +LJXtCyJoVzM1oLSzPbvUpe4fbnhQ/5hcM2+Tfm2DsNb9RVLjbl5t6EUTuVwKP8us +y0Qg67cAE/Grlw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFCzCCAvOgAwIBAgIUbOKEL90YNxD9QGi6wIP6zs5AzCMwDQYJKoZIhvcNAQEL +BQAwFTETMBEGA1UEAwwKU0RLIFJTQSBDQTAeFw0yNTAyMTkxNDUzMDFaFw0zNTAy +MTcxNDUzMDFaMBUxEzARBgNVBAMMClNESyBSU0EgQ0EwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDKHnrAedyOnngswWm1oeOgcfjUHo4EMHMgTn6b6vnj +KRV5idN9iIl0rI/QuyZeGcvEkarSZZMnkme1cnhOpLvelPEgCRqMI+02VodEpVer +7i2QIxqpCzf2VfZMAQ5cNyuBeN+IS+FDViPge71eypmBnF1CHu5d9lfI8y8PVVfJ +QRsP1M/bWCLIgGs7ZjHNt+cA+ZBTBHID66aXx4egW59MPBCq9SH9FC0PfvJqJjkU +QNfiSCpn4XKYRraucQ9LChNlaJqu58HPnCMX+B9/g3MuQ9qCNUq7m/p4ILre0rcJ +mz30RMGFXhyp+94DRwJBDUsWVny9fVhbMtSQKcGd51nBrrn1xcWC0+NNEWkf4VLt +sp3OPOGw/b+njgshxOdi2oPmSumRhHmMC98nl7iWT41Hy/uvLuTpd8KStN/2VIFt +7lsCRnPoIUezM34oZvsIiMsEm93AFPfQtWaKm/8GvSzGBHZ0ba8op9ZVL879yaSN +B1oHrR6OzgpfiekB8Jg3OLFSxwtgDuKJeAiorFXMiSIfqZxBfzsOQCU4UhlY38xR +SVYZMRxmHq06Mi9tVGak60RHV4opu9ixlm5sUbv0NliIzHbOHjry85z+iNSttjqu +Wv3w6jVeIHJcZeYHXZYNx8nGMWEI3JpVBNaF9ycvVpvV1hC5GM/Egn5qggpAjiL+ +uwIDAQABo1MwUTAdBgNVHQ4EFgQU4K2cwJ3zvcYnOngdtmy67GGj7AgwHwYDVR0j +BBgwFoAU4K2cwJ3zvcYnOngdtmy67GGj7AgwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQsFAAOCAgEAifwXv/ezBA8BbdV+7IcdA9R5Yz/fENQ8n5u8U0Mmpu2v +mcGpuqJOQlH6Yr5cs0zS9BRmNaMYlVWNnJxMz/3m+uaqohiFf98SgxhT+RGFRohx +jSPI6jE19vKbi1RMvv8yf8DLIjnc8d5e8kOEWNleOarVtkpAhze5nyKVyYkIyyER +zL2RKslmWzxsG0ae0HZ5T5U1voIUG5Y8WyE662egR7INLE3HMUklYljIUJNXClqe +sMfDyvl735z8S93r7sRFv3x+2YZpIzJZGk0ZbyWxfpwAVfr+ktf01BZ+lASXCmDX +94TPHswhoC4HQyxziyf2CLHvpnRczS57/bSVgatYELN4oU2sPicHqPTntrSA6Yhq ++qswrShiF47MXZeiXrddjcWTRQZOs30dmBvTj7CufAYek7r+9KeK0j+ETs/yr5Q4 +NQd7/7kkS/4GIKx0uf/+WJJhMDD8qJfWlZDV4kZ+laz49ksjES19IPKoalugst06 +SquAqOCKiOQxWeD+QQvdUu9Yac8jNEt3th1z29MoJ02QHSrKe1CmFu7jXcgvWTVI +1dhO2YJ4UNvGaFK3rWU8sDvgFnV6Hpw7y1YAgVYtterSPMAyAGdSFDvZKuo2Bq2N +juj9U9BUS1Xrl1cj8RjpZ0g0gYYF+BX2qwDCqi9qkxHel/oCzG80QAY0dnM+JT4= +-----END CERTIFICATE----- diff --git a/rust-runtime/aws-smithy-http-client/tests/server.rsa b/rust-runtime/aws-smithy-http-client/tests/server.rsa new file mode 100644 index 000000000..0ccbbf739 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/tests/server.rsa @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrSoCEs//u5V9H +nO/x3jV5yIIRyjaQqOqg302VTLzG3x81QW8V1KoSys8zLJzJ8+D0cGEkeEIG1VBL +Gav/L8gSS9t/k/lqrYKdUooyMabGWpSb6Yea0NhmQmn/aecrdkWb39vWiqzpe98Q +ndHZ6oV/jnhrxJEdfWBV2P4sWeYRV9SRUFJkIwmb0Q4v0cvYjq0M/Ne8mkRkzO7+ +kei4w15IEF5AMZA3u9mjfpxvbAY8JPAcKH8ONmkq0krx4pEOKkhuNCve6k1svG9r +fr9XvTEzqtPL1pz4ZP8hSHQOHSqdeCOe17PmCu2XPgOtAEGE2EYACWI5Ma+TviQ+ +PMdgXLwVAgMBAAECggEAIRG6myQXIpuE2BIL3vGr+E2GEwIro6UA2zsRQuQ0Q966 +qzDtTdUnWoZuFy6jPHgJc5eooX5YHPKc1ErqAlPKuAGOKGS8j+RcpZvUU1lznbLK +IwmkZPax+JgU17st5p2oVa4TxqkyNcd06sPVSlF1IYmzZPbnnz5f1WMVuyFGAg3W +CsFevfTtdpzgN8fWE6EnpSO1OY9Sa0xc+k94U6b1Coi2i6loUfKXP/iFStsGlDW3 +Dkl2egptPHi4oDcUuobJrOFr61XgOrTrYlFOrzZOgykgzAEyKN/nF3q2vAIbZSPq +MkJTw+TFGypVkMBmMTBb83CnaBWDmsicY1WJ4DjXAQKBgQDo8wgCNzNGDaqcFR2F +ZSYdqsGeSQzxjBnxnyMp/1ewb5cYFrE86ORXND7TfmJECJNEIhNLv5ytu8Z/cDsm +envwlotj8J+u0cVp3t916GEWyNBZaZM/40ivDxMCAWTeryleGbQ0ytmnDPOdPS93 +6tIImk6vKiyae3iM4eKx3o/hgQKBgQC8PZHcWrXt1OYOn/VrMeYfGp57HNeHddrA +noVIL5Ysx0pnAMhyZi69orJUYX9n1d0DwiXbagS1mTuqJK2t+0EUe5tKHalUY3Ew +CL0XGskN3526l1CKzD/vFfx28Q3lGdpxwFSNIil+85hk8BMDAu6nvzVTWd0ol/Ll +FmhIj2R8lQKBgQCMPsTzkIguBMxSa+P6C4uHEObAhPpl8hMshMKG5lPExWoR9pd+ +NDhEyA+LBOvkScVfn6Q+Vn3dms9GqiryX4t+rSP+Zz+74E8aDjQ6qEzLitrk+crN +C+kWe9zVuEEiUBJ3tMHphrbC++kvIUcSyyzoQP5eNuXjm7JYHyZ8L6IwAQKBgCir +KKsx0eJrP7TjLDOXmT8ZEipJBeuXM8avuN3qoghUmid8zNGib/C6iMqgMdVuKAza +0jEAS7osO+67c+aFxP624cr2c5Hu1hJpoOiv+cYMjNg2Pslt7VYrKttLoxPfLQms +YtgHDG4IFOGh2ImrBYKqVcwHOze89FY4LBmZGT2tAoGADKA9beP/o5vXu2BmdEPF +c4XUb5gvbI7Zv7xhF6CGOsryBkz8yF5WaAreNcG1uwPzqAyV6kk6Fgaa7XDa9Mhf +3QMe/ncGWI3NjQaB6E+7rJMQ/UDIr4Cs5ThZMkXvrR9GPhpULQi3iPepcIT79Jvn +o40e3/lYe5+59N2kVfwac0U= +-----END PRIVATE KEY----- diff --git a/rust-runtime/aws-smithy-experimental/tests/smoke_test_clients.rs b/rust-runtime/aws-smithy-http-client/tests/smoke_test_clients.rs similarity index 58% rename from rust-runtime/aws-smithy-experimental/tests/smoke_test_clients.rs rename to rust-runtime/aws-smithy-http-client/tests/smoke_test_clients.rs index 1782449b7..6844e7403 100644 --- a/rust-runtime/aws-smithy-experimental/tests/smoke_test_clients.rs +++ b/rust-runtime/aws-smithy-http-client/tests/smoke_test_clients.rs @@ -4,13 +4,14 @@ */ #![cfg(any( - feature = "crypto-ring", - feature = "crypto-aws-lc", - feature = "crypto-aws-lc-fips" + feature = "rustls-ring", + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "s2n-tls", ))] use aws_smithy_async::time::SystemTimeSource; -use aws_smithy_experimental::hyper_1_0::{CryptoMode, HyperClientBuilder}; +use aws_smithy_http_client::{tls, Builder}; use aws_smithy_runtime_api::client::dns::{DnsFuture, ResolveDns, ResolveDnsError}; use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnector, HttpConnectorSettings}; use aws_smithy_runtime_api::client::orchestrator::HttpRequest; @@ -21,34 +22,49 @@ use std::str::FromStr; use std::sync::Arc; use tower::Service; -#[cfg(feature = "crypto-ring")] +#[cfg(feature = "rustls-ring")] #[tokio::test] async fn ring_client() { - let client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::Ring) + let client = Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::Ring, + )) .build_https(); smoke_test_client(&client).await.unwrap(); } -#[cfg(feature = "crypto-aws-lc-fips")] +#[cfg(feature = "rustls-aws-lc-fips")] #[tokio::test] async fn aws_lc_fips_client() { - let client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::AwsLcFips) + let client = Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLcFips, + )) .build_https(); smoke_test_client(&client).await.unwrap(); } -#[cfg(feature = "crypto-aws-lc")] +#[cfg(feature = "rustls-aws-lc")] #[tokio::test] async fn aws_lc_client() { - let client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::AwsLc) + let client = Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) .build_https(); smoke_test_client(&client).await.unwrap(); } -#[cfg(feature = "crypto-ring")] +#[cfg(feature = "s2n-tls")] +#[tokio::test] +async fn s2n_tls_client() { + let client = Builder::new() + .tls_provider(tls::Provider::S2nTls) + .build_https(); + smoke_test_client(&client).await.unwrap(); +} + +#[cfg(any(feature = "rustls-ring", feature = "s2n-tls"))] #[tokio::test] async fn custom_dns_client() { use std::sync::atomic::{AtomicUsize, Ordering}; @@ -64,26 +80,32 @@ async fn custom_dns_client() { let count = self.count.clone(); DnsFuture::new(async move { count.fetch_add(1, Ordering::Relaxed); - let result = inner - .call(name) - .await - .map_err(|err| ResolveDnsError::new(err))?; + let result = inner.call(name).await.map_err(ResolveDnsError::new)?; Ok(result.map(|addr| addr.ip()).collect::>()) }) } } - let resolver = PassThroughResolver { - inner: GaiResolver::new(), - count: Default::default(), - }; - let client = HyperClientBuilder::new() - .crypto_mode(CryptoMode::Ring) - .build_with_resolver(resolver.clone()); - smoke_test_client(&client).await.unwrap(); - assert_eq!(resolver.count.load(Ordering::Relaxed), 1); + + let providers = [ + #[cfg(feature = "rustls-ring")] + tls::Provider::Rustls(tls::rustls_provider::CryptoMode::Ring), + #[cfg(feature = "s2n-tls")] + tls::Provider::S2nTls, + ]; + + for provider in providers { + let resolver = PassThroughResolver { + inner: GaiResolver::new(), + count: Default::default(), + }; + let client = Builder::new() + .tls_provider(provider) + .build_with_resolver(resolver.clone()); + smoke_test_client(&client).await.unwrap(); + assert_eq!(resolver.count.load(Ordering::Relaxed), 1); + } } -#[cfg(feature = "crypto-ring")] async fn smoke_test_client(client: &dyn HttpClient) -> Result<(), Box> { let connector_settings = HttpConnectorSettings::builder().build(); let runtime_components = RuntimeComponentsBuilder::for_tests() diff --git a/rust-runtime/aws-smithy-http-client/tests/tls.rs b/rust-runtime/aws-smithy-http-client/tests/tls.rs new file mode 100644 index 000000000..667f861e8 --- /dev/null +++ b/rust-runtime/aws-smithy-http-client/tests/tls.rs @@ -0,0 +1,268 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +#![cfg(any( + feature = "rustls-ring", + feature = "rustls-aws-lc", + feature = "rustls-aws-lc-fips", + feature = "s2n-tls", +))] + +use aws_smithy_async::time::SystemTimeSource; +use aws_smithy_http_client::tls; +use aws_smithy_http_client::tls::{TlsContext, TrustStore}; +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnector, HttpConnectorSettings}; +use aws_smithy_runtime_api::client::orchestrator::HttpRequest; +use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; +use aws_smithy_types::byte_stream::ByteStream; +use http_1x::{Method, Request, Response, StatusCode}; +use http_body_util::{BodyExt, Full}; +use hyper::body::{Bytes, Incoming}; +use hyper::service::service_fn; +use hyper_util::rt::{TokioExecutor, TokioIo}; +use hyper_util::server::conn::auto::Builder; +use rustls::ServerConfig; +use rustls_pki_types::{CertificateDer, PrivateKeyDer}; +use std::net::SocketAddr; +use std::sync::Arc; +use std::{fs, io}; +use tokio::net::TcpListener; +use tokio::task::JoinHandle; +use tokio_rustls::TlsAcceptor; +use tracing::{debug, error}; + +struct TestServer { + _handle: JoinHandle<()>, + listen_addr: SocketAddr, +} + +async fn server() -> Result { + // Set process wide crypto provider + let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let addr = listener.local_addr().unwrap(); + + // load public certificate. + let certs = load_certs("tests/server.pem")?; + + // load private key. + let key = load_private_key("tests/server.rsa")?; + + debug!("Starting to serve on https://{}", addr); + + // TLS config + let mut server_config = ServerConfig::builder() + .with_no_client_auth() + .with_single_cert(certs, key) + .map_err(|e| error(e.to_string()))?; + + server_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec(), b"http/1.0".to_vec()]; + let tls_acceptor = TlsAcceptor::from(Arc::new(server_config)); + let service = service_fn(echo); + + let server = async move { + loop { + let (tcp_stream, remote_addr) = listener.accept().await.unwrap(); + debug!("accepted connection from: {}", remote_addr); + + let tls_acceptor = tls_acceptor.clone(); + tokio::spawn(async move { + let tls_stream = match tls_acceptor.accept(tcp_stream).await { + Ok(tls_stream) => tls_stream, + Err(err) => { + error!("failed to perform tls handshake: {err:#}"); + return; + } + }; + if let Err(err) = Builder::new(TokioExecutor::new()) + .serve_connection(TokioIo::new(tls_stream), service) + .await + { + error!("failed to serve connection: {err:#}"); + } + }); + } + }; + + let server_task = tokio::spawn(server); + + Ok(TestServer { + _handle: server_task, + listen_addr: addr, + }) +} + +// Custom echo service, handling two different routes and a +// catch-all 404 responder. +async fn echo(req: Request) -> Result>, hyper::Error> { + let mut response = Response::new(Full::default()); + match (req.method(), req.uri().path()) { + // default route. + (&Method::GET, "/") => { + *response.body_mut() = Full::from("Hello TLS!"); + } + // echo service route. + (&Method::POST, "/echo") => { + *response.body_mut() = Full::from(req.into_body().collect().await?.to_bytes()); + } + // Catch-all 404. + _ => { + *response.status_mut() = StatusCode::NOT_FOUND; + } + }; + Ok(response) +} + +fn error(err: String) -> io::Error { + io::Error::new(io::ErrorKind::Other, err) +} + +// Load public certificate from file. +fn load_certs(filename: &str) -> io::Result>> { + let certfile = fs::File::open(filename) + .map_err(|e| error(format!("failed to open {}: {}", filename, e)))?; + let mut reader = io::BufReader::new(certfile); + rustls_pemfile::certs(&mut reader).collect() +} + +// Load private key from file. +fn load_private_key(filename: &str) -> io::Result> { + // Open keyfile. + let keyfile = fs::File::open(filename) + .map_err(|e| error(format!("failed to open {}: {}", filename, e)))?; + let mut reader = io::BufReader::new(keyfile); + + // Load and return a single private key. + rustls_pemfile::private_key(&mut reader).map(|key| key.unwrap()) +} + +fn tls_context_from_pem(filename: &str) -> TlsContext { + let pem_contents = fs::read(filename).unwrap(); + let trust_store = TrustStore::empty().with_pem_certificate(pem_contents); + TlsContext::builder() + .with_trust_store(trust_store) + .build() + .unwrap() +} + +#[cfg(feature = "rustls-aws-lc")] +#[should_panic(expected = "InvalidCertificate(UnknownIssuer)")] +#[tokio::test] +async fn test_rustls_aws_lc_native_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "rustls-aws-lc")] +#[tokio::test] +async fn test_rustls_aws_lc_custom_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) + .tls_context(tls_context_from_pem("tests/server.pem")) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "rustls-aws-lc-fips")] +#[should_panic(expected = "InvalidCertificate(UnknownIssuer)")] +#[tokio::test] +async fn test_rustls_aws_lc_fips_native_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLcFips, + )) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "rustls-aws-lc-fips")] +#[tokio::test] +async fn test_rustls_aws_lc_fips_custom_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLcFips, + )) + .tls_context(tls_context_from_pem("tests/server.pem")) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "rustls-ring")] +#[should_panic(expected = "InvalidCertificate(UnknownIssuer)")] +#[tokio::test] +async fn test_rustls_ring_native_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::Ring, + )) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "rustls-ring")] +#[tokio::test] +async fn test_rustls_ring_custom_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::Ring, + )) + .tls_context(tls_context_from_pem("tests/server.pem")) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "s2n-tls")] +#[should_panic(expected = "Certificate is untrusted")] +#[tokio::test] +async fn test_s2n_native_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::S2nTls) + .build_https(); + + run_tls_test(&client).await.unwrap() +} + +#[cfg(feature = "s2n-tls")] +#[tokio::test] +async fn test_s2n_tls_custom_ca() { + let client = aws_smithy_http_client::Builder::new() + .tls_provider(tls::Provider::S2nTls) + .tls_context(tls_context_from_pem("tests/server.pem")) + .build_https(); + run_tls_test(&client).await.unwrap() +} + +async fn run_tls_test(client: &dyn HttpClient) -> Result<(), BoxError> { + let server = server().await?; + let endpoint = format!("https://localhost:{}/", server.listen_addr.port()); + + let connector_settings = HttpConnectorSettings::builder().build(); + let runtime_components = RuntimeComponentsBuilder::for_tests() + .with_time_source(Some(SystemTimeSource::new())) + .build() + .unwrap(); + let connector = client.http_connector(&connector_settings, &runtime_components); + let mut response = connector.call(HttpRequest::get(endpoint).unwrap()).await?; + + let sdk_body = response.take_body(); + let body_stream = ByteStream::new(sdk_body); + let resp_bytes = body_stream.collect().await?.into_bytes(); + assert_eq!(b"Hello TLS!", &resp_bytes[..]); + Ok(()) +} diff --git a/rust-runtime/aws-smithy-http-server-python/Cargo.toml b/rust-runtime/aws-smithy-http-server-python/Cargo.toml index e97da4a6c..7e7bf561d 100644 --- a/rust-runtime/aws-smithy-http-server-python/Cargo.toml +++ b/rust-runtime/aws-smithy-http-server-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-http-server-python" -version = "0.63.2" +version = "0.63.3" authors = ["Smithy Rust Server "] edition = "2021" license = "Apache-2.0" @@ -18,27 +18,27 @@ aws-smithy-http-server = { path = "../aws-smithy-http-server", features = ["aws- aws-smithy-json = { path = "../aws-smithy-json" } aws-smithy-types = { path = "../aws-smithy-types", features = ["byte-stream-poll-next", "http-body-0-4-x"] } aws-smithy-xml = { path = "../aws-smithy-xml" } -bytes = "1.2" +bytes = "1.10.0" futures = "0.3" -http = "0.2" +http = "0.2.9" hyper = { version = "0.14.26", features = ["server", "http1", "http2", "tcp", "stream"] } tls-listener = { version = "0.7.0", features = ["rustls", "hyper-h2"] } rustls-pemfile = "1.0.1" tokio-rustls = "0.24.0" -lambda_http = { version = "0.8.0" } +lambda_http = { version = "0.8.3" } num_cpus = "1.13.1" parking_lot = "0.12.1" -pin-project-lite = "0.2" +pin-project-lite = "0.2.14" pyo3 = "0.18.2" pyo3-asyncio = { version = "0.18.0", features = ["tokio-runtime"] } signal-hook = { version = "0.3.14", features = ["extended-siginfo"] } -socket2 = { version = "0.5.2", features = ["all"] } -thiserror = "1.0.32" -tokio = { version = "1.20.1", features = ["full"] } -tokio-stream = "0.1" +socket2 = { version = "0.5.5", features = ["all"] } +thiserror = "1.0.40" +tokio = { version = "1.40.0", features = ["full"] } +tokio-stream = "0.1.2" tower = { version = "0.4.13", features = ["util"] } -tracing = "0.1.36" -tracing-subscriber = { version = "0.3.15", features = ["json", "env-filter"] } +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter"] } tracing-appender = { version = "0.2.2"} [dev-dependencies] diff --git a/rust-runtime/aws-smithy-http-server/Cargo.toml b/rust-runtime/aws-smithy-http-server/Cargo.toml index 4857fae8b..d5dcad557 100644 --- a/rust-runtime/aws-smithy-http-server/Cargo.toml +++ b/rust-runtime/aws-smithy-http-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-http-server" -version = "0.63.4" +version = "0.63.5" authors = ["Smithy Rust Server "] edition = "2021" license = "Apache-2.0" @@ -24,24 +24,24 @@ aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["http aws-smithy-types = { path = "../aws-smithy-types", features = ["http-body-0-4-x", "hyper-0-14-x"] } aws-smithy-xml = { path = "../aws-smithy-xml" } aws-smithy-cbor = { path = "../aws-smithy-cbor" } -bytes = "1.1" +bytes = "1.10.0" futures-util = { version = "0.3.29", default-features = false } -http = "0.2" -http-body = "0.4" +http = "0.2.9" +http-body = "0.4.5" hyper = { version = "0.14.26", features = ["server", "http1", "http2", "tcp", "stream"] } -lambda_http = { version = "0.8.0", optional = true } +lambda_http = { version = "0.8.3", optional = true } mime = "0.3.17" -nom = "7" -once_cell = "1.13" -pin-project-lite = "0.2" +nom = "7.1.3" +once_cell = "1.20.1" +pin-project-lite = "0.2.14" regex = "1.5.5" serde_urlencoded = "0.7" thiserror = "1.0.40" -tokio = { version = "1.23.1", features = ["full"] } -tower = { version = "0.4.11", features = ["util", "make"], default-features = false } +tokio = { version = "1.40.0", features = ["full"] } +tower = { version = "0.4.13", features = ["util", "make"], default-features = false } tower-http = { version = "0.3", features = ["add-extension", "map-response-body"] } -tracing = "0.1.35" -uuid = { version = "1", features = ["v4", "fast-rng"], optional = true } +tracing = "0.1.40" +uuid = { version = "1.1.2", features = ["v4", "fast-rng"], optional = true } [dev-dependencies] pretty_assertions = "1" diff --git a/rust-runtime/aws-smithy-http/Cargo.toml b/rust-runtime/aws-smithy-http/Cargo.toml index 74e2ef0e9..b56cf03f1 100644 --- a/rust-runtime/aws-smithy-http/Cargo.toml +++ b/rust-runtime/aws-smithy-http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-http" -version = "0.61.1" +version = "0.62.0" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", @@ -18,18 +18,20 @@ rt-tokio = ["aws-smithy-types/rt-tokio"] aws-smithy-eventstream = { path = "../aws-smithy-eventstream", optional = true } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["client", "http-02x"] } aws-smithy-types = { path = "../aws-smithy-types", features = ["byte-stream-poll-next", "http-body-0-4-x"] } -bytes = "1" +bytes = "1.10.0" bytes-utils = "0.1" -http-02x = { package = "http", version = "0.2.3" } -http-body-04x = { package = "http-body", version = "0.4.4" } -once_cell = "1.10" -percent-encoding = "2.1.0" -pin-project-lite = "0.2.9" +# TODO(hyper1) - Complete the breaking changes by updating to http 1.x ecosystem fully in this crate. Also remove hyper 0.14 from dev +http-02x = { package = "http", version = "0.2.9" } +http-1x = { package = "http", version = "1" } +http-body-04x = { package = "http-body", version = "0.4.5" } +once_cell = "1.20.1" +percent-encoding = "2.3.1" +pin-project-lite = "0.2.14" pin-utils = "0.1.0" -tracing = "0.1" +tracing = "0.1.40" # For an adapter to enable the `Stream` trait for `aws_smithy_types::byte_stream::ByteStream` -futures-core = "0.3.29" +futures-core = "0.3.31" [dev-dependencies] async-stream = "0.3" diff --git a/rust-runtime/aws-smithy-http/src/endpoint.rs b/rust-runtime/aws-smithy-http/src/endpoint.rs index 71a3012a2..3c5adc464 100644 --- a/rust-runtime/aws-smithy-http/src/endpoint.rs +++ b/rust-runtime/aws-smithy-http/src/endpoint.rs @@ -5,10 +5,7 @@ //! Code for resolving an endpoint (URI) that a request should be sent to -#![allow(deprecated)] - -use crate::endpoint::error::InvalidEndpointError; -use http_02x::uri::{Authority, Uri}; +use aws_smithy_runtime_api::client::endpoint::{error::InvalidEndpointError, EndpointPrefix}; use std::borrow::Cow; use std::result::Result as StdResult; use std::str::FromStr; @@ -20,23 +17,12 @@ pub use error::ResolveEndpointError; #[deprecated(since = "0.60.1", note = "Was never used.")] pub type Result = std::result::Result; -/// A special type that adds support for services that have special URL-prefixing rules. -#[deprecated( - since = "0.60.1", - note = "Use aws_smithy_runtime_api::client::endpoint::EndpointPrefix instead." -)] -pub type EndpointPrefix = aws_smithy_runtime_api::client::endpoint::EndpointPrefix; - /// Apply `endpoint` to `uri` /// /// This method mutates `uri` by setting the `endpoint` on it -#[deprecated( - since = "0.60.1", - note = "Use aws_smithy_runtime::client::endpoint::apply_endpoint instead." -)] pub fn apply_endpoint( - uri: &mut Uri, - endpoint: &Uri, + uri: &mut http_1x::Uri, + endpoint: &http_1x::Uri, prefix: Option<&EndpointPrefix>, ) -> StdResult<(), InvalidEndpointError> { let prefix = prefix.map(EndpointPrefix::as_str).unwrap_or(""); @@ -50,14 +36,14 @@ pub fn apply_endpoint( } else { Cow::Borrowed(authority) }; - let authority = Authority::from_str(&authority).map_err(|err| { + let authority = http_1x::uri::Authority::from_str(&authority).map_err(|err| { InvalidEndpointError::failed_to_construct_authority(authority.into_owned(), err) })?; let scheme = *endpoint .scheme() .as_ref() .ok_or_else(InvalidEndpointError::endpoint_must_have_scheme)?; - let new_uri = Uri::builder() + let new_uri = http_1x::Uri::builder() .authority(authority) .scheme(scheme.clone()) .path_and_query(merge_paths(endpoint, uri).as_ref()) @@ -67,7 +53,7 @@ pub fn apply_endpoint( Ok(()) } -fn merge_paths<'a>(endpoint: &'a Uri, uri: &'a Uri) -> Cow<'a, str> { +fn merge_paths<'a>(endpoint: &'a http_1x::Uri, uri: &'a http_1x::Uri) -> Cow<'a, str> { if let Some(query) = endpoint.path_and_query().and_then(|pq| pq.query()) { tracing::warn!(query = %query, "query specified in endpoint will be ignored during endpoint resolution"); } diff --git a/rust-runtime/aws-smithy-json/Cargo.toml b/rust-runtime/aws-smithy-json/Cargo.toml index 92105e744..ccba8f2df 100644 --- a/rust-runtime/aws-smithy-json/Cargo.toml +++ b/rust-runtime/aws-smithy-json/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-json" -version = "0.61.2" +version = "0.61.3" authors = ["AWS Rust SDK Team ", "John DiSanti "] description = "Token streaming JSON parser for smithy-rs." edition = "2021" diff --git a/rust-runtime/aws-smithy-observability/Cargo.toml b/rust-runtime/aws-smithy-observability/Cargo.toml index 76bb6d8fe..a78de04d1 100644 --- a/rust-runtime/aws-smithy-observability/Cargo.toml +++ b/rust-runtime/aws-smithy-observability/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-observability" -version = "0.1.0" +version = "0.1.1" authors = [ "AWS Rust SDK Team ", ] @@ -11,7 +11,7 @@ repository = "https://github.com/awslabs/smithy-rs" [dependencies] aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api" } -once_cell = "1.19.0" +once_cell = "1.20.0" [dev-dependencies] serial_test = "3.1.1" diff --git a/rust-runtime/aws-smithy-protocol-test/Cargo.toml b/rust-runtime/aws-smithy-protocol-test/Cargo.toml index d732b169e..195b7e775 100644 --- a/rust-runtime/aws-smithy-protocol-test/Cargo.toml +++ b/rust-runtime/aws-smithy-protocol-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-protocol-test" -version = "0.63.0" +version = "0.63.1" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "A collection of library functions to validate HTTP requests against Smithy protocol tests." edition = "2021" @@ -13,11 +13,11 @@ assert-json-diff = "1.1" base64-simd = "0.8" cbor-diag = "0.1.12" ciborium = "0.2" -http = "0.2.1" +http = "0.2.9" pretty_assertions = "1.3" regex-lite = "0.1.5" roxmltree = "0.14.1" -serde_json = "1" +serde_json = "1.0.128" thiserror = "1.0.40" aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["client"] } diff --git a/rust-runtime/aws-smithy-runtime-api/Cargo.toml b/rust-runtime/aws-smithy-runtime-api/Cargo.toml index b43ba312f..739ad85a1 100644 --- a/rust-runtime/aws-smithy-runtime-api/Cargo.toml +++ b/rust-runtime/aws-smithy-runtime-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.7.4" authors = ["AWS Rust SDK Team ", "Zelda Hessler "] description = "Smithy runtime types." edition = "2021" @@ -20,13 +20,13 @@ http-1x = [] [dependencies] aws-smithy-async = { path = "../aws-smithy-async" } aws-smithy-types = { path = "../aws-smithy-types" } -bytes = "1" +bytes = "1.10.0" http-02x = { package = "http", version = "0.2.9" } http-1x = { package = "http", version = "1" } -pin-project-lite = "0.2" -tokio = { version = "1.25", features = ["sync"] } -tracing = "0.1" -zeroize = { version = "1", optional = true } +pin-project-lite = "0.2.14" +tokio = { version = "1.40.0", features = ["sync"] } +tracing = "0.1.40" +zeroize = { version = "1.7.0", optional = true } [dev-dependencies] proptest = "1" diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/behavior_version.rs b/rust-runtime/aws-smithy-runtime-api/src/client/behavior_version.rs index a9c77508b..07764f344 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/behavior_version.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/behavior_version.rs @@ -20,6 +20,7 @@ enum Inner { // IMPORTANT: Order matters here for the `Ord` derive. Newer versions go to the bottom. V2023_11_09, V2024_03_28, + V2025_01_17, } impl BehaviorVersion { @@ -32,9 +33,26 @@ impl BehaviorVersion { /// If, however, you're writing a service that is very latency sensitive, or that has written /// code to tune Rust SDK behaviors, consider pinning to a specific major version. /// - /// The latest version is currently [`BehaviorVersion::v2024_03_28`] + /// The latest version is currently [`BehaviorVersion::v2025_01_17`] pub fn latest() -> Self { - Self::v2024_03_28() + Self::v2025_01_17() + } + + /// Behavior version for January 17th, 2025 + /// + /// This version updates the default HTTP client and TLS stack. SDKs shipped with + /// a pre 1.x version of hyper and rustls originally. This behavior version updates + /// the HTTP+TLS stack to maintained versions. + /// + ///
+ /// NOTE: In a future release behavior versions prior to this will require enabling + /// feature flags manually to keep the legacy Hyper stack as the default. Specifically the + /// `aws-smithy-runtime/tls-rustls` feature flag combined with an older behavior version. + ///
+ pub fn v2025_01_17() -> Self { + Self { + inner: Inner::V2025_01_17, + } } /// Behavior version for March 28th, 2024. @@ -42,6 +60,10 @@ impl BehaviorVersion { /// This version enables stalled stream protection for uploads (request bodies) by default. /// /// When a new behavior major version is released, this method will be deprecated. + #[deprecated( + since = "1.8.0", + note = "Superseded by v2025_01_17, which updates the default HTTPS client stack." + )] pub fn v2024_03_28() -> Self { Self { inner: Inner::V2024_03_28, @@ -51,7 +73,7 @@ impl BehaviorVersion { /// Behavior version for November 9th, 2023. #[deprecated( since = "1.4.0", - note = "Superceded by v2024_03_28, which enabled stalled stream protection for uploads (request bodies) by default." + note = "Superseded by v2024_03_28, which enabled stalled stream protection for uploads (request bodies) by default." )] pub fn v2023_11_09() -> Self { Self { @@ -81,11 +103,14 @@ mod tests { assert!(BehaviorVersion::latest() == BehaviorVersion::latest()); assert!(BehaviorVersion::v2023_11_09() == BehaviorVersion::v2023_11_09()); assert!(BehaviorVersion::v2024_03_28() != BehaviorVersion::v2023_11_09()); + assert!(BehaviorVersion::v2025_01_17() != BehaviorVersion::v2024_03_28()); assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::latest())); assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2023_11_09())); assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2024_03_28())); + assert!(BehaviorVersion::latest().is_at_least(BehaviorVersion::v2025_01_17())); assert!(!BehaviorVersion::v2023_11_09().is_at_least(BehaviorVersion::v2024_03_28())); assert!(Inner::V2024_03_28 > Inner::V2023_11_09); assert!(Inner::V2023_11_09 < Inner::V2024_03_28); + assert!(Inner::V2024_03_28 < Inner::V2025_01_17); } } diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/connection.rs b/rust-runtime/aws-smithy-runtime-api/src/client/connection.rs index 114f7f746..043566716 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/connection.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/connection.rs @@ -5,9 +5,10 @@ //! Types related to connection monitoring and management. -use std::fmt::{Debug, Formatter}; +use aws_smithy_types::config_bag::{Storable, StoreReplace}; +use std::fmt; use std::net::SocketAddr; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; /// Metadata that tracks the state of an active connection. #[derive(Clone)] @@ -63,8 +64,8 @@ impl ConnectionMetadata { } } -impl Debug for ConnectionMetadata { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Debug for ConnectionMetadata { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SmithyConnection") .field("is_proxied", &self.is_proxied) .field("remote_addr", &self.remote_addr) @@ -82,8 +83,8 @@ pub struct ConnectionMetadataBuilder { poison_fn: Option>, } -impl Debug for ConnectionMetadataBuilder { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +impl fmt::Debug for ConnectionMetadataBuilder { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("ConnectionMetadataBuilder") .field("is_proxied", &self.is_proxied) .field("remote_addr", &self.remote_addr) @@ -173,6 +174,52 @@ impl ConnectionMetadataBuilder { } } +type LoaderFn = dyn Fn() -> Option + Send + Sync; + +/// State for a middleware that will monitor and manage connections. +#[derive(Clone, Default)] +pub struct CaptureSmithyConnection { + loader: Arc>>>, +} + +impl CaptureSmithyConnection { + /// Create a new connection monitor. + pub fn new() -> Self { + Self { + loader: Default::default(), + } + } + + /// Set the retriever that will capture the `hyper` connection. + pub fn set_connection_retriever(&self, f: F) + where + F: Fn() -> Option + Send + Sync + 'static, + { + *self.loader.lock().unwrap() = Some(Box::new(f)); + } + + /// Get the associated connection metadata. + pub fn get(&self) -> Option { + match self.loader.lock().unwrap().as_ref() { + Some(loader) => loader(), + None => { + tracing::debug!("no loader was set on the CaptureSmithyConnection"); + None + } + } + } +} + +impl fmt::Debug for CaptureSmithyConnection { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "CaptureSmithyConnection") + } +} + +impl Storable for CaptureSmithyConnection { + type Storer = StoreReplace; +} + #[cfg(test)] mod tests { use std::{ @@ -257,4 +304,23 @@ mod tests { assert_eq!(metadata3.local_addr(), None); assert_eq!(metadata3.remote_addr(), Some(TEST_SOCKET_ADDR)); } + + #[test] + #[allow(clippy::redundant_clone)] + fn retrieve_connection_metadata() { + let retriever = CaptureSmithyConnection::new(); + let retriever_clone = retriever.clone(); + assert!(retriever.get().is_none()); + retriever.set_connection_retriever(|| { + Some( + ConnectionMetadata::builder() + .proxied(true) + .poison_fn(|| {}) + .build(), + ) + }); + + assert!(retriever.get().is_some()); + assert!(retriever_clone.get().is_some()); + } } diff --git a/rust-runtime/aws-smithy-runtime-api/src/http/headers.rs b/rust-runtime/aws-smithy-runtime-api/src/http/headers.rs index 98e571b8c..d0f7692e7 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/http/headers.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/http/headers.rs @@ -321,6 +321,42 @@ mod sealed { Ok(self) } } + + #[cfg(feature = "http-1x")] + impl AsHeaderComponent for http_1x::HeaderName { + fn into_maybe_static(self) -> Result { + Ok(self.to_string().into()) + } + + fn as_str(&self) -> Result<&str, HttpError> { + Ok(self.as_ref()) + } + } + + #[cfg(feature = "http-1x")] + impl AsHeaderComponent for http_1x::HeaderValue { + fn into_maybe_static(self) -> Result { + Ok(Cow::Owned( + std::str::from_utf8(self.as_bytes()) + .map_err(|err| { + HttpError::non_utf8_header(NonUtf8Header::new_missing_name( + self.as_bytes().to_vec(), + err, + )) + })? + .to_string(), + )) + } + + fn as_str(&self) -> Result<&str, HttpError> { + std::str::from_utf8(self.as_bytes()).map_err(|err| { + HttpError::non_utf8_header(NonUtf8Header::new_missing_name( + self.as_bytes().to_vec(), + err, + )) + }) + } + } } mod header_value { diff --git a/rust-runtime/aws-smithy-runtime/Cargo.toml b/rust-runtime/aws-smithy-runtime/Cargo.toml index 5ec7722d7..3fc239c37 100644 --- a/rust-runtime/aws-smithy-runtime/Cargo.toml +++ b/rust-runtime/aws-smithy-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-runtime" -version = "1.7.8" +version = "1.8.0" authors = ["AWS Rust SDK Team ", "Zelda Hessler "] description = "The new smithy runtime crate" edition = "2021" @@ -9,44 +9,61 @@ repository = "https://github.com/smithy-lang/smithy-rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +# TODO(hyper1) - deprecate legacy hyper and http testing features when available in cargo: https://github.com/rust-lang/cargo/issues/7130 [features] client = ["aws-smithy-runtime-api/client", "aws-smithy-types/http-body-1-x"] http-auth = ["aws-smithy-runtime-api/http-auth"] -connector-hyper-0-14-x = ["dep:hyper-0-14", "hyper-0-14?/client", "hyper-0-14?/http2", "hyper-0-14?/http1", "hyper-0-14?/tcp", "hyper-0-14?/stream", "dep:h2"] -tls-rustls = ["dep:hyper-rustls", "dep:rustls", "connector-hyper-0-14-x"] +# NOTE: connector-hyper-0-14-x and tls-rustls are "legacy" features related to default HTTP client based on hyper 0.14.x ecosystem +connector-hyper-0-14-x = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/hyper-014"] +tls-rustls = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/legacy-rustls-ring", "connector-hyper-0-14-x"] +default-https-client = ["dep:aws-smithy-http-client", "aws-smithy-http-client?/rustls-aws-lc"] rt-tokio = ["tokio/rt"] # Features for testing -test-util = ["aws-smithy-runtime-api/test-util", "dep:aws-smithy-protocol-test", "dep:tracing-subscriber", "dep:serde", "dep:serde_json", "dep:indexmap"] -wire-mock = ["test-util", "connector-hyper-0-14-x", "hyper-0-14?/server"] +# NOTE: `test-util` originally enabled the HTTP related test utils which have since been relocated to `aws-smithy-http-client` +# and updated to work with the 1.x HTTP/hyper ecosystem. Prefer using the `test-util` and `wire-mock` features from +# `aws-smithy-http-client` directly instead for HTTP test utils. +test-util = [ + "aws-smithy-runtime-api/test-util", + "dep:tracing-subscriber", + "aws-smithy-http-client/test-util", + # TODO(hyper1): Feature remains in place for backwards compat but in a future release we will break this flag and disable legacy HTTP test utils + "legacy-test-util", +] + +legacy-test-util = [ + # non HTTP test utils + "aws-smithy-runtime-api/test-util", + "dep:tracing-subscriber", + "aws-smithy-http-client/test-util", + # legacy http test utils + "connector-hyper-0-14-x", + "aws-smithy-http-client/legacy-test-util", +] + +wire-mock = ["legacy-test-util", "aws-smithy-http-client/wire-mock"] [dependencies] aws-smithy-async = { path = "../aws-smithy-async" } aws-smithy-http = { path = "../aws-smithy-http" } -aws-smithy-protocol-test = { path = "../aws-smithy-protocol-test", optional = true } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api" } aws-smithy-types = { path = "../aws-smithy-types", features = ["http-body-0-4-x"] } -bytes = "1" +aws-smithy-http-client = { path = "../aws-smithy-http-client", optional = true } +bytes = "1.10.0" # Make sure to update `fastrand` in [dev-dependencies] if we bump the major version # We probably need to update unit tests using the `fastrand` crate when that happens fastrand = "2.3.0" -h2 = { version = "0.3", default-features = false, optional = true } -http-02x = { package = "http", version = "0.2.8" } -http-body-04x = { package = "http-body", version = "0.4.4" } +http-02x = { package = "http", version = "0.2.9" } +http-1x = { package = "http", version = "1" } +http-body-04x = { package = "http-body", version = "0.4.5" } http-body-1x = { package = "http-body", version = "1" } # This avoids bringing `httparse` 1.9.0 and 1.9.1 through `hyper-0-14` that break unit tests of runtime crates -httparse = "1.8.0" -hyper-0-14 = { package = "hyper", version = "0.14.26", default-features = false, optional = true } -hyper-rustls = { version = "0.24", features = ["rustls-native-certs", "http2"], optional = true } -once_cell = "1.18.0" -pin-project-lite = "0.2.7" +#httparse = "1.8.0" +once_cell = "1.20.1" +pin-project-lite = "0.2.14" pin-utils = "0.1.0" -rustls = { version = "0.21.8", optional = true } -serde = { version = "1", features = ["derive"], optional = true } -serde_json = { version = "1", features = ["preserve_order"], optional = true } -indexmap = { version = "2", optional = true, features = ["serde"] } -tokio = { version = "1.25", features = [] } -tracing = "0.1.37" +tokio = { version = "1.40.0", features = [] } +tracing = "0.1.40" tracing-subscriber = { version = "0.3.16", optional = true, features = ["env-filter", "fmt", "json"] } [dev-dependencies] @@ -62,8 +79,8 @@ pretty_assertions = "1.4.0" tokio = { version = "1.25", features = ["macros", "rt", "rt-multi-thread", "test-util", "full"] } tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } tracing-test = "0.2.1" +# FIXME - migrate to hyper-1 hyper_0_14 = { package = "hyper", version = "0.14.27", features = ["client", "server", "tcp", "http1", "http2"] } -http1 = { package = "http", version = "1" } [package.metadata.docs.rs] all-features = true diff --git a/rust-runtime/aws-smithy-runtime/additional-ci b/rust-runtime/aws-smithy-runtime/additional-ci index b44c6c05b..c79db8729 100755 --- a/rust-runtime/aws-smithy-runtime/additional-ci +++ b/rust-runtime/aws-smithy-runtime/additional-ci @@ -9,4 +9,5 @@ set -e echo "### Testing every combination of features (excluding --all-features)" -cargo hack test --feature-powerset --exclude-all-features +# Skip deprecated features that are re-exported from `aws-smithy-http-client` (and tested there already) +cargo hack test --feature-powerset --exclude-all-features --exclude-features legacy-test-util,wire-mock,connector-hyper-0-14-x,tls-rustls diff --git a/rust-runtime/aws-smithy-runtime/external-types.toml b/rust-runtime/aws-smithy-runtime/external-types.toml index ef336fec7..c2da47280 100644 --- a/rust-runtime/aws-smithy-runtime/external-types.toml +++ b/rust-runtime/aws-smithy-runtime/external-types.toml @@ -23,6 +23,11 @@ allowed_external_types = [ "hyper::client::connect::Connection", "tokio::io::async_read::AsyncRead", "tokio::io::async_write::AsyncWrite", + "aws_smithy_http_client::hyper_014", + "aws_smithy_http_client::test_util::*", + "aws_smithy_http_client::ev", + "aws_smithy_http_client::match_events", + "aws_smithy_http_client::matcher", # TODO(https://github.com/smithy-lang/smithy-rs/issues/1193): Once tooling permits it, only allow the following types in the `http-0-x` feature "http_body::Body" diff --git a/rust-runtime/aws-smithy-runtime/src/client.rs b/rust-runtime/aws-smithy-runtime/src/client.rs index 33ccc1f09..b509f5327 100644 --- a/rust-runtime/aws-smithy-runtime/src/client.rs +++ b/rust-runtime/aws-smithy-runtime/src/client.rs @@ -33,7 +33,7 @@ pub mod retries; /// Utilities for testing orchestrators. An orchestrator missing required components will panic when /// run. This module contains stub components that can be used when you only care about testing some /// specific aspect of the orchestrator. -#[cfg(feature = "test-util")] +#[cfg(any(feature = "test-util", feature = "legacy-test-util"))] pub mod test_util; mod timeout; diff --git a/rust-runtime/aws-smithy-runtime/src/client/defaults.rs b/rust-runtime/aws-smithy-runtime/src/client/defaults.rs index f6699907d..b6d581baa 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/defaults.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/defaults.rs @@ -52,10 +52,49 @@ where } /// Runtime plugin that provides a default connector. +#[deprecated( + since = "1.8.0", + note = "This function wasn't intended to be public, and didn't take the behavior major version as an argument, so it couldn't be evolved over time." +)] pub fn default_http_client_plugin() -> Option { - let _default: Option = None; - #[cfg(feature = "connector-hyper-0-14-x")] - let _default = crate::client::http::hyper_014::default_client(); + #[allow(deprecated)] + default_http_client_plugin_v2(BehaviorVersion::v2024_03_28()) +} + +/// Runtime plugin that provides a default HTTPS connector. +pub fn default_http_client_plugin_v2( + behavior_version: BehaviorVersion, +) -> Option { + let mut _default: Option = None; + + if behavior_version.is_at_least(BehaviorVersion::v2025_01_17()) { + // the latest https stack takes precedence if the config flag + // is enabled otherwise try to fall back to the legacy connector + // if that feature flag is available. + #[cfg(all( + feature = "connector-hyper-0-14-x", + not(feature = "default-https-client") + ))] + #[allow(deprecated)] + { + _default = crate::client::http::hyper_014::default_client(); + } + + // takes precedence over legacy connector if enabled + #[cfg(feature = "default-https-client")] + { + let opts = crate::client::http::DefaultClientOptions::default() + .with_behavior_version(behavior_version); + _default = crate::client::http::default_https_client(opts); + } + } else { + // fallback to legacy hyper client for given behavior version + #[cfg(feature = "connector-hyper-0-14-x")] + #[allow(deprecated)] + { + _default = crate::client::http::hyper_014::default_client(); + } + } _default.map(|default| { default_plugin("default_http_client_plugin", |components| { @@ -198,6 +237,7 @@ fn default_stalled_stream_protection_config_plugin_v2( let mut config = StalledStreamProtectionConfig::enabled().grace_period(Duration::from_secs(5)); // Before v2024_03_28, upload streams did not have stalled stream protection by default + #[allow(deprecated)] if !behavior_version.is_at_least(BehaviorVersion::v2024_03_28()) { config = config.upload_enabled(false); } @@ -277,7 +317,7 @@ pub fn default_plugins( .unwrap_or_else(BehaviorVersion::latest); [ - default_http_client_plugin(), + default_http_client_plugin_v2(behavior_version), default_identity_cache_plugin(), default_retry_config_plugin( params diff --git a/rust-runtime/aws-smithy-runtime/src/client/endpoint.rs b/rust-runtime/aws-smithy-runtime/src/client/endpoint.rs index 26ae1c10e..4fb90bc9a 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/endpoint.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/endpoint.rs @@ -13,6 +13,10 @@ use std::str::FromStr; /// Apply `endpoint` to `uri` /// /// This method mutates `uri` by setting the `endpoint` on it +#[deprecated( + since = "1.8.0", + note = "Depends on pre 1.x http types. May be removed or feature gated in a future minor version." +)] pub fn apply_endpoint( uri: &mut http_02x::Uri, endpoint: &http_02x::Uri, diff --git a/rust-runtime/aws-smithy-runtime/src/client/http.rs b/rust-runtime/aws-smithy-runtime/src/client/http.rs index d4fcc998d..eebb8a320 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/http.rs @@ -2,19 +2,94 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ +use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; +#[cfg(feature = "default-https-client")] +use aws_smithy_runtime_api::client::http::SharedHttpClient; /// Interceptor for connection poisoning. pub mod connection_poisoning; +#[deprecated = "Direct HTTP test utility support from `aws-smithy-runtime` crate is deprecated. Please use the `test-util` feature from `aws-smithy-http-client` instead"] #[cfg(feature = "test-util")] -pub mod test_util; +pub mod test_util { + #![allow(missing_docs)] + + pub use aws_smithy_http_client::test_util::{ + legacy_capture_request as capture_request, CaptureRequestHandler, CaptureRequestReceiver, + }; + + #[cfg(feature = "connector-hyper-0-14-x")] + pub mod dvr { + pub use aws_smithy_http_client::test_util::dvr::*; + } + + pub use aws_smithy_http_client::test_util::{ReplayEvent, StaticReplayClient}; + + pub use aws_smithy_http_client::test_util::legacy_infallible::infallible_client_fn; + + pub use aws_smithy_http_client::test_util::NeverClient; + + #[cfg(feature = "connector-hyper-0-14-x")] + pub use aws_smithy_http_client::test_util::NeverTcpConnector; + + #[cfg(all(feature = "connector-hyper-0-14-x", feature = "wire-mock"))] + #[macro_use] + pub mod wire { + pub use aws_smithy_http_client::test_util::wire::ev; + pub use aws_smithy_http_client::test_util::wire::match_events; + pub use aws_smithy_http_client::test_util::wire::matcher; + pub use aws_smithy_http_client::test_util::wire::*; + } +} /// Default HTTP and TLS connectors that use hyper 0.14.x and rustls. /// /// This module is named after the hyper version number since we anticipate /// needing to provide equivalent functionality for hyper 1.x in the future. #[cfg(feature = "connector-hyper-0-14-x")] -pub mod hyper_014; +#[deprecated = "hyper 0.14.x connector is deprecated, please use the `aws-smithy-http-client` crate directly instead."] +pub mod hyper_014 { + #[allow(deprecated)] + pub use aws_smithy_http_client::hyper_014::*; +} /// HTTP body and body-wrapper types pub mod body; + +// NOTE: We created default client options to evolve defaults over time (e.g. allow passing a different DNS resolver) +/// Configuration options for the default HTTPS client +#[derive(Debug, Clone)] +pub(crate) struct DefaultClientOptions { + _behavior_version: BehaviorVersion, +} + +impl Default for DefaultClientOptions { + fn default() -> Self { + DefaultClientOptions { + _behavior_version: BehaviorVersion::latest(), + } + } +} + +impl DefaultClientOptions { + /// Set the behavior version to use + #[allow(unused)] + pub(crate) fn with_behavior_version(mut self, behavior_version: BehaviorVersion) -> Self { + self._behavior_version = behavior_version; + self + } +} + +/// Creates an HTTPS client using the default TLS provider +#[cfg(feature = "default-https-client")] +pub(crate) fn default_https_client(_options: DefaultClientOptions) -> Option { + use aws_smithy_http_client::{tls, Builder}; + tracing::trace!("creating a new default hyper 1.x client using rustls"); + Some( + Builder::new() + .tls_provider(tls::Provider::Rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) + .build_https(), + ) +} diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/body/content_length_enforcement.rs b/rust-runtime/aws-smithy-runtime/src/client/http/body/content_length_enforcement.rs index 9ee070b0a..22e7ded68 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/body/content_length_enforcement.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/http/body/content_length_enforcement.rs @@ -206,7 +206,7 @@ impl RuntimePlugin for EnforceContentLengthRuntimePlugin { } } -#[cfg(all(feature = "test-util", test))] +#[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] mod test { use crate::assert_str_contains; use crate::client::http::body::content_length_enforcement::{ diff --git a/rust-runtime/aws-smithy-runtime/src/client/http/connection_poisoning.rs b/rust-runtime/aws-smithy-runtime/src/client/http/connection_poisoning.rs index 13ea455a8..e18adf748 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/http/connection_poisoning.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/http/connection_poisoning.rs @@ -5,19 +5,19 @@ use crate::client::retries::classifiers::run_classifiers_on_ctx; use aws_smithy_runtime_api::box_error::BoxError; -use aws_smithy_runtime_api::client::connection::ConnectionMetadata; use aws_smithy_runtime_api::client::interceptors::context::{ AfterDeserializationInterceptorContextRef, BeforeTransmitInterceptorContextMut, }; use aws_smithy_runtime_api::client::interceptors::Intercept; use aws_smithy_runtime_api::client::retries::classifiers::RetryAction; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; -use aws_smithy_types::config_bag::{ConfigBag, Storable, StoreReplace}; +use aws_smithy_types::config_bag::ConfigBag; use aws_smithy_types::retry::{ReconnectMode, RetryConfig}; -use std::fmt; -use std::sync::{Arc, Mutex}; use tracing::{debug, error}; +// re-export relocated struct that used to live here +pub use aws_smithy_runtime_api::client::connection::CaptureSmithyConnection; + /// An interceptor for poisoning connections in response to certain events. /// /// This interceptor, when paired with a compatible connection, allows the connection to be @@ -96,73 +96,3 @@ impl Intercept for ConnectionPoisoningInterceptor { Ok(()) } } - -type LoaderFn = dyn Fn() -> Option + Send + Sync; - -/// State for a middleware that will monitor and manage connections. -#[derive(Clone, Default)] -pub struct CaptureSmithyConnection { - loader: Arc>>>, -} - -impl CaptureSmithyConnection { - /// Create a new connection monitor. - pub fn new() -> Self { - Self { - loader: Default::default(), - } - } - - /// Set the retriever that will capture the `hyper` connection. - pub fn set_connection_retriever(&self, f: F) - where - F: Fn() -> Option + Send + Sync + 'static, - { - *self.loader.lock().unwrap() = Some(Box::new(f)); - } - - /// Get the associated connection metadata. - pub fn get(&self) -> Option { - match self.loader.lock().unwrap().as_ref() { - Some(loader) => loader(), - None => { - tracing::debug!("no loader was set on the CaptureSmithyConnection"); - None - } - } - } -} - -impl fmt::Debug for CaptureSmithyConnection { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "CaptureSmithyConnection") - } -} - -impl Storable for CaptureSmithyConnection { - type Storer = StoreReplace; -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - #[allow(clippy::redundant_clone)] - fn retrieve_connection_metadata() { - let retriever = CaptureSmithyConnection::new(); - let retriever_clone = retriever.clone(); - assert!(retriever.get().is_none()); - retriever.set_connection_retriever(|| { - Some( - ConnectionMetadata::builder() - .proxied(true) - .poison_fn(|| {}) - .build(), - ) - }); - - assert!(retriever.get().is_some()); - assert!(retriever_clone.get().is_some()); - } -} diff --git a/rust-runtime/aws-smithy-runtime/src/client/orchestrator.rs b/rust-runtime/aws-smithy-runtime/src/client/orchestrator.rs index 8e1b0818c..df5ef2bf9 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/orchestrator.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/orchestrator.rs @@ -379,7 +379,7 @@ async fn try_attempt( trace!(request = ?request, "transmitting request"); let http_client = halt_on_err!([ctx] => runtime_components.http_client().ok_or_else(|| OrchestratorError::other("No HTTP client was available to send this request. \ - Enable the `rustls` crate feature or configure a HTTP client to fix this.") + Enable the `default-https-client` crate feature or configure an HTTP client to fix this.") )); let timeout_config = cfg.load::().expect("timeout config must be set"); let settings = { @@ -462,16 +462,16 @@ async fn finally_op( }); } -#[cfg(all(test, feature = "test-util"))] +#[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] mod tests { use crate::client::auth::no_auth::{NoAuthRuntimePlugin, NO_AUTH_SCHEME_ID}; - use crate::client::http::test_util::NeverClient; use crate::client::orchestrator::endpoints::StaticUriEndpointResolver; use crate::client::orchestrator::{invoke, invoke_with_stop_point, StopPoint}; use crate::client::retries::strategy::NeverRetryStrategy; use crate::client::test_util::{ deserializer::CannedResponseDeserializer, serializer::CannedRequestSerializer, }; + use aws_smithy_http_client::test_util::NeverClient; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver; use aws_smithy_runtime_api::client::auth::{ diff --git a/rust-runtime/aws-smithy-runtime/src/client/orchestrator/auth.rs b/rust-runtime/aws-smithy-runtime/src/client/orchestrator/auth.rs index 5afc34bba..487b7c78d 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/orchestrator/auth.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/orchestrator/auth.rs @@ -278,7 +278,7 @@ impl fmt::Debug for ExploredList { } } -#[cfg(all(test, feature = "test-util"))] +#[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] mod tests { use super::*; use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver; diff --git a/rust-runtime/aws-smithy-runtime/src/client/orchestrator/operation.rs b/rust-runtime/aws-smithy-runtime/src/client/orchestrator/operation.rs index 756f0b742..c44af7703 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/orchestrator/operation.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/orchestrator/operation.rs @@ -400,7 +400,7 @@ impl OperationBuilder { assert!( components.http_client().is_some(), - "a http_client is required. Enable the `rustls` crate feature or configure a HTTP client to fix this." + "a http_client is required. Enable the `default-https-client` crate feature or configure an HTTP client to fix this." ); assert!( components.endpoint_resolver().is_some(), @@ -437,12 +437,12 @@ impl OperationBuilder { } } -#[cfg(all(test, feature = "test-util"))] +#[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] mod tests { use super::*; - use crate::client::http::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use crate::client::retries::classifiers::HttpStatusCodeClassifier; use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}; + use aws_smithy_http_client::test_util::{capture_request, ReplayEvent, StaticReplayClient}; use aws_smithy_runtime_api::client::result::ConnectorError; use aws_smithy_types::body::SdkBody; use std::convert::Infallible; @@ -450,7 +450,7 @@ mod tests { #[tokio::test] async fn operation() { let (connector, request_rx) = capture_request(Some( - http_02x::Response::builder() + http_1x::Response::builder() .status(418) .body(SdkBody::from(&b"I'm a teapot!"[..])) .unwrap(), @@ -487,21 +487,21 @@ mod tests { async fn operation_retries() { let connector = StaticReplayClient::new(vec![ ReplayEvent::new( - http_02x::Request::builder() + http_1x::Request::builder() .uri("http://localhost:1234/") .body(SdkBody::from(&b"what are you?"[..])) .unwrap(), - http_02x::Response::builder() + http_1x::Response::builder() .status(503) .body(SdkBody::from(&b""[..])) .unwrap(), ), ReplayEvent::new( - http_02x::Request::builder() + http_1x::Request::builder() .uri("http://localhost:1234/") .body(SdkBody::from(&b"what are you?"[..])) .unwrap(), - http_02x::Response::builder() + http_1x::Response::builder() .status(418) .body(SdkBody::from(&b"I'm a teapot!"[..])) .unwrap(), diff --git a/rust-runtime/aws-smithy-runtime/src/client/retries/strategy/standard.rs b/rust-runtime/aws-smithy-runtime/src/client/retries/strategy/standard.rs index 933476aa5..8aaf58332 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/retries/strategy/standard.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/retries/strategy/standard.rs @@ -540,7 +540,7 @@ mod tests { retry_actions: Mutex>, } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] impl PresetReasonRetryClassifier { fn new(mut retry_reasons: Vec) -> Self { // We'll pop the retry_reasons in reverse order, so we reverse the list to fix that. @@ -574,7 +574,7 @@ mod tests { } } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] fn setup_test( retry_reasons: Vec, retry_config: RetryConfig, @@ -595,7 +595,7 @@ mod tests { (cfg, rc, ctx) } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn eventual_success() { let (mut cfg, rc, mut ctx) = setup_test( @@ -628,7 +628,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 495); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn no_more_attempts() { let (mut cfg, rc, ctx) = setup_test( @@ -659,7 +659,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 490); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn successful_request_and_deser_should_be_retryable() { #[derive(Clone, Copy, Debug)] @@ -751,7 +751,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 5); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn no_quota() { let (mut cfg, rc, ctx) = setup_test( @@ -776,7 +776,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 0); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn quota_replenishes_on_success() { let (mut cfg, rc, mut ctx) = setup_test( @@ -816,7 +816,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 90); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn quota_replenishes_on_first_try_success() { const PERMIT_COUNT: usize = 20; @@ -870,7 +870,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), PERMIT_COUNT); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn backoff_timing() { let (mut cfg, rc, ctx) = setup_test( @@ -913,7 +913,7 @@ mod tests { assert_eq!(token_bucket.available_permits(), 480); } - #[cfg(feature = "test-util")] + #[cfg(any(feature = "test-util", feature = "legacy-test-util"))] #[test] fn max_backoff_time() { let (mut cfg, rc, ctx) = setup_test( diff --git a/rust-runtime/aws-smithy-runtime/src/client/retries/token_bucket.rs b/rust-runtime/aws-smithy-runtime/src/client/retries/token_bucket.rs index c2c8ba8c6..7931adb1b 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/retries/token_bucket.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/retries/token_bucket.rs @@ -69,7 +69,7 @@ impl TokenBucket { } } - #[cfg(all(test, feature = "test-util"))] + #[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] pub(crate) fn available_permits(&self) -> usize { self.semaphore.available_permits() } diff --git a/rust-runtime/aws-smithy-runtime/src/client/waiters.rs b/rust-runtime/aws-smithy-runtime/src/client/waiters.rs index e9330b2fa..b5e297c2b 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/waiters.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/waiters.rs @@ -196,7 +196,7 @@ impl WaiterOrchestratorBuilder self } - #[cfg(all(test, feature = "test-util"))] + #[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] fn random(mut self, random_fn: impl Fn(u64, u64) -> u64 + Send + Sync + 'static) -> Self { self.random_fn = RandomImpl::Override(Box::new(random_fn)); self @@ -281,7 +281,7 @@ pub fn attach_waiter_tracing_span( future.instrument(span) } -#[cfg(all(test, feature = "test-util"))] +#[cfg(all(test, any(feature = "test-util", feature = "legacy-test-util")))] mod tests { use super::*; use crate::test_util::capture_test_logs::show_test_logs; diff --git a/rust-runtime/aws-smithy-runtime/src/lib.rs b/rust-runtime/aws-smithy-runtime/src/lib.rs index 36dcd854e..c40434e4d 100644 --- a/rust-runtime/aws-smithy-runtime/src/lib.rs +++ b/rust-runtime/aws-smithy-runtime/src/lib.rs @@ -32,5 +32,13 @@ pub mod expiring_cache; pub mod static_partition_map; /// General testing utilities. -#[cfg(feature = "test-util")] +#[cfg(any(feature = "test-util", feature = "legacy-test-util"))] pub mod test_util; + +// legacy test-util, re-export of macros +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::ev; +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::match_events; +#[cfg(feature = "wire-mock")] +pub use aws_smithy_http_client::test_util::wire::matcher; diff --git a/rust-runtime/aws-smithy-runtime/tests/reconnect_on_transient_error.rs b/rust-runtime/aws-smithy-runtime/tests/reconnect_on_transient_error.rs index 792861354..41600db48 100644 --- a/rust-runtime/aws-smithy-runtime/tests/reconnect_on_transient_error.rs +++ b/rust-runtime/aws-smithy-runtime/tests/reconnect_on_transient_error.rs @@ -3,11 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#![cfg(all( - feature = "client", - feature = "wire-mock", - feature = "connector-hyper-0-14-x", -))] +#![cfg(all(feature = "client", feature = "wire-mock",))] use ::aws_smithy_runtime::client::retries::classifiers::{ HttpStatusCodeClassifier, TransientErrorClassifier, diff --git a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_common.rs b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_common.rs index 6b63a5ce3..b55639748 100644 --- a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_common.rs +++ b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_common.rs @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#![cfg(all(feature = "client", feature = "test-util"))] +#![cfg(all( + feature = "client", + any(feature = "test-util", feature = "legacy-test-util") +))] // Extra imports are used by stalled_stream_download and stalled_stream_upload as conveniences #![allow(unused_imports)] diff --git a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_download.rs b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_download.rs index a60a515b7..05eb8bdc5 100644 --- a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_download.rs +++ b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_download.rs @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#![cfg(all(feature = "client", feature = "test-util"))] +#![cfg(all( + feature = "client", + any(feature = "test-util", feature = "legacy-test-util") +))] use std::time::Duration; use tokio::sync::mpsc::channel; diff --git a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_performance.rs b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_performance.rs index b0137f8e2..34ff0d3cc 100644 --- a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_performance.rs +++ b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_performance.rs @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#![cfg(all(feature = "client", feature = "test-util"))] +#![cfg(all( + feature = "client", + any(feature = "test-util", feature = "legacy-test-util") +))] use aws_smithy_async::rt::sleep::TokioSleep; use aws_smithy_async::time::{SystemTimeSource, TimeSource}; diff --git a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_upload.rs b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_upload.rs index 3cbae755b..ec253be27 100644 --- a/rust-runtime/aws-smithy-runtime/tests/stalled_stream_upload.rs +++ b/rust-runtime/aws-smithy-runtime/tests/stalled_stream_upload.rs @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#![cfg(all(feature = "client", feature = "test-util"))] +#![cfg(all( + feature = "client", + any(feature = "test-util", feature = "legacy-test-util") +))] #[macro_use] mod stalled_stream_common; diff --git a/rust-runtime/aws-smithy-types-convert/Cargo.toml b/rust-runtime/aws-smithy-types-convert/Cargo.toml index 826f213c9..392b9e5e9 100644 --- a/rust-runtime/aws-smithy-types-convert/Cargo.toml +++ b/rust-runtime/aws-smithy-types-convert/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-types-convert" -version = "0.60.8" +version = "0.60.9" authors = ["AWS Rust SDK Team "] description = "Conversion of types from aws-smithy-types to other libraries." edition = "2021" @@ -17,7 +17,7 @@ aws-smithy-types = { path = "../aws-smithy-types", optional = true } aws-smithy-async = { path = "../aws-smithy-async", optional = true } chrono = { version = "0.4.35", optional = true, default-features = false, features = ["std"] } time = { version = "0.3.4", optional = true } -futures-core = { version = "0.3.0", optional = true } +futures-core = { version = "0.3.31", optional = true } [package.metadata.docs.rs] all-features = true diff --git a/rust-runtime/aws-smithy-types/Cargo.toml b/rust-runtime/aws-smithy-types/Cargo.toml index d743ee161..f252d5cff 100644 --- a/rust-runtime/aws-smithy-types/Cargo.toml +++ b/rust-runtime/aws-smithy-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-types" -version = "1.2.13" +version = "1.3.0" authors = [ "AWS Rust SDK Team ", "Russell Cohen ", @@ -32,25 +32,25 @@ serde-deserialize = [] [dependencies] base64-simd = "0.8" -bytes = "1" +bytes = "1.10.0" bytes-utils = "0.1" -http = { version = "0.2.3", optional = true } +http = { version = "0.2.9", optional = true } http-1x = { package = "http", version = "1", optional = true } -http-body-0-4 = { package = "http-body", version = "0.4.4", optional = true } +http-body-0-4 = { package = "http-body", version = "0.4.5", optional = true } http-body-1-0 = { package = "http-body", version = "1", optional = true } -http-body-util = { version = "0.1.0", optional = true } +http-body-util = { version = "0.1.2", optional = true } hyper-0-14 = { package = "hyper", version = "0.14.26", optional = true } itoa = "1.0.0" num-integer = "0.1.44" -pin-project-lite = "0.2.9" +pin-project-lite = "0.2.14" pin-utils = "0.1.0" ryu = "1.0.5" time = { version = "0.3.4", features = ["parsing"] } # ByteStream internals -futures-core = { version = "0.3.29", optional = true } -tokio = { version = "1.23.1", optional = true } -tokio-util = { version = "0.7", optional = true } +futures-core = { version = "0.3.31", optional = true } +tokio = { version = "1.40.0", optional = true } +tokio-util = { version = "0.7.1", optional = true } [dev-dependencies] base64 = "0.13.0" @@ -91,7 +91,7 @@ name = "base64" harness = false [target."cfg(aws_sdk_unstable)".dependencies.serde] -version = "1" +version = "1.0.210" features = ["derive"] [lints.rust] diff --git a/rust-runtime/aws-smithy-types/src/body/http_body_0_4_x.rs b/rust-runtime/aws-smithy-types/src/body/http_body_0_4_x.rs index d4eae4cf4..54def0c27 100644 --- a/rust-runtime/aws-smithy-types/src/body/http_body_0_4_x.rs +++ b/rust-runtime/aws-smithy-types/src/body/http_body_0_4_x.rs @@ -76,6 +76,7 @@ mod tests { assert_eq!(new_body.bytes(), Some(b"hello!".as_slice())); } + #[cfg(feature = "hyper-0-14-x")] #[test] fn sdkbody_debug_dyn() { let hyper_body = hyper_0_14::Body::channel().1; diff --git a/rust-runtime/aws-smithy-types/src/byte_stream/http_body_0_4_x.rs b/rust-runtime/aws-smithy-types/src/byte_stream/http_body_0_4_x.rs index 358727ab9..fabe4737e 100644 --- a/rust-runtime/aws-smithy-types/src/byte_stream/http_body_0_4_x.rs +++ b/rust-runtime/aws-smithy-types/src/byte_stream/http_body_0_4_x.rs @@ -33,6 +33,7 @@ mod tests { use crate::byte_stream::Inner; use bytes::Bytes; + #[cfg(feature = "hyper-0-14-x")] #[tokio::test] async fn read_from_channel_body() { let (mut sender, body) = hyper_0_14::Body::channel(); diff --git a/rust-runtime/aws-smithy-wasm/Cargo.toml b/rust-runtime/aws-smithy-wasm/Cargo.toml index 1ab7981a7..89e80a8e2 100644 --- a/rust-runtime/aws-smithy-wasm/Cargo.toml +++ b/rust-runtime/aws-smithy-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-smithy-wasm" -version = "0.1.3" +version = "0.1.4" authors = [ "AWS Rust SDK Team ", "Eduardo Rodrigues <16357187+eduardomourar@users.noreply.github.com>", @@ -14,7 +14,7 @@ repository = "https://github.com/awslabs/smithy-rs" aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["http-1x"]} aws-smithy-http = { path = "../aws-smithy-http" } aws-smithy-types = { path = "../aws-smithy-types" } -bytes = "1" +bytes = "1.10.0" http = "1.0.0" tracing = "0.1.40" # Note the wasi crate will only build for target wasm32-wasi, but having a target diff --git a/rust-runtime/inlineable/Cargo.toml b/rust-runtime/inlineable/Cargo.toml index a64289436..e3d8c1276 100644 --- a/rust-runtime/inlineable/Cargo.toml +++ b/rust-runtime/inlineable/Cargo.toml @@ -25,17 +25,17 @@ aws-smithy-runtime = { path = "../aws-smithy-runtime", features = ["client"] } aws-smithy-runtime-api = { path = "../aws-smithy-runtime-api", features = ["client", "test-util"] } aws-smithy-types = { path = "../aws-smithy-types" } aws-smithy-xml = { path = "../aws-smithy-xml" } -bytes = "1" +bytes = "1.10.0" fastrand = "2.3.0" -futures-util = "0.3.29" -http = "0.2.1" -http-body = "0.4" +futures-util = "0.3.31" +http = "0.2.9" +http-body = "0.4.5" md-5 = "0.10.0" -once_cell = "1.16.0" -percent-encoding = "2.2.0" -pin-project-lite = "0.2" +once_cell = "1.20.1" +percent-encoding = "2.3.1" +pin-project-lite = "0.2.14" regex-lite = "0.1.5" -tracing = "0.1.37" +tracing = "0.1.40" url = "2.5.4" [dev-dependencies] diff --git a/tools/ci-build/Dockerfile b/tools/ci-build/Dockerfile index 109f20836..1317629df 100644 --- a/tools/ci-build/Dockerfile +++ b/tools/ci-build/Dockerfile @@ -95,7 +95,7 @@ RUN set -eux; \ chmod g+rw -R /opt/cargo/registry FROM install_rust AS cargo_deny -ARG cargo_deny_version=0.16.1 +ARG cargo_deny_version=0.16.4 RUN cargo install cargo-deny --locked --version ${cargo_deny_version} FROM install_rust AS cargo_udeps diff --git a/tools/ci-build/runtime-versioner/src/command/patch.rs b/tools/ci-build/runtime-versioner/src/command/patch.rs index bf701ccdb..649675385 100644 --- a/tools/ci-build/runtime-versioner/src/command/patch.rs +++ b/tools/ci-build/runtime-versioner/src/command/patch.rs @@ -183,6 +183,19 @@ fn remove_unchanged_dependencies( .expect("failed to determine change-status") }); + let mut crates_to_patch = crates_to_patch; + for pkg in &all_crates { + if crate_is_new_and_used_by_existing_runtime(&crates_to_patch, pkg, aws_sdk_rust) + .expect("failed to determine crate status") + { + tracing::trace!( + "adding new crate `{}` to set of crates to be patched", + pkg.handle + ); + crates_to_patch.push(pkg.clone()); + } + } + for patched_crate in &all_crates { tracing::trace!( "removing unchanged path dependencies for {}", @@ -193,6 +206,50 @@ fn remove_unchanged_dependencies( Ok(crates_to_patch.into_iter()) } +/// Check if a runtime crate is new and used by the new runtime. +/// +/// This is an edge case where there is a new crate used by an existing runtime crate +/// such that failure to patch in the new crate we'll get an error because the new +/// crate won't be found. For these we need to add them to the list of crates to patch +/// in the root SDK Cargo.toml. +fn crate_is_new_and_used_by_existing_runtime( + crates_to_patch: &Vec, + runtime_crate: &Package, + aws_sdk_rust: &Repo, +) -> Result { + let sdk_cargo_toml = aws_sdk_rust + .root + .join("sdk") + .join(&runtime_crate.handle.name) + .join("Cargo.toml"); + + if sdk_cargo_toml.exists() { + // existing runtime crate + return Ok(false); + } + + // check if the new runtime crate is used by an existing crate that changed (i.e. is set to be patched) + for pkg in crates_to_patch { + let manifest = Manifest::from_path(pkg.manifest_path.clone())?; + let used = manifest + .dependencies + .iter() + .any(|(dep_name, dep_metadata)| { + runtime_crate.handle.name.as_str() + == dep_metadata.package().unwrap_or(dep_name.as_str()) + }); + if used { + tracing::trace!( + "`{}` is a new crate and used by crate set to be patched: `{}`.", + runtime_crate.handle, + pkg.handle + ); + return Ok(true); + } + } + Ok(false) +} + /// Remove `path = ...` from the dependency section for unchanged crates, /// and add version numbers for those where necessary. /// diff --git a/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs b/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs index faab55f4e..1fc2abfd3 100644 --- a/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs +++ b/tools/ci-build/sdk-lints/src/lint_cargo_toml.rs @@ -168,7 +168,10 @@ impl Lint for DocsRs { } fn files_to_check(&self) -> Result> { - Ok(all_cargo_tomls()?.collect()) + Ok(all_cargo_tomls()? + // aws-lc-fips cannot build on docs.rs, grant an exception for this crate which does not follow the same cargo.toml w.r.t docs.rs + .filter(|path| !path.to_string_lossy().contains("aws-smithy-http-client")) + .collect()) } } @@ -373,6 +376,13 @@ impl StableCratesExposeStableCrates { !(name == "aws-smithy-runtime" && ["tower_service", "serde"].contains(&tpe.as_str())) }) + // TODO(tooling): When tooling allows, specify this at the crate level. These + // are gated by the hyper-014 feature and carryover from relocating hyper-014.x + // support from aws-smithy-runtime. hyper_util is only exposed as part of test_util trait impl + .filter(|tpe| { + !(name == "aws-smithy-http-client" + && ["tower_service", "serde", "hyper_util"].contains(&tpe.as_str())) + }) .map(|crte| { LintError::new(format!( "stable crate {name} exposed {crte} which is unstable" diff --git a/tools/ci-resources/tls-stub/Cargo.toml b/tools/ci-resources/tls-stub/Cargo.toml index e0aff352a..a4067ef93 100644 --- a/tools/ci-resources/tls-stub/Cargo.toml +++ b/tools/ci-resources/tls-stub/Cargo.toml @@ -13,11 +13,9 @@ publish = false aws-config = {path = "../../../aws/sdk/build/aws-sdk/sdk/aws-config", features = ["client-hyper"] } aws-credential-types = { path = "../../../aws/sdk/build/aws-sdk/sdk/aws-credential-types", features = ["hardcoded-credentials"] } aws-sdk-sts = { path = "../../../aws/sdk/build/aws-sdk/sdk/sts" } -aws-smithy-runtime = { path = "../../../aws/sdk/build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x"] } +aws-smithy-http-client = { path = "../../../aws/sdk/build/aws-sdk/sdk/aws-smithy-http-client", features = ["rustls-aws-lc"] } exitcode = "1" -hyper-rustls = { version = "0.24", features = ["rustls-native-certs", "http2"] } -rustls = "0.21.8" -rustls-native-certs = "0.6" -rustls-pemfile = "1" tokio = { version = "1", features = ["full"] } -x509-parser = "0.15" +rustls = "0.23.23" +rustls-pemfile = "1" +x509-parser = "0.17" diff --git a/tools/ci-resources/tls-stub/src/main.rs b/tools/ci-resources/tls-stub/src/main.rs index f674d0116..54a38229c 100644 --- a/tools/ci-resources/tls-stub/src/main.rs +++ b/tools/ci-resources/tls-stub/src/main.rs @@ -3,16 +3,19 @@ * SPDX-License-Identifier: Apache-2.0 */ -use std::env; use std::fs::File; use std::io::BufReader; use std::time::Duration; +use std::{env, fs}; use aws_config::timeout::TimeoutConfig; use aws_credential_types::Credentials; use aws_sdk_sts::error::SdkError; -use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; +use aws_smithy_http_client::tls::{self, TlsContext, TrustStore}; +use aws_smithy_http_client::Builder as HttpClientBuilder; + +use rustls::pki_types::CertificateDer; #[cfg(debug_assertions)] use x509_parser::prelude::*; @@ -40,23 +43,25 @@ fn debug_cert(cert: &[u8]) { } fn add_cert_to_store(cert: &[u8], store: &mut rustls::RootCertStore) { - let cert = rustls::Certificate(cert.to_vec()); #[cfg(debug_assertions)] - debug_cert(&cert.0); - if let Err(e) = store.add(&cert) { + debug_cert(cert); + let der = CertificateDer::from_slice(cert); + if let Err(e) = store.add(der) { println!("Error adding root certificate: {e}"); unsupported(); } } -fn load_ca_bundle(filename: &String, roots: &mut rustls::RootCertStore) { +fn load_ca_bundle(filename: &String) -> TrustStore { + // test the certs are supported and fail quickly if not match File::open(filename) { Ok(f) => { let mut f = BufReader::new(f); + let mut roots = rustls::RootCertStore::empty(); match rustls_pemfile::certs(&mut f) { Ok(certs) => { for cert in certs { - add_cert_to_store(&cert, roots); + add_cert_to_store(&cert, &mut roots); } } Err(e) => { @@ -70,47 +75,40 @@ fn load_ca_bundle(filename: &String, roots: &mut rustls::RootCertStore) { unsupported(); } } + + let pem_bytes = fs::read(filename).expect("bundle exists"); + TrustStore::empty().with_pem_certificate(pem_bytes.as_slice()) } -fn load_native_certs(roots: &mut rustls::RootCertStore) { - let certs = rustls_native_certs::load_native_certs(); - if let Err(ref e) = certs { - println!("Error reading native certificates: {e}"); - unsupported(); - } - for cert in certs.unwrap() { - add_cert_to_store(&cert.0, roots); - } - let mut pem_ca_cert = b"\ +fn load_native_certs() -> TrustStore { + // why do we need a custom trust store when invoked with native certs? + // Because the trytls tests don't actually only rely on native certs. + // It's native certs AND the one replaced in the blank pem cert below + // via the `update-certs` script. + let pem_ca_cert = b"\ -----BEGIN CERTIFICATE----- -----END CERTIFICATE-----\ " as &[u8]; - let certs = rustls_pemfile::certs(&mut pem_ca_cert).unwrap(); - for cert in certs { - add_cert_to_store(&cert, roots); - } + + TrustStore::default().with_pem_certificate(pem_ca_cert) } async fn create_client( - roots: rustls::RootCertStore, + trust_store: TrustStore, host: &String, port: &String, ) -> aws_sdk_sts::Client { let credentials = get_credentials(); - let tls_config = rustls::client::ClientConfig::builder() - .with_safe_default_cipher_suites() - .with_safe_default_kx_groups() - .with_safe_default_protocol_versions() - .unwrap() - .with_root_certificates(roots) - .with_no_client_auth(); - let tls_connector = hyper_rustls::HttpsConnectorBuilder::new() - .with_tls_config(tls_config) - .https_only() - .enable_http1() - .enable_http2() - .build(); - let http_client = HyperClientBuilder::new().build(tls_connector); + let tls_context = TlsContext::builder() + .with_trust_store(trust_store) + .build() + .expect("valid TLS config"); + let http_client = HttpClientBuilder::new() + .tls_provider(tls::Provider::rustls( + tls::rustls_provider::CryptoMode::AwsLc, + )) + .tls_context(tls_context) + .build_https(); let sdk_config = aws_config::from_env() .http_client(http_client) .credentials_provider(credentials) @@ -133,21 +131,21 @@ async fn main() -> Result<(), aws_sdk_sts::Error> { eprintln!("Syntax: {} [ca-file]", argv[0]); std::process::exit(exitcode::USAGE); } - let mut roots = rustls::RootCertStore::empty(); - if argv.len() == 4 { + let trust_store = if argv.len() == 4 { print!( "Connecting to https://{}:{} with root CA bundle from {}: ", &argv[1], &argv[2], &argv[3] ); - load_ca_bundle(&argv[3], &mut roots); + load_ca_bundle(&argv[3]) } else { print!( "Connecting to https://{}:{} with native roots: ", &argv[1], &argv[2] ); - load_native_certs(&mut roots); - } - let sts_client = create_client(roots, &argv[1], &argv[2]).await; + load_native_certs() + }; + + let sts_client = create_client(trust_store, &argv[1], &argv[2]).await; match sts_client.get_caller_identity().send().await { Ok(_) => println!("\nACCEPT"), Err(SdkError::DispatchFailure(e)) => println!("{e:?}\nREJECT"), diff --git a/tools/ci-scripts/check-aws-config b/tools/ci-scripts/check-aws-config index 751999ef9..5d3cb8939 100755 --- a/tools/ci-scripts/check-aws-config +++ b/tools/ci-scripts/check-aws-config @@ -42,11 +42,11 @@ cargo hack check --feature-powerset --exclude-all-features --exclude-features al echo "${C_YELLOW}## Testing each feature in isolation${C_RESET}" # these features are missed by the following check because they are grouped -cargo hack test --each-feature --include-features rt-tokio,client-hyper,rustls --exclude-no-default-features +cargo hack test --each-feature --include-features rt-tokio,client-hyper,rustls,default-https-client --exclude-no-default-features # This check will check other individual features and no-default-features # grouping these features because they don't interact -cargo hack test --feature-powerset --exclude-all-features --exclude-features allow-compilation --group-features rt-tokio,client-hyper,rustls +cargo hack test --feature-powerset --exclude-all-features --exclude-features allow-compilation --group-features rt-tokio,client-hyper,rustls,default-https-client echo "${C_YELLOW}## Checking the wasm32-unknown-unknown and wasm32-wasip1 targets${C_RESET}" cargo check --target wasm32-unknown-unknown --no-default-features diff --git a/tools/ci-scripts/check-aws-sdk-cargo-deny b/tools/ci-scripts/check-aws-sdk-cargo-deny index 0ddd047d9..49bdfbffc 100755 --- a/tools/ci-scripts/check-aws-sdk-cargo-deny +++ b/tools/ci-scripts/check-aws-sdk-cargo-deny @@ -10,6 +10,7 @@ cd aws-sdk # Remove examples from workspace since they don't have license metadata sed -i '/"examples\//d' Cargo.toml +cargo deny --version cargo deny --all-features check \ --hide-inclusion-graph \ --config ../smithy-rs/.cargo-deny-config.toml \ diff --git a/tools/ci-scripts/check-rust-runtimes b/tools/ci-scripts/check-rust-runtimes index 377f017ab..6f01cd302 100755 --- a/tools/ci-scripts/check-rust-runtimes +++ b/tools/ci-scripts/check-rust-runtimes @@ -35,8 +35,10 @@ do echo -e "## ${C_YELLOW}Running 'cargo minimal-versions check' on ${runtime_path}...${C_RESET}" # Print out the cargo tree with minimal versions for easier debugging - cargo +"${RUST_NIGHTLY_VERSION}" minimal-versions tree || echo "cargo minimal-versions tree failed" - cargo +"${RUST_NIGHTLY_VERSION}" minimal-versions check --all-features + cargo +"${RUST_NIGHTLY_VERSION}" minimal-versions tree --direct || echo "cargo minimal-versions tree failed" + # The `--direct` flag is used to test only direct dependencies, rather than all transitive dependencies. See: + # https://doc.rust-lang.org/cargo/reference/unstable.html#direct-minimal-versions + cargo +"${RUST_NIGHTLY_VERSION}" minimal-versions check --direct --all-features for crate_path in *; do if [[ -f "${crate_path}/external-types.toml" ]]; then diff --git a/tools/ci-scripts/test-windows.sh b/tools/ci-scripts/test-windows.sh index a862d2584..c8e5153f6 100755 --- a/tools/ci-scripts/test-windows.sh +++ b/tools/ci-scripts/test-windows.sh @@ -6,7 +6,7 @@ set -eu -o pipefail -exclusions=("--exclude" "aws-smithy-http-server-python" "--exclude" "aws-smithy-http-server-typescript" "--exclude" "aws-smithy-experimental") +exclusions=("--exclude" "aws-smithy-http-server-python" "--exclude" "aws-smithy-http-server-typescript" "--exclude" "aws-smithy-http-client") for runtime_path in "rust-runtime" "aws/rust-runtime"; do echo "testing $runtime_path" pushd "${runtime_path}" &>/dev/null @@ -19,5 +19,5 @@ for runtime_path in "rust-runtime" "aws/rust-runtime"; do done # TODO(https://github.com/awslabs/aws-sdk-rust/issues/1117) We don't have a way to codegen the deps needed by the aws-config crate # (cd aws/rust-runtime/aws-config && cargo test --all-features) # aws-config is not part of the workspace so we have to test it separately -echo "Testing isolated features of aws-smithy-experimental" -(cd rust-runtime && cargo test -p aws-smithy-experimental --features crypto-ring) # only ring works on windows +echo "Testing isolated features of aws-smithy-http-client" +(cd rust-runtime && cargo test -p aws-smithy-http-client --features rustls-ring) # only ring works on windows -- GitLab