Commit Graph

140 Commits

Author SHA1 Message Date
Russell Cohen a107c0154a
Add initial implementation of a Serde Decorator (#3753)
## Motivation and Context
Customers want to be able to use `serde` with Smithy models. For
details, see the
[RFC](https://github.com/smithy-lang/smithy-rs/blob/configurable-serde/design/src/rfcs/rfc0045_configurable_serde.md)

## Description
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Implementation of `serde::Serialize` for smithy-rs code generators. This
takes the approach of a trait, `SerializeConfigured` which _returns_ a
type that implements `Serialize`. This allows customers to control serde
behavior for their use case.

```rust
/// Trait that allows configuring serialization
/// **This trait should not be implemented directly!** Instead, `impl Serialize for ConfigurableSerdeRef<T>`**
pub trait SerializeConfigured {
    /// Return a `Serialize` implementation for this object that owns the object. This is what you want
    /// If you need to pass something that `impl`s serialize elsewhere.
    fn serialize_owned(self, settings: SerializationSettings) -> impl Serialize;

    /// Return a `Serialize` implementation for this object that borrows from the given object
    fn serialize_ref<'a>(&'a self, settings: &'a SerializationSettings) -> impl Serialize + 'a;
}
```

This can be used as follows:
```rust
serde_json::to_string(&my_struct.serialize_ref(&SerializationSettings::redact_sensitive_fields());
```


Currently, this codegen plugin is not used by anything. It can be
enabled by bringing it in scope during code generation & adding the
`@serde` trait to the model for the fields where serialization is
desired. This will allow the SDK (if they choose to) roll it out only
for specific types or services that have customer demand.

There are a number of follow on items required:
- [x] Ensure the generated impls work for `Server` codegen
- [ ] Generate `Deserialize` implementations
- [x] Test the implementation all Smithy protocol test models (ensure it
compiles)


## Testing
Unit test testing serialization with a kitchen-sink model

## 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: david-perez <d@vidp.dev>
2024-08-12 16:44:32 +00:00
david-perez bb1971a1ba
Publish "Detailed error explanations" design documentation page (#3780)
The page was added back in #3734, but was not added to the index, so

https://smithy-lang.github.io/smithy-rs/design/client/detailed_error_explanations.html,
which is exposed here:


10a92052b1/rust-runtime/aws-smithy-runtime-api/src/client/connection.rs (L24-L27)

currently points to a 404.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-08-02 15:18:53 +00:00
ysaito1001 10a92052b1
Switch to file-per-change changelog (#3774)
## Motivation and Context
Implements [RFC: File-per-change
changelog](https://smithy-lang.github.io/smithy-rs/design/rfcs/rfc0042_file_per_change_changelog.html#rfc-file-per-change-changelog)

## Description
When this PR is merged to `main`, it will impact developer workflow for
creating a changelog entry that goes with a PR.
Prior to this, one edited `CHANGELOG.next.toml` to enter a changelog
entry, but it often caused merge conflicts among us. With this PR, one
creates a `.md` file (any filename stem will do) under the
`smithy-rs/.changelog` directory. This Markdown file has the YAML front
matter, and it can be created manually or via the `ChangeLogger` CLI
(see [this
commit](83cda76608)
for more details).

Here are the highlights of the code changes:
- [The release
script](https://github.com/smithy-lang/smithy-rs/pull/3774/files#diff-162dc2b82eb3d72b105291d2fc5fc8d10c4fbc1e6f35862bc08ac0d6a7c53f76)
has been pointed to `smithy-rs/.changelog`. This is pretty much what it
takes to let the `smithy-rs` release infra switch to the new changelog
mode.
-
[sdk-lints](efcc772b37)
now disallows `CHANGELOG.next.toml`. It will complain if the file is
present.
- The `--source-to-truncate` option for the `changelogger`'s `render` is
now optional because our internal release infra code no longer needs to
specify that option (i.e. there is nothing to truncate there).
- Tests in `smithy-rs-tool-common` and `changelogger` have been updated
so TOML changelog entries used in tests have been re-written to Markdown
changelog entries. We want to avoid giving the false impression that
TOML changelog entries are still well-supported.

## Testing
- Existing tests & lints in CI
- Ran `smithy-rs` [dry-run
release](https://github.com/smithy-lang/smithy-rs/actions/runs/10100442953)
and confirmed the correctness of `CHANGELOG.md` and
`SDK_CHANGELOG.next.json` in the release artifacts
- Ran the internal release and confirmed `CHANGELOG.md` was rendered
correctly in `aws-sdk-rust`

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-08-01 04:31:19 +00:00
Zelda Hessler fe1b341e8f
add detailed error explanations page (#3734)
I was speaking to several customers that found our connection poisoning
terminology confusing. To address this, I've changed the messaging and
I've also created a new section in the docs that explains some errors in
greater detail. To direct users to these explanations, I've added a link
to the `tracing::info!` call.

I propose that we consider doing the same any time we identify error
messaging that
- must be kept succinct to avoid logging too much info
- must be more understandable to our users.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-07-03 17:13:30 +00:00
Aaron Todd e8449bd152
behavior version 2024-03-28 (#3617)
## Motivation and Context
This PR is the combination of two previously reviewed PRs that both
enable new behaviors behind a new Behavior Major Version (BMV):
* https://github.com/smithy-lang/smithy-rs/pull/3527
* https://github.com/smithy-lang/smithy-rs/pull/3578

## Description
* Enables stalled stream protection by default on latest behavior
version.
* Enables creation of a default identity cache.

## Testing
All testing done on prior PRs. See for details.

## 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: ysaito1001 <awsaito@amazon.com>
2024-05-02 12:47:07 +00:00
Russell Cohen f15e7b3d59
Docs Improvements (#3600)
## Motivation and Context
- Add READMEs to internal tools
- Delete completely outdated documentation from the design folder

----

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

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
2024-04-26 15:50:38 +00:00
Zelda Hessler c2e50d0c9e
RFC: Environment-defined service config (#3452)
Related to #3429 

----

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

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
2024-04-12 18:00:31 +00:00
Aaron Todd 8040cced55
rfc: change default identity cache and partitioning (#3544)
## Motivation and Context

Original issue: https://github.com/smithy-lang/smithy-rs/issues/3427

See the motivation section of the RFC.

## Description

Proposes a new RFC that changes the default behavior of `SdkConfig` and
`SharedCredentialsProvider`/`SharedTokenProvider` w.r.t caching and
cache partitions.

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-09 18:09:17 +00:00
John DiSanti 8bb11b8cc4
Add RFC for changing the smithy-rs changelog process (#3313)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-04-05 16:53:18 -07:00
John DiSanti c6020e6d6f
Add RFC for improving client error ergonomics (#2075)
## Motivation and Context
This RFC proposes merging `Error`/`ErrorKind` on code generated client
errors to simplify error handling.


[Rendered](https://github.com/awslabs/smithy-rs/blob/jdisanti-rfc-improve-error-ergonomics/design/src/rfcs/rfc0027_improve_client_error_ergonomics.md)

----

_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>
2024-04-05 16:42:53 -07:00
Thomas B 2d003567e5
Make BehaviorVersion as future-proof as the documentation and RFC specify (#3513)
Fixes aws-sdk-rust#1111

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

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-03-27 00:10:10 +00:00
Russell Cohen 8df5ac8545
Update links (these don't redirect) (#3218)
Fix broken links as a result of repo movement

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-12-05 17:22:54 -08:00
John DiSanti 572c5d7650
Rename behavior versions and associated functions (#3204)
The previous names are just too verbose. This PR shortens them and tries
to make things clearer.

----

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

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

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

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

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-14 22:06:10 +00:00
Russell Cohen 0f9ada693d
RFC for forwards compatible errors (#3108)
## Motivation and Context
This RFC describes a way to allow services to add model previously
unmodeled variants in the future without breaking customers.

## Description

[Rendered](https://github.com/awslabs/smithy-rs/blob/errors-forward-compat-rfc/design/src/rfcs/rfc0039_forward_compatible_errors.md)

----

_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-11-13 20:01:05 +00:00
John DiSanti 6438a09bef
Fix repo org move issues (#3166)
This PR fixes issues introduced by moving the repository from
awslabs/smithy-rs to smithy-lang/smithy-rs.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-11-10 18:51:04 +00:00
david-perez 53dcff3ff0
Build services with a derived configuration object (#3095)
This is a pared-down version of #2809.

This is the code-generated version of the
david-perez/smithy-rs-service-config#2 POC.

This introduces a code-generated `PokemonServiceConfig` object which is
provided to the service builder constructor via
`PokemonService::builder(config: PokemonServiceConfig)`. This will
displace the
current `builder_without_plugins` and `builder_with_plugins`,
deprecating them.
We will eventually remove them.

The motivation is to have a single place where to register plugins and
layers.
Smithy traits can leverage this object to inject methods that can apply
plugins
and layers. For example, an `@authorization` trait implementer could
vend a
smithy-rs decorator that pre-applied an authorization plugin inside the
`${serviceName}Config` object, possibly exposing a method to pass in any
runtime arguments needed to configure the middleware.

## 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-10-30 16:25:04 +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
Zelda Hessler e06a57d336
add retry classifier customization RFC (#3018)
add SUMMARY link to new RFC

----

_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 21:24:23 +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
Russell Cohen aaf71c8311
Produce `&[T]` instead of `Option<&[T]>` for list fields (#2995)
## Motivation and Context
When the returned field is a list, there is _almost_ never a reason to
know if the returned value was null or `[]` — this addresses the 99%
case.

Before:
```rust
fn blah(&self) -> Option<&[T]> { self.blah.as_deref() }
```

After:
```rust
fn blah(&self) -> &[T] { self.blah.as_deref().unwrap_or_default() }
```

**note**: no impact on servers by default, see codegen diff.

## Description
Update accessors for lists.

## Testing
- [x] codegen diff audit (no server changes)
- [x] 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-09-28 16:00:20 +00:00
Russell Cohen 3c11815e5e
Merge 0.56.x back into main (#3003)
## 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 -->

## 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 -->
- [ ] 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: ysaito1001 <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: kstich <kevin@kstich.com>
2023-09-28 13:20:04 +00:00
Russell Cohen 5675a69d72
Update HTTP RFC with note (#2906)
## Motivation and Context
Add a quick note about the CRT

CI fails because of rust compilation I'll see if I can fix easily
otherwise will mark as ignored


----

_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 16:19:56 +00:00
82marbag 4615785c7f
Add TLS docs page (#2898)
## Motivation and Context
The TLS connector page is missing

## Description
Render the TLS connector documentation page

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

---------

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: david-perez <d@vidp.dev>
2023-08-03 20:27:21 +00:00
Russell Cohen c7fe610ffd
Add an RFC for limiting the HTTP public dependency (#2899)
## Motivation and Context

[Rendered](d3eaf5eea5/design/src/rfcs/rfc0036_http_dep_elimination.md)

## Description
An RFC describing the need and proposed path for limiting the scope of
our HTTP dependency.

----

_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-08-03 20:26:27 +00:00
Russell Cohen 71c5788398
Default collections RFC (#2900)
[Rendered](https://github.com/awslabs/smithy-rs/blob/flatten-collections-rfc/design/src/rfcs/rfc0035_collection_defaults.md)

Could use a bit more color but I think it gets the point across.

_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-08-03 17:39:33 +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 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
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
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
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
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
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
Harry Barber 29a900e74d
Add CI to the book (#2027)
## Motivation and Context

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

## Description

Run `mdbook test` over the `design` folder.

## TODO

- [x] Ignore the RFC sections using `ignore` tag on the code blocks.
- [ ] Fix the remaining examples.
- [x] Ensure local `rust-runtime` dependencies are being used.

---------

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: 82marbag <69267416+82marbag@users.noreply.github.com>
2023-06-07 09:01:16 +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 2e6b6345ee
Add an identity and auth design doc (#2559)
## Motivation and Context
This PR adds a design doc for client identity and auth for the new
client 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: Zelda Hessler <zhessler@amazon.com>
2023-04-19 17:47:49 +00:00
Zelda Hessler ab6f607f0b
add: orchestrator design doc (#2543)
This document is intended to capture the philosophy and ideas
underpinning the current state of the orchestrator and should grow
alongside the orchestrator.

Abhinav requested something like this and I think it'll be helpful for
future people.

----

_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-04-19 16:48:50 +00:00
Harry Barber a737694f73
Move examples to root, refactor to workspace, and refactor integration tests (#2481)
* Move examples

* Update documentation

* Add to CI

* Fix CI

* Cleanup

* Fix clippy lints

* Fix documentation

* Bump example dependencies

* Cleanup

* Update documentation

---------

Co-authored-by: Matteo Bigoi <1781140+crisidev@users.noreply.github.com>
2023-03-22 14:00:21 +00:00
Russell Cohen de97b3d7f3
Remove deprecated ResolveAwsEndpoint and related interfaces. (#2464)
* Remove deprecated ResolveAwsEndpoint and related interfaces.

* update changelog with pointer

* Rename AwsEndpointDecorator to have a more appropriate name

* Allow endpoint resolver to be omitted
2023-03-21 12:43:04 +00:00
Zelda Hessler a02426fc46
RFC: Smithy Orchestrator (#2439)
* add: WIP for smithy orchestrator RFC

* update: incorporate runtime plugin ideas

* update: RFC to reflect current impl of orchestrator
add: section on encapsulation

* update: RFC code examples

* update: changes section:
update: FAQ
update: set status to "implemented"

* fix: code example indentation

* no really, fix the indents

* I keep seeing more...

* Thanks Yuki
2023-03-17 16:02:16 +00:00
John DiSanti b2c5eaa328
Update RFC-26 (#2453) 2023-03-14 14:27:39 +00:00
Harry Barber bec93c8a5e
Remove uncessary type parameter and constraints from `Upgrade` service (#2436)
* Remove B from Upgrade service

* Remove duplicated bounds on Upgradable

* Update documentation

* Add CHANGELOG.next.toml entry
2023-03-08 15:56:56 +00:00
Julian Antonielli 72df8440c0
Correct outdated details (#2420) 2023-02-28 07:47:21 +00:00
Harry Barber d7f81308bf
Update the service builder RFCs (#2374)
* Complete service_builder.md

* Complete refine_builder.md
2023-02-15 11:45:56 +00:00
John DiSanti 13b10d51a8
Add RFC for improving request ID access in SDK clients (#2083) 2023-02-10 19:07:56 +00:00
david-perez 3ee62e8a4c
RFC: Better Constraint Violations (#2040) 2023-02-07 12:51:35 +00:00
Thomas Cameron efd1508eec
Update the event stream section in RFC30 (#2243) 2023-01-27 22:30:34 +00:00
ysaito1001 c21705852c
Add RFC: Providing fallback credentials on timeout (#2218)
* Add RFC: providing fallback credentials on timeout

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: Zelda Hessler <zhessler@amazon.com>

* Update design/src/rfcs/rfc0031_providing_fallback_credentials_on_timeout.md

Co-authored-by: John DiSanti <jdisanti@amazon.com>

* Incorporate review feedback into RFC

This commit addresses the review feedback:
https://github.com/awslabs/smithy-rs/pull/2218#discussion_r1072657848
https://github.com/awslabs/smithy-rs/pull/2218#discussion_r1072685567
https://github.com/awslabs/smithy-rs/pull/2218#discussion_r1072693150

In addition, we have renamed the proposed method `on_timeout` to
`fallback_on_interrupt` to make it more descriptive.

* Update rfc0031_providing_fallback_credentials_on_timeout.md

* Update RFC

This commit updates RFC and leaves to discussion how `fallback_on_interrupt`
should be implemented, i.e., either as a synchronous primitive or an
asynchronous primitive.

* Update rfc0031_providing_fallback_credentials_on_timeout.md

* Update rfc0031_providing_fallback_credentials_on_timeout.md

* Update rfc0031_providing_fallback_credentials_on_timeout.md

---------

Co-authored-by: Yuki Saito <awsaito@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
2023-01-27 17:02:08 +00:00
Thomas Cameron 4af30b686c
UPDATE for RFC30: Serialization and deserialization (#2186)
* commit RFC

* commit

* Delete rfc0023_serialization_and_deserialization.md

* fix formatting

* https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054637168

* https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054632202

* applied grammarly
pre-commit

* better example wip

* FIX

* https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054632468

https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054818444

https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054820192

* add examples for output's builer

* fixes

* fixing unstable feature gate snippet

* Update rfc0028_serialization_and_deserialization.md

Section is deleted in response to the discussion
https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1061577656

* file name fix

* Update rfc0030_serialization_and_deserialization.md

https://github.com/awslabs/smithy-rs/pull/2183#discussion_r1064573442

* Update rfc0030_serialization_and_deserialization.md
2023-01-09 09:59:36 -06:00