Commit Graph

548 Commits

Author SHA1 Message Date
Russell Cohen 09ba40e66b
Add FIPS support to Hyper 1.0 Client (#3539)
## Description
This does several things:
1. Upgrade to RusTLS 0.23 which enables FIPS support
2. Add smoke test of the clients. This revealed a bug where https URLs
were not supported.

This is technically a breaking change because I added `non_exhaustive`
to the CryptoMode enum.

<!--- Describe your changes in detail -->

## Testing
New integration tests. I expect this to fail in CI since I'll need to
update the build image to match.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-02 18:02:13 +00:00
Mohamed Khaled d37ac94ad9
Allow user to set `policy` and `policy_arns` in `WebIdentityTokenCredentialsProvider` builder (#3506)
Related PR: https://github.com/smithy-lang/smithy-rs/pull/1892/

## Motivation and Context
This change allows users to define inline IAM policies and/or set
predefined policies (using their ARNs) with
`WebIdentityTokenCredentialsProvider`

## Description
Adds `policy` and `policy_arns` to `WebIdentityTokenCredentialsProvider`
builder.

## Testing

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: ysaito1001 <awsaito@amazon.com>
2024-04-02 17:09:27 +00:00
Zelda Hessler 5f7113f506
Sourcing service config from the environment. (#3493)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
https://github.com/smithy-lang/smithy-rs/issues/2863
https://github.com/awslabs/aws-sdk-rust/issues/1060

## Description
<!--- Describe your changes in detail -->
This PR adds a new feature: the ability to source service-specific
config from the environment.
This is **only** supported when creating a service config from an
`SdkConfig`. I've posted [a
guide](https://github.com/smithy-lang/smithy-rs/discussions/3537) to our
discussions board.

[This also adds support for setting an endpoint URL in environment
config.](https://github.com/smithy-lang/smithy-rs/issues/2863)

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
I have written several tests ensuring config is extracted with the
correct precedence.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-04-01 14:50:31 +00:00
John DiSanti 498dc5fe85
Revert "Overhaul stalled stream protection and add upload support (#3485)" (#3534)
The stalled stream protection changes are triggering a semver hazard
that will break the release. Need to revert it temporarily to fix this
issue.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-28 19:43:32 +00:00
Russell Cohen 327e31e580
disable content length enforcement (#3524)
https://github.com/smithy-lang/smithy-rs/issues/3523

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-28 14:54:37 +00:00
John DiSanti 27834ae2cc
Overhaul stalled stream protection and add upload support (#3485)
This PR overhauls the existing stalled stream protection with a new
algorithm, and also adds support for minimum throughput on upload
streams. The new algorithm adds support for differentiating between the
user or the server causing the stall, and not timing out if it's the
user causing the stall. This will fix timeout issues when a customer
makes remote service calls in between streaming pieces of information.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-27 20:33:44 +00:00
Thomas B 2d003567e5
Make BehaviorVersion as future-proof as the documentation and RFC specify (#3513)
Fixes aws-sdk-rust#1111

This is *technically* a breaking change but since this was released
recently and it's documented that this API shouldn't be used, this can
probably be considered a bug, which is better fixed now than later.

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-03-27 00:10:10 +00:00
Russell Cohen 745d48a74e
Add a RuntimePlugin/Interceptor to enforce expected content length (#3491)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
There is a rarely-triggered bug
(https://github.com/awslabs/aws-sdk-rust/issues/1079) that can occur
when the runtime is dropped between requests. Although this is
definitely the _wrong thing to do_(tm) which should still aim to at
least protect the users from bad data in this case.

This adds an interceptor which validates that the body returned is the
correct length.

## Description
- Adds an interceptor that computes the actual content length of the
body and compares it to the actual length

## Testing
- Integration style test. Note that this is very hard to test using
Hyper because Hyper will attempt to mitigate this issue.


## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-26 18:36:06 +00:00
John DiSanti 70f6e1f339
Merge release branch back into main (#3511)
_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: AWS SDK Rust Bot <aws-sdk-rust-primary@amazon.com>
2024-03-25 14:55:47 -07:00
David Souther e858d3e262
Replace `enforce_order(bool)` with `enum RuleMode` (#3502)
RuleMode describes how rules will be interpreted.
- In RuleMode::MatchAny, the first matching rule will be applied, and
the rules will remain unchanged.
- In RuleMode::Sequential, the first matching rule will be applied, and
that rule will be removed from the list of rules.

Also adds a `make_client!` macro produces a Client configured with a
number of Rules and appropriate test default configuration.

## Motivation and Context
Working through improvements on experimental mocks after implementing
them in the Cloudwatch Logs example.

## Testing
Unit tests, doctests, 

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-20 19:51:12 +00:00
ysaito1001 3e81645f1f
Fix `sigv4-s3express` position in `auth_scheme_options` (#3498)
## Motivation and Context
Fixes an S3-related bug introduced when s3 Express was added

## Description
This PR fixes a bug where s3 Express auth flow was incorrectly used when
no auth schemes were available for an endpoint. This use case was
observed in test settings and manifested itself as a confusing behavior.

To address this issue, the fix ensures that an auth scheme for S3
express will be registered after that for sigv4 has been registered.

## Testing
Added an integration test
`s3_express_auth_flow_should_not_be_reached_with_no_auth_schemes`

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-20 16:17:36 +00:00
Zelda Hessler 0b35a092b3
Add support for env-defined endpoint URLs (#3488)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Part of the endpoint config work I'm doing

## Description
<!--- Describe your changes in detail -->
This change does two things:
- add support for setting an endpoint URL from the env or profile file
- add support for ignoring endpoint URLs sourced from the env and
profile file

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
I wrote many unit tests.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-03-15 17:23:49 +00:00
ysaito1001 2392a24ed6
Thread through `BehaviorVersion` to S3 Express identity provider (#3478)
## Motivation and Context
A follow-up task that resolves one of the `TODO(Post S3Express release)`

## Description
This PR ensures that `BehaviorVersion` is threaded through from an outer
S3 client to the inner S3 client when `DefaultS3ExpressIdentityProvider`
is constructed.

I considered the alternative where `BehaviorVersion` would be stored in
`ConfigBag`using another flavor like `StoreOnce` and obtained from the
bag within
`DefaultS3ExpressIdentityProvider::express_session_credentials`. But
ensuring `StoreOnce` per `ConfigBag` was not enough for
`BehaviorVersion` since there could be nested `ConfigBag`s where each
`ConfigBag` was separate. `BehaviorVersion` needs to be unique across
those different `ConfigBag`s and the fact that we store
`BehaviorVersion` outside `RuntimeComponents` or `ConfigBag` is a
reasonable choice from that perspective (the ease of guaranteeing the
uniqueness of `BehaviorVersion`).

## Testing
Relied on existing tests in CI.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-13 19:54:01 +00:00
Landon James 1e55d75e9a
Bumping version of `wasi` crate dependency (#3476)
## Motivation and Context
The `0.12.0` version of `wasi` suffered from a bug the could impact
users using lower versions of `wit-bindgen` dependencies. Mixed versions
of `wit-bindgen` generated bindings in a single project would cause a
symbol collision. This is fixed by newer versions of `wit-bindgen` and
`wasi = 0.12.1` contains bindings generated by one of these newer
versions. See this issue for details:
https://github.com/bytecodealliance/wit-bindgen/issues/849 and a longer
discussion of the issue on Zulip
[here](https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/Component.20failing.20to.20compile.20with.20mixed.20wit-bindgen.20versions/near/422068264).

## Description
<!--- Describe your changes in detail -->
Bumped version of `wasi` dependency in `aws-amithy-wasm` from `0.12.0`
-> `0.12.1`

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates


----

_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: John DiSanti <john@vinylsquid.com>
2024-03-12 23:04:36 +00:00
AWS SDK Rust Bot b515533c07 Update changelog 2024-03-12 18:15:51 +00:00
ysaito1001 f0c7fd7401
Bump minor for some runtime crates as part of S3 Express (#3477)
## Description
- Bump minor for `aws-sigv4` for [these
changes](https://github.com/smithy-lang/smithy-rs/pull/3465/files#diff-154d03aaceb2d08722c365acf156e47c523638765a8a645c350cff72550c80dd)
- Bump minor for `aws-smithy-runtime-api` for [these
changes](https://github.com/smithy-lang/smithy-rs/pull/3465/files#diff-daa7b9cc6f272b9b914593b1ce032b87af4fe17c351fee5608d621bdac091040)

## Testing
Existing tests in CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-11 22:59:45 +00:00
ysaito1001 f3b332da47
Add support for S3 Express One Zone (#3465)
## Motivation and Context
Allows the Rust SDK to use [S3 Express One
Zone](https://aws.amazon.com/s3/storage-classes/express-one-zone/)

## Description
The PR adds the said S3-specific functionality to the Rust SDK. The code
changes have already been reviewed by previous sub PRs, but it's worth
going through them again as a whole:
- https://github.com/smithy-lang/smithy-rs/pull/3386
- https://github.com/smithy-lang/smithy-rs/pull/3388
- https://github.com/smithy-lang/smithy-rs/pull/3390
- https://github.com/smithy-lang/smithy-rs/pull/3432
- https://github.com/smithy-lang/smithy-rs/pull/3433
- https://github.com/smithy-lang/smithy-rs/pull/3459
- https://github.com/smithy-lang/smithy-rs/pull/3457
- https://github.com/smithy-lang/smithy-rs/pull/3462

In addition to the PRs above, commit eebe8af increases the canary
lambda's memory size to 512MB from 128MB (also makes it configurable
through a command line arg for `canary-runner`). By default, lambda's
allowed memory size is 128MB but with the addition of `canary-wasm` in
main, canary lambda's memory usage will be 152MB, causing the lambda to
be killed by a signal during runtime. The commit addresses that issue.

## Testing
- Unit tests in
[aws/rust-runtime/aws-inlineable/src/s3_express.rs](7f8c28b703/aws/rust-runtime/aws-inlineable/src/s3_express.rs)
- Integration tests in
[aws/sdk/integration-tests/s3/tests/express.rs](7f8c28b703/aws/sdk/integration-tests/s3/tests/express.rs)
- Canary in smithy-rs#3462

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
Co-authored-by: AWS SDK Rust Bot <aws-sdk-rust-primary@amazon.com>
Co-authored-by: AWS SDK Rust Bot <97246200+aws-sdk-rust-ci@users.noreply.github.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: Russell Cohen <rcoh@amazon.com>
2024-03-11 16:01:48 +00:00
John DiSanti a413b9ba28
Upgrade Smithy to 1.45 (#3470)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-08 13:16:02 -08:00
John DiSanti 58a14caa79
Add support for SSO bearer token authentication to the SDK (#3453)
This PR adds support for SSO bearer token authentication to the AWS SDK,
specifically for Code Catalyst, which requires authentication via SSO
with a Builder ID using a bearer token rather than SigV4.

This functionality was developed in a feature branch, and this PR merely
merges that branch to main. The changes consist of the following
previous PRs:
- https://github.com/smithy-lang/smithy-rs/pull/3381
- https://github.com/smithy-lang/smithy-rs/pull/3442
- https://github.com/smithy-lang/smithy-rs/pull/3443

All these changes have been reviewed in the previous PRs, but it would
be good to review this again as a whole to verify it all looks good.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-06 21:24:19 +00:00
John DiSanti a884a66974
Enable event streams for all services with REST protocols (#3451)
This PR enables event stream operations for the AWS `@restJson1` and
`@restXml` Smithy protocols. This will add the missing operations
reported in https://github.com/awslabs/aws-sdk-rust/issues/1075 and
https://github.com/awslabs/aws-sdk-rust/issues/1080.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-03-01 19:12:05 +00:00
John DiSanti 827444d7a3
Update CHANGELOG.next.toml
Co-authored-by: Russell Cohen <rcoh@amazon.com>
2024-02-28 11:07:17 -08:00
John DiSanti 318dbf7565
Update authors on WASM changes in changelog 2024-02-28 10:28:09 -08:00
Caymon Sullivan d42727e331
feat(aws-smithy-types): Impl http-body-1.0 Body for SdkBody (#3380)
## Motivation and Context
A step towards moving to http-1.0
https://github.com/awslabs/aws-sdk-rust/issues/1046

(Russell): This is a minimal implementation of `http-body = 1`. It isn't
maximally efficient since even if we were given a 1x body, we convert it
back and forth first. This is a first step.

## Description
Implements http-body-1.0 Body trait for SdkBody.

## Testing
Regular CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Russell Cohen <rcoh@amazon.com>
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
Co-authored-by: John DiSanti <john@vinylsquid.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2024-02-28 01:37:54 +00:00
Landon James d95cc86400
Add `aws-smithy-wasm` crate with WASI http client (#3409)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
This change adds a new crate, `aws-smithy-wasm`, that exports a SDK
compatible WASI http client. This is a continuation of the work in #2520
using the now stabilized WASI 0.2.0 interfaces from the [wasi
crate](https://crates.io/crates/wasi). This supports, but does not
finalize the work for #2087

## Description
<!--- Describe your changes in detail -->

Add a new crate, `aws-smithy-wasm` which exports a function
`wasi_http_client` that will provide the user with a WASI compatible
http client. This client is implemented by using the
`wasi::http::outgoing_handler`
[ref](https://docs.rs/wasi/0.12.0+wasi-0.2.0/wasi/http/outgoing_handler/index.html)
along with some utility implementations of `TryFrom` to transform back
and worth between the types from the `http` crate and the `wasi::http`
types. It also exports a unit struct `WasmSleep` that impls the
`AsyncSleep` trait needed by the SDK.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
This is tested via an integration test in
`aws/sdk/integration-tests/webassembly` that uses the wasi http-client
to vuild a config and an operation (that is not sent). It is further
tested in a new canary (`wasm_canary`) that calls the S3
`list_objects_v2` API.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_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: Eduardo Rodrigues <eduardomourar@users.noreply.github.com>
Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Russell Cohen <rcoh@amazon.com>
Co-authored-by: John DiSanti <john@vinylsquid.com>
2024-02-27 23:40:42 +00:00
Jack Kleeman 07c8074ce5
Support EKS Pod Identity credentials (#3416)
## Motivation and Context
I would like to support EKS Pod Identity credentials in the Rust SDKs

## Description
This brings the ECS provider in line with other sdks (eg, Go) by
supporting AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE as well as permitting
http IPs to be non-loopback if they are the EKS pod identity IPs.

## Testing
I have added various new unit tests, and I have updated the existing
integration test to also create pods with eks pod identity creds, which
I have used to test in a real EKS cluster as well.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Signed-off-by: Jack Kleeman <jackkleeman@gmail.com>
Co-authored-by: John DiSanti <john@vinylsquid.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2024-02-23 23:03:46 +00:00
AWS SDK Rust Bot 56f83344f2 Update changelog 2024-02-22 22:35:58 +00:00
Russell Cohen 40f44cee6c
Rust msrv 1.74 (#3410)
## Motivation and Context
Update MSRV to 1.74

## Description
Normal slate of things, mostly appeasing clippy.

----

_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: John DiSanti <jdisanti@amazon.com>
2024-02-16 21:15:48 +00:00
AWS SDK Rust Bot 19648ace5f Update changelog 2024-02-15 19:43:00 +00:00
Russell Cohen 1ea9d055f0
Change timeout settings to merge them when configuration is merged (#3405)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
For context, see
https://github.com/smithy-lang/smithy-rs/discussions/3408

## Description
<!--- Describe your changes in detail -->
- During `invoke`, load all timeout configs and merge them via a custom
loader.
- Fix config bag bugs that prevented using a Stored type that differed
from `T`.
- Add new e2e and codegen integration test validating that timeout
settings are properly merged.
- Add fallback for an empty timeout config being equivalent to
`TimeoutConfig::disabled`.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-02-13 20:19:07 +00:00
John DiSanti f573cc2234
Only create inner chain provider once in profile creds provider (#3387)
The `SsoCredentialsProvider` maintains an in-memory expiring cache of
SSO tokens, and this cache is maintained within its instance. The
`ProfileFileCredentialsProvider`, which uses `SsoCredentialsProvider` as
a base/inner provider, is currently reconstructing the inner provider
every time it loads credentials, which discards the SSO token cache
entirely.

This PR refactors the `ProfileFileCredentialsProvider` to cache the
inner provider so that it is only initialized once on first load of
credentials. This is done via a new `ErrorTakingOnceCell` abstraction
since the same init-caching mechanism will be needed for the
`ProfileFileTokenProvider` when it is implemented.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-12 18:43:05 +00:00
ysaito1001 166f0e29dd
Cap the max jitter fraction for cache refresh buffer time to 0.5 (#3402)
## Description
Via code inspection, we have identified that there is a potential bug in
`DEFAULT_BUFFER_TIME_JITTER_FRACTION`. Specifically, if the fraction
happens to be set to 1.0, we end up not respecting the buffer time for
cache refresh (see diagrams in #2335). This PR will cap the max fraction
value to 0.5 to avoid the problem.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-02-09 19:57:33 +00:00
Zelda Hessler df1103d1fd
Implement and test retry classifier sorting (#3392)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
#3322

## Description
<!--- Describe your changes in detail -->
I gave classifiers priorities but never actually sorted them. This PR
fixes that.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
I wrote a test

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-02-09 17:19:21 +00:00
Russell Cohen 5761d1fe12
Make it possible to customize presigned requests (#3385)
## Motivation and Context
This enables the following code:
```rust
    let req = client
        .get_object()
        .bucket("foo")
        .key("bar")
        .customize()
        .mutate_request(|req| {
            req.set_uri(req.uri().to_string() + "&a=b")
                .expect("failed to update URI")
        })
        .presigned(static_ps_config)
        .await
```
Previously, it wasn't possible to presign a request once customization
had begun.


## Description
- Follow the same pattern as send by introducing an additional trait,
CustomizeablePresign
- change InvokeWithStopPoint to actually _return_ the error if there is
one.

## Testing
New integration test

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
- [x] Conditionally generate the presign method

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-02-07 20:04:52 +00:00
Prince Kumar Maurya 4187b639f1
Adding impl Display for enum (#3391)
## Motivation and Context
This change address the
[#3335](https://github.com/smithy-lang/smithy-rs/issues/3336)

## Description
Added Display trait to the Enum. 

## Testing
Updated the
[ClientEnumGeneratorTest.kt](https://github.com/smithy-lang/smithy-rs/blob/main/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientEnumGeneratorTest.kt)
which test the ```impl Display``` for the enums.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
----

_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: Prince Kumar Maurya <princekumarmaurya06@gmail.com>
2024-02-07 16:55:11 +00:00
Russell Cohen 8873666b0e
Add http = "1.0" support to the `http` request wrapper (#3373)
## Motivation and Context
- aws-sdk-rust#977
- smithy-rs#3365

## Description
Add `try_from` and `try_into` for HTTP 1.x to the HTTP request/response
wrapper. This is a stepping stone en route to supporting Hyper 1.0

## Testing
- [x] New unit tests

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-01-25 17:32:34 +00:00
AWS SDK Rust Bot d868407c5d Update changelog 2024-01-24 19:24:14 +00:00
John DiSanti b50c2baf1f
Implement support for `sso-session` in AWS config file (#3379)
This PR implements parsing support for `[sso-session name]` in the
`~/.aws/config` file.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-24 17:03:05 +00:00
John DiSanti 4c256ef020
Move `aws-http` types into `aws-runtime` (#3355)
This issue addresses a semver compatibility problem similar to the one
described in https://github.com/smithy-lang/smithy-rs/pull/3318, except
for the storable types in the aws-http crate. I opted to move all of
aws-http into aws-runtime since there was so little in there.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-23 22:10:34 +00:00
AWS SDK Rust Bot 4d7c84c5dc Update changelog 2024-01-18 18:00:40 +00:00
Russell Cohen e9abec67cf
Update sigv4 to allow applying signature to http1x URIs (#3366)
## Motivation and Context
- https://github.com/awslabs/aws-sdk-rust/issues/1041

## Description
Enable signing Http 1x requests.

## Testing
Unit tests

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-17 19:17:45 +00:00
Russell Cohen 336243c4e7
store identity resolvers in a map (#3363)
## Motivation and Context
- aws-sdk-rust#901
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
Identity resolvers aren't a list—they are a map keyed on AuthSchemeId.
This updates the internal representation to match.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2024-01-12 21:03:02 +00:00
John DiSanti 30a801a8fc
Fix subtle break of endpoint prefixes due to semver (#3318)
When we released smithy-rs release-2023-12-08, we introduced a silent
failure for endpoint prefixes, and not in the newly released version,
but in the previous releases. There is a subtle issue with semver that
causes this. This PR addresses the endpoint prefix part of this problem.
Other PRs will fix other parts that are broken by this semver issue.

The issue is that unstable (0.x) runtime crates are declaring types that
get placed into the `ConfigBag`, and these types are referenced in the
`ConfigBag` across crate boundaries. This by itself isn't a problem, but
because our stable 1.x crates depend on the unstable crates, it becomes
a problem. By releasing 1.1.0 that depends on 0.61, consumers of 1.x
pull in both 0.60 and 0.61. The generated code pulls in 0.60, and the
1.1.x crates pull in 0.61. This is fine since two semver-incompatible
crate versions can be in the dependency closure. Thus, the generated
code which is using 0.60 is placing a 0.60 type in the `ConfigBag`, and
the runtime crates that pull the type out of the `ConfigBag` are
expecting a 0.61 version of it. This leads to the type not existing upon
lookup, which then causes the silent break.

This PR fixes this by moving the `EndpointPrefix` type and its
associated methods into `aws-smithy-runtime-api`, a stable crate. The
`aws-smithy-http` unstable crate is updated to point to the new stable
version so that a patch release of that crate will solve the issue for
old versions going forward as well.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-12 20:03:16 +00:00
John DiSanti e3f0de42db
Move `Metadata` config bag type into a stable crate (#3325)
This issue addresses a semver compatibility problem similar to the one
described in #3318, except for the
`aws_smithy_http::operation::Metadata` type.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-12 19:11:29 +00:00
AWS SDK Rust Bot 4bdd9dab74 Update changelog 2024-01-10 15:22:38 +00:00
Russell Cohen 49622b204c
Make profile keys case-insensitive (#3344)
## Motivation and Context
- https://github.com/aws/aws-sdk/issues/574
- https://github.com/awslabs/aws-sdk-rust/issues/1020

## Description
To match the CLI behavior and improve customer experience, make the keys
on the profile file case-insensitive.

## Testing
- New credentials integration test

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-09 14:23:20 +00:00
Russell Cohen e652d6a693
Add 'as-service-error' to simplify handling of specific error conditions (#3333)
## Motivation and Context
aws-sdk-rust#1010

## Description
Add `as-service-error` helper function to cleanup handling of service
error

## Testing
UT

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-01-04 21:45:11 +00:00
Erlend Langseth 7541fe7fc8
Stream implementation (wrapper) for PaginationStream (#3299)
## Motivation and Context
https://github.com/awslabs/aws-sdk-rust/discussions/995

## Description
I tried to implement futures::Stream for a wrapper struct around
`PaginationStream`. I am unsure if I did it in the best way. After
fighting with the borrow checker for a while I decided to try
`Arc<Mutex<_>>` - is this the way to go or does there exist a better
way?
Even then, does the code look correct? I used it in my project and my
integration tests do pass but I am not 100% that these tests will catch
any error in paginated ListObjectsV2.

I would appreciate any feedback so far.

## Testing
In progress while waiting for feedback on code

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates


_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: Russell Cohen <rcoh@amazon.com>
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
2024-01-02 17:36:00 +00:00
Russell Cohen fc3ba64f64
Merge branch 'main' into source-partitions-json 2023-12-20 14:36:06 -05:00
Russell Cohen ee5ae957fd
Update CredentialsProcess to support no-expiry credentials (#3335)
## Motivation and Context
- aws-sdk-rust#1021

## Description
Fix bug in CredentialsProcess provider where expiry was erroneously
required

## Testing
- unit test

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-20 17:50:57 +00:00
Russell Cohen d89cbb0104 Update changelog 2023-12-20 10:29:51 -05:00
ysaito1001 fe9f492c44 Merge remote-tracking branch 'origin/smithy-rs-release-1.x.y' into merge-smithy-rs-release-1.x.y-to-main 2023-12-15 14:10:23 -06:00
Miles Ziemer 345624eb6c
Ignore actual default value instead of 0/false (#3252)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Previously, there was logic used to ignore the default 0/false values
for numbers/booleans when serializing members if they weren't boxed.
This was to fix issues that occured when upstream models didn't properly
box shapes that were meant to be optional, and for the most part worked
because services would just fill in the default if it wasn't passed.
However, with Smithy 2.0, models may have defaults != 0/false, but the
codegenerator still ignores the zero value.

## Description
<!--- Describe your changes in detail -->
This commit makes it so that the actual default value for the member is
ignored for booleans and numbers, instead of just 0/false. It also
updates serialization for http bindings so that headers and query
parameters with 0/false values aren't ignored if they are optional
parameters.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
- [x] Generated AWS SDK and inspected diff. Only changes are not
ignoring default value inside `if let Some() = ...` blocks, and ignoring
default value instead of just 0 (only seems to effect nimble).
- [x] Added protocol tests for serializing 0/false in query params for
restXml and restJson

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <john@vinylsquid.com>
2023-12-15 16:37:36 +00:00
Russell Cohen 7dfd6097c3
Add support for constructing sdk body types from http-body 1.0 (#3300)
## Motivation and Context
- aws-sdk-rust#977


## Description
The first of several PRs to make add support for Hyper 1.0. This minimal
change allows the use of Hyper 1.0 bodies although it does not actually
leverage Hyper 1.0.

## Testing
- Unit test suite
- Ran cargo hack check --feature-powerset because we had a lot of
features. I found a couple of issues.


## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2023-12-13 20:57:00 +00:00
AWS SDK Rust Bot 49dae16604 Update changelog 2023-12-11 22:22:27 +00:00
ysaito1001 9f0ba850e0
Reexport `EventReceiver` in a generated client crate (#3305)
## Motivation and Context
Adds re-export for `EventReceiver` in a generated client crate

## Description
`EventReceiver` was added in
https://github.com/smithy-lang/smithy-rs/pull/3114 but the struct itself
could not be referenced as `pub`. Our SDK integration tests did not
break in the said PR because they only called the `next` method on it
and never referred to that struct name.

This PR adds a re-export for `EventReceiver` in case customers need to
refer to the name in their code.

## Testing
Added a unit test and edited a `transcribestreaming` integration test to
verify the re-export.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: AWS SDK Rust Bot <aws-sdk-rust-primary@amazon.com>
2023-12-11 21:17:35 +00:00
AWS SDK Rust Bot 17bcdb1db5 Update changelog 2023-12-08 22:39:53 +00:00
Russell Cohen 4d3d19382e
Merge branch 'main' into docs-attr 2023-12-08 16:13:41 -05:00
Russell Cohen 0bcc193628 Add the `docsrs` autocfg attr to all crates
This also adds it to generated crates, and adds an autofix+lint to manage these attributes.
2023-12-08 10:24:19 -05:00
Russell Cohen b09b02f332
Allow lossless conversions from float into integral types (#3294)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Some APIs return JSON values that are intended to be represented by
integral types but are returned as floating values e.g `[1.0, -2.0,
25.0]`.

This allows those values to be converted into Integral types.

## Description

This uses a bidirectional conversion to check if a float can be
losslessly converted into a integral type. This can have issues at the
limits of i64::MAX but I think that's probably acceptable. These values
would be represented imprecisely by floats already.

## Testing
Added additional unit tests of the behavior.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-08 15:19:29 +00:00
Declan Kelly b78367cbe0
Record TCP connection local socket address in metadata (#3286)
## Motivation and Context
I want to use this field to uniquely identify TCP connection based on
their `local_addr` + `remote_addr`.

See https://github.com/awslabs/aws-sdk-rust/issues/990 for additional
motivation for this change.

## Description
- Add a new optional `local_addr` field in the `ConnectionMetadata`
struct.
- Transfer the `local_addr` `SocketAddress` from the `hyper::HttpInfo`
to the `ConnectionMetadata` field.
- Add to the `trace-serialize` example program so that it will print out
the capture connection values.

## Testing
`cargo test` in `rust-runtime/aws-smithy-runtime-api` and
`aws-smithy-runtime`.

Also ran:
```
thedeck@c889f3b04fb0 examples % cargo run --example trace-serialize
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `/Users/thedeck/repos/github/declanvk/smithy-rs/target/debug/examples/trace-serialize`
2023-12-06T00:13:15.605555Z  INFO lazy_load_identity: aws_smithy_runtime::client::identity::cache::lazy: identity cache miss occurred; added new identity (took Ok(296µs))
2023-12-06T00:13:15.608344Z  INFO trace_serialize: Response received: response=Response { status: StatusCode(200), headers: Headers { headers: {"content-type": HeaderValue { _private: "application/json" }, "content-length": HeaderValue { _private: "17" }, "date": HeaderValue { _private: "Wed, 06 Dec 2023 00:13:15 GMT" }} }, body: SdkBody { inner: BoxBody, retryable: false }, extensions: Extensions }
2023-12-06T00:13:15.608388Z  INFO trace_serialize: Captured connection info remote_addr=Some(127.0.0.1:13734) local_addr=Some(127.0.0.1:50199)
2023-12-06T00:13:15.608511Z  INFO trace_serialize: Response received POKEMON_SERVICE_URL=http://localhost:13734 response=GetServerStatisticsOutput { calls_count: 0 }
```

You can see the log line with "Captured connection info" contains the
`remote_addr` and the `local_addr` fields.

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Declan Kelly <thedeck@amazon.com>
2023-12-06 19:05:47 +00:00
John DiSanti 04aa4c815b
Fix docs in hyper_014 module (#3282)
Moves the doc comments from HyperConnector to HyperClientBuilder where
they're more relevant, and fixes the examples.

This fix is for https://github.com/awslabs/aws-sdk-rust/issues/986.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-05 17:59:23 +00:00
John DiSanti 85d2621b7c
Improve error messaging for auth scheme selection (#3277)
This patch adds a stack-allocated list of explored auth schemes and the
reason each didn't work to the auth orchestrator so that its error
message is much easier to decipher.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-04 19:27:39 +00:00
Russell Cohen 2cac4d7f56
Improve docs no credentials (#3279)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
- aws-sdk-rust#971

## Description
Add documentation to `no_credentials` and add `test_credentials()`
method

## Testing
CI

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
2023-12-01 21:15:13 +00:00
John DiSanti 9587dbc061
Lazy initialize the default HTTP client (#3262)
This change initializes the TLS trust certs at base client validation
time rather than upon creation of the default HTTP client runtime plugin
so that if the default is overridden, that initialization doesn't need
to take place. This is especially helpful on MacOS where that
initialization takes approximately 100 milliseconds.

----

_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: Russell Cohen <rcoh@amazon.com>
2023-11-30 23:03:42 +00:00
John DiSanti 5b93fd2f4a
Improve client init time by switching to regex-lite (#3269)
Each client initialization was taking between 1 and 2 milliseconds,
regardless if the client had been constructed before or not. For
example, if a customer wants five clients with different credentials
providers, that could be 10 milliseconds of time spent in
`Client::from_conf`. Approximately 98% of this time was spent compiling
regular expressions for the endpoint partition resolver.

This change switches everything over to the regex-lite crate, which has
faster regex compile times, and shouldn't have much of an impact on
performance for our specific use-cases (small strings, only evaluated at
client initialization).

The use of regex was entirely removed in aws-sigv4 since it was overkill
for what it was being used for.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-30 19:28:07 +00:00
AWS SDK Rust Bot 9a66e88ca5 Update changelog 2023-11-17 23:56:42 +00:00
Russell Cohen 404f402e59
Feature-gate http versions in aws-smithy-runtime-api (#3236)
## Motivation and Context
Without this, we will have http = 0.2 permanently in-tree.

## Description
- Add feature gate for http 02x. 
- ~Add http 1x as an experiment.~

## Testing
CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-17 15:00:56 -08:00
ysaito1001 f17aeb4d53 Remove #[doc(hidden)] from stable crates (#3226)
This PR removes `#[doc(hidden)]` from types/functions in stable crates
(as defined in
[CrateSet.kt](ad520b080a/buildSrc/src/main/kotlin/CrateSet.kt (L19-L33))).
They are now `pub`, however, for those that are not intended to be used
directly, we preserve the original docs to be explicit about it.

After this PR, stable crates contain neither
<details>
<summary>#[doc(hidden)]</summary>

```
➜  smithy-rs git:(ysaito/remove-doc-hidden) rg -l '#\[doc\(hidden\)\]'
aws/rust-runtime/aws-http/src/user_agent.rs
CHANGELOG.next.toml
CHANGELOG.md
rust-runtime/aws-smithy-http/src/lib.rs
rust-runtime/aws-smithy-http/src/event_stream/sender.rs
rust-runtime/aws-smithy-http/src/event_stream/receiver.rs
codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/error/ErrorImplGenerator.kt (this is only for CodegenTarget.SERVER)
codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/StructureGeneratorTest.kt
design/src/server/instrumentation.md
design/src/rfcs/rfc0039_forward_compatible_errors.md
design/src/rfcs/rfc0032_better_constraint_violations.md
design/src/rfcs/rfc0026_client_crate_organization.md
rust-runtime/aws-smithy-http-server/src/macros.rs
rust-runtime/aws-smithy-http-server/src/routing/mod.rs
rust-runtime/aws-smithy-http-server/src/shape_id.rs
rust-runtime/aws-smithy-http-server/src/body.rs
rust-runtime/aws-smithy-http-server/src/lib.rs
rust-runtime/aws-smithy-http-server/src/plugin/mod.rs
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/MapConstraintViolationGenerator.kt
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/CollectionConstraintViolationGenerator.kt
```
</details>

nor

<details>
<summary>DocHidden</summary>

```
➜  smithy-rs git:(ysaito/remove-doc-hidden) rg -l 'DocHidden'
codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerBuilderConstraintViolations.kt
```
</details>

<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Russell Cohen <rcoh@amazon.com>
2023-11-17 14:34:17 -06:00
Russell Cohen caf86d3f98 Add Display impl for DateTime (#3235)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
It implements Display trait For DateTime

<!--- If it fixes an open issue, please link to the issue here -->
https://github.com/smithy-lang/smithy-rs/issues/3161

## Description
<!--- Describe your changes in detail -->
I implemented Display trait for DateTime

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->

I used this test
```rust
    fn test_display_formatting() {
        // Create a DateTime instance for testing
        let datetime = DateTime {
            seconds: 1636761600, // Example timestamp (replace with your actual timestamp)
            subsecond_nanos: 123456789, // Example subsecond nanos (replace with your actual value)
        };

        // Expected RFC-3339 formatted string
        let expected = "2021-11-13T00:00:00.123456789Z";

        // Format the DateTime using Display trait
        let formatted = format!("{}", datetime);

        // Assert that the formatted string matches the expected result
        assert_eq!(formatted, expected);
    }
```

<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Hakan Vardar <hakovardo123@gmail.com>
2023-11-17 14:34:17 -06:00
John DiSanti 04ede19216 Remove deprecations from rust-runtime (#3222)
This PR removes deprecations throughout smithy-rs client and the SDK.
Some of these deprecations were ignored by the compiler (in the case
where `#[deprecated]` was used with `pub use`), so these will need to be
explicitly called out in the changelog.

----

_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: Russell Cohen <rcoh@amazon.com>
2023-11-17 14:34:17 -06:00
Miles Ziemer a055471ead Remove defaults for more services (#3228)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Removing defaults from these shapes may not have a codegen impact since
these are in top level input, but doing this just to be safe from future
changes.

## Description
<!--- Describe your changes in detail -->
Adds more services/shapes to RemoveDefaultsDecorator, which will have
their models changed in the future. Also updates RemoveDefaults to allow
for members to be present in the list.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
- Updated unit test for RemoveDefaults
- Generated clients and looked at the output code

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-17 14:34:17 -06:00
Russell Cohen 0d80212a32
Avoid overflow in exponential backoff computation (#3229)
## Motivation and Context
aws-sdk-rust#960

## Description
Use checked_pow to avoid overflow in backoff computation

## Testing
- unit test

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-17 17:45:50 +00:00
Zelda Hessler 768237a539
Feature: Stalled stream protection (#3202)
[See the upgrade guide for this feature to learn
more.](https://github.com/awslabs/aws-sdk-rust/discussions/956)

The breaking change is to the `MinimumThroughputBody::new` method.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
#1562

## Description
<!--- Describe your changes in detail -->
https://github.com/awslabs/aws-sdk-rust/discussions/956

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
I added several tests

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Russell Cohen <rcoh@amazon.com>
2023-11-17 15:01:18 +00:00
Miles Ziemer ad520b080a
Remove invalid defaults for some services (#3217)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

Some services have generated types with properties that have a default
value of zero. This can cause invalid requests if the service expects a
value > 0.

## Description
<!--- Describe your changes in detail -->

Adds a customization that removes the default value for services with
this issue.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
- Added a test for the customization to make sure defaults were removed.
- Generated clients for the impacted services and verified the expected
types had the default value removed.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Russell Cohen <rcoh@amazon.com>
2023-11-17 02:57:26 +00:00
AWS SDK Rust Bot 77227c8ad5 Update changelog 2023-11-16 23:32:31 +00:00
Russell Cohen e6369509ed
Pre-emptively update the S3 model with transform (#3213)
## Motivation and Context
S3 models is being updated but this creates issues with
examples-compilation. This fixes that issue by pre-emptively updating
the model so we can synchronize codegen and examples updates

## Testing
- [x] generated S3, verified the same compilation errors

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-16 21:04:20 +00:00
Russell Cohen 31625f5bac
Assorted cleanups of stable runtime crates (#3205)
## Motivation and Context
Stable crates MUST only expose other stable crates.

## Description
 This:
- fixes the remaining issues
- adds a lint tool to be sure we don't expose unstable crates by
accident in the future

## Testing
CI run

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-16 18:33:42 +00:00
AWS SDK Rust Bot 3cac667f7f Update changelog 2023-11-15 23:14:58 +00:00
John DiSanti 572c5d7650
Rename behavior versions and associated functions (#3204)
The previous names are just too verbose. This PR shortens them and tries
to make things clearer.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-15 11:35:22 -08:00
John DiSanti c830caa281
Revise unhandled error variant according to RFC-39 (#3191)
This PR implements
[RFC-39](https://github.com/smithy-lang/smithy-rs/blob/main/design/src/rfcs/rfc0039_forward_compatible_errors.md)
with a couple slight deviations:
- No `introspect` method is added since `Error` already implements
`ProvideErrorMetadata`.
- The same opaqueness and deprecation pointer is applied to the enum
unknown variant for consistency.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-15 10:12:13 -08:00
Russell Cohen 446326c537
Add support for BehaviorMajorVersions (#3151)
## Motivation and Context
See [rendered
RFC](df518bfb59/design/src/rfcs/rfc0039_behavior_major_versions.md)

## Description
This add `BehaviorMajorVersions` to the SDK and wires them in up and
down the stack.

## Testing
- [x] lots of ITs / UTs

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-14 22:06:10 +00:00
codypenta 4128662936
Fix error struct with default impl (#3190)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

When an error member has a default value, it will generate errors
(specifically is_none not found on type String) with smithy-rs client
unless you manually specify @required

More Here: #3182

## Description
<!--- Describe your changes in detail -->

Adds recomendation change to address error structures with a default
implementation like so:

```kotlin
if (errorMessageMember != null) {
    val symbol = symbolProvider.toSymbol(errorMessageMember)
    if (symbol.isOptional()) {
        rust(
            """
            if tmp.message.is_none() {
                tmp.message = _error_message;
            }
            """,
        )
    }
}
..... 
```


```smithy
@error("client")
structure Error {
    @required
    requestId: String

    @required
    message: String

    code: String = "400"

    context: String
}
```

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

Added the above and ran `./gradlew codegen-client-test:build` with a
build successful

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: John DiSanti <john@vinylsquid.com>
2023-11-14 21:21:18 +00:00
Russell Cohen 910d42dd8b Merge remote-tracking branch 'origin/smithy-rs-release-0.57.x' into merge-0.57-to-main 2023-11-14 15:51:14 -05:00
AWS SDK Rust Bot e7cd72a193 Update changelog 2023-11-14 19:22:56 +00:00
John DiSanti cbcbed95d9
Implement ProvideErrorMetadata for service errors (#3189)
This PR implements the `ProvideErrorMetadata` trait for service errors
as a prerequisite for implementing
[RFC-39](https://github.com/awslabs/smithy-rs/blob/main/design/src/rfcs/rfc0039_forward_compatible_errors.md).

Related SDK issue: https://github.com/awslabs/aws-sdk-rust/issues/780

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-14 19:14:30 +00:00
Russell Cohen ccab4b69bd Clean up re-exports and improve 'BuildError' conversions (#3173)
## Motivation and Context
- Fixes #3171 
- Fixes #3155 
- Fixes #3172 


## Description
- Add `configReExport` to make it easy and consistent to re-export types
into the config module when they are used!
- Add this for a bunch of types and clean up some (now) dead code
- Re export `BuildError`
- Enable converting from `BuildError` into `SdkError`

There are probably more places this can be used, but I'd like to keep
this change small to facilitate easy backport to 0.57.

## Testing
CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-13 13:31:21 -05:00
ysaito1001 3af97de96e Ensure identity resolver is set when a credentials provider is given only at operation level (#3156)
Fixes https://github.com/awslabs/aws-sdk-rust/issues/901

This PR is a rework of https://github.com/awslabs/smithy-rs/pull/3021
whose fix was inadvertently discarded during
https://github.com/awslabs/smithy-rs/pull/3077. The way we fix the issue
is slightly different. In this PR, we add an identity resolver to
runtime components within `set_credentials_provider`, instead of using
`ServiceConfig.OperationConfigOverride`.

Added a Kotlin integration test to `CredentialProviderConfigTest.kt`
based on the customer reported issue.

<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-13 13:31:01 -05:00
John DiSanti d4e2745cfc
Move `RequestId` to aws-types (#3160)
This PR moves `RequestId` into the aws-types stable crate.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-10 18:18:17 -08:00
John DiSanti 7eb008c4f7
Create the HTTP `Response` wrapper types (#3148)
For the same reason that the request wrapper types were created in
#3059, this PR establishes the response wrapper types and refactors
existing code to use them.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-10 16:56:04 -08:00
AWS SDK Rust Bot 0a446ede9e
Merge smithy-rs-release-0.57.x back into main (#3178) 2023-11-10 17:40:49 -05:00
Russell Cohen acbe8ce65f
Clean up re-exports and improve 'BuildError' conversions (#3173)
## Motivation and Context
- Fixes #3171 
- Fixes #3155 
- Fixes #3172 


## Description
- Add `configReExport` to make it easy and consistent to re-export types
into the config module when they are used!
- Add this for a bunch of types and clean up some (now) dead code
- Re export `BuildError`
- Enable converting from `BuildError` into `SdkError`

There are probably more places this can be used, but I'd like to keep
this change small to facilitate easy backport to 0.57.

## Testing
CI

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-10 21:15:11 +00:00
Russell Cohen bf692d57d0 Merge remote-tracking branch 'origin/smithy-rs-release-0.57.x' into merge-smithy-rs-release-0.57.x-to-main 2023-11-10 16:03:21 -05:00
Russell Cohen 8a62635094 Merge commit '426e77f' into smithy-rs-release-0.57.x-backport-snapshot-fix 2023-11-10 15:18:02 -05:00
Utkarsh Gupta 7f8fef2626
Return impl AsyncBufRead from into_async_read (#3164)
## Motivation and Context
The tokio `StreamReader` implements `AsyncBufRead`, but we're returning
`AsyncRead` currently. If a user needs an `AsyncBufRead`, then they've
to wrap the returned value in tokio `BufReader` for no reason. Since
`ByteStream` doesn't implement `Stream` anymore, one has to either wrap
the returned value unnecessarily or write a wrapper similar to this
function.
See
https://github.com/smithy-lang/smithy-rs/pull/2983#discussion_r1380822997.

## Description
Simply changed the return type to say `impl AsyncBufRead`. Since
`AsyncBufRead` is a super-set of `AsyncRead`, this is not a breaking
change.

## Testing
The code example tests it.

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Russell Cohen <rcoh@amazon.com>
2023-11-10 16:42:44 +00:00
ysaito1001 9a82b44488
Ensure identity resolver is set when a credentials provider is given only at operation level (#3156)
## Motivation and Context
Fixes https://github.com/awslabs/aws-sdk-rust/issues/901

## Description
This PR is a rework of https://github.com/awslabs/smithy-rs/pull/3021
whose fix was inadvertently discarded during
https://github.com/awslabs/smithy-rs/pull/3077. The way we fix the issue
is slightly different. In this PR, we add an identity resolver to
runtime components within `set_credentials_provider`, instead of using
`ServiceConfig.OperationConfigOverride`.

## Testing
Added a Kotlin integration test to `CredentialProviderConfigTest.kt`
based on the customer reported issue.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-10 05:20:22 +00:00
ysaito1001 f9c05262e0
Avoid exposing `aws_smithy_http::event_stream::receiver::Receiver` in SDK's public API (#3114)
## Motivation and Context
Implements #3100 

## Description
Currently, we expose `aws_smithy_http::event_stream::Receiver` in
generated SDKs, as shown in the following S3's example (see[ a generated
diff](https://d2luzm2xt3nokh.cloudfront.net/codegen-diff/cc303ab1a07693ab02d5ec4f06101b628d1dbabe/1aa6a8da7d2b7669ba3ab7179a1fd72aadc03162/aws-sdk-ignore-whitespace/index.html)
for
`tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/select_object_content/_select_object_content_output.rs`):
```
pub struct SelectObjectContentOutput {
    <p>The array of results.</p>
    pub payload: ::aws_smithy_http::event_stream::Receiver<
        crate::types::SelectObjectContentEventStream,
        crate::types::error::SelectObjectContentEventStreamError,
    >,
...
```

This PR wraps `Receiver` in a new-type, called `EventReceiver`, which
then supports `pub async fn recv` method whose signature is the same as
`aws_smithy_http::event_stream::Receiver::recv`.

## Testing
Relied on existing tests (e.g. `s3` and `transcribestreaming`
integration tests cover uses cases affected by this change).

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-07 02:33:01 +00:00
ysaito1001 c296e8e999
Move `Message`, `Header`, `HeaderValue`, and `StrBytes` from `aws-smithy-eventstream` to `aws-smithy-types` (#3139)
## Motivation and Context
Fixes the following statement in
https://github.com/awslabs/smithy-rs/pull/3114

> A notable breaking change is the error type of the new recv method.
Previously, it was [SdkError<E,
RawMessage>>](https://docs.rs/aws-smithy-http/0.57.0/aws_smithy_http/event_stream/struct.Receiver.html#method.recv)
but it is now a BoxError. This means that upon an event receive error,
customers can only show what the error is, but not match on it and take
some actions.

so that the `recv` method on a new-type wrapper
`aws_smithy_http::event_stream::Receiver` can expose `SdkError<E,
RawMessage>>` in public API. It is the responsibility of the above PR to
move
[RawMessage](c7f0d5dc33/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs (L92-L98))
from `aws-smithy-http` to `aws-smithy-types` but doing so first requires
`Message` to be moved to `aws-smithy-types`, hence this PR.


## Description
Moving `Message` to `aws-smithy-types` also requires moving the types it
depends upon, namely `Header`, `HederValue`, and `StrBytes`. However,
their serialization/deserialization methods (`read_from` and `write_to`)
remain in `aws-smithy-eventstream` and they are converted to free
functions, with the aim of moving things as minimally as possible.

`aws-smithy-eventstream` has fuzz testing. It previously implemented the
`Arbitrary` trait for moved types, but since they are now in
`aws-smithy-types`, we need to have newtypes for them to enable the
trait due to the orphan rules. A newly added module
`aws-smithy-eventstream::arbitrary` is exactly for that purpose.

## Testing
Relied on the existing tests.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-06 20:00:31 +00:00
John DiSanti 8abeb04f5e
Move http types out of client and split headers out of request (#3138)
This PR moves the HTTP types into the root of aws-smithy-runtime-api
since they're not client-specific, and the serializers/deserializers
will need to rely on them. It also refactors the headers and errors out
of the request module.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-02 17:48:31 +00:00
Russell Cohen e1a0c9411c Merge branch 'smithy-rs-release-0.57.x' of github.com:awslabs/smithy-rs into 0.57.1-to-main 2023-11-01 15:30:38 -04:00
AWS SDK Rust Bot a23cf9800f Update changelog 2023-11-01 18:54:07 +00:00