* Improve Pokémon Service `Makefile`
* Code-generate only the Pokémon Service SDK (as opposed to all targets
in the `codegen-server-test` subproject like we do currently).
* Add `run` target to run the service.
* Add `doc-open` target to generate and open Rustdoc documentation.
* Bring back client generation
Co-authored-by: Matteo Bigoi <1781140+crisidev@users.noreply.github.com>
* add: default list of http versions
add: type alias for list of http versions
add: decorator to add desired http versions to property bag
fix: gradle warning for argument "model"
update: CHANGELOG
* fix: clippy lint
* update: use more accurate name for test RustCodegenDecorators
rename: HttpVersionListGenerator.kt to HttpVersionListCustomization.kt
update: HttpVersionListCustomization to grab versions from models when possible
fix: various docs issues reported by IDE
add: new "Extras" section to ServiceConfig
update: code broke by "Extras" change
add: tests for http version sniffing
* rename: in aws_smithy_types, timeout::TimeoutConfig is now timeout::Config
update: timeout::Config now wraps 3 config structs (Http, Tcp, Api)
update: aws_config timeout setting to work with timeout::Config changes
update: providers to work with new timeout config structure
update: codegen to work with new timeout config structure
update: CHANGELOG.next.toml
* add: missing copyright header
* update: impl From instead of Into for timeout conf
fix: clippy lints
* fix: service config codegen for timeouts
* fix: broken doc tests
* fix: bad doc link
* update: transfer aws_types::Config changes to new aws_types::SdkConfig
* fix: two outdated doc tests
* Apply suggestions from code review
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* undo: doc change for timeout env vars
refactor: move parse_str_as_timeout to aws_config and privatize it
update: aws_config code for parse_str_as_timeout
move
remove: comments from private struct members
update: comments for pub struct methods
Co-authored-by: John DiSanti <jdisanti@amazon.com>
This commit rewrites the server's error system so that it can render
accurate protocol-specific HTTP responses adhering to the malformed
requests protocol tests' expectations. It also makes 400+ of the tests
relating to request deserialization pass.
Previously, we were rendering the `SmithyRejection` type in our HTTP responses
directly as we desired. However, AWS protocols' errors are not as granular:
many different request deserialization failure causes are conflated and
signaled to clients under a single `SerializationException` in the response.
This commit introduces a new concept, the `RuntimeEror` type, which groups
rejections and renders the responses that these protocols expect. Rejection
types now become an internal detail of the framework that only serve for us
maintainers to keep track and inventory all possible error causes in great
detail.
Extension types have also been renamed to better reflect their purpose.
For more information about this patch, read the added documentation to the
`rejection`, `extension`, and `runtime_error` modules.
* rename: aws_types::config::Config to sdk_config::SdkConfig
update: code affected by SdkConfig rename
update: CHANGELOG.next.toml
* update: reëxport SdkConfig from aws_types root module
* Update aws/rust-runtime/aws-config/src/lib.rs
* Update CHANGELOG.next.toml
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* add: deprecated config helper
update: use reexported SdkConfig in docs referencing it
* fix: bad doc link
fix: wrong deprecation version
* Revert "fix: bad doc link"
This reverts commit eaa1b68e3b.
* fix: try new link style
* add: deprecation notice for `aws_types::config` module
Co-authored-by: Russell Cohen <rcoh@amazon.com>
This PR introduce a benchmarking tool that is run as part of the GitHub actions to allow to spot performance regressions in the server implementation.
The "deviation" between the last and current benchmark is posted as a message in the pull request.
I want to let this run for a little so we can figure out if GitHub action capacity can give us consistent results, otherwise we will have to move this to some capacity we own.
Co-authored-by: david-perez <d@vidp.dev>
According to the protocol tests, here's how a server should behave when
the operation has no output, and when the operation output shape is empty
(has no members):
* Empty output is serialized to `"{}"`; clients should gracefully accept `""`.
* No output is serialized to `""`.
Compare this to how clients should behave when the operation has no
input, and when the operation input shape is empty (has no members):
* Empty input is serialized to `""`; servers should gracefully accept `"{}"`.
* No input is serialized to `""`.
Notice the behavioral difference in the empty case among clients and
servers. Since clients treat both cases the same by serializing `""`,
the "no input" case is reduced to the "empty input" case by transforming
the model and creating synthetic empty input shapes for all operations
that have no input shapes.
However, the server behavior is different. Up until this commit servers
were always serializing `"{}"` in both cases. This commit implements the
correct behavior. It does so by disambiguating both cases by checking if
the operation output shape is actually synthetic, which would mean that
the original model has no operation output. In that case the structured
data serializer now returns `null`, so we end up serializing `""` to the
HTTP response body.
This commit also renames the methods in charge of serializing operation
inputs/outputs from the `StructuredDataSerializerGenerator` interface,
and removes the unused class `OutputBodyTrait` from
`SyntheticOutputTrait.kt`.
These protocol tests were added to the denylist before `53b8d4c`, when
we realized we were not filtering protocol tests applied to errors
depending on client or server.
Since these protocol tests only apply to clients, they can be removed
from the denylist.
We are adding this example service in the aws-smithy-http-server folder to showcase the SSDK and to be able soon to run benchmarks against this example.
This change includes a new model for the Pokémon Service and all the necessary infrastructure to code generate the client and server SKDs and make them available to the runtime implementation.
A basic README has also been added with instructions on how to build, run and test the service.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
In 171d76f, we regressed on HTTP response code binding in (non-error)
operation outputs. We made the call to obtain the `Writable`, but we
never wrote it with our writer.
In that commit, I inadvertently added the `RestJsonHttpResponseCode`
test (which was previoulsy passing) to the list of failing tests without
noticing the regression.
* Make it possible to configure the default credentials cache
* Update changelog
* Add settings directly to the `DefaultCredentialsChain` builder
* Improve doc comments for `load_timeout`
Smithy defines one trait specifically for the behavior of server
protocol implementations.
From https://awslabs.github.io/smithy/1.0/spec/http-protocol-compliance-tests.html#httpmalformedrequesttests:
> The `httpMalformedRequestTests` trait is used to define how a malformed
> HTTP request is rejected given a specific protocol and HTTP message.
> Protocol implementations MUST assert that requests are rejected during
> request processing.
This commit implements code generation for these tests. The ones for the
restJson1 protocol have been added to the list of failing tests. These
should begin passing once we start implementing constraint traits
https://awslabs.github.io/smithy/1.0/spec/core/constraint-traits.html
* Fix presigning bug with `content-length` and `content-type` in S3
* Fix presigning test in `aws-sigv4`
* Update changelog
* Clean when generating code for diff preview
* Incorporate feedback
* Fix server codegen
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
* Fix exit status in `api-linter`
* Run `api-linter` against `aws-smithy-types` in CI
* Hide external buffer types used by `primitive::Encoder`
* Unpin nightly in CI
* Make `Encoder` a struct and split out an inner enum
* Update changelog
* Implement tool to identify external types used in public APIs
* Allow specifying which nightly to use
* Move `visitor::is_allowed_type` into `Config`
* Add doc comments
* Use `tracing_attributes::instrument`
* Rename `RefType` to `ErrorLocation`
* Add ability to output a Markdown table
* Allow customization of crate features in analysis
* Work around rustdoc ICE in `aws-smithy-json`
* Integrate with cargo
* Add a readme
* Fix some comments
* Rename `ContextStack` to `Path`
* Verify rustdoc output format version
* Improve error message
This commit allows for the `modules` and `cargoCommands` properties to
be specified when running the `codegen-test` and `codegen-server-test`
Gradle modules. The `modules` property allows one to only generate a
subset of the integration test services, while the `cargoCommands`
property allows one to specify the Cargo commands to be run on the
generated Rust crates.
This functionality can be useful to reduce development iteration cycles. For
instance, to only run `cargo test` on the integration test
`simple.smithy`:
```sh
./gradlew codegen-test:build -P cargoCommands='test' -P modules='simple'
```
This commit also refactors the buildscripts of the `codegen-test` and
the `codegen-server-test` modules, extracting shared functionality to
`buildSrc/src/main/kotlin/CodegenTestCommon.kt`.