* Add AwsEndpointResolver when constructing operations
This commit adds a customization for AWS-services to allow specifying an EndpointResolver, with a default fallback provided.
* Enforce no doc warnings, fix bug, add cargoCheck to CI
* wip
* Add SigV4 Signing Middleware
Utilizing `MapRequest` and the `Credentials` machinery, this diff adds SigV4SigningStage, a middleware stage that can sign `SigV4Requests`.
The signing behavior is driven by several fields that may be present in the property bag.
* Implement Tower Shims for SDK middleware
This commit implements 3 pieces of tower middleware:
1. A tower service supporting smithy_http::middleware::MapRequest
2. A tower service to dispatch operation::Request
3. A tower service to dispatch & parse the results of `operation::Operation`
* Fix clippy lints
* Go back to default debug implementation
* Check docs in rust-runtime test script
* Make Dispatch layer non-exhaustive
* Derive default for DispatchLayer
* Add credentials provider config & test
* Prepare to use `Features` during Operation Generation
* Fix sdk gradle build changes that were previously missed
* Utilize the credentials provider in the feature
* Update IdempotencyTokenProvider to be Send + Sync
* Add accessors for credential providers
* Fix build.gradle
* Update auth references to be aws-auth
* Update idempotency token test
* AWS Endpoint Middleware
This commit builds on the work of previous `Endpoint` work to incorporate AWS-specific endpoint abstractions.
* Delete dead code, add more docs
* CR Feedback: Rename Provide to Resolve
* Implement core Smithy endpoint support
This commit adds `Endpoint` to smithy-http & records our design decisions in `endpoint.md`. This provides support for the endpoint trait in Smithy. A design for endpoint discovery is proposed but is not currently implemented.
* Apply suggestions from code review
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
* More cleanups
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
* Fallback to a generic error representation for unmodeled errors
* DRY out some dependencies
* Fix name is instant_iso8601 resource
* Top level error shape improvements
This commit adds `code` and `message` as inherent methods to top level error shapes (eg. `ListTablesError`). If the error is unmodeled, it uses
downcasting to extract a message.
* Fix clippy warning
* Http Operation traits and structures
Initial implementation of `Operation` for HTTP based services and `ParseHttpResponse`. I'm also starting to collect design documentation in `design`, an mdBook intended to serve as a repository for public facing design documentation.
* Update rust-runtime/smithy-http/src/body.rs
Co-authored-by: Jonathan Esterhazy <jonathan.esterhazy@gmail.com>
* Add retry policy
* Fix doctest failures
* Update rust-runtime/smithy-http/src/operation.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update rust-runtime/smithy-http/src/operation.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update rust-runtime/smithy-http/src/response.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
Co-authored-by: Jonathan Esterhazy <jonathan.esterhazy@gmail.com>
Co-authored-by: Kerem Kat <keremkat@gmail.com>
Named enums were being incorrectly serialized via the derive macro. This was causing the value of the enum to be disregarded. This change implements `Serialize` and `Deserialize` explicitly for enums.
Additionally, a new protocol test was added that avoid using sets–this allow it to be run without being flaky until #37 is fixed.
* Support Deserializing Boxes and HashMaps
* Extract SerializerBuilder to its own file & add some more comments
* Rename to CustomSerializerGenerator
* CR updates
* Add comment for container interface
* Update the comments with example generated code
* Customization Abstractions & Config Generation
A previous PR supported idempotency tokens with a hardcoded config implementation. This commit replaces it with the "real thing,"
supported by the `NamedSectionGenerator` abstraction. The intention idea is that sections can be typesafe, well documented, and evolve as compile
errors instead of silent failures.
Sections can also bring along state / generation context to allow for situation-specific customization. This API is still very experimental
and is expected to evolve as we continue to generate a fully customized DynamoDB client.
HttpProtocolGeneratorTest & integration tests provide complete test coverage—a unit test was also added to allow quicker iterations when adding customizations.
* Use typealias
* Fix missed merge conflicts, rename to member
This code replaces the hand-written deserializers that were used to serialize types like Instant & Blob with autogenerated code. A follow-on diff will do the same thing for serializers.
Once sufficiently developed (and if desired) this would allow us to completely remove our use of Serde-derived serializers with serializers & deserializers generated at codegen time.
* Generate Crate Documentation
This commit utilizes the documentation trait attached to the relevant service shape to generate crate-level documentation for services.
* Test fixes
* Don't upload integration test docs
* Support Deserializing Http Dates
Deserializing HTTP dates is made slightly more complex because Smithy actually supports a format _not_ outlined by the RFC where the HTTP date
uses fractional seconds. For this reason (as well as dropping the chrono dependency in the future), `httpdate` was forked and incorporated into smithy-types. At a later date, we _may_ consider inlining this dependency into the crates that actually need it.
As a side change, I'm starting to refactor the way that custom serialization works via new-types. This enables generating composable serializers
that are much easier to autogenerate.
This commit adds support for the idempotency token trait via a config. I'm not ready to build a generalized Config generator yet, so intead I'm injecting a static config via inlinable. A follow up diff will flesh out ServiceConfigGenerator to support adding more config sections as required by AWS.
As the ServiceGenerator grew more complex, it was becoming tedious to keep the hand-written operation in the HttpProtocolTestGenerator updated.
This diff replaces the hand-written operation with a custom protocol. To support this, rudimentary support for pluggable protocols was added to CodegenVisitor—eventually this will be driven by SPI.
* Dynamo IT & IO Layer v0
This diff adds 2 _extremely_ WIP components:
1. A basic IO layer that uses Hyper and a pure Rust signer. This will change significantly over the coming days.
2. A rudimentary Dynamo DB integration test that creates a table and verifies that it exists.
Neither of these is anywhere near final, but, rather, these are intended as a starting point for discussion.
* Fixup tests
* Refactor CargoTomlGenerator to use Toml4J
* Generate Cargo.toml with a TOML lib & create unified test machinery
I'm going to hold off porting all the tests to use the new machinery until the builder refactor lands to avoid heinous conflicts.
* Fixup bad merge
* Refactor structure builders out of StructureGenerator
* Refactor Operation Shape
This commit builds on the builder refactoring to introduce `Operation`s as the top level object that users interact with. This has a number of improvements:
1. The operations page in the documentation is now clean and includes exactly the operations that are available.
2. Builders for Input shapes now actually return an `Operation`. In a follow-up commit, the `build()` method on input shapes will be
updated to accept a service configuration object.
3. The split-impl block for operation shapes has been removed.
4. Docs for operation shapes are now the documentation for the operation and not for the input
5. This sets us up for having a top level operation onto which we can attach a `from_response(..)` method in a follow-up PR to implement response parsing.
* Add combined error generator
* Deterministic operation generation
* Test generator refactoring
* Fix test failure in inlineable
* Back out needless changes to Rust.kt and merge error types
* Add some docs
* Add non_exhaustive to structs, unions, and enums
During a refactoring, `non_exhaustive` was accidentally removed from generated structurs. This commit re-adds it and validates its present with tests.
* Remove print
* Delete empty test