Commit Graph

145 Commits

Author SHA1 Message Date
Russell Cohen f2b3442103
Update README.md 2021-04-22 16:02:22 -04:00
Russell Cohen e698ceae2e
Send Poll::Ready(None) on empty body (#325)
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.
2021-04-22 15:33:13 -04:00
Victor Barbu 6a8e4274a6
Add as_xyz and is_xyz helper methods on Smithy Unions (#321)
* Add as_xyz and is_xyz helper methods on Smithy Unions

Issue #298

* Fix Unions generation and add unit test

Co-authored-by: Victor Barbu <vicbarbu@amazon.com>
2021-04-21 16:54:55 -04:00
Russell Cohen 7c7640550a
Update README.md (#305) 2021-04-20 23:01:40 +00:00
Doug a3d88b7a75
Doug secretsmanager examples (#318)
* Added SecretsManager code examples for CreateSecret, GetSecretValue, and ListSecrets

* Fixed lint error in SecretsManager ListSecrets code example
2021-04-20 21:12:56 +00:00
Doug c36b5efade
Added Polly code examples after running clippy (#315)
* Added Polly code examples after running clippy

* Cleanup examples

* Remove unnecessary or_else

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
2021-04-19 23:36:13 -04:00
Russell Cohen e7a0f1fa60
Update Rust version (#276)
* Update Rust version

* wip

* Refactor handling of clippy lints

* Delete old version of clippy lints

* Delete unused code
2021-04-19 14:21:42 -04:00
Russell Cohen 5cbfbf580d
Add support (& default to) Rustls (#311)
* Add support (& default to) Rustls

* Add example of switching to native tls

* Delete dead code

* Update conn.rs
2021-04-19 16:59:52 +00:00
Russell Cohen fc0c6ea90c
Upgrade proptest to 1.0 (#310) 2021-04-14 18:08:29 -04:00
Russell Cohen 36bc1bd592
Zero credentials when dropped (#295)
* Zero credentials when dropped

* Use the Zeroize wrapper
2021-04-14 21:07:05 +00:00
Russell Cohen ece5e147a5
Add more missing licenses (#309) 2021-04-14 16:14:19 -04:00
Russell Cohen 8e81a3e006
Rename generated crates to aws-sdk-* (#302)
* Rename generated crates to aws-sdk-*

* Don't use module name as service name for metadata

* Add module authors to protocol test builds

* Couple more fixes

* Fix module authors field

* Update dependency
2021-04-14 17:59:53 +00:00
Russell Cohen 908dec558e
Add LICENSE to generated crates and set license in Cargo.toml (#301) 2021-04-14 17:35:53 +00:00
Russell Cohen 5055eb8e76
Add missing copyright headers (#299)
* Add missing copyright headers

* Fixes
2021-04-14 12:58:15 -04:00
Russell Cohen 27486aa6e4
master -> main in Contributing.md (#300) 2021-04-14 14:46:50 +00:00
Nas Taibi cad0d0e16a
add better error handling for secretsmanager helloworld example (#307)
* add better error handling for secretsmanager helloworld example

* Format

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
2021-04-13 22:18:52 -04:00
Nas Taibi cc805834b8
add secretsmanager helloworld example (#303) (#304)
* add secrets manager hello world example

* Apply suggestions from code review

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
2021-04-13 15:30:15 -04:00
Russell Cohen cd21b6d30e
Make Generated Builders Vec-Aware (#267)
* Make Generated Builders Vec-Aware

This updates the generated builders & fluent client to be vec-aware. The builder method with the same name as the field will append the field to the list, creating it if it doesn't exist. A `set_xyz` method is added which retains the original behavior.

* Fix test usages of builders

* Add Map builder

* Fix unit tests

* Add impl Into clause for builder helpers

* Update another test

* One more spot that needed to be updated

* Delete dead code
2021-04-07 10:34:38 -04:00
Russell Cohen 336670b4c1
Create a Top-Level Error Generator (#282)
* This is weird

* impl Error for Top Level Errors

* Disable 1.51 clippy lints. Not sure why they are showing up in this PR that hasn't bumped the rustc version

* clean impl display, top level errors send/sync

* Assert errors are send+sync

* Make futures Send
2021-04-02 15:01:02 -04:00
Russell Cohen 60841ef279
Rename the 'fluent' feature to `client` and rename module (#285)
* Rename the 'fluent' dynamodb feature to client

* Update examples

* Don't upload a broken SDK
2021-04-02 11:13:17 -04:00
Russell Cohen bc511ec77f
Add two Amazon Polly examples (#286)
* Add to Amazon Polly examples

* Fix copy-paste error

* Update aws/sdk/examples/polly-helloworld/src/main.rs

Co-authored-by: David Barsky <dbarsky@amazon.com>

* Update aws/sdk/examples/polly-helloworld/src/main.rs

Co-authored-by: David Barsky <dbarsky@amazon.com>

* Some cleanups

* Rerun precommit

* CR Feedback

* Fix clippy lint

* Small cleanup

Co-authored-by: David Barsky <dbarsky@amazon.com>
2021-04-01 21:49:57 -04:00
Russell Cohen 6b605892c7
Add ApiGateway accept header customization (#287)
* Add ApiGateway accept header customization

* Update Java version in CI to match local

* Fix bug in dependency relative paths

* Add path validation
2021-04-01 17:16:13 +00:00
Russell Cohen 9aa7881a1d
Add Polly, ApiGateway, fix bugs. (#283)
* wip

* Fixes for Polly & API Gateway

* Add ApiGateway and Polly Models

* Fix ktLint issues

* backport clippy ignores

* remap timeout error

* Format

* Fix error handling on timeout

* Ignore another clippy lint
2021-03-31 18:52:37 -04:00
Russell Cohen 138320e99e
Add restJson error parsing & prefix headers support (#274)
* restJson1 Header Deserialization Support

This adds support for the `@httpHeader` trait during request deserialization. This is facilitated via a `Read` abstraction which allows parsers to consume part of an input and return the remaining input. We use this to enable things like `HttpDates` which actually include commas to be parsed in a comma delimited fashion.

The internal libraries may eventually be refactored to reduce the amount of generics if it proves to be a compiler bottleneck.

* Add support for parsing request bodies

* Add response code parsing

* Lots of refactorings to restJson response parsing

* Fix some clippy lints

* Add document deserialization support and delete the failing tests

* Add new error handling (all RestJson protocol tests passing!)

* Add prefix headers parsing support

* Fix Rust Runtime clippy warnings

* Cleanup some more dead code / clippy fixes

* Update external functions to take HeaderMap instead of the value iterator

* Hard error on unreconized binding location

* Refactor parse function generation to be on-demand

* One more round of refactoring

* Few more cleanups
2021-03-31 14:19:29 -04:00
Russell Cohen 89d984df13
Fix Retryability of Unmodeled Errors (#277)
A bug was introduced which caused unmodeled response codes to be lost during error handling. This caused the unmodeled errors to always be marked as "unretryable" because their code wasn't exposed to the retry policy. This diff adds a fix and integration test for this behavior.
2021-03-30 10:33:17 -04:00
Russell Cohen c049a37f8c
RestJson Response Parsing (#272)
* restJson1 Header Deserialization Support

This adds support for the `@httpHeader` trait during request deserialization. This is facilitated via a `Read` abstraction which allows parsers to consume part of an input and return the remaining input. We use this to enable things like `HttpDates` which actually include commas to be parsed in a comma delimited fashion.

The internal libraries may eventually be refactored to reduce the amount of generics if it proves to be a compiler bottleneck.

* Add support for parsing request bodies

* Add response code parsing

* Lots of refactorings to restJson response parsing

* Fix some clippy lints

* Add document deserialization support and delete the failing tests
2021-03-29 19:03:26 -04:00
Russell Cohen b67e651f22
Add support for document deserialization (#273) 2021-03-25 19:55:23 -04:00
Russell Cohen 16b71cf9fe
Http Prefix Header Support (#263)
* Http Prefix Header Support

The impetus of this diff is adding support for HttpPrefix headers. This ended up leading to a bunch of other changes:

1. operation.build() now always returns a result to account for inability to construct HTTP requests from certain inputs
2. HeaderName/HeaderValue is now created eagerly to give a better error message
3. httpPrefixHeaders are supported
4. The Dynamo movies example now uses the fluent client.

* Disable clippy lint of extra wrap

* Fix example

* Delete some dead code
2021-03-24 15:45:42 -04:00
Russell Cohen 41d948c597
Serialize Request bodies for restJson (#255)
* Serialize Request Bodies for RestJson

* Move the bodies to the serializer module

* RestJson body CR feedback and bug fixes
2021-03-22 16:40:50 -04:00
Russell Cohen 4f958f3709
Add support for query literals (#257)
* Add support for query literals

* Add comments

* Refactor to avoid needing a Vec and skip some allocations

* Another rename, more docs
2021-03-22 15:19:36 -04:00
Russell Cohen 3f4f44c323
Add Fluent API (#251)
* Fully qualify types from models

For a long time, we've been fully qualifying depdency types but not model types. This produces code that's fine, but it's always been a confusing inconsistency and it posed problems trying to render Opaque types that specified namespaces (because the namespace was ignored).

This removes that inconsistency.

* A few more small refactorings

* Fix test failures

* Wip fluent API

* Fluent builders working!

* fix handle visibility

* Delete unused imports

* Lots of refactorings & making the fluent client an optional feature

* Cleanup module handling & add support for Cargo features

* Fix AWS tests

* Remove unused modules customization

* Set optional in the Cargo toml

* .execute() -> .send()

* Fix issues from refactoring out cargo features implementation
2021-03-16 22:50:50 +00:00
Russell Cohen 5fde528219
Cleanup module handling & add support for Cargo features (#253)
* Cleanup module handling & add support for Cargo features

* Fix AWS tests

* Set optional in the Cargo toml
2021-03-16 18:45:02 -04:00
Russell Cohen 90f116c501
Refactor errors to expose a kind & meta field separately (#249)
* Refactor errors to expose a kind & meta field separately

* More simplification of errors

* Simplify the retryable_error_kind implementation

* Error generator cleanups

* Fix aws-hyper feature issue

* Small test-util refactoring to improve debug output
2021-03-16 15:11:24 -04:00
Russell Cohen 3308fef88a
Fully qualified model types (#244)
* Fully qualify types from models

For a long time, we've been fully qualifying depdency types but not model types. This produces code that's fine, but it's always been a confusing inconsistency and it posed problems trying to render Opaque types that specified namespaces (because the namespace was ignored).

This removes that inconsistency.

* A few more small refactorings

* Fix test failures

* CR feedback
2021-03-16 14:36:17 +00:00
Russell Cohen 8b386a8868
No more unpin (#248)
* Remove unecessary Unpin bound

* Cargo Fmt
2021-03-10 23:46:37 +00:00
Russell Cohen 6b38bf718e
Concrete body in SdkResult/SdkError (#247)
* Refactor out generic `B` parameter from SdkResult / SdkError

* Switch to from_static

* Add docs, fix old broken docs

* Remove unused From<Bytes> bound

* Rustfmt run
2021-03-10 23:28:05 +00:00
Doug d75b7605b1
Update README.md (#246) 2021-03-09 18:49:16 -05:00
Russell Cohen 5bb8b35779
Ensure that clients are Send+Sync (#243)
* Ensure that clients are Send+Sync

* Make constructor more ergonomic
2021-03-09 14:33:49 -05:00
Russell Cohen 7d39bf6b63
Add DynamoDB pseudo integration test (#240) 2021-03-09 09:19:19 -05:00
Russell Cohen 9959d9b97e
Introduce a `Standard` enum for connections (#237)
* Enum Conn POC

* Make alias public

* Add docs, Debug impl, format

* Add comment delete dead code

* A couple of missing cargo-formats

* Cleanup, address CR feedback

* Derive clone instead of implementing it manually
2021-03-08 18:02:48 -05:00
Russell Cohen d364e69462
Add complex DynamoDB usage example (#241)
* Add complex DynamoDB usage example

* Fix clippy lint

* Remove unused clone
2021-03-08 18:17:17 +00:00
Russell Cohen f192530f4d
Pseudo-Integration tests for KMS (#239)
* wip

* Generate Cargo.toml after lib rs, cleanup deps

* Move RecordingConnection into an extras crate

* Move generation code into extras crate

* Delete unused conn method

* Add todo about storing req/resps externally

* Add note about credential expiry

* Fix clippy lint

* Replace creds with fake creds

* Delete note about real credentials

* Give cargo fmt a hand
2021-03-05 12:24:37 -05:00
Russell Cohen 00671a237a
Retry bug (#238)
* Fix bug in RetryPolicy

* Add tracing to the retry policy
2021-03-05 10:20:21 -05:00
Russell Cohen 77b24b2c3b
Cleanups (#236)
* EndpointResolver should be pub(crate)

* Switch internals of Region to be Cow

* Rename ProvideIdempotencyToken to MakeIdempotenyToken

* Make the config module public and rename ConfigBuilder to Builder

* Rename credentials to

* Fix missed use of Endpoint
2021-03-03 15:54:20 -05:00
Russell Cohen 638b2a90de
Upgrade to Smithy 1.6.1 (#235) 2021-03-03 14:08:03 -05:00
Russell Cohen 970f69bf06
Create a table in the example (#226) 2021-03-03 11:35:41 -05:00
Russell Cohen 8f844c579c
Add Retry support (#232)
* Add Retry support

* Fixup some broken tests

* Refactor, add docs, rename retry strategy

* Some more renames, some more docs
2021-03-02 22:32:55 +00:00
Russell Cohen 6eaae060dc
Fix user agent lang header (#233)
* Fix user agent lang header

The User-Agent and x-amz-user-agent headers were not setting `lang/` before the language section.

* Fix tower deprecation
2021-03-02 14:48:07 +00:00
Russell Cohen 27fb78ac63
Fix a few clippy issues & add clippy to CI (#231) 2021-02-24 20:22:32 +00:00
Russell Cohen 24fdd04236
Sensitive trait (#229)
* Add support for the Sensitive Trait

* Add kms integration test for sensitive trait

* Add additional test

* Always generate a custom debug impl

This actually causes a reduction in llvm-lines & apparently can improve compile performance. It also simplifies the code.
2021-02-23 23:09:03 +00:00