Commit Graph

763 Commits

Author SHA1 Message Date
Zelda Hessler 0f1f1a677a
Minimum throughput body timeouts Pt.1 (#3068)
## 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/awslabs/smithy-rs/issues/1562

## Description
<!--- Describe your changes in detail -->
This change adds a new body wrapper: The minimum throughput limit
wrapper. It tracks the rate that data is being streamed from itself. If
that rate falls below some configurable limit, it emits an error instead
of the next chunk. This protects users from requests that start quickly
but then slow down considerably.

I'd like to get this merged and then figure out the
codegen/docs/examples/config part in a separate PR.

## 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. -->
Tests are included.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-26 20:10:24 +00:00
ysaito1001 222155022e
Add more type aliases for types moved to the `aws-smithy-types` crate (#3091)
## Motivation and Context
https://github.com/awslabs/smithy-rs/pull/3076 missed type alias for
some types we moved to `aws-smithy-types`. This small PR will fix that.

## Testing
Relied on the 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

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-25 21:23:15 +00:00
Russell Cohen 6ceabf8b24
Use tokio::process to allow timeouts to occur (#3052)
## Motivation and Context
The existing credentials provider was a DOS risk and didn't obey timeout
settings because it used `std::timeout::spawn` but relied on a
async-based timeout mechanism.

## Description
- Use `tokio::process` instead
- introduce new cargo feature

## 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-10-25 18:27:58 +00:00
ysaito1001 2a51e0bceb
Feature-gate public use of `http-body` and `hyper` within `aws-smithy-types` (#3088)
## Motivation and Context
Implements https://github.com/awslabs/smithy-rs/issues/3033

## Description
This PR hides behind cargo features the third-party types from
`http-body` and `hyper` crates that are used in`aws-smithy-types`'
public API. Customers need to opt-in by enabling a cargo feature
`http-body-0-4-x` in `aws-smithy-types` to create an `SdkBody` or
`ByteStream` using those third-party types. For more details, please see
[the upgrade
guide](https://github.com/awslabs/smithy-rs/discussions/3089).

As can been seen from code changes, to reduce the surface area where we
need to feature-gate things, we have fused the
`aws_smithy_types::body::Inner::Streaming` enum variant into
`aws_smithy_types::body::Inner::Dyn` variant, thereby removing
`SdkBody::from_dyn`.

## Testing
Relied on existing tests in CI

## 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: Zelda Hessler <zhessler@amazon.com>
2023-10-25 16:45:22 +00:00
Russell Cohen 12bed905bb
Fix bug where Custom Auth Schemes were not respected (#3087)
## Motivation and Context
- Fixes #3034
## Description
Because AuthSchemeOptions were being registered at the operation level,
there was no way for them to be overridden by customer-provided runtime
plugins. This moves them into a separate plugin that is added at
Client/Default priority.

## Testing
- new 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-10-24 16:15:23 +00:00
John DiSanti 40f466213b
Replace credentials cache with identity cache (#3077)
This PR replaces the credentials cache with the new identity cache, and
adds config validation via the `SharedConfigValidator` runtime component
and `ValidateConfig` trait.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-20 23:37:16 +00:00
ysaito1001 ed8763e5df
Re-point those using `ByteStream` and `SdkBody` to smithy-types (#3076)
# Motivation and Context
A follow-up on #3026

## Description
#3026 moved
- `aws_smithy_http::body::{BoxBody, Error, SdkBody}` to
`aws_smithy_types::body::{BoxBody, Error, SdkBody}`
- `aws_smithy_http::byte_stream::{AggregatedBytes, ByteStream,
error::Error}` to `aws_smithy_types::byte_stream::{AggregatedBytes,
ByteStream, error::Error}`

and also left "breadcrumbs", so that customers could still consume
updated types from `aws_smithy_http` after the move.

This PR turns breadcrumbs into deprecation messages (via
`#[deprecated(...)]`) and updates existing places that used to use moved
types from `aws_smithy_http` to directly depend on `aws_smithy_types`.

## Testing
Relied on 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

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-19 20:15:32 +00:00
ysaito1001 e447a22794
Re-point those using `BuildError` from smithy-http to smithy-types (#3070)
## Motivation and Context
Completes #3054 (a follow-up on #3032)

## Description
#3032 moved `BuildError` from `aws_smithy_http::operation::error` to
`aws_smithy_types::error::operation`. That PR also left "breadcrumbs",
so that customers could still consume `BuldError` from `aws_smithy_http`
after the move.

This PR turns breadcrumbs into deprecation messages (via
`#[deprecated(...)]`) and updates existing places that used to use moved
types from `aws_smithy_http` to `aws_smithy_types`.

## Testing
Relied on tests in CI.

## 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>
2023-10-19 18:38:25 +00:00
Russell Cohen 12fa4d3963
Delete `aws_smithy_http::ResolveEndpoint` and point usages to service-specific trait (#3078)
## Motivation and Context
- Fixes https://github.com/awslabs/smithy-rs/issues/3043

As a follow up to #3072 this removes the old endpoint resolver
interfaces in favor of creating a per-service resolver trait.

This trait defines a `into_shared_resolver()` method which converts the
local trait into a global resolver that can be used with the
orchestrator.

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

## 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._
2023-10-18 20:57:56 +00:00
John DiSanti bcfc211277
Simplify default config and add default async sleep (#3071)
While implementing identity caching, I noticed we don't have a default
async sleep impl wired up for generic clients, which was causing caching
to panic in many tests since it needs a sleep impl for timeouts. I
likely need to figure out what to do other than panic if there's no
sleep impl, but that's a problem for a different PR.

This PR adds a default sleep impl to generic clients, and also
simplifies how default config works. Previously, the generated config
`Builder::build` method set all the defaults with a series of "if not
set, then set default" statements. In this PR, defaults are registered
via default ordered runtime plugins.

Additionally, I cleaned up the standard retry strategy:
- The `TokenBucketPartition` didn't appear to be used at all, so I
deleted it.
- `StandardRetryStrategy` was taking retry config at construction, which
means it isn't possible to config override the retry config unless the
strategy is recreated. It now doesn't take any config at all during
construction.
- The adaptive retry client rate limiter was created at construction
based on retry config at that point in time. This means config overrides
wouldn't work with it, so it is also no longer set up at construction
time.
- Removed some unused runtime plugins.

## 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-10-17 22:15:51 +00:00
John DiSanti d48acae8a2
Implement an identity cache in aws-smithy-runtime (#3062)
This PR adds a `ResolveCachedIdentity` trait, and adapts the existing
LazyCredentialsCache implementation to it. It does NOT make this cache
used yet, as that will be done as a separate PR to keep code review
smaller.

Notable differences from the credentials cache:
- Supports multiple different identity types and identity resolvers
- Applies cache partitioning to the `SharedIdentityResolver` so that
operation config overrides of the identity resolver will result in the
correct identity being resolved.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-17 20:11:56 +00:00
Russell Cohen 6dceb8c074
Move default endpoint resolver into a runtime plugin (#3072)
## Motivation and Context
In preparation for inlining the old endpoint traits, I'm cleaning up the
endpoint resolver behavior.

## Description

1. The `Config` field of `service_runtime_plugin` was unused to I
deleted it
2. Store the endpoint resolver in `RuntimeComponents` instead of in
operation config. This allows a lot of complex logic around
`ConfigOverride` to be removed.
3. Move the default endpoint resolver into a runtime plugin.
4. Don't have a fallback implementation for `EndpointResolver`, allow
final construction of `RuntimeComponents` to fail
5. `ServiceRuntimePlugin` has been changed to `Defaults` so that it
doesn't overwrite settings set by the service config


## Testing
Well covered by existing UT / IT
## 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-10-17 19:41:25 +00:00
ysaito1001 0f38daeaf6
Move `SdkBody` and `bytestream` into `aws-smithy-types` (#3026)
## Motivation and Context
Takes care of the first part of
https://github.com/awslabs/smithy-rs/issues/3053 (the remaining part is
denoted as `TODO(runtimeCratesVersioningCleanup)` and until that and
https://github.com/awslabs/smithy-rs/issues/3033 are done the issue will
not be closed).

## Description
This PR moves from `aws-smithy-http` to `aws-smithy-types`:
- the `SdkBody` struct
- the `byte_stream` module

Within the origin crate, we leave "breadcrumbs" (i.e. reexports) for
existing customers of the items above so they are not broken by the
move.

We have just moved `SdkBody` to `aws-smithy-types` without renaming it
to see how it looks there. However, as
[TODO(naming)](https://github.com/awslabs/smithy-rs/pull/3026/files#diff-090c503b779024fdadb8ac97465c80438635df82e62c42b0d85b588a303d9a95R28)
says, we can choose to rename it to just `Body`. Curious to hear what
the reviewers think.

## Testing
Relied on the tests in CI.

----

_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-10-17 17:07:45 +00:00
david-perez 3ab5a6926f
Showcase a minimal operation-agnostic server model plugin (#3060)
Agnostic in that it's generic over the operation it's applied to.

Figuring out how to write such a plugin can be fun but is not trivial.
I'm mostly adding this as a reference to refresh my memory the next time
I have to implement one of these.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-17 11:42:59 +00:00
John DiSanti 068ad03975
Implement `SsoTokenProvider` (#2917)
This PR adds a `SsoTokenProvider` that loads session name cached SSO
tokens, and automatically refreshes them when possible. The
`SsoCredentialsProvider` is updated to use this new `SsoTokenProvider`
so that it is now compatible with the latest AWS CLI.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-16 23:34:51 +00:00
Russell Cohen 684605ae4e
Http updates (#3059)
## Motivation and Context
- [ ] Upgrade guidance
- [x] changelog

To allow seamless adoption of the incoming `http` crate, we're updating
our client crates to use an intermediate type.

## Description

Update _client_ code to use `HttpRequest`. Some internal code still uses
`http::Request` but those usages are limited.

## 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-10-14 00:57:14 +00:00
John DiSanti 63ce3f951e
Rename orchestrator traits to be verbs (#3065)
This PR makes the orchestrator traits more idiomatic by making them
verbs.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-13 18:49:54 +00:00
ysaito1001 d6a1befb3a
Fix vulnerability report from `cargo audit` (#3066)
## Motivation and Context
With `cargo-audit` v0.18.2, it reports the following vulnerabilities
when run against generated SDKs.
```
$ pwd
<smithy-rs root>/aws/sdk/build/aws-sdk
$ cargo generate-lockfile && cargo audit
...
    Scanning Cargo.lock for vulnerabilities (339 crate dependencies)

Crate:     atty
Version:   0.2.14
Warning:   unsound
Title:     Potential unaligned read
Date:      2021-07-04
ID:        RUSTSEC-2021-0145
URL:       https://rustsec.org/advisories/RUSTSEC-2021-0145
Dependency tree:
atty 0.2.14
├── env_logger 0.9.3
│   └── aws-credential-types 0.56.1
|
...
|___ criterion 0.4.0
```
Both of the latest `env_logger` and `criterion` removed their
dependencies on `atty`. This PR, therefore, updates a version of
`env_logger` and that of `criterion` within the `smithy-rs` codebase.

## Testing
Ran the above repro steps against SDKs generated from this branch. No
vulnerabilities detected.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-13 17:02:34 +00:00
John DiSanti d293d1f762
Add lifetimes to async traits that take args by reference (#3061)
This PR adds lifetimes to the `IdentityResolver`, `DnsResolver` (renamed
to `ResolveDns`), and `EndpointResolver` traits so that lifetime
gymnastics aren't needed when implementing those traits. For example,
`IdentityResolver::resolve_identity` takes `&ConfigBag` as an argument,
which means you have to pull things out of the ConfigBag outside of any
returned async block in order for the compiler to be satisfied. This
change removes that consideration and makes implementing these traits a
lot easier.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-13 16:56:50 +00:00
ysaito1001 8439f2ae43
Move `aws_smithy_http::operation::error::BuildError` into `aws-smithy-types` (#3032)
## Motivation and Context
Takes care of the first part of
https://github.com/awslabs/smithy-rs/issues/3054 (the remaining part is
denoted as `TODO(runtimeCratesVersioningCleanup)` and until that's done
the issue will not be closed).

## Description
This PR moves from `aws-smithy-http::operation::error::{BuildError,
SerializationError}` to
`aws-smithy-types::error::operation::{BuildError, SerializationError}`.

Within the origin crate, we leave "breadcrumbs" (i.e. reexports) for
existing customers of the items above so they are not broken by the
move. The breadcrumps will be removed by the part two of the issue.

As part of the move, `aws_smithy_http::endpoint::EndpointPrefix::new`
now returns its `crate::endpoint::error::InvalidEndpointError` instead
of `crate::operation::error::BuildError` for two reasons:
- `BuildError` is now in a stable crate and for an `InvalidUri` variant
to be created, it needed to take a `http::uri::InvalidUri` from a
unstable crate, which we cannot expose in public API.
- The new error is more closely related to the endpoint business.

## Testing
Relied on the tests in CI.

## 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: John DiSanti <jdisanti@amazon.com>
2023-10-12 21:49:26 +00:00
John DiSanti 3b6f8867f6
New-type all the orchestrator futures (#3055)
This PR replaces the `Future` type-alias that was pointing to
`NowOrLater` with a new-type for each trait that returns a future.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-11 18:13:06 +00:00
Zelda Hessler 96a9f8441e
implement user-configurable retry classifiers (#2977)
[Read the RFC here](https://github.com/awslabs/smithy-rs/pull/3018)

## 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 -->
#2417

## Description
<!--- Describe your changes in detail -->
Exactly what it says on the tin. I have a related RFC to publish that
goes into more depth.

## 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 an integration test that ensures a custom retry classifier can
be set and is called.

## 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-10-10 19:07:23 +00:00
John DiSanti 0f9080658d
Remove `CaptureSmithyConnectionWrapper` (#3045)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-10 17:04:21 +00:00
Russell Cohen 7b30ffcbf4
HTTP Wrapper Type RFC & Implementation (#2912)
## Motivation and Context
Implementation of the HTTP request wrapper type from RFC

## Description
RFC + implementation of HttpRequest

## Testing
- IT/UT
- Separate PR which uses this type in implementation of the SDK


----

_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-10-10 13:03:22 +00:00
John DiSanti 08196ec893
Remove remaining middleware code (#3038)
This PR removes the remaining rust-runtime code to support middleware,
deprecates empty crates, and removes the remaining codegen references to
any of that code. In the interest of keeping code review easier, a
separate PR will finish addressing the remaining
`TODO(enableNewSmithyRuntime)` comments.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-09 17:13:22 +00:00
John DiSanti 26a914ece0
Replace `DynConnector` and `HttpConnector` with `HttpClient` (#3011)
This PR removes the last usages of `DynConnector` and `HttpConnector`
from the `aws_smithy_client` crate with their counterparts in
aws-smithy-runtime-api and aws-smithy-runtime. It also introduces
`HttpClient` to make HTTP connector selection a smoother process, and
adds a runtime plugin that configures a default `HttpClient` so that
`Config` doesn't have to do that.

The `DnsService` from aws-config is also moved into aws-smithy-runtime
and refactored to be consistent with the other configurable traits in
the orchestrator since it will likely be used in the future for more
than just the ECS credentials provider.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-06 17:32:35 +00:00
John DiSanti ce5f0aae3f
Port connection poisoning tests to orchestrator and fix issues discovered (#3029)
Issues fixed:
- `ConnectionPoisoningInterceptor` should use the
`read_after_deserialization` hook so that it's possible to poison
modeled transient errors.
- aws-config should enable connection poisoning on its IMDS/ECS/HTTP
clients.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-10-05 21:19:56 +00:00
Russell Cohen 5129c1f5f0
Remove ProviderConfig as the configuration source for AssumeRoleProvider (#3014)
## Motivation and Context
`AssumeRoleProvider` currently uses `ProviderConfig` as a source of
configuration, but that API is hard use and not intended for external
consumption.

This fixes the Assume Role issue but only for `AssumeRoleProvider`

## Description
Update the API (see changelog) to be more ergonomic and derive
configuration from `SdkConfig` instead.

## Testing
Existing tests + 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._
2023-10-02 13:32:50 +00:00
John DiSanti d800d33e28
Use the orchestrator client for ECS and IMDS credentials in aws-config (#2997)
This ports the direct uses of the `aws_smithy_client::Client` in
aws_config to the orchestrator.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-09-29 01:07:49 +00:00
ysaito1001 33cd698f7f
Remove `futures_core::stream::Stream` from `aws_smithy_http::byte_stream::ByteStream` (#2983)
## Motivation and Context
Removes `futures_core::stream::Stream` from
`aws_smithy_http::byte_stream::ByteStream`

## Description
This PR is part of our ongoing effort,
https://github.com/awslabs/smithy-rs/issues/2413. We remove the
`futures_core::stream::Stream` trait from
`aws_smithy_http::byte_stream::ByteStream`. To continue support existing
places that relied upon `ByteStream` implementing the `Stream` trait, we
provide explicit `.next`, `.try_next`, and `.size_hints` methods on that
type. As part of it, a doc-hidden type `FuturesStreamCompatByteStream`,
which implements `Stream`, has been added to `aws_smithy_http` to cater
to those who need a type implementing `Stream` (see
[discussion](https://github.com/awslabs/smithy-rs/pull/2910#discussion_r1317112233)
why doc-hidden).

Another place we need to update is codegen responsible for rendering
stream payload serializer, and this affects the server. The regular
server and the python server have slightly different rendering
requirements, since the former uses
`aws_smithy_http::byte_stream::ByteStream` (that does _not_ implement
the `Stream` trait) and latter uses its own
[ByteStream](cb79a68e3c/rust-runtime/aws-smithy-http-server-python/src/types.rs (L343))
(that does implement `Stream`). We use
`ServerHttpBoundProtocolCustomization` to handle the difference:
`StreamPayloadSerializerCustomization` and
`PythonServerStreamPayloadSerializerCustomization`.

## Testing
No new behavior has been added, relied on the existing tests in CI.

## Checklist
- [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-09-28 19:47:05 +00:00
Zelda Hessler bc41828451
add Sigv4A support (#2939)
## Motivation

smithy-rs#1797

## Description

This PR adds Sigv4a support along with many tests that were ported from
the CRT Sigv4a project. **It does not include**:
- An E2E test. We should create one, but doing so requires us to set up
MRAP which is a good amount of work.
- A fuzz test. While I wrote and ran one on my machine, I found the fuzz
testing tool to be really difficult to use and it would take some work
to include fuzz testing in CI.

Additionally, test Sigv4a is annoying because Sigv4a signing is
non-deterministic. Because of this, the tests test signature generation
by first signing a request, and then by verifying that signature (_This
is how the CRT tests this feature_).

----

_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>
2023-09-28 17:50:33 +00:00
Fahad Zubair 3229089fba
Allow python middleware to set the URI of a request (#3002)
## Motivation and Context
Python middleware were unable to change the URI which makes it
impossible to change the route of an incoming request in Python.

## Description
URI has a #[setter] that Python side can use to change it.

## Testing
- Test has been added that ensures URI can be changed from python.
- If the URI is modified by a middleware in a local smithy-rs Python
server, a different route will be invoked.

## Checklist
- I've updated the changelog.next.toml

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2023-09-28 15:05:08 +00:00
ysaito1001 75fc85f6ea
Remove `futures_core::stream::Stream` from `aws-smithy-async` (#2978)
## Motivation and Context
Removes `futures_core::stream::Stream` from the `aws-smithy-async`
crate.

## Description
This PR is part of our ongoing effort,
https://github.com/awslabs/smithy-rs/issues/2413. We remove the
`futures_core::stream::Stream` trait from the public API in the
`aws-smithy-async` crate. While doing so, we compensate
- `FnStream` by providing the explicit `.next` and `.collect` methods to
let the previously working code continue working.
- `TryFlatMap` by making it return a new-type wrapper `PaginationStream`
to hide `FnStream` from those who use paginators.

With this change, the latest canary no longer uses
`tokio_stream::StreamExt`, since the paginator does not work in terms of
the `Stream` trait. Furthermore, `aws-sdk-rust` has been more than [3
releases since
release-2023-01-26](https://github.com/awslabs/aws-sdk-rust/releases),
so the module `release-2023-01-26` has been removed from
`canary-lambda`.

## Testing
No new tests added, but made sure the existing tests keep working with
the 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-09-27 21:14:40 +00:00
Ryan Schmitt 32655552c1
Omit fractional seconds from `http-date` format (#2989)
## Motivation and Context
Closes #2831.

## Description
Fractional seconds will still be accepted during parsing, but not
emitted during serialization.

## Testing
```
./gradlew codegen-core:check codegen-client:check codegen-server:check codegen-client-test:check codegen-server-test:check
```

## 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>
2023-09-21 18:54:03 +00:00
Zelda Hessler 1331dc5443
add support for nullable struct members when generating AWS SDKs (#2916)
## 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 -->
smithy-rs#1767 aws-sdk-rust#536

## Description
<!--- Describe your changes in detail -->
This PR adds support for nullability i.e. much less unwraps will be
required when using the AWS SDK. For generic clients, this new behavior
can be enabled in codegen by setting `nullabilityCheckMode: "Client"` in
their codegen config:
```
      "plugins": {
        "rust-client-codegen": {
          "codegen": {
            "includeFluentClient": false,
            "nullabilityCheckMode": "CLIENT_CAREFUL"
          },
     }
```


## 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. -->
Ran 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
- [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-09-21 17:20:51 +00:00
Russell Cohen a5c1ced056
add map_immutable to allow signing to work with a wrapped SdkBody (#2567)
## 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#749

## Description
<!--- Describe your changes in detail -->
When wrapping an `SdkBody`, the resulting body is no longer signable.
Some services support this and others don't. This change adds a new
method for mapping an `SdkBody` called `map_readonly_body`. If called on
a body that is signable, it will produce a signable body. However, this
function should never when modifying the inner body is necessary, as
that will result in a signing error.

## 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. -->
Zelda 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._
2023-09-19 14:38:05 +00:00
John DiSanti cb79a68e3c
Add utility for making unmodeled requests with the orchestrator (#2975)
This PR adds a utility for making unmodeled requests with the
orchestrator, which is a prerequisite for getting aws-config completely
off of the old generic middleware client.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-09-12 19:11:54 +00:00
Russell Cohen 7bf88376ae
Retry additional classes of H2 errors (#2971)
Draft pull request pending merge of #2970 
## Motivation and Context
- https://github.com/awslabs/aws-sdk-rust/issues/738
- https://github.com/awslabs/aws-sdk-rust/issues/858
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->

## Description
<!--- Describe your changes in detail -->
This PR adds two additional classes of retries tested:
1. GO_AWAY: https://github.com/awslabs/aws-sdk-rust/issues/738
2. REFUSED_STREAM: https://github.com/awslabs/aws-sdk-rust/issues/858

I tested 1 by using the example helpfully provided. The fix for 2 is
untested and difficult to reproduce but since my fix for 1 worked, I'm
confident that we're detecting the correct error class here.

## Testing
I used the example provided by the customer and validated the H2 GO_AWAY
fix.

## 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-09-12 18:04:23 +00:00
ysaito1001 0bd57fe312
Port redacting sensitive body to orchestrator (#2972)
## Motivation and Context
Fixes https://github.com/awslabs/smithy-rs/issues/2926

## Description
This PR ports logic implemented in
https://github.com/awslabs/smithy-rs/pull/2603. Thankfully, even though
we did not port this at the time of the orchestrator launch, the
orchestrator has not logged sensitive bodies because we have never
logged response bodies in the orchestrator code.

The code changes in this PR
- now logs response bodies in `try_attempt`
- ports the logic from the previous PR in question to the orchestrator,
via an interceptor

Now, when credentials providers in `aws_config` need to say "I want to
redact a response body"
([example](2c27834f90/aws/rust-runtime/aws-config/src/http_credential_provider.rs (L48)))
when middleware is gone, they can pass an interceptor
`SensitiveOutputInterceptor` to `Config` of whatever clients they are
using.

## Testing
Depends on the existing tests.

Without the logic ported over the orchestrator and by logging response
bodies unconditionally in `try_attempt`, we got the following failures.
After we've ported the logic, they now pass.
```
    default_provider::credentials::test::ecs_assume_role
    default_provider::credentials::test::imds_assume_role
    default_provider::credentials::test::sso_assume_role
    default_provider::credentials::test::web_identity_token_env
    default_provider::credentials::test::web_identity_token_profile
    default_provider::credentials::test::web_identity_token_source_profile
    profile::credentials::test::e2e_assume_role
    profile::credentials::test::region_override
    profile::credentials::test::retry_on_error
```


## 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>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-09-08 17:45:30 +00:00
John DiSanti 5401e0d364
Make order of expected/actual consistent in protocol tests (#2976)
Debugging tests is easier when the order of arguments in assertions is
consistent across the board. With consistent order, you don't need to
look at the line of code to know which value is the correct value. Most
of the rest of the project uses expected/actual order, so this PR makes
the protocol tests also use that order.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-09-08 16:09:45 +00:00
John DiSanti e322a2d733
Port middleware connectors to the orchestrator (#2970)
This PR ports all the connectors from the `aws-smithy-client` crate into
`aws-smithy-runtime` implementing the new `HttpConnector` trait. The old
connectors are left in place for now, and follow up PRs will remove them
as well as revise the generated configs to take `HttpConnector` impls
rather than `DynConnector`.

----

_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: Zelda Hessler <zhessler@amazon.com>
2023-09-07 16:54:56 +00:00
ysaito1001 8a3b8f3a00
Update the base image for ci-build's Dockerfile (#2674)
## Motivation and Context
~~**The PR will be a draft until
https://github.com/awslabs/smithy-rs/pull/2675 is merged into `main`.
Once that's merged, this PR can remove the change to `Cargo.toml` in
`aws-smithy-client`.**~~

**Now that it's passed tests in CI, ysaito1001 will merge this PR once
it has passed the internal tests**

Fixes https://github.com/awslabs/smithy-rs/issues/2500.

## Description
This PR updates the base image for ci-build's Dockerfile as the latest
image for [amazonlinux](https://gallery.ecr.aws/amazonlinux/amazonlinux)
has been updated to 2023.

As part of it, the changes to Dockerfile include
- Fixing conflicting curl's libraries by specifying `--allowerasing`
Without it, we'd get an error as follows:
```
package curl-minimal-7.88.1-1.amzn2023.0.1.x86_64 conflicts with curl provided by curl-7.87.0-2.amzn2023.0.2.x86_64
```
- Adding perl explicitly as a new version of openssl now requires it
Without `perl`, we'd get an error as follows:
```
Step 24/48 : RUN cargo +${rust_nightly_version} -Z sparse-registry install cargo-deny --locked --version ${cargo_deny_version}
 ---> Running in 3c3431881cfa
...
error: failed to run custom build command for `openssl-sys v0.9.76`
...
  --- stderr
  Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./Configure line 15.
  BEGIN failed--compilation aborted at ./Configure line 15.
  thread 'main' panicked at '
```

Also, there is a change to `Cargo.toml` in `aws-smithy-client`:
- Forcing `aws-smithy-client` with `native-tls` feature to use a more
recent `openssl-sys` crate
Without it, `cargo minimal-versions check` would fail in
`aws-smithy-client` trying to build `openssl-sys` v0.9.39 where OpenSSL
in a container is more up-to-date, leading to a build failure (See [this
issue](https://github.com/sfackler/rust-openssl/issues/1724) for more
details)

Finally, updating CI for `Run Tests on Windows`
- Manually installing `openssl` as
[suggested](https://github.com/sfackler/rust-openssl/issues/1542#issuecomment-1399358351).
Without it, after introducing a more recent `openssl` 0.10.52
`dev-dependencies` in `aws-smithy-client`, we'd get this on Windows:
```
  --- stderr
  thread 'main' panicked at '

  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-pc-windows-msvc
  $TARGET = x86_64-pc-windows-msvc
  openssl-sys = 0.9.90
```

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
2023-09-07 01:16:46 +00:00
ysaito1001 be9093c90d
Remove `once_cell` from public API (#2973)
## Motivation and Context
Addresses  7 in #2413 

## Description
This small PR removes uses of `once_cell` from public API. The
`http_versions` module in the `aws_smithy_http` crate was dead-code.

## Testing
Relies 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
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>
2023-09-06 03:07:26 +00:00
Russell Cohen 0d44c68bbb
Fix chrono deprecation (#2956)
## Motivation and Context
Chrono deprecated an API


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-29 14:48:29 +00:00
Zelda Hessler 778244f801
update MSRV to 1.70.0 (#2948)
## 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-08-24 19:51:06 +00:00
John DiSanti d934835fe9 Merge remote-tracking branch 'origin/smithy-rs-release-0.56.x' 2023-08-22 12:46:19 -07:00
John DiSanti e5506cfde3
Add endpoint params to debug logs (#2936)
Debugging endpoint resolution can be difficult when the params being
used during resolution aren't logged. This PR adds that logging.

Example output below. It doesn't ordinarily have newlines and
indentation. I added those for clarity.
```
2023-08-22T00:27:54.363727Z DEBUG
invoke{service=s3 operation=ListObjectsV2}:try_op:try_attempt:
aws_smithy_runtime::client::orchestrator::endpoints: resolving endpoint
endpoint_params=EndpointResolverParams(TypeErasedBox[!Clone]:Params {
  bucket: Some("test-bucket"),
  region: Some("us-east-1"),
  use_fips: false,
  use_dual_stack: false,
  endpoint: None,
  force_path_style: false,
  accelerate: false,
  use_global_endpoint: false,
  use_object_lambda_endpoint: None,
  disable_access_points: None,
  disable_multi_region_access_points: false,
  use_arn_region: None
})
endpoint_prefix=None
```

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-22 17:55:12 +00:00
John DiSanti 67830dccb5
Make it possible to nest runtime components (#2909)
Runtime plugins need to be able to wrap components configured in other
runtime components. For example, one runtime plugin should be able to
wrap the HTTP connector configured in another runtime plugin.

This PR makes this possible by:
- Introducing the ability to order runtime plugins within the
service/operation plugin "levels".
- Adding an argument to `RuntimePlugin::runtime_components` so that
implementations can reference components configured by previous plugins.

The `order` function has three separate order values: `Defaults`,
`Overrides`, and `NestedComponents`. The `Defaults` order is currently
unused, but will be used later when we refactor how defaults in config
work. Everything defaults to `Overrides` since most runtime plugins will
want to be in this slot. The `NestedComponents` order is specifically
for runtime plugins that want to create nested components, and runs at
the very end.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-22 00:17:04 +00:00
ysaito1001 c742b5f66c
Reduce amount of logging from #[instrument] (#2934)
**Will be merged to `smithy-rs-release-0.56.x` branch**

Addresses https://github.com/awslabs/aws-sdk-rust/issues/872

## Motivation and Context
With the introduction of the orchestrator, the core functions that live
in `aws-smithy-runtime/src/client/orchestrator.rs` were annotated by
`#instrument`. By default this emits logs at the `INFO` level, which
caused our customer to see the excessive amount of logging after
switching to the latest SDK creates `0.29`.

## Description
This PR reduces the log level to `DEBUG` wherever we use `#instrument`
throughout the file.

## Testing
No new tests have been added as part of this PR. [An
enhancement](https://github.com/awslabs/smithy-rs/issues/2932) has been
filed to check logging volume.

Here is a quick check that all instances in the file specify `trace`:
```
✗ rg "instrument"
src/client/orchestrator.rs
34:use tracing::{debug, debug_span, instrument, trace, Instrument};
160:    .instrument(debug_span!("invoke", service = %service_name, operation = %operation_name))
167:#[instrument(skip_all, level = "debug")]
186:#[instrument(skip_all, level = "debug")]
319:#[instrument(skip_all, level = "debug")]
389:                .instrument(debug_span!("read_body"))
398:    .instrument(debug_span!("deserialization"))
407:#[instrument(skip_all, level = "debug")]
419:#[instrument(skip_all, level = "debug")]
```

## 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>
2023-08-18 11:17:58 -07:00
John DiSanti 0286b9fbea
Fix S3 optional auth (#2907)
## Motivation and Context
This PR implements a short-term solution for aws-sdk-rust#864 while a
long-term solution is worked out.

## Testing
- Tested manually against S3.
- Added DVR tests.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-10 22:18:03 +00:00
david-perez fa54d8b6b5
Check `Content-Type` header in all server protocols (#2531)
## 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

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-08 13:52:13 +00:00
Zelda Hessler d4a2308e94
update MSRV to 1.69.0 (#2893)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-01 19:37:59 +00:00
Russell Cohen a0b60ed5e0
Add clippy.toml with forbidden methods & fix SystemTime usages (#2882)
## Motivation and Context
- #2087 

## Description
- remove lingering usages of SystemTime::now()
- ensure they don't return by adding a clippy.toml

## Testing
- CI
- Ran the webassembly example

## 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: John DiSanti <jdisanti@amazon.com>
2023-07-28 17:16:44 +00:00
John DiSanti cf8df40f18
Merge `sra-test` into the SDK integration tests and fix its tests (#2883)
This PR merges the benchmark and integration tests from `aws/sra-test`
into the SDK integration tests, and updates the tests so that they
compile and pass.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-28 17:09:18 +00:00
John DiSanti b62756ca15
Add missing docs to `aws-smithy-runtime` and move the clock skew interceptor (#2871)
This PR adds missing documentation to the `aws-smith-runtime` crate, and
moves the `ServiceClockSkewInterceptor` into the `aws-runtime` 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-07-27 22:06:54 +00:00
John DiSanti 748d05cd0b
New-type the interceptor context `Input`, `Output`, and `Error` (#2872)
This PR creates new-types for `Input`, `Output`, and `Error` so that the
type system can enforce that an output isn't given to an input and vice
versa. It also removes `TypedBox` since that isn't really needed
anymore.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-27 17:51:12 +00:00
John DiSanti 911aa71685
Add names to interceptors (#2878)
This PR adds a `name` function to the `Interceptor` trait so that
interceptor errors are easier to narrow down.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-27 17:06:39 +00:00
Russell Cohen 8eeb21c490
Split test-util feature to allow test-util to be utilized in WASM (#2873)
## Motivation and Context
- #2087 

test-util pulled in Hyper but that's not strictly necessary

## Description
Split out wiremock as it's own features and do some other cleanup.

## 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-07-27 15:52:12 +00:00
Russell Cohen 9a4156de04
Remove vestiges of the old TimeSource implementation & refactor (#2877)
## Motivation and Context
When `TimeSource` was created, we didn't carefully track down all the
places and left a bit of existing implementation to limit the scope of
the change.
## Description
This removes the public (doc hidden) Testing code from
aws-credential-types and our other test time sources instead.


## Testing
- IT/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._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-07-26 23:51:36 +00:00
John DiSanti 2922f561b0
More tidying up of `aws-smithy-runtime-api` (#2869)
This PR finishes documenting `aws-smithy-runtime-api` and also:

- Adds `Send + Sync` bounds to `Interceptor`.
- Moves `Interceptors` into `aws-smithy-runtime`.
- Expands the more complicated macros in the interceptor context
wrappers.
- Makes the `OrchestratorError` an informative error according to
[RFC-22](https://github.com/awslabs/smithy-rs/blob/main/design/src/rfcs/rfc0022_error_context_and_compatibility.md).
- Renames `ConnectorError::is_other` to `as_other` and adds an
equivalent `is_other` that returns a boolean.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-25 19:59:17 +00:00
John DiSanti 666c474f4a
Tidy up `aws-smithy-runtime-api` a bit (#2867)
This PR makes some progress towards documenting the
`aws-smithy-runtime-api` crate, as well as some additional work to make
it more stable:

- Places the `client` module behind a `client` feature so that it will
be possible to add a `server` module/feature in the future.
- Deletes `ConfigBagAccessors`.
- Renames auth types to reflect changes in the internal spec.
- Moves `RequestAttempts` into the `client::retries` module.
- Moves several types that were in floating around in
`client::orchestrator` to their own modules.
- Renames `Connector` to `HttpConnector`.
- Changes `DynResponseDeserializer` to `SharedResponseDeserializer` for
consistency with serialization, and also so that it could be moved into
runtime components or config in the future (since those need to
implement `Clone`).
- Updates the identity and auth design doc.
- Updates READMEs and crate-level documentation.
- Fixes most, but not all, the missing documentation in the crate.
- Hides the builder macros.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-24 15:28:49 +00:00
david-perez e060135e01
Move `alb_health_check` module out of the `plugin` module (#2865)
The current module location is misleading, since you never want to run
the layer as a plugin: plugins always run after routing, and the health
check should be enacted before routing. Examples have been corrected,
and a test has been added.

## 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._
2023-07-21 13:24:08 +00:00
Russell Cohen e91b393b58
Cleanup and add more tests for from/to nanos (#2655)
## Motivation and Context
- Simplify no-op code in `as_nanos`
- Add more proptests

## Testing
Ran the tests


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-20 20:30:24 +00:00
John DiSanti 7f714db532
Improve docs on config bag and type erasure (#2862)
This PR improves the docs on the aws-smithy-types `config_bag` and
`type_erasure` modules.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-20 19:09:51 +00:00
John DiSanti 25abe5a842
Change the default runtime mode to orchestrator (#2847)
This PR changes the default runtime mode to orchestrator for generated
clients and the AWS SDK.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-20 15:49:53 +00:00
ysaito1001 1ac59421a9
Remove third party types from public APIs Part 2 (#2848)
## Motivation and Context
Addresses item 8 in #2413 

## Description
This PR removes the third party types as follows:
- removes `SegmentedBuf` from public API in `aws-smithy-http` (used when
the feature `event-stream` was enabled)

## Testing
- [x] Passed 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

----

_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>
2023-07-17 14:58:48 +00:00
John DiSanti 7d1d35c9f6
Fix Timestream in the orchestrator (#2846)
This PR fixes Timestream in the orchestrator implementation.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-14 20:57:54 +00:00
ysaito1001 2999766595
Remove third party types from public APIs (#2845)
## Motivation and Context
Addresses item 1, 3, and 9 in #2413 

## Description
This PR removes the third party types as follows:
- removes `InvalidHeaderValue` from public API in `aws-http`
- removes `SendError` from public API in `aws-smithy-async`
- removes `xmlparser` from public API in `aws-smithy-xml`

Those types were exposed to public APIs primarily due to the
implementation of traits, e.g. `From` and `Iterator`. Those
implementations are used internally (such as XML deserialization and
converting an error type) so we should be able to hide them within
crates.

## Testing
- [x] Passed 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._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2023-07-14 17:36:17 +00:00
John DiSanti 26827f1aca
Don't allow `test-util` feature in compile time dependencies (#2843)
During the orchestrator implementation, a bug was introduced that always
enabled the `test-util` feature on `aws-smithy-runtime` in the generated
crates. This led to several pieces of non-test code relying on test-only
code, specifically around `SystemTime` implementing `TimeSource`.

This PR fixes that issue, and also fixes another issue where the
`RuntimeComponentsBuilder` was being initialized without a name for the
service config.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-13 20:35:55 +00:00
John DiSanti 3d1c34d3aa
Fix panic from repeat clones of `TypeErasedBox` (#2842)
This PR fixes a panic that would result from cloning a cloneable
`TypeErasedBox` twice.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-13 01:31:28 +00:00
John DiSanti c1a1daeee0
Split runtime components out of config in the orchestrator impl (#2832)
This PR moves all the "runtime components", pieces that are core to the
operation of the orchestrator, into a separate `RuntimeComponents` type
for the orchestrator to reference directly.

The reason for this is so that these core components cannot be changed
by interceptors while the orchestrator is executing a request.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-07-12 16:59:54 -07:00
Russell Cohen 3a133b1807
Prevent non-clone types from entering cloneable layer (#2834)
## Motivation and Context
There is a bug in cloneable layer that allows non-clone types to enter

## Description
Remove `DerefMut` and resolve the consequences

## Testing
- new doc test
- existing orchestrator CI

## 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: John DiSanti <jdisanti@amazon.com>
2023-07-10 18:13:50 +00:00
ysaito1001 7c9c283a38
Add `Metadata` to a config layer through operation runtime plugin (#2830)
## Motivation and Context
Adds `Metadata` to a config layer through `OperationRuntimePlugin`.

## Description
We have had a customer's use case where a service name and a operation
name are obtained from
[Metadata](ddba46086a/rust-runtime/aws-smithy-http/src/operation.rs (L17-L22)).
The end goal was to use their names as part of metrics collection.
Previously, it was done using `map_operation` on a
`CustomizableOperation`, e.g.
```
client
    .some_operation()
    .customize()
    .await?
    .map_operation(|operation| {
        operation.try_clone().map(|operation| {
            let (_, parts) = operation.into_request_response();
            parts.metadata.map(|metadata| {
                let service_name = metadata.service().to_string().to_uppercase();
                let operation_name = metadata.name().to_string();
                /*
                 * do something with `service_name` and `operation_name`
                 */
            })
        });

        Ok(operation)
    })?
    .send()
    .await;
```
The orchestrator no longer supports `map_operation` on
`CustomizableOperation`. We therefore add `Metadata` to a config layer
through `OperationRuntimePlugin`. See the added integration test for how
`Metadata` is retrieved from within an interceptor.

## Testing
Added an integration-test to verify `Metadata` is properly set.

----

_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>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
2023-07-10 14:57:34 +00:00
Burak 735b635190
Python: Allow configuring logging formatter (#2829)
## Motivation and Context
Allow Python users to configure their logging formatter to either
`json`, `pretty` or `compact` (default).

## 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-07-10 09:31:01 +00:00
david-perez ddba46086a
Better distinguish model and HTTP plugins (#2827)
So far, servers have tacitly worked with the notion that plugins come in
two flavors: "HTTP plugins" and "model plugins":

- A HTTP plugin acts on the HTTP request before it is deserialized, and
  acts on the HTTP response after it is serialized.
- A model plugin acts on the modeled operation input after it is
  deserialized, and acts on the modeled operation output or the modeled
  operation error before it is serialized.

However, this notion was never reified in the type system. Thus, users
who pass in a model plugin where a HTTP plugin is expected or
viceversa in several APIs:

```rust
let pipeline = PluginPipeline::new().push(http_plugin).push(model_plugin);

let app = SimpleService::builder_with_plugins(http_plugins, IdentityPlugin)
    .post_operation(handler)
    /* ... */
    .build()
    .unwrap();
```

would get the typical Tower service compilation errors, which can get
very confusing:

```
error[E0631]: type mismatch in function arguments
  --> simple/rust-server-codegen/src/main.rs:47:6
   |
15 | fn new_svc<S, Ext>(inner: S) -> model_plugin::PostOperationService<S, Ext> {
   | -------------------------------------------------------------------------- found signature defined here
...
47 |     .post_operation(post_operation)
   |      ^^^^^^^^^^^^^^ expected due to this
   |
   = note: expected function signature `fn(Upgrade<RestJson1, (PostOperationInput, _), PostOperationService<aws_smithy_http_server::operation::IntoService<simple::operation_shape::PostOperation, _>, _>>) -> _`
              found function signature `fn(aws_smithy_http_server::operation::IntoService<simple::operation_shape::PostOperation, _>) -> _`
   = note: required for `LayerFn<fn(aws_smithy_http_server::operation::IntoService<..., ...>) -> ... {new_svc::<..., ...>}>` to implement `Layer<Upgrade<RestJson1, (PostOperationInput, _), PostOperationService<aws_smithy_http_server::operation::IntoService<simple::operation_shape::PostOperation, _>, _>>>`
   = note: the full type name has been written to '/local/home/davidpz/workplace/smithy-ws/src/SmithyRsSource/target/debug/deps/simple-6577f9f79749ceb9.long-type-4938700695428041031.txt'
```

This commit introduces the `HttpPlugin` and `ModelPlugin` marker traits,
allowing plugins to be marked as an HTTP plugin, a model plugin, or
both. It also removes the primary way of concatenating plugins,
`PluginPipeline`, in favor of `HttpPlugins` and `ModelPlugins`, which
eagerly check that whenever a plugin is `push`ed, it is of the expected
type. The generated service type in the server SDKs'
`builder_with_plugins` constructor now takes an `HttpPlugin` as its
first parameter, and a `ModelPlugin` as its second parameter.

I think this change perhaps goes counter to the generally accepted
wisdom that trait bounds in Rust should be enforced "at the latest
possible moment", that is, only when the behavior encoded in the trait
implementation is relied upon in the code (citation needed).
However, the result is that exposing the concepts of HTTP plugin and
model plugin in the type system makes for code that is easier to reason
about, and produces more helpful compiler error messages.

Documentation about the plugin system has been expanded, particularly on
how to implement model plugins.

## 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-07-04 12:19:15 +00:00
ysaito1001 d75382789a
Implement the remaining part of supporting operation level configuration (#2814)
## Motivation and Context
Implements the actual meat of `config_override` introduced [as a
skeleton in the past](https://github.com/awslabs/smithy-rs/pull/2589).

## Description
This PR enables operation-level config via `config_override` on a
customizable operation (see
[config-override.rs](8105dd46b4/aws/sdk/integration-tests/s3/tests/config-override.rs)
integration tests for example code snippets).

The way it's implemented is through `ConfigOverrideRuntimePlugin`. The
plugin holds onto two things: a `Builder` passed to `config_override`
and a `FrozenLayer` derived from a service config (the latter is
primarily for retrieving default values understood by a service config).
The plugin then implements the `RuntimePlugin` trait to generate its own
`FrozenLayer` that contains operation-level orchestrator components.
That `FrozenLayer` will then be added to a config bag later in the
orchestrator execution in a way that it takes precedence over the
client-level configuration (see
[register_default_runtime_plugins](8105dd46b4/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/OperationGenerator.kt (L65-L71))).

A couple of things to note:
- The size of `ConfigOverrideRuntimePlugin::config` code-generated is
getting large. Maybe each customization defines a helper function
instead of inlining logic directly in `config` and we let the `config`
method call those generated helpers.
- The PR does not handle a case where `retry_partition` within
`config_override` since it's currently `#[doc(hidden)]`, e.g.
```
client
    .some_operation()
    .customize()
    .await
    .unwrap()
    .config_override(Config::builder().retry_partition(/* ... */))
    ...
```

## Testing
- Added tests in Kotlin
[ConfigOverrideRuntimePluginGeneratorTest.kt](https://github.com/awslabs/smithy-rs/pull/2814/files#diff-04a76a43c2adb3a2ee37443157c68ec6dad77fab2484722b370a7ba14cf02086)
and
[CredentialCacheConfigTest.kt](https://github.com/awslabs/smithy-rs/pull/2814/files#diff-32246072688cd11391fa10cd9cb38a80ed88b587e95037225dbe9f1a482ebc5d).
~~These tests are minimal in that they only check if the appropriate
orchestrator components are inserted into a config override layer when a
user calls a certain builder method as part of `config_override`.~~
- Added integration tests
[config-override.rs](https://github.com/awslabs/smithy-rs/pull/2814/files#diff-6fd7a1e70b1c3fa3e9c747925f3fc7a6ce0f7b801bd6bc46c54eec44150f5158)

----

_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: Yuki Saito <awsaito@amazon.com>
2023-07-01 00:40:27 +00:00
John DiSanti 847ed0b66a
Fix the S3 alternate runtime retries test in orchestrator mode (#2825)
This PR fixes the S3 `alternative-async-runtime` retry tests. The retry
backoff time was being included in the operation attempt timeout, which
I think is undesirable as it makes retry config much harder to get right
since the backoff times are not predictable (they have randomness
incorporated into them). The overall operation timeout is the only one
that needs to incorporate backoff times.

In addition, this PR also:
- Updates READMEs for the `aws-smithy-runtime-api` and
`aws-smithy-runtime` crates
- Adds top-level crate docs to describe features to `aws-smithy-runtime`
- Copies `capture_test_logs` into `aws-smithy-runtime` so that it can be
used (just about) everywhere instead of just in `aws-config`
- Adds service/operation name to the tracing `invoke` span so it's
possible to tell which operation the events are for
- Makes the `Debug` impl for `Identity` useful
- Adds a ton of trace/debug spans and events to the orchestrator
- Fixes an issue in `aws-smithy-runtime` where a huge amount of the
orchestrator tests weren't being compiled due to a removed feature flag

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-30 21:21:15 +00:00
Zelda Hessler 386ded887d
add connection poisoning support to the orchestrator (#2824)
This PR updates the orchestrator to support connection poisoning for the
`hyper` connector. It also renames many usages of "connection" to
"connector" in order to make talking about these concepts less
confusing. In short:

```
/// A "connector" manages one or more "connections", handles connection timeouts, re-establishes
/// connections, etc.
///
/// "Connections" refers to the actual transport layer implementation of the connector.
/// By default, the orchestrator uses a connector provided by `hyper`.
```

One possibly controversial decision I made is that `reconnect_mode` is
now a standalone configurable field, rather that a sub-field of
`RetryConfig`. I think we should get together as a team and discuss what
kinds of things we want to allow users to do when configuring
connections.

My thoughts on this are that we should either:

- **A.** Make connection-related settings their own types instead of
including them within other config types
- **B.** Make a single config struct for all connector-related stuff/use
the preëxisting `ConnectorSettings` struct.

Personally, I'm partial to A.

----

_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-06-30 19:09:51 +00:00
John DiSanti 1de38029b7
Fix `@httpChecksumRequired` and idempotency tokens in the orchestrator (#2817)
This PR fixes the Smithy `@httpChecksumRequired` trait and idempotency
token auto-fill in the orchestrator implementation.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-28 22:07:51 +00:00
Russell Cohen ee5aadc29f
Make endpoint resolution async (#2816)
## Motivation and Context
Make endpoint resolution async from the perspective of the orchestrator.
- #2608 

## Description
Change the endpoint trait in the orchestrator to be asynchronous

## Testing
- compiled code

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-28 22:06:13 +00:00
Zelda Hessler 9c95803a73
add support for adaptive retries when orchestrator mode is enabled (#2800)
## 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 -->
#2190  

## Description
<!--- Describe your changes in detail -->
add support for adaptive retries

## 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 some tests and I'm open to suggestions for more.

----

_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-06-28 17:38:00 +00:00
John DiSanti c8ba2d5b80
Fix auth failures in codegen-client-tests in orchestrator mode (#2812)
## Motivation and Context
In orchestrator mode, most `codegen-client-test` tests were failing due
to being unable to find a matching auth scheme, or due to some of the
test models referencing the `@sigv4` trait. This PR fixes all of those
failures, and adds the `smithy.runtime.mode` flag to
`codegen-client-test` 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._
2023-06-28 17:08:00 +00:00
John DiSanti 57459f042b
Fix optional auth in the orchestrator (#2808)
This PR:
- Renames "anonymous auth" to "no auth"
- Removes fallback to other auth schemes when an identity fails to
resolve (this was not complying to the reference architecture)
- Adds the ability to opt out of credentials in `ConfigLoader`, and
removes defaulting of the shared credentials cache if no credentials
provider is given
- Makes `ConfigBagAccessors` work on `FrozenLayer` and `CloneableLayer`
- Fixes STS and aws-config tests

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-26 16:11:05 -07:00
John DiSanti fbeaab9d38
Remove `get`/`put` methods from `ConfigBag` and `Layer` (#2807)
This PR removes the non-storable `get`/`put` methods from `ConfigBag`
and `Layer`.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-23 23:13:12 +00:00
John DiSanti 6ad3195731
Fixes for orchestrator doc hiddens and re-exports (#2801)
## Motivation and Context
This PR:
- Makes the `#[doc(hidden)]` attributes on orchestrator-only config
functions be conditional based on whether the orchestrator is default or
not.
- Adds re-exports specific to the orchestrator.
- Centralizes `BoxError`.
- Changes organization of interceptor context types a bit.
- Reduces visibility of `Phase` to `pub(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-06-22 18:05:10 +00:00
ysaito1001 8dc8963146
Configure orchestrator's key components in builder's build method (#2802)
## Motivation and Context
Moves setting orchestrator components out of `ServiceRuntimePlugin` and
puts it in service config builders' build method.

## Description
This PR is the forth in a series of config refactoring. Here, we move
pieces of code out of `ServiceRuntimePlugin::config` method so that key
orchestrator components meant for the service-level config should only
be constructed once when a service config is created, e.g. during
builder's `build` method. Previously, those components were newly
created every time an operation is invoked.

Wherever `self.handle.conf...` is used, the PR has moved it from
`ServiceRuntimePlugin::config` to the builders' `build` method.

Note that there will be a separate PR to better handle auth resolver &
identity resolver in the context of the ongoing config refactoring.

## Testing
- [x] Passed tests in CI

----

_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: Yuki Saito <awsaito@amazon.com>
2023-06-22 03:33:17 +00:00
ysaito1001 df62f5c696
Make service config builder contain `CloneableLayer` (#2795)
## Motivation and Context
This PR will reduce fields in service config builders to contain only
`CloneableLayer` (except for `interceptors` and `identity_resolvers`).

## Description
This is the third PR in a series of config refactoring in the
orchestrator mode. Just like #2762, this PR reduces fields in service
config builders to contain `CloneableLayer`.

The code changes follow a straightforward pattern where builders'
setters are implemented via a config layer.

## Testing
Relies on the existing tests in CI

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
2023-06-21 20:55:48 +00:00
ysaito1001 7ed51b2129
Add `CloneableLayer` that can be `Clone`d (#2784)
## Motivation and Context
Alternative to #2776, making `Layer` cloneable so it can be stored in a
type that implements `Clone`.

## Description
In an attempt to reduce struct fields of a service config builder so it
only contains `Layer` (plus some exceptions such as `interceptors`), we
need to make `Layer` clone since the service config builder
`#[derive(Clone)]`.

There are two options. One, adopted by this PR, is to have a separate
`CloneableLayer` that primarily caters for the need for service config
builders. The other option is #2776, where we require that items in
`Layer` be `Clone`. Since the latter is rather a sledge hammer, changing
the requirement for all of the items to be stored, we will go for the
former, which is a more targeted approach and a two-way door if we want
to switch to the latter in the future.

## Testing
Added unit tests in `type_erase.rs` and `config_bag.rs`.

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
2023-06-20 20:41:19 +00:00
Zelda Hessler d5a315fa74
Adaptive Retries 1/2 (rate limiter) (#2773)
## 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 -->
#2190

## Description
<!--- Describe your changes in detail -->
this PR adds the rate limiter necessary for orchestrator support of
adaptive retries. I'll integrate the rate limiter with the retry policy
as part of a separate PR following this one. I wanted to keep these
small and easy to review.

This implementation is based on the Go v2 SDK's implementation.

## 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. -->
tests are included
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-20 18:05:57 +00:00
Harry Barber 934129cf4c
Consolidate `proto` and `protocols` modules into single `protocol` module (#2780)
## Motivation and Context

We have two modules `proto` and `protocols` in `aws_smithy_http_server`,
these can be consolidated.
2023-06-20 12:27:25 +00:00
Yotam Ofek 2987cbdd91
Optimize `AggregatedBytes::to_vec` (#2786)
## 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 -->
Avoid intermediate vec allocations in `AggregatedBytes::to_vec`.

## Description
<!--- Describe your changes in detail -->
Calling `slice::to_vec` on every segment is wasteful, the segments can
be just flattened into an iterator over `u8`s and collected directly.
Also makes the code a bit simpler.

## 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
- [ ] 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: 82marbag <69267416+82marbag@users.noreply.github.com>
2023-06-20 09:10:57 +00:00
John DiSanti 7dc67c8192
Fix `@httpChecksum` in the orchestrator implementation (#2785)
This PR fixes codegen for the Smithy `@httpChecksum` trait when
generating in orchestrator mode, and also fixes an issue in the unit
tests where the wrong body was being tested to be retryable. The request
body should be retryable rather than the response body.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-19 21:34:57 +00:00
ysaito1001 2e472d068e
Make service config just contain a `FrozenLayer` in the orchestrator mode (#2762)
## Motivation and Context
Service config structs now only contain a
`aws_smithy_types::config_bag::FrozenLayer` in the orchestrator mode (no
changes for the middleware mode).

## Description
This PR reduces the individual fields of service configs to contain just
`FrozenLayer`. This makes service configs work more seamlessly with
runtime plugins in the orchestrator mode.

Note that service config _builder_ s still contain individual fields.
We're planning to make them just contain
`aws_smithy_types::config_bag::Layer`. To do that, though, we need to
make `Layer` cloneable and that will be handled in a separate PR. For
builders, the only change you will in the PR is that their `build`
method will put fields into a `Layer`, freeze it, and pass it to service
configs.

This PR is marked as a breaking change because it's based on [another
PR](https://github.com/awslabs/smithy-rs/pull/2728) that's also breaking
change.

## Testing
- [x] Passed tests in CI

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
2023-06-15 23:46:24 +00:00
Harry Barber b2bdcba57a
Parameterize `Plugin` by service rather than protocol (#2772)
## Motivation and Context

Closes https://github.com/awslabs/smithy-rs/issues/1839

Currently, `Plugin` is parameterized by protocol and operation. To
improve symmetry, extensibility and uniformity we switch this to be
parameterized by service instead. The protocol can still be recovered
via the `type Protocol` associated type on `ServiceShape`.

## Description

- Add `ServiceShape` trait, encoding the properties of a Smithy service.
- Change `Plugin<Protocol, Operation, S>` to `Plugin<Service, Operation,
S>`.
- Add `FilterByOperation` and `filter_by_operation` `Plugin`s.
2023-06-15 21:37:24 +00:00
John DiSanti 3d0db5650c
Categorize orchestrator TODO comments into `Launch` and `Cleanup` (#2774)
This PR categorizes orchestrator TODO comments into `Launch` and
`Cleanup`:

- `enableNewSmithyRuntimeLaunch`: Comment needs to be addressed before
orchestrator launch
- `enableNewSmithyRuntimeCleanup`: Comment needs to be addressed after
launch when removing middleware

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-15 17:06:28 +00:00
Russell Cohen 45885b115f
Make RuntimePlugin & RuntimePlugins Send/Sync (#2771)
## Motivation and Context
We will eventually want to store additional runtime plugins on fluent
builders, clients, etc. To make this work, the RuntimePlugin trait needs
to assert Send/Sync

## Description
Small tweaks + test on the RuntimePlugin trait

## Testing
CI


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-15 14:41:34 +00:00
Harry Barber 07bd832a21
Relax bounds on `Scoped` (#2779)
## Motivation and Context

I accidentally added this bound, it is not only redundant but its
absence is one of the key benefits of this approach.
2023-06-15 13:30:54 +00:00
John DiSanti a694dd9dcd
Fix Polly presigning in the orchestrator (#2769)
This PR fixes presigning for Amazon Polly in the orchestrator
implementation.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-14 20:05:16 +00:00
Thomas Cameron 9d56db1f3e
Add serde support to document type. (#2616)
## Description
Implements serde support for `Document`.

## Testing
Test checks whether the serialized/de-serialized data matches with the
expected value

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-14 17:33:47 +00:00
Harry Barber 988eb617fb
Add `Scoped` `Plugin` (#2759)
## Motivation and Context

The
[`FilterByOperationName`](https://docs.rs/aws-smithy-http-server/0.55.4/aws_smithy_http_server/plugin/struct.FilterByOperationName.html)
allows the customer to filter application of a plugin. However this is a
_runtime_ filter. A faster and type safe alternative would be a nice
option.

## Description

Add `Scoped` `Plugin` and `scope` macro.

---------

Co-authored-by: david-perez <d@vidp.dev>
2023-06-14 14:17:35 +00:00
Zelda Hessler 312d190535
Update standard orchestrator retries with token bucket and more tests (#2764)
## 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 -->
addresses #2743 

## Description
<!--- Describe your changes in detail -->
- add more standard retry tests
- add optional standard retries token bucket

## 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. -->
tests are included

----

_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-06-13 23:49:43 +00:00
Russell Cohen 5473192d3f
Update runtime plugin trait (#2754)
## Motivation and Context
Update the RuntimePlugin trait based on discussion:
1. Methods are infallible
2. Split out `Config` and `Interceptors`
3. `ConfigBag` now has an explicit field `interceptor_state`
4. Refactor `ConfigBagAccessors` so that we can build the core around
the trait and keep the trait together with a `where Self` trick

## Description
- Update the `RuntimePlugin` trait
- Deal with resulting implications
## Testing
- [x] CI


----

_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-06-13 19:43:03 +00:00
John DiSanti 8e37d42f3c
Unpin the `arbitrary` and `derive-arbitrary` dependencies (#2765)
These no longer need to be pinned since the current MSRV is compatible
with their latest versions.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-13 15:58:27 +00:00
John DiSanti cfff41a883
Upgrade MSRV to 1.68.2 (#2745)
## Motivation and Context
This PR upgrades the MSRV to 1.68.2.

## Checklist
- [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: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: 82marbag <69267416+82marbag@users.noreply.github.com>
2023-06-13 15:23:04 +00:00
Zelda Hessler 8c4d186487
Update dependencies flagged by cargo audit (#2753)
Also, sort `Cargo.toml` dependencies if they were disordered.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-12 17:09:29 +00:00
Harry Barber 11cf41d944
Simplify `Plugin` trait (#2740)
## Motivation and Context

https://github.com/awslabs/smithy-rs/issues/2444

## Description

- Simplify `Plugin`, make it closer to `Layer`.
- Remove `Operation`.
2023-06-12 16:46:58 +00:00
82marbag 5eb0927514
OperationShape::NAME as ShapeId (#2678) (#2717)
See https://github.com/awslabs/smithy-rs/issues/2634

## 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._

---------

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: Harry Barber <106155934+hlbarber@users.noreply.github.com>
2023-06-09 13:33:40 +00:00
Russell Cohen dabbfaa8e3
Add the ability to disable interceptors via the config bag (#2757)
This replaces the existing custom interceptor disable logic with shared
logic to allow generally disabling any public interceptors from Runtime
plugins. The previous behavior was very brittle because it relied
heavily on runtime plugin execution order.

## Motivation and Context
- simplify presigning behavior
- generalize logic to disable interceptors

## Description
Create `disable_interceptor` struct, which, when inserted into the
configuration bag can disable an interceptor via the `Interceptors`
execution interface.

## Testing
- ` (cd aws/sdk/build/aws-sdk/sdk/s3 && cargo test --test presigning)`

## 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-06-08 17:31:52 +00:00
Russell Cohen 334891d98f
Remove Debug bound from struct definition (#2749)
## Description
the debug bound on the struct definition is redundant and is viral,
making the code harder to use

## Testing
code compiles


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-07 13:31:39 +00:00
Russell Cohen 3285c43b42
Runtime config refactors (#2748)
## Motivation and Context
Part of refactoring config bag to work with the new RuntimePlugin API

## Description
- change config bag to a vector instead of a linked list

## Testing
- existing UTs

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-06 18:58:30 +00:00
Thomas Cameron 77395c3582
Add serde support to Blob type (#2647)
## Motivation and Context
This is a child PR of https://github.com/awslabs/smithy-rs/pull/2616

The changes that this PR introduces is same as the ones that were merged
to `unstable-serde-support` branch before.

Initially, we tried to make commit to unstable-serde-support branch and
merge changes one by one in small PRs. However, in order to make it up
to date with the main branch, we would need to go through a large PR of
over 700 files.

Thus, I decided to create individual PRs that commits directly to `main`
branch.

## Description
- Implements `serde` support to `Blob`

## Testing
- Test checks whether the serialized/de-serialized data matches with the
expected value

## Checklist
NA

----

_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 <johndisanti@gmail.com>
2023-06-06 16:16:56 +00:00
Thomas Cameron 74a7204123
Add serde support to date time (#2646)
## Motivation and Context
This is a child PR of https://github.com/awslabs/smithy-rs/pull/2616

The changes that this PR introduces is same as the ones that were merged
to `unstable-serde-support` branch before.

Initially, we tried to make commit to unstable-serde-support branch and
merge changes one by one in small PRs. However, in order to make it up
to date with the main branch, we would need to go through a large PR of
over 700 files.

Thus, I decided to create individual PRs that commits directly to `main`
branch.

## Description
- Implements `serde` support to `DateTime`

## Testing
- Test checks whether the serialized/de-serialized data matches with the
expected value

## Checklist
NA

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-05 19:25:27 +00:00
John DiSanti ccc3474d5b
Fix S3 presigning in the orchestrator (#2738)
## Motivation and Context
This PR fixes S3 presigning in the client orchestrator implementation. A
Polly presigning fix will come in a separate PR.

This PR also:
- Renames `ClientProtocolGenerator` to `OperationGenerator` to better
represent what its generating.
- Moves `OperationCustomization` into `codegen-client` since it is
client specific and unused by the server codegen.
- Deletes the `ProtocolGenerator` base class in `codegen-core` since it
wasn't adding any value.
- Adds the concept of stop points to the orchestrator so that
orchestration can be halted before transmitting a request.
- Adds `DisableInvocationIdInterceptor`,
`DisableRequestInfoInterceptor`, `DisableUserAgentInterceptor`, and
`HeaderSerializationSettings` config bag configs to facilitate
presigning requirements.
- Fixes compilation of all S3 and Polly tests when in orchestrator mode.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-02 17:01:18 -07:00
ysaito1001 500aef3957
Add SharedAsyncSleep wrapping Arc<dyn AsyncSleep> (#2742)
## Motivation and Context
Add `SharedAsyncSleep` wrapping `Arc<dyn AsyncSleep>` and update call
sites of `Arc<dyn AsyncSleep>` to use `SharedAsyncSleep`

## Description
Public APIs that take/return a trait object for `AsyncSleep` have been
using `Arc<dyn AsyncSleep>` in the codebase. This has a downside of
exposing a bare `Arc`, making it difficult to change the APIs in the
future without breaking backwards compatibility. This PR adds a newtype
wrapper `SharedAsyncSleep` that hides `Arc<dyn AsyncSleep>` to alleviate
the said issue (the idiom of having `SharedXXX` has been seen in the
codebase, e.g. `SharedTimeSource`, `SharedCredentialsProvider`, and so
on).

## Testing
- [x] Passed 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._

---------

Co-authored-by: Yuki Saito <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-06-02 20:33:23 +00:00
Zelda Hessler 7ea3ed92f8
No really, add the standard retry strategy to the orchestrator (#2741)
## Description
<!--- Describe your changes in detail -->
This PR adds support for the Standard retry strategy. The standard
strategy will be inserted into a service's config bag if a retry config
was set. Otherwise, unless another retry strategy was already set, a
`NeverRetryStrategy` will be set. This seemed like a reasonable default,
but I'm open to suggestions.

## 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. -->
tests are included

---

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-02 15:18:10 +00:00
Zelda Hessler 303d99b688
Fix various small issues with the orchestrator (#2736)
## 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 fixes many of the smaller issues I ran into during the
implementation of standard retries for the orchestrator. Merges from
`main` were getting difficult with my [other
PR](https://github.com/awslabs/smithy-rs/pull/2725) so I'm breaking
things up.

## Description
<!--- Describe your changes in detail -->
- when orchestrator attempt timeout occurs, error is now set in context
- update test connection to allow defining connection events with
optional latency simulation update orchestrator attempt loop to track
iteration count
- set request attempts from the attempt loop
- add comment explaining "rewind" step of making request attempts add
`doesnt_matter` method to `TypeErasedBox`, useful when testing update
tests to use the new `TypeErasedBox::doesnt_matter` method
- add more doc comments
- add `set_subsec_nanos` method to `DateTime`.
- I added this to make it easier to string-format a datetime that didn't
include the nanos.
- fix Invocation ID interceptor not inserting the expected header update
input type for `OperationError::other` to be more user-friendly
- add `test-util` feature to `aws-smithy-runtime-api`
- add `test-util` feature to `aws-runtime`
- fix presigining inlineable to pull in tower dep during codegen

## 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. -->
tests have been updated where necessary
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-01 18:44:05 +00:00
Zelda Hessler 0cba3d892a
Update retry classifiers to act on InterceptorContext instead of OrchestratorError (#2737)
## Description
<!--- Describe your changes in detail -->
- update retry classifiers to act directly on the `InterceptorContext`
- add codegen method for inserting retry classifiers into the config bag
- update `InterceptorContext` to return options instead of panicking

## 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. -->
Tests were updated as needed.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-06-01 15:59:49 +00:00
ysaito1001 40612a9308
Move `config_bag` and `type_erasure` to `aws-smithy-types` (#2735)
## Motivation and Context
This PR moves types and traits in those modules to the
`aws-smithy-types` crate.

## Description
This is to prepare for the upcoming refactoring where `SdkConfig` and
service configs (and both of their builders) will be backed by
`ConfigBag`.

## Testing
- [x] Pass 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~~

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-05-31 21:49:52 +00:00
Russell Cohen 8c045d271c
Add support for TimeStreamWrite and TimeStreamQuery (#2707)
TODO:
- [x] docs
- [x] integration test (canary even?)
- [x] customize README for timestream
## Motivation and Context
- #613 
- https://github.com/awslabs/aws-sdk-rust/issues/114


## Description
This adds support for TSW and TSQ by adding endpoint discovery as a
customization. This is made much simpler by the fact that endpoint
discovery for these services **has no parameters** which means that
there is no complexity from caching the returned endpoint.

Customers call `.enable_endpoint_discovery()` on the client to create a
version of the client with endpoint discovery enabled. This returns a
new client and a Reloader from which customers must spawn the reload
task if they want endpoint discovery to rerun.

## 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 -->
- [ ] 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-05-31 18:08:51 +00:00
Harry Barber 7347c58458
Remove `PollError` from server type parameters (#2457)
## Motivation and Context

https://github.com/awslabs/smithy-rs/issues/2444

## Description

Remove `PollError` from the implementation and documentation.
2023-05-30 20:13:53 +00:00
Thomas Cameron 840221dddb
Add serde support to number type (#2645)
## Motivation and Context
This is a child PR of https://github.com/awslabs/smithy-rs/pull/2616

The changes that this PR introduces is same as the ones that were merged
to `unstable-serde-support` branch before.

Initially, we tried to make commit to unstable-serde-support branch and
merge changes one by one in small PRs. However, in order to make it up
to date with the main branch, we would need to go through a large PR of
over 700 files.

Thus, I decided to create individual PRs that commits directly to `main`
branch.

## Description
- Implements `serde` support to `Number`

## Testing
- Test checks whether the serialized/de-serialized data matches with the
expected value

## Checklist
NA

----

_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 <johndisanti@gmail.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-05-30 18:47:41 +00:00
Russell Cohen b30b063e1e
Integrate TimeSource into the orchestrator and middleware (breaking change warning is spurious) (#2728)
## Motivation and Context
- #2262 
- #2087 
- #2707 

This adds `TimeSource` in SDK and service configs so we can effectively
control time when executing requests with the SDK at the client level.

_note:_ the breaking change is in a trait implementation of a struct
we're going to delete, not a real breaking change

## Description
- Add `SharedTimeSource` and use it in SdkConfig / `aws-config` /
<service>::Config
- Wire up the signer and other uses of `SystemTime::now()` that I could
find
- track down broken tests

## Testing
- [x] various unit tests that all still pass

## 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-05-30 15:52:11 +00:00
david-perez cf292d5817
Bump `lambda_http` dependency of `aws-smithy-http-server` to 0.8.0 (#2685) (#2691)
This is https://github.com/awslabs/smithy-rs/pull/2685 again, which was
merged
prematurely and reverted in
https://github.com/awslabs/smithy-rs/pull/2690.

This time we won't merge it until it's due time.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-30 14:47:20 +00:00
Thor Bjorgvinsson 5126a61489
Fix tiny_map from_iter where one operation was being dropped (#2733)
## Motivation and Context
15th operation was being dropped when iterator was being read into a
TinyMap

## Description
The 15th operation was being dropped when the if statement was caught
because the operation had been popped of the iterator but hadn't been
added to the vec of operations before the two iterators were being
chained and collected into a

## Testing
Added unit tests that reproduced the issue and verified that the issue
is fixed

## 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: david-perez <d@vidp.dev>
Co-authored-by: Fahad Zubair <fahadzubair@gmail.com>
2023-05-30 11:46:07 +00:00
John DiSanti d91232667f
Set up a default connector for generic clients in the orchestrator implementation (#2693)
## Motivation and Context
This PR makes generic clients default to the built-in rustls HTTPS
connector when no override is provided, but only for the new
orchestrator implementation.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-26 17:12:55 +00:00
John DiSanti c6e537969e
Fix event streams in the orchestrator implementation (#2673)
## Motivation and Context
This PR gets event streams working in the client orchestrator
implementation, and depends on #2671.

The orchestrator's `TypeErasedBox` enforces a `Send + Sync` requirement
on inputs and outputs. For the most part, this isn't an issue since
almost all generated inputs/outputs are `Send + Sync`, but it turns out
the `EventStreamSender` wasn't `Sync` due to an omission of the `Sync`
bound. Thus, this PR is a breaking change, as it adds a `Sync`
requirement for anyone who passes a stream to an event stream operation.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-26 16:46:39 +00:00
John DiSanti 8773a70428
Simplify event stream message signer configuration (#2671)
## Motivation and Context

This PR creates a `DeferredSigner` implementation that allows for the
event stream message signer to be wired up by the signing implementation
later in the request lifecycle rather than by adding an event stream
signer method to the config.

Refactoring this brings the middleware client implementation closer to
how the orchestrator implementation will work, which unblocks the work
required to make event streams work in the orchestrator.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-26 15:49:56 +00:00
82marbag d083c6f271
remove native-tls (#2675)
* Show how to plug a connector
* For TLS: keep rustls, only

## 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._

---------

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
2023-05-26 10:18:29 +00:00
John DiSanti f89b14337c
Port Glacier customizations to the orchestrator (#2704)
## Motivation and Context
This PR gets the Glacier integration tests to pass against the
orchestrator implementation by porting the Glacier customizations from
`make_operation` changes to interceptors.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-25 19:50:37 +00:00
John DiSanti 3c68521cd9
Remove middleware code when generating the orchestrator exclusively (#2723)
## Motivation and Context
This PR removes all the middleware code from generated clients when the
`smithy.runtime.mode` flag is set to `orchestrator`. It also changes the
`aws-config` crate to use the fluent client instead of the Smithy client
for STS and SSO based credential providers.

The `polly` test no longer compiles in orchestrator mode with these
changes since presigning directly references middleware code. This will
get fixed in a later PR.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-25 17:12:51 +00:00
Russell Cohen c0345a5b5f
Add timesource abstration to aws-smithy-async (#2721)
## Motivation and Context
- Controlling time is required for several testing use cases
- #2087 
- #2262 

## Description
Introduce `TimeSource` trait, a real implementation, and a test
implementation.

## Testing
These changes are used in the timestream PR

## Checklist
No changelog, these changes have no impact since the code is not yet
utilized

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-23 18:16:28 +00:00
ysaito1001 61b7a774b4
Allow integration tests to run in both runtime modes (#2709)
## Description
This will allow integration tests under `aws/sdk/integration-tests` to
run in both smithy runtime modes. Prior to the PR, the integration tests
use `map_operation` to customize operations, which is not supported in
the orchestrator, preventing us from running them in the orchestrator
mode. Fortunately, all the usages of `map_operation` in the integration
tests involve setting a test request time and a test user agent in a
property bag.

This PR stops using `map_operation` in those tests and instead
introduces separate test helper methods in both runtime modes: one for
setting a test request and the other for setting a test user agent. They
allow the integration tests to compile and run in both modes.

Note that the integration tests in the orchestrator do not necessarily
pass at this time. We'll address the failures subsequently.

## Testing
Confirmed integration tests continue passing with the changes when run
in the middleware . Confirmed those complied (but not necessarily
passed) in the orchestrator.

----

_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: Yuki Saito <awsaito@amazon.com>
2023-05-19 18:29:39 +00:00
John DiSanti 9bfe936fbc
Make the SDK ad hoc tests pass against the orchestrator (#2708)
## Motivation and Context
This PR refactors the client protocol test generator machinery to use a
client instead of calling `make_operation` directly, and then fixes the
ad hoc tests for the orchestrator.

The ad hoc tests revealed that overriding the signing region/service via
endpoint config was lost when porting SigV4 signing to the orchestrator,
so this PR updates the SigV4 `HttpRequestSigner` implementation to
restore this functionality. It is doing this in the signer directly
rather than via an interceptor since it should only run this logic when
SigV4 is the selected auth scheme.

Other notable changes:
- Adds `--no-fail-fast` arg to `cargoTest` targets so that all Rust
tests run in CI rather than stopping on the first failure
- Changes `EndpointResolver::resolve_and_apply_endpoint` to just
`resolve_endpoint` so that the orchestrator can place the endpoint
config into the request state, which is required for the signer to make
use of it
- Adds a `set_region` method to SDK service configs
- Deletes the API Gateway model and integration test from the SDK smoke
test since it is covered by the ad hoc tests
- Adds a comment explaining where the API Gateway model comes from in
the ad hoc tests
- Adds a `smithy.runtime.mode` Gradle property to `aws:sdk` and
`aws:sdk-adhoc-test` to trivially switch between middleware and
orchestrator when testing/generating locally

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-19 16:58:28 +00:00
Zelda Hessler 4cc4fb1181
fix type-erasure bug for errors (#2713)
## Description
<!--- Describe your changes in detail -->
We were unintentionally double-boxing type-erased errors. This fix
correctly de-references the errors, solving the problem.

## 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.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-18 17:42:36 +00:00
Zelda Hessler a9e22ce17a
Fix: orchestrator flow (#2699)
## 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 -->
Necessary before we can implement retries.

## Description
<!--- Describe your changes in detail -->
I noticed that we weren't handling the flow quite right when errors
occurred. This PR fixes that and adds interceptor-based tests to ensure
things are working right. I still think we could use more tests but the
PR is already quite large.

## 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 PR contains tests

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-18 14:59:36 +00:00
John DiSanti a514793fa8
Port API Gateway customizations to the orchestrator (#2705)
## Motivation and Context
This PR ports the API Gateway `Accept` header customization into the
orchestrator implementation. The original implementation of this
customization in #287 didn't include a test, so this PR also adds an
integration test for it.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-17 23:31:35 +00:00
ysaito1001 3b95b9706c
Port customizable operation to orchestrator (#2706)
## Motivation and Context
Port [Customizable
Operation](https://github.com/awslabs/smithy-rs/pull/1647) to
orchestrator

## Description
This PR implements `CustomizableOperation` in the orchestrator. Just
like the counterpart in the middleware, it is created when the
`customize` method (in the orchestrator mode) on a fluent builder is
called. The `customize` method in the orchestrator could technically be
made a synchronous method because there is no need to create an
operation, which requires `async`, therefore making the `customize`
method in the middleware `async`. However, during the transition from
the middleware to the orchestrator, the integration tests
([example](31c152d9af/aws/sdk/integration-tests/s3/tests/signing-it.rs (L36)))
need to be able to run in both modes. For this reason, the `customize`
method in the orchestrator is temporarily marked as `async`.

Regarding methods defined on the new `CustomizableOperation`, they
include `mutate_request` and `map_request` from the counterpart in the
middleware. However, it did not port `map_operation` because there is no
operation to map on. Most use cases for `map_operation` is put things in
a property bag. The new `CustomizableOperation` provides an
`interceptor` method to accomplish the same, i.e putting things in a
config bag.

Finally, for integration tests to run in both modes, the code gen emits
the implementation of the `customize` method differently depending on
the active Smithy runtime mode, similar to what the implementation of
`send` method does.

## Testing
Added one `sra-test` for mutating a request.

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-05-17 21:31:23 +00:00
Zelda Hessler 33e1a67b22
add: request information header interceptors and plugins (#2641)
## 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 -->
#1793 

## Description
<!--- Describe your changes in detail -->
This adds a runtime plugin which provides support for a request info
header.
The plugin depends upon three interceptors:
- `ServiceClockSkewInterceptor` - tracks the approximate latency between
the client and server
- `RequestAttemptsInterceptor` - tracks the number of attempts made for
a single operation
- `RequestInfoInterceptor` - adds request metadata to outgoing requests.
Works by setting a header.

## 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 one test but need to implement several more

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-17 16:30:45 +00:00
ysaito1001 92b26df402
Allow for configuring interceptors on generic client (#2697)
## Description
This PR allows users to pass-in interceptors to a generic client.
Client-level configured interceptors are eventually added to
`client_interceptors` and operation-level interceptors to
`operation_interceptors`, both of which are fields in the
`aws-smithy-runtime-api::client::interceptors::Interceptors`. The
relevant code is generated only in the orchestrator mode.

The SDK registers a default set of (client-level & operation-level)
interceptors, and the passed-in interceptors by a user will run _after_
those default interceptors.

## Testing
- Added integration tests `operation_interceptor_test` and
`interceptor_priority` in `sra_test`.

----

_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: Yuki Saito <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-05-12 18:12:05 +00:00
82marbag c2da4cf16d
Revert "OperationShape::NAME as ShapeId (#2678)" (#2698)
This reverts https://github.com/awslabs/smithy-rs/pull/2678.

It is a breaking change and it will be included in the next release.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-12 09:07:52 +00:00
John DiSanti 0e90d6502d
Fix KMS tests by fixing `Send` bound on fluent send method (#2695)
## Motivation and Context
This PR fixes the KMS tests when the generating code in orchestrator
mode by ensuring the `Future` returned by `send()` implements `Send`,
and also adds a codegen unit test for this so that it's checked at the
generic client level.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-11 19:50:13 +00:00
82marbag 9b340fb89e
OperationShape::NAME as ShapeId (#2678)
See https://github.com/awslabs/smithy-rs/issues/2634

## 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._

---------

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
2023-05-11 15:02:03 +00:00
david-perez a78ac591fe
Revert "Bump `lambda_http` dependency of `aws-smithy-http-server` to 0.8.0 (#2685)" (#2690)
This reverts commit 04db5e3572.

This is a breaking change that needs to wait to be merged in until the
next breaking release.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-10 10:41:28 +00:00
david-perez 04db5e3572
Bump `lambda_http` dependency of `aws-smithy-http-server` to 0.8.0 (#2685)
This patch also removes the unneeded dependency on `lambda_runtime` by
`aws-smithy-http-server-python`.

This patch also refactors `LambdaHandler`'s `convert_event` to avoid
cloning the URI path when not needed.

This is a breaking change. See #2676 why.

This patch also bumps `aws-smithy-http-server` dependency on `mime` to
0.3.4.

`cargo +nightly-2022-11-16 minimal-versions check --all-features`
otherwise
fails when using 0.3.0, because we require `impl fmt::Display for
mime::FromStrError`, which was first introduced in 0.3.4.

As to why `minimal-versions` is now picking `mime` 0.3.0 with this
patch, it's
because in `lambda_http` 0.7.3, they had [`mime =

"0.3.16"`](99dba64472/lambda-http/Cargo.toml (L35-L35)),
and in `lambda_http` 0.8.0, they've now relaxed that to [`mime =

"0.3"`](393d6447be/lambda-http/Cargo.toml (L36)).


## 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-05-10 09:39:15 +00:00
david-perez c3e6ed96df
Document compatibility of `aws-smithy-http-server` with `lambda_http` (#2683)
See #2676.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-10 08:18:21 +00:00
Henrik Sjööh 2b165037fd
Use `as_nanos` in `Ord` impl for `DateTime` (#2656)
## Motivation and Context
This PR adresses on [feedback from my previous
PR](https://github.com/awslabs/smithy-rs/pull/2653#pullrequestreview-1404515899).


## Description
- use `as_nanos` in `Ord` impl for `DateTime` instead of manual impl.

## Testing
- add proptest that checks that `Ord` impl matches RFC 3339 comparison.

## 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._
2023-05-09 23:31:51 +00:00
Zelda Hessler 97c70c429c
add: tests to ensure all interceptors are run if an error occurs in one (#2664)
## 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 -->
#2662

## Description
<!--- Describe your changes in detail -->
This PR adds tests for all interceptor hooks to ensure the correct error
handling behavior and defines a set of stub components for orchestrator
testing.

## 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 PR includes tests.
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-08 21:28:50 +00:00
John DiSanti beedd2c70d
Refactor interceptor phases to improve optionality inside interceptors (#2670)
## Motivation and Context
This PR:
- Deletes `TraceProbe`
- Replaces the orchestrator's `Phase` helper with a couple of macros
- Introduces the concept of phases into `InterceptorContext` so that
input/output/error/request/response accessors don't need option wrappers
- Adds `TypeErasedError` so that `orchestrator::Error` can implement
`Error`
- Rewinds the interceptor context in the retry loop

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-03 21:29:40 +00:00
Zelda Hessler c75807ce37
fix/format: various code that's escaped the linter (#2667)
_Every once in a while I run clippy and the pre-commit checks on
everything b/c stuff seems to fall through the cracks._

- fix: various code that's escaped the linter
- format: various code that's escaped the formatter
- update: `chrono` because a test was using a method only available in
v0.4.23 _(I don't know why that didn't fail in CI)_


_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-03 15:46:18 +00:00
John DiSanti e1cf72e52d
Make the `Debug` impl on `TypeErasedBox` useful (#2665)
## Motivation and Context
This PR ports @rcoh's addition of `Debug` in `ConfigBag` to the
`TypeErasedBox`.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-05-02 21:37:47 +00:00