Go to file
Matteo Bigoi 2931c9e1e6
Initial awsJson 1.0 and 1.1 server implementation (#1279)
To support these new protocols, we also changed the runtime Router definition as for both awsJson 1.0 and 1.1, every request MUST be sent to the root URL (/) using the HTTP "POST" method.

The runtime Router now supports explicitly all the available protocols.

There are still some protocol tests failing for awsJson 1.0 and 1.1. The failure are caused by the missing implementation of @endpoint trait and date parsing. Protocol tests for these 2 protocols are heavily biased towards Responses. Before announcing support for awsJson 1.0 and 1.1, we should increase the protocol tests coverage.

Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
Co-authored-by: david-perez <d@vidp.dev>
2022-04-19 16:41:03 +00:00
.cargo Include SDK example/test projects in CI and centralize Cargo target directory (#636) 2021-08-09 12:25:40 -07:00
.github Split `ci.yml` to avoid max workflow depth error (#1316) 2022-04-13 10:50:18 -07:00
.pre-commit-hooks Add recursion detection middleware to the default middleware stack (#1003) 2021-12-27 18:04:10 +00:00
aws update: MSRV from 1.56.1 to 1.58.1 (#1325) 2022-04-15 14:01:18 -05:00
buildSrc Run `ktlint` from repository root (#1327) 2022-04-19 17:56:00 +02:00
codegen Initial awsJson 1.0 and 1.1 server implementation (#1279) 2022-04-19 16:41:03 +00:00
codegen-server Initial awsJson 1.0 and 1.1 server implementation (#1279) 2022-04-19 16:41:03 +00:00
codegen-server-test Initial awsJson 1.0 and 1.1 server implementation (#1279) 2022-04-19 16:41:03 +00:00
codegen-test Fix serialization of required shapes (timestamps and nested shapes) (#1275) 2022-03-24 11:19:18 +00:00
design RFC: Callbacks for `ByteStream` and `SdkBody` (#1307) 2022-04-15 14:56:06 -05:00
gradle Add more docs to codegen (#776) 2021-10-15 16:49:27 -07:00
rust-runtime Initial awsJson 1.0 and 1.1 server implementation (#1279) 2022-04-19 16:41:03 +00:00
tools update: MSRV from 1.56.1 to 1.58.1 (#1325) 2022-04-15 14:01:18 -05:00
.gitignore Generate a `versions.toml` with the SDK (#1311) 2022-04-12 16:55:32 -07:00
.pre-commit-config.yaml Add license header checker & missing headers (#917) 2021-12-02 13:39:30 +00:00
CHANGELOG.md update: gradle.properties for release (#1324) 2022-04-14 16:08:11 -05:00
CHANGELOG.next.toml update: MSRV from 1.56.1 to 1.58.1 (#1325) 2022-04-15 14:01:18 -05:00
CODEOWNERS Add benchmark deviation calculation from origin/main to current PR (#1230) 2022-03-08 17:42:26 +00:00
CODE_OF_CONDUCT.md Initial commit 2020-10-28 06:37:45 -07:00
CONTRIBUTING.md master -> main in Contributing.md (#300) 2021-04-14 14:46:50 +00:00
LICENSE Initial commit 2020-10-28 06:37:45 -07:00
NOTICE Initial commit 2020-10-28 06:37:45 -07:00
README.md Remove unused test scripts and update readme (#1136) 2022-02-01 18:15:20 -08:00
build.gradle.kts Upgrade Smithy to 1.16.1 (#1053) 2022-01-12 15:35:40 -08:00
ci Split `ci.yml` to avoid max workflow depth error (#1316) 2022-04-13 10:50:18 -07:00
ci.mk Split `ci.yml` to avoid max workflow depth error (#1316) 2022-04-13 10:50:18 -07:00
gradle.properties update: MSRV from 1.56.1 to 1.58.1 (#1325) 2022-04-15 14:01:18 -05:00
gradlew Aws config connector timeouts (#740) 2021-10-06 13:35:24 -04:00
gradlew.bat Add gradle files 2020-10-28 11:01:13 -04:00
settings.gradle.kts Upgrade Smithy to 1.16.1 (#1053) 2022-01-12 15:35:40 -08:00

README.md

Smithy Rust status

Smithy code generators for Rust that generate clients, servers, and the entire AWS SDK. The latest unreleased SDK build can be found in aws-sdk-rust/next.

Design documentation

All internal and external interfaces are considered unstable and subject to change without notice.

Setup

  1. ./gradlew will setup gradle for you. JDK 11 is required.
  2. Running tests requires a working Rust installation. See Rust docs for installation instructions on your platform. Minimum supported Rust version is the latest released Rust version, although older versions may work.

Development

For development, pre-commit hooks make it easier to pass automated linting when opening a pull request. Setup:

brew install pre-commit # (or appropriate for your platform: https://pre-commit.com/)
pre-commit install

Project Layout

  • aws: AWS specific codegen & Rust code (signing, endpoints, customizations, etc.) Common commands:
    • ./gradlew :aws:sdk:assemble: Generate (but do not test / compile etc.) a fresh SDK into sdk/build/aws-sdk
    • ./gradlew :aws:sdk:test: Generate & run all tests for a fresh SDK
    • ./gradlew :aws:sdk:{cargoCheck, cargoTest, cargoDocs, cargoClippy}: Generate & run specified cargo command.
  • codegen: Whitelabel Smithy client code generation
  • codegen-test: Smithy protocol test generation & integration tests for Smithy client whitelabel code
  • design: Design documentation. See the design/README.md for details about building / viewing.
  • codegen-server: Whitelabel Smithy server code generation
  • codegen-server-test: Smithy protocol test generation & integration tests for Smithy server whitelabel code

Testing

Running all of smithy-rs's tests can take a very long time, so it's better to know which parts to test based on the changes being made, and allow continuous integration to find other issues when posting a pull request.

In general, the components of smithy-rs affect each other in the following order (with earlier affecting later):

  1. rust-runtime
  2. codegen and codegen-server
  3. aws/rust-runtime
  4. aws/sdk-codegen

Some components, such as codegen-test and codegen-server-test, are purely for testing other components.

Testing rust-runtime and aws/rust-runtime

To test the rust-runtime crates:

# Run all Rust tests for `rust-runtime/`
./gradlew rust-runtime:cargoTest
# Run clippy for `rust-runtime/`
./gradlew rust-runtime:cargoClippy

For aws/rust-runtime, just prefix with aws::

# Run all Rust tests for `rust-runtime/`
./gradlew aws:rust-runtime:cargoTest
# Run clippy for `rust-runtime/`
./gradlew aws:rust-runtime:cargoClippy

Some runtime crates have a additional-ci script that can also be run. These scripts often require cargo-hack and cargo-udeps to be installed.

Testing Client/Server Codegen

To test the code generation, the following can be used:

# Run Kotlin codegen unit tests
./gradlew codegen:check
# Run client codegen tests
./gradlew codegen-test:check
# Run server codegen tests
./gradlew codegen-server-test:check

Several Kotlin unit tests generate Rust projects and compile them. When these fail, they typically output links to the location of the generated code so that it can be inspected.

To look at generated code when the codegen tests fail, check these paths depending on the test suite that's failing:

  • For codegen-test: codegen-test/build/smithyprojections/codegen-test
  • For codgen-server-test: codegen-server-test/build/smithyprojections/codegen-server-test

Testing SDK Codegen

See the readme in aws/sdk/ for more information about these targets as they can be configured to generate more or less AWS service clients.

# Run Kotlin codegen unit tests
./gradlew aws:sdk-codegen:check
# Generate an SDK, but do not attempt to compile / run tests. Useful for inspecting generated code
./gradlew :aws:sdk:assemble
# Run all the tests
./gradlew :aws:sdk:test
# Validate that the generated code compiles
./gradlew :aws:sdk:cargoCheck
# Validate that the generated code passes Clippy
./gradlew :aws:sdk:cargoClippy
# Validate the generated docs
./gradlew :aws:sdk:cargoDoc

The generated SDK will be placed in aws/sdk/build/aws-sdk.