* Support server event streams
* Rename EventStreamInput to EventStreamSender
* Custom event stream errors
* EventStreamSender and Receiver are parametrized also on event stream error types
* Pokemon service model updated
* Pokemon server event handler
* Pokemon client to test event streams
* EventStreamDecorator to make optional using SigV4 signing
* Use forInlineFun for all errors
Closes: #1157
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Include aws-smithy-http-server and aws-smithy-http-server-python in the list of crates that are automatically published to crates.io on each release of smithy-rs.
Recently CI is failing with
> ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/jre-11-openjdk
> Please set the JAVA_HOME variable in your environment to match the
> location of your Java installation.
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Update `hydrate-readmes` to take versions from `versions.toml`
* Add cleanup TODO comments to `changelogger`
* Update SDK readme template
* Split up `generate-version-manifest` subcommand
* Eliminate the `aws.sdk.version` property
* Fallback to model hash comparison if model metadata claims no changes
* Add `acquire-base-image` to `release.yml`
* Use empty model metadata for SDK generation in CI
* Fix the `aws-config` version number in SDK crate readmes
The affected target of a change (client, server, all) is shown in CHANGELOG.md
The meta tag for a change log entry in CHANGELOG.next.toml supports adding the affected target, as an example:
[smithy-rs]
...
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "server" }
...
Possible values for target: [client, server, all]
* add: checksum related body-wrappers
add: tests for checksum related body-wrappers
* add: aws-smithy-checksums to CrateSet.key
* add: missing base64::encoded_length fn
* update: use the checksum digest trait's output_size method to get checksum size
add: proptest for base64 encoded length
remove: old base64 encoded length test
remove: incorrect leftover comments and comment quotes
* remove: unnecessary pin
* remove: use of clone during checksum finalization
refactor: checksum fns are no longer fallible
refactor: HttpChecksum is now responsible for reporting size correctly
fix: don't consider trailers as part of ChecksumBody size hint
* remove: Taken error state
update: prefer if-let to match
fix: incorrect is_end_stream impl
refactor: use default trait impl for HttpChecksum::header_value
* fix: clippy lint
* add: header value tests
* undo: accidental retry changes
* add: http-checksum-related errors
* refactor: break up and modularize body wrappers
update: docs
update: ChecksumValidatedBody::new now takes a Box<dyn HttpChecksum>
* fix: broken test
* refactor: rename checksum body structs to be differentiated only by their module
* `aws-config`: Fix compilation error with `rustls` and `native-tls` disabled
The `ProviderConfig::with_tcp_connector` method uses
`aws_smithy_client::hyper_ext`, which only exists with the
`client-hyper` feature enabled. Add a feature enabling that, and enable
it by default.
Introducing this feature does not cause breakage, because aws-config
did not previously compile with `default-features = false` and neither
`rustls` nor `native-tls` enabled.
* CHANGELOG.next.toml: Update for aws-config compilation fix
* Fix doctest by adding feature gate
Co-authored-by: Russell Cohen <rcoh@amazon.com>
`.addReference(this)` adds a reference to the `Symbol` on which
`.mapRustType` was called. This is correct only when `f` is a function
that _wraps_ its input `RustType`; for example, when `f` wraps it in a
`Box` or constructs a `Vec`. However, the code is incorrect for an
arbitrary `f`; for example, when `f` _swaps_ the type.
Despite all the decorators and protocols that we have, there aren't any
`RustCodegenDecorator`s or `ProtocolGeneratorFactory`s that are
modifying the base symbol provider that the Smithy plugin provides. So
we can use directly the base symbol provider everywhere and remove the
methods from these interfaces to make the code a little bit simpler.
Likewise, there isn't a single `ProtocolGeneratorFactory` that
transforms the base model that the Smithy plugin provides.
* Re-export aws_types::SdkConfig in aws_config
This way people that want to access that structure don't have to add aws_types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
* Add entry about SdkConfig to the changelog
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* add: support for unsigned aws-chunked content encoding
* add: aws-smithy-checksums to CrateSet.key
* refactor: API of AwsChunkedBodyOptions
update: AwsChunkedBody to note we only support single chunks
remove: unnecessary `Option`s
remove: overly smart total_length_of_trailers_in_bytes in trailers_as_aws_chunked_bytes
update: use "where"-style declaration for `impl<Inner> Body for AwsChunkedBody<Inner>`
add: helpful data to trace logging
add: trailer len double check in AwsChunkedBody::poll_data
add: test for trailer len double check
add: assert to size_hint
fix: incorrect body emitted when body is empty
add: test for empty encoded body
* Update CHANGELOG.next.toml
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* update: CHANGELOG.next.toml message
* refactor: aws-chunked trailer encoding and size calculation
update: when aws-chunked formatting a `HeaderMap`, header names with multiple values will be written out one value per line
remove: unnecessary AwsChunkedBodyOptions::stream_length method
add: trace fields
refactor: make inserting the final body CRLF more explicit
add: test to ensure trailer encoding and trailer len calculation stay in sync
* udpate: emit error instead of panicking for incorrect trailer length
* add: test ensuring trailer serialization and length calculation stay in sync for empty HeaderMap
* update: avoid repeated allocations in trailers_as_aws_chunked_bytes
fix: don't convert to str before getting len of HeaderValue
* add: aws-chunked body test for inner bodies that emit intermittent chunks
add: double check that stream_length used to create an `AwsChunkedBody` is correct.
Co-authored-by: John DiSanti <jdisanti@amazon.com>
`ServerOperationRegistryGenerator` is the only server generator that is
currently not protocol-agnostic, in the sense that it is the only
generator that contains protocol-specific logic, as opposed to
delegating to the `Protocol` interface like other generators do.
With this change, we should be good to implement a
`RustCodegenDecorator` loaded from the classpath that implements support
for any protocol, provided the decorator provides a class implementing
the `Protocol` interface.
This commit also contains some style changes that are making `ktlint`
fail. It seems like our `ktlint` config was recently broken and some
style violations slipped through the cracks in previous commits that
touched these files.
`async fn` are currently not supported by Rust. To allow for such syntax today, the [async_trait](https://docs.rs/async-trait/latest/async_trait/) macro eagerly `Box::pin`s the `async` block. This incurs an unnecessary allocation.
One instance where `async_trait` is used is on the [FromRequest](https://docs.rs/axum/latest/axum/extract/trait.FromRequest.html) method (inherited from [axum](https://docs.rs/axum/latest/axum/)). The use case for `FromRequest` in `axum` does not exist in our case, it is therefore a candidate for removal.
While `IntoResponse` does not involve the same boxing as `FromRequest`, it also does not need to be a trait - and so we remove it for symmetry.
* Remove `FromRequest` and replace it with a static method
* Remove `IntoResponse` and replace it with a static method
This PR add several functionalities to the Python/Rust code-generation, making it usable for models that are not using Streaming and Union shapes.
* Export codegenerated shapes as shared library that can be imported by the Python interpreter.
* Add complete end-to-end testing running in CI.
* Register signals and handle workers processes lifecycle.
* Use a custom SymbolProvider to override non-primitive types that are exposed to Python.
* Implement support for DateTime.
* Cast Python exception into Rust error types.
* End to end testing suite with a Rust client calling a real Python server.
* Docker settings
add note on settings needed when using sdk inside docker container
* update changelog.next
* move to group relevant info
* mark code snippet as txt