* Support signing requests to S3
* Refactor to include support for signing streaming bodies (tested)
* Update stale comments
* Remove left-over `dbg!` invocation
This diff adds the S3 model & fixes compilation / clippy related codegen issues. I altered the SDK ID to be "S3 Preview". This means that all the generated code includes
"preview" because until a number of other fixes land, requests to S3 won't actually work.
* Write XML Encoding Abstractions
This commit creates an XML encode & escaping abstraction that allows "fearless code generation"
(invalid XML is a compile error).
* Rename TagWriter to ScopeWriter
Found several bugs while adding some more protocol tests:
- whitespace characters were not properly handled by `dq()/doubleQuote()`. I found a proper implementation in Smithy I should have been using all along.
- I erred at some point when I used a Vim macro to setup the new percent encoder. This is been resolved & a test has been added
* Refactor HttpBinding protocol
* Update XmlBindingTraitParserGenerator to fix new protocol tests
* Clear all warnings
* Major overhaul of Http Trait based protocols
* Remove pointless wrapping
* Nullable types fall through
* Cleanup JsonParserGenerator, refactor
* More Json parser generator cleanups
* Update test
* Fix unit test
* [cleanup] Move interfaces to their own files
* Use parser / serializer generators from AwsJson
Errors returned by AWS services may be stored at `Message`, `message` or `errorMessage`. This updates the relevant code to search all three locations when surfacing a clean error message to the customer. This diff also fixes a long-standing shortcoming of SdkError where it failed to provide a clean Display implementation.
* Update signing API
Updates signing to the new API which accepts borrowed credentials. This ensures that credentials aren't copied unnecessarily which improves both security and performance.
* Roll back changes to user agent
* Remove local dependency, code is landed upstream
* Switch back to crates.io dependency
* Use double encoding
* Appease clippy
* Refactor HttpProtocolGenerator body construction
* Well that was easy... (add streaming input support)
* Fix tests, clippy warning
* One more clippy wrap ignore
* Fix test that used private API
* Add test for default value
* Parser Generator for XmlBindingTraits
This diff adds two components:
- `smithy-xml`: A scoped-reader XML abstraction on top of `xmlparser`
- `XmlBindingTraitParserGenerator`: A code generator for deserializing data targetted with the XmlBinding traits
This is not currently used outside of the tests, but this implementation passes all protocol tests expect for escaping (wiring is still WIP).
This commit also adds two inlinable abstractions for error parsing which can be swapped in at code generation time based on the service traits.
* Cleanup XmlError
* Add support for unescaping XML
* Back out changes to testutil
* Rename currentTarget to accum
* CR feedback
* Remove duplicate copyright & fix doc compilation
* CR feedback
* Add initial set of docs
* More design documentation updates
* Updates to the docs
* Update tenets again to remove the dependeny tenet
* Remove `!`
* Add more design documentation
* More updates to tenets
* More tenets updates
* tenets typo
* Rephrase as 'AWS SDK for Rust'
* rephrase tenets
- Support recursive inline dependencies & iterate to a fixed point properly
- Fix unit test function naming
- Record orginal id in synthetic inputs & outputs
- Instantiate recursive unions properly
* fix: typo in qldbsession example
* feat: test harness for QLDB signv4 service name
* fix: typo in qldbsession example
* feat: test harness for QLDB signv4 service name
* feat: integration test for qldbsession signing
* fix: request protocol version
* fix: test request protocol version
* fix: overwrite the user agent for test
Co-authored-by: Shing Lyu <shinglyu@amazon.nl>
* Assert field-by-field equality in protocol tests
Protocol tests currently use `PartialEq`, but when we add streaming members, we can no longer compare equality synchronously & without
side effects. This diff removes `PartialEq` from output shapes (we may re add it later for non-streaming shapes) & instead asserts equality of each output member in turn.
* Cleaner version of body streaming, still some work to get it to work with tests
* Finalize protocol test support
* Add default to the operation parsers
* Add helper for isStreaming on member shapes
* Cleanups & add test
* allow upper case keys in rustTemplate
* Upgrade to Smithy 1.7
Two changes:
1. Add support for shape renaming. Since renaming doesn't apply to operations, errors, or resources, this was actually a fairly narrow change. I intentionally
maintained the ability to generate a model without a service shape, I expect at some point, some one will just want to make some Rust structs.
2. Add support for map-driven query params.
* Update APIGW model
* Fix bugs in httpParams implementation
* Cleanup logic and add one more test
* Fix StackOverflow in SdkBody Debug
An incorrect debug implementation lead to infinite recursion when printing `SdkBody` with the debug formatter
* CR Feedback
Protocol tests currently use `PartialEq`, but when we add streaming members, we can no longer compare equality synchronously & without
side effects. This diff removes `PartialEq` from output shapes (we may re add it later for non-streaming shapes) & instead asserts equality of each output member in turn.
* Refactor Operation Code generation
This all started when I wanted to the public API in my protocol tests but couldn't because it depended on the input. So began
a large sequence of refactoring that overall lead to major improvements.
1. `Operation` no longer carries an input around. This was originally done to support paginators, but we'll handle that differently later.
2. `Builders` are now uniform—no more special builders for operation shapes.
3. Idempotency token insertion is now handled during operation construction instead of during builder construction. This removes
a ton of special casing from various parts of the code base.
4. Protocol tests now use the public traits. This will enable us to generate protocol tests for streaming inputs without any
special casing.
This wasn't done originally because the main API was the low-level API and I didn't want `.build().make_operation()`. But now
that this is only an escape hatch, the double call isn't nearly as big of a deal.
* Delete unused variable
* Update other tests that used the LL API
* Add ByteStream abstraction
Introduce `ByteStream`, a wrapper around SdkBody to provide easy-to-use abstractions around streaming binary data.
* Updates for CR feedback
- `data` is renamed to `collect`
- Added `into_inner` so that you can use it as a body directly if desired
- Removed unecessary impl for io::Error
- Added `From<SdkBody> for ByteStream
- Project to remove need for `Unpin` in `Inner`
- Forward relevant method in `Buf` implementation
- Use `try_next` in example
* Fix missed `data -> Collect`
* Show don't tell in examples
* Add qldb, qldbsession and small examples
'Qldb' is an AWS database service. There are two webservices: qldb and
qldbsession. The former has APIs like Create, List and DeleteLedger. The
later is the dataplane API (like connecting to MySQL or Postgres).
QldbSession really has only 1 API, called "send command". A command is
something like "start a session", or "here is some sql".
The 'QldbSession' example isn't very useful, as customers would never
actually use the underlying API. Rather, they would use something like
the driver: https://github.com/awslabs/amazon-qldb-driver-rust.
The 'Qldb' is a simple list-ledgers example, similar to what's found for
other services.
* Update aws/sdk/examples/qldb-list-ledgers/src/main.rs
Co-authored-by: Marc Bowes <bowes@amazon.com>
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* Use SdkBody instead of hyper::Body
As part of the path to supporting streaming request & response bodies, we need to remove the need to have a generic request/response body. This commit hides hyper::Body inside of SdkBody & also introduces a dynamic alternative to enable supporting any HTTP Body implementation.
* Delete ResponseBody & Update usages
Now that SDK body has a visible "Bytes" variant, ResponseBody is no longer needed as a bridge to expose debug information about responses.
* Rename _cx => cx
This diff fixes a bug where the default AWS endpoint resolver was erroneously overriding the signing service with the name of the service, even when a signing service override was present in the models.
When used over H/2, sending an empty data frame for a GET can trigger some problematic behavior in Hyper. Hyper should probably handle this, but this ensures that we will
not hit this behavior.
When sending data to API Gateway services, we are getting GOAWAY because this causes to send duplicate empty data frames.