Commit Graph

49 Commits

Author SHA1 Message Date
Russell Cohen a50c966ef2
change http checksums to be base64 encoded (#615)
* change http checksums to be base64 encoded

due to a misreading of the spec, the http checksums where hex encoded when they should actually be base64 encoded

* Update changelog
2021-07-28 15:29:02 +00:00
Russell Cohen c10899da08
Backfill message & parse without case sensitivity (#565)
* Backfill message & parse without case sensitivity

* Allow empty errors for XML protocols
2021-06-30 21:59:01 +00:00
Russell Cohen b8a3b28acf
More bugfixes from adding every service (#541)
* Suppress noisy logging from the renamer

* Allow codegen settings model settings

* fix more naming bugs

* Fix ambiguous binding function name

* Attempt to fix gradle script bugs

* Remove double unescape

* Fix service names in tier 1 services list

* Fix ResponseBindingGeneratorTest
2021-06-24 22:02:48 +00:00
Russell Cohen 3d61226b5d
fix and test a number of codegen bugs (#539)
- fields named `build`, `send`, `default`
- operations named keywords
- single-element unions needed a clippy lint ignored
- enum docs needed `escape` to be invoked
2021-06-23 15:54:54 -07:00
John DiSanti 28af7e22d2
Implement JsonParserGenerator using smithy-json (#498)
* Implement JsonParserGenerator using smithy-json

* CR feedback

* Fix smithy-json test

* Simplify JsonParserGenerator

* Fix clippy warning
2021-06-22 15:20:16 -07:00
Russell Cohen 46a9e817bf
Fix for parsing string headers (#525)
* Fix for parsing string headers

* Rename function & add docs
2021-06-21 23:03:31 +00:00
Russell Cohen f89f941702
Add support for the httpchecksum required trait (#523) 2021-06-21 14:05:15 -07:00
Russell Cohen fc3af3fe89
Add more naming hygiene for Result (#502)
* Add more naming hygiene for Result

* Fix missing <

* Fix broken test
2021-06-15 19:38:20 +00:00
Russell Cohen a47ada58c6
Name collision refactor (#492)
* Centralize colliding renames

* Add integration test

* Cleanup exception

* Add tests & fixes for more invalid Rust identifiers
2021-06-11 14:52:58 -04:00
John DiSanti 1469090ff4
Add EC2 Query protocol support (#475)
* Add EC2 Query protocol support

* Centralize serialization logic between AWS Query and EC2 Query
2021-06-10 12:50:38 -07:00
Russell Cohen 460ef5397e
Add support for endpoints.json (#468)
* Add support for endpoints.json

* Backout Smithy 1.8 changes

* Delete DefaultAwsEndpoint resolver

* Add test for iam / fips

* IAM works now

* CR feedback

* Fix tests

* CR feedback
2021-06-07 21:00:11 -04:00
Russell Cohen 4f3af7a6c6
Support primitive zeroes in restJson and restXml (#451)
* suppress serializing of primitive 0s as struct members

When a struct primitive is a "zero value" it shouldn't be serialized. It's frequently the case that `0` is an invalid input & sending 0 on the wire will actually cause the service to reject the request.

Fixes #439

* support primitive zeros in restJson and restXml

1. Avoid serializing PrimitiveInteger when it is 0, unless it is required
2. Setup the ability to write protocol tests against generated SDKs
3. Fix a trailing `,` in aws-sdk-codegen-test
4. Keep trying to get the gradle build to invalidate caches properly.

* Add awsQuery support

* Cleanups

* Fix bad merge

* Fix clippy error
2021-06-02 15:48:03 -04:00
Russell Cohen a9daa0497b
fix restXml enum map key deserialization (#437) 2021-06-01 15:56:56 +00:00
John DiSanti 9c5ca9d803
Add response deserialization support for the AWS query protocol (#428)
* Add response deserialization support for the AWS query protocol

* Split AwsQuery specifics into separate AwsQueryParserGenerator

* Refactor operation wrapping logic between AwsQuery and RestXml

* Clean up parseStructInner
2021-05-28 10:47:31 -07:00
John DiSanti 281ee4452f
Finish the JSON serialization refactor (#423)
* Only include document bound members in HTTP operations

* Add rest-json-extras test for maps with an enum key

* Fix serialization of maps with enum keys

* Replace SerdeJsonSerializerGenerator with JsonSerializerGenerator

* Suppress clippy warning

* CR feedback
2021-05-26 15:43:44 -07:00
Russell Cohen 84c258658f
Fix support of primitive headers with a default (#402) 2021-05-21 11:49:10 -04:00
Russell Cohen 392463d022
Add more XML protocol tests (#382)
* Add more XML protocol tests

* Update rest-xml-extras.smithy

* Update rest-xml-unwrapped-errors.smithy
2021-05-19 18:40:54 +00:00
John DiSanti 9e05d1f0d0
Escape enum variants to avoid collision with generated Unknown variant (#388)
* Escape enum variants to avoid collision with generated Unknown variant

* Output enum documentation with unknown variant renaming note

* CR feedback
2021-05-18 12:58:00 -07:00
Russell Cohen 15e21af3ff
Protocol unification & Add Rest XML deserialization support (#369)
* 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
2021-05-14 22:23:02 +00:00
Russell Cohen c62afebd50
Redo url encoding (#368)
* Redo URL encoding to cover all cases

* Fix test that missed a couple of encodings

* Should have been escaping !
2021-05-12 17:45:20 +00:00
Russell Cohen 42c1f215a5
Http Protocol Refactor & Streaming Request bodies (breaking change) (#359)
* 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
2021-05-12 00:04:29 +00:00
Russell Cohen afee2a662a
Support primitive ints in status bindings (#367) 2021-05-11 15:34:39 -04:00
Russell Cohen 0bef36c603
Smithy 1.7 upgrade (#340)
* 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
2021-04-29 17:55:19 -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 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 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 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 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 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 970f69bf06
Create a table in the example (#226) 2021-03-03 11:35:41 -05:00
Russell Cohen ed7454ff0d
Generate smithy_http::Operation & Implement ParseResponse trait (#174)
* Generate smithy_http::Operation

* Implement ParseResponse trait for AwsJson services
2021-01-29 11:56:57 -05:00
Russell Cohen ec0b06d1ad
Top level error shape improvements (#172)
* 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
2021-01-27 20:07:34 -05:00
Russell Cohen 9b40b38dd9
Fix Enum Serialization (#160)
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.
2021-01-15 15:15:38 -05:00
Russell Cohen de4787f271
Update Dynamo Model & IT (#97) 2020-12-30 16:37:40 -05:00
Russell Cohen 5c0bfa4f1b
Generate Crate Documentation (#93)
* 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
2020-12-30 09:59:20 -05:00
Russell Cohen 883fc05795
Generate an AWS-SDK shaped artifact (#92)
* Generate an AWS-SDK shaped artifact

* Fix gradle dependency tree

* Rename artifact to 'sdk'

* Load SdkId from the service shape
2020-12-30 09:48:51 -05:00
Russell Cohen b6b75a7fe3
Support Deserializing Http Dates (#86)
* 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.
2020-12-22 11:00:41 -05:00
Russell Cohen e79ccb1422
Support Idempotency Token (#91)
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.
2020-12-18 12:45:31 -05:00
Russell Cohen c0aa43c614
Update copyrights on every file (#89) 2020-12-17 13:45:48 -05:00
Russell Cohen c76113675a
Dynamo IT & IO Layer v0 (#84)
* 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
2020-12-14 23:24:47 -05:00
Russell Cohen 63fcc795ff
Fix a number of hygiene issues around namespacing and reserved words (#78)
* Fix a number of hygiene issues around namespacing and reserved words

* Enable opting out of Exception => Error
2020-12-10 13:58:56 -05:00
Russell Cohen 5af7fc0bc9
Dynamo update (#54)
* Use the new Dynamo DB model

* Convert Vec<T> to [T] when generating formatters
2020-11-24 19:03:53 -05:00
Russell Cohen be16c2f225
Generate documentation for structures (#47)
* Generate documentation for structures

The first of many commits to generate docs. This is a first pass for structures, we still need to document enums & unions. Some serious design also needs to occur to figure out the best practice for turning the Smithy documentation into nice Rust documentation.

* Bump Java version to 9

* Remove exclusion of `target`

* Don't build docs for deps

* Update to use getMemberTrait
2020-11-24 11:26:11 -05:00
Russell Cohen 555021e36b
Expand protocol tests for RestJson1.1 and AwsRestJson (#38)
* Add document types & other bug fixes to support AwsJson11

* Expand protocol tests for RestJson1.1 and AwsRestJson

This diff adds RestJson1 and AwsJson1.1 to the integration test suite. It uncovered a number of bugs, some of which I fixed inline and some I filed issues for and disabled the tests.

* Add another disabled test & cleaup

* Fix tests broken by changing URL encoding to encode ':'

* Copy-paste Aarons comment

* Fixup Rustfmt
2020-11-18 15:13:12 -05:00
Russell Cohen 86dc5db504
Add pre-commit hooks (#17)
* Setup pre-commit

* Run precommit hook across all files

* Update README.md
2020-11-04 22:09:00 -05:00
Russell Cohen 1d30ad06ca
Add initial protocol test generation (#16)
* Implement Instantiator

* Add support for dev-dependencies

* Pass the protocol in Protocol config

* Add initial protocol test generator

This commit adds an initial and very limited implementation of protocol test generation. Specifically,
it only asserts that the query string contains certain required parameters. We will update protocol test generation in concert with updates to the code generation features.

* Fixes from integration tests

* Add test of recursive maps, fix implementation of empty maps

* Add protocol test generator, pre-commit hooks

* Fix test

* Fix formatting
2020-11-04 11:17:19 -05:00
Russell Cohen 44720f4dc0
Productionize Integration Test Machinery (#15)
* Productionize Integration Test Machinery

smithy-build.json is now dynamically generated along with a Cargo.toml to facilitate easy adding of new integration tests.

* We don't need REPO_ROOT anymore
2020-11-03 18:44:38 -05:00
Russell Cohen ddac680d53
Partial HTTP protocol implementation (#1)
* Add new models to run integration tests against

* Add initial support for HTTP protocols

* Refactor protocol generation arguments

* Add more method comments

* Remove some dead code

* CR feedback
2020-10-29 15:49:22 -04:00
Russell Cohen 4874168a9b Add Rust runtime code 2020-10-28 11:08:23 -04:00