## Motivation and Context
Smithy-rs CI and our release pipeline have exposed another place,
[sdk-adhoc-test](https://github.com/smithy-lang/smithy-rs/tree/main/aws/sdk-adhoc-test),
where we should place a Cargo lockfile but we currently don't.
Specifically, running `./gradlew aws:sdk-adhoc-test:check`on the current
main is encountering the following error:
```
error[E0658]: use of unstable library feature 'error_in_core'
--> /opt/cargo/registry/src/index.crates.io-6f17d22bba15001f/idna-1.0.3/src/lib.rs:78:6
|
78 | impl core::error::Error for Errors {}
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #103765 <https://github.com/rust-lang/rust/issues/103765> for more information
```
We're supposed to pin `idna` to 0.5.0
([example](62caa46394/aws/sdk/Cargo.lock (L2812-L2819))),
but `sdk-adhoc-test` uses 1.0.3.
This PR will fix the problem by copying the checked-in SDK lockfile to
`sdk-adhoc-test`.
## Testing
- [x] `./gradlew aws:sdk-adhoc-test:check` from the repo root has passed
- [ ] Tests in CI
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
Primarily for @drganjoo providing feedback on smithy-rs#3827 (thanks),
but anyone is welcome to review the changes.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Otherwise, if you generate a crate and compile it using Gradle, like for
example using the invocation:
```
./gradlew -P modules='simple' -P cargoCommands='test' codegen-server-test:build
```
And then manually run a `cargo` command within the generated crate
directory, or open the project using `rust-analyzer`, Cargo will
re-compile the project from scratch, with
`CARGO_LOG=cargo::core::compiler::fingerprint=trace` reporting that
flags have changed since the last compilation.
Instead, it's best if we persist these flags to `.cargo/config.toml`, so
all `cargo` invocations, either through Gradle, manually, or through
`rust-analyzer`, use the same set. This way, if no files were changed,
subsequent compilations since code generation will truly be no-ops, with
Cargo reusing all artifacts.
Note this commit fixes a regression that was introduced when `--cfg
aws_sdk_unstable` was introduced in #2614, since I fixed this the first
time back in #1422.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
We have had numerous recent issues where updated dependencies have
broken our build/release process. This seeks to fix that in a brute
force way by manually generating Cargo.lock files for our main
workspaces.
## Description
<!--- Describe your changes in detail -->
Introduce a new gradle task `generateAllLockfiles` (and some child tasks
that it invokes) that generates lock files for
* `aws-config` crate
* `aws/rust-runtime` workspace
* `rust-runtime` workspace
* the superset workspace generated by the `assemble` task
* NOTE: This Cargo.lock is actually generated from the workspace in the
`aws-sdk-rust` repo, saved in this repo, and copied into place at build
time. Generating this one requires a local copy of the `aws-sdk-rust`
repo whose absolute path is indicated by the `-Paws-sdk-rust-path`
parameter.
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
I ran our E2E tests against 3 commits to confirm that the Cargo.lock
files operate as we expect:
* `9d84980ee2e37deadb7e45450d65c5e6bc69e07c` The head commit from this
PR which has our Cargo.lock files
* ✅ Passes
* `d9d9fcec2de0e898bcc804ee0bb31393d7098e72` with lockfiles and with the
`httparse` and `crc323c` crates unpinned
* ✅ Passes
* `df75beb160890b2a9c382c8a2f7da8d7d0ddd3c8` with no lockfiles and has
the `httparse` and `crc32c` crates unpinned
* ❌ Fails (as expected)
This series of tests confirms that that Cargo.lock files will protect us
against bad dependency updates going forward.
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
There are extra service specific model tests in various
`aws/sdk/aws-models/[sdk-id]-tests.smithy` files. These are currently
manually duplicated to `aws-sdk-rust/aws-models`. This PR seeks to make
`smithy-rs` the single source of truth for these tests and remove the
need to copy them into `aws-sdk-rust` at all.
## Description
* move all `-tests.smithy` into a new sibling directory
`aws-models-extra` and _ALWAYS_ include these regardless of what the
path to `aws-models` is (e.g. even when overriding it and generating the
full SDK by setting `-Paws.sdk.models.path`
* move all `-tests.smithy` from `aws-sdk-rust/aws-models` into this
directory (previously only `s3`, `route53`, and `glacier` were in this
repo but there are also additional tests for `ebs`, `batch`, and `sqs`.
This makes `smithy-rs` the only source of truth for additional AWS SDK
model tests
* see https://github.com/awslabs/aws-sdk-rust/pull/1161
* update the `s3` model to latest and revert
ttps://github.com/smithy-lang/smithy-rs/pull/3641
## Testing
Local + CI
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This adds a new runtime crate. The new crate contains code related to
compressing requests. Not included in this PR is everything needed to
actually make use of the new crate.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
- https://github.com/awslabs/aws-sdk-rust/issues/1095
## Description
Update the JSON parser generator to allow for `null` to be set in
unions. Servers can send unions like this:
```json
{
"AmazonElasticsearchParameters": null,
"AmazonOpenSearchParameters": null,
"AppFlowParameters": null,
"AthenaParameters": null,
"AuroraParameters": null,
"AuroraPostgreSqlParameters": null,
"AwsIotAnalyticsParameters": null,
"BigQueryParameters": null,
"DatabricksParameters": null,
"Db2Parameters": null,
"DenodoParameters": null,
"DocumentDBParameters": null,
"DremioParameters": null,
"ExasolParameters": null,
"GoogleAnalyticsParameters": null,
"JiraParameters": null,
"MariaDbParameters": null,
"MongoAtlasParameters": null,
"MongoDBParameters": null,
"MySqlParameters": null,
"OracleParameters": null,
"PostgreSqlParameters": null,
"PrestoParameters": null,
"RdsParameters": null,
"RedshiftParameters": null,
"S3Parameters": {
"IsUploaded": false,
"ManifestFileLocation": {
"Bucket": "deided-bucket.prod.us-east-1",
"Key": "sales/manifest.json"
},
"RoleArn": null
},
"SalesforceParameters": null,
"SapHanaParameters": null,
"ServiceNowParameters": null,
"SnowflakeParameters": null,
"SparkParameters": null,
"SqlServerParameters": null,
"StarburstParameters": null,
"TeradataParameters": null,
"TrinoParameters": null,
"TwitterParameters": null
}
```
This caused our parser to fail.
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
- [x] New unit test
- [x] Dry run against new [smithy protocol
test](https://github.com/smithy-lang/smithy/pull/2180)
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
- #1925
## Description
This adds a minimal Hyper client, focusing on not exposing any unstable
APIs. For this reason, the `Client::Builder` customization API is not
exposed anymore. We do this because at some point in the future, we will
likely move away from the hyper-util based Client.
The code for this was lifted directly from the Hyper 0.14 implementation
but updated for new traits.
However, this does come with some new valuable pieces:
1. Support for aws-lc (no FIPS yet)
2. Support for providing a custom DNS resolver
## Testing
- E2E test with Hyper. A Canary should also be added
(https://github.com/awslabs/aws-sdk-rust/issues/1089)
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
This change adds a new crate, `aws-smithy-wasm`, that exports a SDK
compatible WASI http client. This is a continuation of the work in #2520
using the now stabilized WASI 0.2.0 interfaces from the [wasi
crate](https://crates.io/crates/wasi). This supports, but does not
finalize the work for #2087
## Description
<!--- Describe your changes in detail -->
Add a new crate, `aws-smithy-wasm` which exports a function
`wasi_http_client` that will provide the user with a WASI compatible
http client. This client is implemented by using the
`wasi::http::outgoing_handler`
[ref](https://docs.rs/wasi/0.12.0+wasi-0.2.0/wasi/http/outgoing_handler/index.html)
along with some utility implementations of `TryFrom` to transform back
and worth between the types from the `http` crate and the `wasi::http`
types. It also exports a unit struct `WasmSleep` that impls the
`AsyncSleep` trait needed by the SDK.
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
This is tested via an integration test in
`aws/sdk/integration-tests/webassembly` that uses the wasi http-client
to vuild a config and an operation (that is not sent). It is further
tested in a new canary (`wasm_canary`) that calls the S3
`list_objects_v2` API.
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by: Eduardo Rodrigues <eduardomourar@users.noreply.github.com>
Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Russell Cohen <rcoh@amazon.com>
Co-authored-by: John DiSanti <john@vinylsquid.com>
We intend to include aws-smithy-mocks-experimental in the release, but
it needs to be added to the CrateSet to actually be published.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This PR implements a build tool to audit runtime crate versions as part
of CI and release. If a runtime crate doesn't have the special
`0.0.0-smithy-rs-head` version number, then it is assumed to be
independently versioned, and the audit tool will verify it is version
bumped when any changes are made to it.
Given that there isn't a complete/reliable semver checking tool for Rust
yet, this tool isn't smart. It will rely on devs to correctly bump the
version number when that is done.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This PR changes codegen-core's build-time runtime crate version
resolution to pull versions from the actual runtime crate manifest
files, only changing them to the version numbers in gradle.properties if
they use the special `0.0.0-smithy-rs-head` version number. This is a
prerequisite step in allowing independent crate versioning.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
1. Update `sync-models` to sync from aws-sdk-rust. This location includes `sdk-partitions.json`
2. Update aws:sdk gradle file to properly set this variable in codegen./
3. Add an additional safeguard to ensure that the default hardcoded version is only used in tests and adhoc SDK generation.
This PR upgrades Kotlin to 1.9.20, and Ktlint to 1.0.1.
I had to abandon the pretty-format-kotlin pre-commit hook since it was
ignoring our `.editorconfig`, which made it impossible to suppress some
of the newer lints that would be difficult and undesirable to fix. Now
all Ktlint runs go through gradle, so there isn't any way for
inconsistencies to creep in.
I recommend reviewing this PR commit by commit as the commit that runs
Ktlint against the entire repo has a very large diff. When reviewing the
Ktlint formatting changes, be sure to hide whitespace changes to reduce
how much needs to be examined.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Fix deprecation warnings in the gradle build scripts, and upgrade jsoup
and gson.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by: ysaito1001 <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
## Motivation and Context
When the stable/unstable crate versions were split, this caused a
regression in determining the crate version during codegen. This
enhances our crate-version forwarding code to publish all the crate
versions. For impact, see codegen-client-test.
## Description
- Change the build artifact to be a JSON blob will all required
versions.
## Testing
- [ ] Audit diff
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
In this stable release branch, `CrateVersioner` needs to start
versioning SDK crates in a way they are stable.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
Stable crates MUST only expose other stable crates.
## Description
This:
- fixes the remaining issues
- adds a lint tool to be sure we don't expose unstable crates by
accident in the future
## Testing
CI run
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
- aws-sdk-rust#957
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This PR fixes issues introduced by moving the repository from
awslabs/smithy-rs to smithy-lang/smithy-rs.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
This PR updates our smithy-rs release tooling to prepare for handling
both stable and unstable crates. Merging this PR to `main` does not make
any of the runtime crates stable, instead we will just have a supporting
mechanism in place, ready to be turned on by implementing `TODO(GA)`.
## Description
At a high level, this PR will
- update the `Release smithy-rs` workflow UI to have an additional input
`Stable semantic version`:
![Screenshot 2023-10-24 at 10 19 07
PM](https://github.com/awslabs/smithy-rs/assets/15333866/097502e6-3193-43f6-b39b-dd231c2d14d7)
- split an existing gradle property `smithy.rs.runtime.crate.version`
into `smithy.rs.runtime.crate.stable.version` and
`smithy.rs.runtime.crate.unstable.version`.
- make `publisher upgrade-runtime-crates-version` take a new, optional
(for backwards compatibility) command line argument `--stable-version`
to use the said gradle property
`smithy.rs.runtime.crate.stable.version`. This will allow the
`publisher` to set a value passed via a workflow input `Stable semantic
version` to `smithy.rs.runtime.crate.stable.version` in
`gradle.properties` (and the same goes for unstable crates).
- update `fixRuntimeCrateVersions` so that it fixes up runtime crate
versions based on properties `smithy.rs.runtime.crate.stable.version`
and `smithy.rs.runtime.crate.unstable.version`.
**NOTE**
There is a guard in place. When this PR gets merged and then we enter a
stable crate version in the `Stable semantic version` text box, it will
be overwritten by a version in `Unstable semantic version`, so that
1.x.y version will NOT be published to `crates.io` before GA and that
also replicates today's release workflow's behavior (only publishing
unstable crates). Just make sure we specify a 0.x.y in the `Untable
semantic version` text box because that does get shipped.
### What happens once `TODO(GA)` has been implemented?
Roughly, it will look like this. When we run the `Release smithy-rs`
workflow (not a dry-run), providing a stable version (say 1.0.0) and a
unstable version (say 0.57.0) in the workflow text boxes,
1. the workflow will create a new release branch
`smithy-rs-release-1.x.y`.
2. the workflow will set 1.0.0 to
`smithy.rs.runtime.crate.stable.version` and 0.57.0 to
`smithy.rs.runtime.crate.unstable.version` in `gradle.properties`.
3. for whatever smithy runtime crates whose package metadata says
```
[package.metadata.smithy-rs-release-tooling]
stable = true
```
their `Cargo.toml` will include `version = 1.0.0` (and `version =
0.57.0` if `smithy-rs-release-tooling` is not specified or if its value
is `stable = false`).
4. the workflow will publish smithy runtime crates accordingly to
`crates.io`.
5. releasing `aws-sdk-rust` subsequently will render `version = 1.0.0`
in `Cargo.toml` for stable AWS runtime crates (again as specified by
`smithy-rs-release-tooling`), will render `version = 1.1.0` for SDK
crates (we will not go into details here as to why it's not `1.0.0`),
and will publish those crates to `crates.io`.
## Testing
In a [separate
branch](https://github.com/awslabs/smithy-rs/tree/ysaito/stable-and-unstable-crates)
that implemented `TODO(GA)`, I verified that
- our internal release pipeline was executed without errors
- a generated AWS SDK had following manifests (showing excerpts from
arbitrary crates)
```
[package]
name = "aws-sdk-s3"
version = "1.1.0"
```
```
[package]
name = "aws-smithy-types"
version = "1.0.0"
```
```
[package]
name = "aws-smithy-http"
version = "0.57.0"
```
```
[package]
name = "aws-types"
version = "1.0.0"
```
```
[package]
name = "aws-config"
version = "1.0.0"
```
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by: John DiSanti <jdisanti@amazon.com>
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
## Description
<!--- Describe your changes in detail -->
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by: ysaito1001 <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: kstich <kevin@kstich.com>
I noticed `sdk-lints` was getting recompiled just about every time I ran
`git commit` as part of the pre-commit hooks. It looks like a compiler
flag was added to the `ExecRustBuildTool` task type that isn't actually
used by any tools. Removing it should eliminate compiler flag conflicts
between the gradle targets and pre-commit.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
When the WebAssembly SDK example was added some months ago, we changed
the build process to make each SDK example its own Cargo workspace. This
allowed the `.cargo/config.toml` that changed the compiler target to
work correctly. However, this has led to other issues: dependency
compilation is no longer shared between examples which greatly increases
the time it takes for that CI step to run, and now it is even running
out of disk space on the GitHub Actions runners.
This PR adds support for a new workspace layout where the
[`aws-doc-sdk-examples`](https://github.com/awsdocs/aws-doc-sdk-examples)
repo gets to decide how the workspaces are logically grouped. If a
`Cargo.toml` file exists at the example root, then the build system
assumes that the _old_ "one example, one workspace" layout should be
used. If there is no root `Cargo.toml`, then it assumes the new layout
should be used.
The `sdk-versioner` tool had to be adapted to support more complex
relative path resolution to make this work, and the `publisher
fix-manifests` subcommand had to be fixed to ignore workspace-only
`Cargo.toml` files.
The build system in this PR needs to work for both the old and new
examples layout so that the `sdk-sync` process will succeed. #2810 has
been filed to track removing the old example layout at a later date.
[aws-doc-sdk-examples#4997](https://github.com/awsdocs/aws-doc-sdk-examples/pull/4997)
changes the workspace structure of the actual examples to the new one.
## Testing
- [x] Generated a full SDK with the old example layout, manually
examined the output, and spot checked that some examples compile
- [x] Generated a full SDK with the new example layout, manually
examined the output, and spot checked that some examples compile
- [x] Examples pass in CI with the old example layout
- [x] Examples pass in CI with the new example layout
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
In orchestrator mode, most `codegen-client-test` tests were failing due
to being unable to find a matching auth scheme, or due to some of the
test models referencing the `@sigv4` trait. This PR fixes all of those
failures, and adds the `smithy.runtime.mode` flag to
`codegen-client-test` as well.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
TODO:
- [x] docs
- [x] integration test (canary even?)
- [x] customize README for timestream
## Motivation and Context
- #613
- https://github.com/awslabs/aws-sdk-rust/issues/114
## Description
This adds support for TSW and TSQ by adding endpoint discovery as a
customization. This is made much simpler by the fact that endpoint
discovery for these services **has no parameters** which means that
there is no complexity from caching the returned endpoint.
Customers call `.enable_endpoint_discovery()` on the client to create a
version of the client with endpoint discovery enabled. This returns a
new client and a Reloader from which customers must spawn the reload
task if they want endpoint discovery to rerun.
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
This PR refactors the client protocol test generator machinery to use a
client instead of calling `make_operation` directly, and then fixes the
ad hoc tests for the orchestrator.
The ad hoc tests revealed that overriding the signing region/service via
endpoint config was lost when porting SigV4 signing to the orchestrator,
so this PR updates the SigV4 `HttpRequestSigner` implementation to
restore this functionality. It is doing this in the signer directly
rather than via an interceptor since it should only run this logic when
SigV4 is the selected auth scheme.
Other notable changes:
- Adds `--no-fail-fast` arg to `cargoTest` targets so that all Rust
tests run in CI rather than stopping on the first failure
- Changes `EndpointResolver::resolve_and_apply_endpoint` to just
`resolve_endpoint` so that the orchestrator can place the endpoint
config into the request state, which is required for the signer to make
use of it
- Adds a `set_region` method to SDK service configs
- Deletes the API Gateway model and integration test from the SDK smoke
test since it is covered by the ad hoc tests
- Adds a comment explaining where the API Gateway model comes from in
the ad hoc tests
- Adds a `smithy.runtime.mode` Gradle property to `aws:sdk` and
`aws:sdk-adhoc-test` to trivially switch between middleware and
orchestrator when testing/generating locally
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
## Motivation and Context
This PR set `aws_sdk_unstable` to RUSTFALGS when running cargo from
kotlin.
It is required to enable test gated features introduced on RFC30.
No breaking changers are introduced.
## Description
add `RUSTFLAGS = aws_sdk_unstable` when running cargo from kotlin.
## Parent PR
This PR is listed as one of prerequisite PRs on this PR.
- https://github.com/awslabs/smithy-rs/pull/2615
## Testing
NA.
----
*By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.*
* A barely working code generation in typescript
* Extract shared socket into feature inside aws-smithy-http-server
* Building a fully functional application, I think
* Add NAPI build.rs
* Refactor all names to use typescript instead of js
* Add (hopefully) the PR bot for TS
* Clippy fixes
* Fix documentation
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* set_reuse_port in socket not on windows
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Add example implementation
* Allow the new application to build
* Remove all occurrences of Python
* Simplify README
* Fix issue with the codegen-diff-revision script
* Try to prevent the ci-lint to bother us with TODO at this stage of development
* Remove codegen-client from typescript dependencies
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add CODEOWNERS and fix some other linting issues
* Add license
* Prevent from running tests on typescript in Windows
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Initial work to remove error from this PR
* Update to call_async
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* types/node in package.json
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Generate app.ts
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Improve makefile
* Adapting code to the latest changes and removing runtime dependency (for now).
* Removing rust-runtime/aws-smithy-http-server-typescript.
* Making CI happy.
* Restoring ServerCodegenDecorator to be like main.
* Adding back the aws-smithy-http-server-typescript crate back.
* Removing index.js file.
---------
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
Co-authored-by: 82marbag <69267416+82marbag@users.noreply.github.com>
Co-authored-by: Alberto Pose <albepose@amazon.com>
* Create the `aws-runtime` and `aws-runtime-api` crates
* Implement SigV4 in the orchestrator
* CI fixes
* Connect the service config http connector to the orchestrator
* Make it possible to register interceptors, and get signing to pass tests
* Fix allowed types lint
* Add missing docs.rs metadata
This commit automates the fix made in https://github.com/awslabs/aws-sdk-rust/pull/767.
When `aws-sdk-rust` is generated, `examples` will be excluded from the
workspace.
Co-authored-by: Yuki Saito <awsaito@amazon.com>
* Upgrade Kotlin to 1.7.21
* Upgrade Ktlint to 0.48.2
* Run `pre-commit run --all-files` to fix broken Ktlints
* Fix string comparison broken by code formatting
* feat(aws-types): add api key to configuration
* chore: set package version to 0.52.0
* feat(aws-smithy-types): create auth types
* chore: use auth from smithy types
* chore: fix return self type
* chore: create http auth definition type
* chore: add constructor for http auth definition
* chore: ensure properties are not moved
* chore: create convenience constructors
* chore: add some todo comments
* feat: move query writer to aws-smithy-http crate
* chore(codegen): expose smithy http tower dependency
* chore: remove setters for auth definition
* chore: fix logical error for scheme not allowed
* chore: add constructor for basic and digest auth
* chore: allow equality comparision for api key
* Revert "chore: set package version to 0.52.0"
This reverts commit da660fcf16.
* chore: fix additional references to querywriter
* chore: implement from string for api key struct
* chore: disallow none api key in sdk config
* chore: fix formatting
* chore: add unit tests for auth types
* chore: add auth api key to external types
* chore: make query writer doc hidden
* feat: create aws-smithy-http-auth crate
* chore: use zeroing for auth api key
* chore: use builder pattern for auth definition
* chore: restructure http auth package
* chore: define default lint warning
* chore: include http auth in runtime common list
* chore: define setter for optional scheme
* chore: should panic while building auth definition
* chore: return missing required field error
* chore: make few code simplications for api key
* Revert "chore: add auth api key to external types"
This reverts commit b2318b0230.
* chore: revert api key from sdk config
* chore: panic on missing required field
* Opt out of `clippy::derive_partial_eq_without_eq`
---------
Co-authored-by: Eduardo Rodrigues <eduardomourar@users.noreply.github.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Copy non-service integration tests into SDK root tests directory
For tests in `aws/sdk/integration-tests` that are not named after a
service module, copy them into the SDK's root `tests/` directory so that
they are run as part of CI on the entire SDK.
* Add missing fields to integration test manifests
* Remove tests from root workspace
* Explicitly exclude the root tests from the root workspace
* Workaround bug in smithy-rules-engine
This PR works around a bug in smithy-rules-engine `Parameter.toBuilder()` — the method was discarding the default value (and other fields). This was fixed here: https://github.com/awslabs/smithy/pull/1571/files. Until that's merged, this works around it by copying the value manually. This also adds an SDK adhoc test that includes an endpoint test.
* change to TODO comment
* Add the `aws-credential-types` crate
This commit adds a new crate `aws-credential-types` to the `rust-runtime`
workspace. This lays the groundwork for being able to create a
`LazyCachingCredentialsProvider` outside the `aws-config` crate according
to the proposed solution in https://github.com/awslabs/smithy-rs/pull/2082.
We have moved the following into this new crate:
- Items in aws_types::credentials and and their dependencies
- Items in aws_config::meta::credentials and their dependencies
Finally, the crate comes with auxiliary files that are present in the
other crates in the `rust-runtime` workspace such as `external-types.toml`.
* Make `aws-types` depend on `aws-credential-types`
The credentials module has been moved from the `aws-types` crate to the
`aws-credential-types` crate. This leads to some of the items in the
`aws-types` crate adjusting their use statements to point to
`aws-credential-types`.
The `TimeSource` struct has also been moved to `aws-credential-types`
because it is used by `LazyCachingCredentialsProvider`. We have decided
to move it instead of duplicating it because `aws-config` was creating
a `TimeSource` from `aws-types` and then passing it to the builder for
`LazyCachingCredentialsProvider`. If we had duplicated the implementation
of `TimeSource` in `aws-credential-types`, two `TimeSource` implementations
would have been considered different types and the said use case in
`aws-config` would have been broken.
* Make `aws-config` depend on `aws-credential-types`
The `cache` module and modules in `meta::credentials` (except for `chain`)
have been moved to `aws-credential-types`. Again, the goal of restructuring
is to allow `LazyCachingCredentialsProvider` to be created outside the
`aws-config` crate. While doing so, we try not moving all the default
credential provider implementations.
* Make `aws-http` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Make `aws-inlineable` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Make `aws-sig-auth` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Emit `aws-credential-types` to the build directory
This commit adds `aws-credential-types` to AWS_SDK_RUNTIME so that
the build command `/gradlew :aws:sdk:assemble` can generate the crate
into sdk/build/aws-sdk.
* Make codegen aware of `aws-credential-types`
This commit allows the codegen to handle the `aws-credential-types` crate.
The items that have been moved from `aws-types` should now be prefixed with
`aws-credential-types` when generating fully qualified names.
* Make `dynamo-tests` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Make `s3-tests` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Make `s3control` depend on `aws-credential-types`
This commit adjusts the use statements for the items that have been moved
from the `aws-types` crate to the `aws-credential-types` crate.
* Update external-types.xml in rust-runtime crates
This commit fixes CI failures related to `cargo check-external-types`
in ec994be.
* Update the file permission on additional-ci
* Remove unused dependency from aws-credential-types
* Clean up features for aws-credential-types
This commit fixes a CI failure where the feature hardcoded-credentials
needed other features, aws-smithy-async/rt-tokio and tokio/rt, for the
test code to compile with --no-default-features.
* Update sdk-external-types.toml
* Update aws/rust-runtime/aws-credential-types/Cargo.toml
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-credential-types/README.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-credential-types/README.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-credential-types/additional-ci
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-credential-types/src/lib.rs
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Reduce re-exports from `aws-credential-types`
This commit reduces the number of re-exports from `aws-credential-types`.
The rationale here is that if we add more items to this crate later on,
we may get some name collisions in root. Since this crate is not used by
our customers directly, it is acceptable for items to take a bit of typing
to get to.
* Fix broken intra doc link
This commit fixes a broken intra doc link that went unnoticed because the
offending link was behind the feature `hardcoded-credentials`.
* Update aws/rust-runtime/aws-credential-types/README.md
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
* Rename variants of `aws_credential_types::time_source::Inner`
This commit addresses https://github.com/awslabs/smithy-rs/pull/2108#discussion_r1053637722
* Split the unit test for `time_source` into two
This commit addresses https://github.com/awslabs/smithy-rs/pull/2108#discussion_r1053638381
* Update CHANGELOG.next.toml
Co-authored-by: Yuki Saito <awsaito@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Zelda Hessler <zhessler@amazon.com>