* Generate service readmes and fix module descriptions
* Add missing `moduleDescription` to codegen tests
* Update changelogs
* Add `moduleDescription` to server codegen tests
* Fix event stream allow list in build.gradle.kts
* Type alias and doc comment the manifest customizations
* Rename `protocol-test-helpers` to `smithy-protocol-test-helpers`
* Add missing licenses to runtime crates
* Normalize runtime crate manifests
* Remove unused dependencies
* Make `pretty_assertions` version consistent
* Add repository to generated SDK crate manifests
* Create `smithy-rs-head` crate version tag
* Set correct crate versions when relocating runtimes
* Run version replacement only on Cargo.toml files
* Revise head version number from RFC feedback
* Rename `smithy-protocol-test-helpers` to `smithy-protocol-test`
* Incorporate feedback
* Update changelogs
* Fix rename issues
* Fix EventStreamMarshallerGeneratorTest
* feature: add retry_config to aws_config::ConfigLoader and aws_config::default_provider
feature: add retry_config to aws_types::Config and aws_types::Builder
feature: add RetryConfig and RetryMode to smithy_types
feature: create EnvironmentVariableRetryConfigProvider
feature: create RetryConfigProviderChain
feature: create ProfileFileRetryConfigProvider
update: make smithy-types dep non-optional for aws-config
add: smithy-types dep to aws-types
* Update aws/rust-runtime/aws-config/src/lib.rs
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* refactor: simplify configuration logic of retry_configs
update: use non-allocating string comparison for RetryMode::from_str
update: panic on setting invalid values for RetryConfig
remove: provider chain for retry_config
remove: ProvideRetryConfig trait and related functionality
* update: AwsFluentClientDecorator to work with retry_config
refactor: rename smithy_client::retry::Config.max_retries to max_attempts and fix code broken by this change
add: RetryConfigDecorator to smithy codegen with example and test
add: RetryConfigDecorator to decorators list
add: update SharedConfigDecorator to work with retry_config
add: prop getters to RetryConfig
add: From<RetryConfig> for smithy_client::retry::Config
update: RegionDecorator example of generated code
sort: decorators list alphabetically
* fix: clone moved valued in AwsFluentClientDecorator
update: imds client to refer to max attempts instead of max retries
fix: clippy lint about FromStr
add: RetryModeErr error struct for when FromStr fails
fix: code affected by added FromStr<RetryMode> trait usage
* formatting: run rustfmt
* format: use 1.53 version of fustfmt
* fix: smithy_client tests broken by max_attempts change
* fix: clarify some confusing counter logic around request attempts
* update: set_retry_config example code to be more helpful
fix: broken docs link
* add: missing PartialEq impl for RetryConfig
update: EnvironmentVariableRetryConfigProvider tests
remove: unused import
* update: CHANGELOGs
* update: Config builder decorators to match Config builder methods
* fix: old references to ProtocolConfig
* refactor: surface all retry_config errors in the default_provider
add: RetryConfigErr
* update: Changelog to not new semantics of max_attempts
update: Config::retry_config() example
fix: copy paste error
rename: RetryModeErr to RetryModeParseErr
update: note valid retry modes in error message
add: helper for creating RetryConfig that disables retries
update: use Cow<&str> for RetryConfigErr to save on allocations
add: FailedToParseMaxAttempts error when creating RetryConfig from invalid max_attempts
update: don't ignore invalid/unparseable max_attempts
update: note panic that can occur in retry_config::default_provider
remove: invalid/useless code from RetryConfigDecorator.kt
remove: inside baseball comments previously added to CHANGELOG
* disable: adaptive RetryMode tests
* fix: don't listen to the IDE, err is being used
* fix: don't listen to the IDE, err is being used
* fix: really struggling with this underscore
* fix: typo in doc comment example
* fix: typo in doc comment example
fix: outdated tests
* Update rust-runtime/smithy-client/src/retry.rs
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
* update: retry_config::default_provider to consider precedence per-field instead of per struct
add: RetryConfigBuilder to make the above possible
update: Env and Profile provider for RetryConfig to return RetryConfigBuilder
add: docs to generated retry_config builders
add: from_slice method to os_shim_internal::Fs
* update: use old ordering of decorators in AwsCodegenDecorator
* update: use old ordering of decorators in AwsCodegenDecorator
fix: os_shim_internal example not compiling
formatting: run ktlint
update: tests broken by RetryConfigDecorator.kt changes
* formatting: don't use * imports in kotlin
* fix: tests broken by stubConfigProject change
* Update codegen/src/test/kotlin/software/amazon/smithy/rust/RetryConfigProviderConfigTest.kt
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
* formatting: run ktlint
* add: back accidentally removed presigning decorator
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
* Split out MakeOperationGenerator for HttpProtocolGenerator
* Clean up body metadata calculation
* Add debug instructions to readme
* Add example for Polly presigned requests
* Add ability to change payload signing type for query signing
* Generate special cased make operation functions for presigning
* Reorganize protocol generators
* Rename ProtocolConfig to CodegenContext and move to a central location
* Consolidate protocol classes in protocols package
* Make protocol generator names consistent
* Fully decompose ProtocolGenerator
* Add integration test for Polly presigning
* Add make_operation and presigned to reserved words
* Update presigning RFC
* Make Polly transforms reusable and add tests
* Fix RequestBindingGeneratorTest
* Update changelogs
* Remove `HttpBodySigningType`
* Perform model transformations up front
* Add checks to presigning transformers
* Fix `codegen-server` build
* Fix bugs in Event Stream unmarshalling
- S3 Select's `Cont` event doesn't come across with a `:content-type`
header, but the unmarshaller was expecting this header.
- The unmarshaller attempted to parse events that were modeled as empty
structs, but S3 sends an empty payload for empty structs rather than
an empty XML payload conforming to restXml.
- The event stream `Receiver` was returning that there were no more events
even when it had some remaining events in its buffer.
* Update changelogs
* Incorporate feedback
* Split `smithy_http::event_stream` into multiple modules
* Add another test case to Receiver
* Fix CI
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* Add test cases that point out the bugs.
* Fix the bugs by using an owned Option<&mut String>.
* Improve test comments.
* Update CHANGELOG.md.
* Clean up and add explanatory comments.
* Fix whitespace.
* Update CHANGELOG.md
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
* feat(aws-config): Add IMDSv2 Credentials Provider
This follows up on #701 to use IMDS to act as a credentials provider. IMDS sits in the chain in two places:
1. IMDS may be used as a `credential_source` in `~/.aws/config`
2. IMDS is the last provider in the default chain of credential providers.
The IMDS credential provider may also be used directly.
* fix doc links
* Update aws/rust-runtime/aws-config/src/imds/credentials.rs
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-config/src/imds/credentials.rs
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* CR feedback
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* feat(aws-config): Add IMDS Client
* Fix docs
* Add two missing error implementations + usage example
* Fix clippy errors
* Fix doctest in os_shim_internal
* Fix a missed occurence of test connection assertions
* fix doc link
* remove link to private item
* Update changelog, make depedencies optional
* CR feedback cleanups
* Apply suggestions from code review
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Update aws/rust-runtime/aws-config/src/imds/client.rs
* refactor cache into its own module
* fix clippy warning
* add additional internal changelog entries
* endpoint mode comparsion should be case insensitive
* update docs to remove references to credentials
* Fix bug in token that doubled the buffer period
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* update: require that unmarshaller used to create a Receiver is Send
* update: changelogs
* Fix typo in CHANGELOG.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Fix typo in aws/SDK_CHANGELOG.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* add: test ensuring Receiver is Send
* remove: extra colons
* fix(codegen): Fix bug triggered by operation input/output naming
During codegeneration, synthetic copies of input & output shapes are created. However, due to a Smithy shape id conflict, these
shapes were overwriting existing shapes in the model instead of creating new shapes.
This lead to a number of bugs exposed by the new s3control model. A minimal example of this model is included as a test in rest-xml-extras.
This commit augments the namespace of synthetic shapes to exist in the `synthetic` Smithy namespace, removing the conflict. After this bug was fixed, a subsequent bug in the serializer function naming was exposed where two shapes with the same name but in different modules generated a conflicting serializer.
Tests:
- [x] new s3control model compiles
- [x] test case added to rest-xml-extras
* cl: update changelog
* fix(codegen): Fix smithy-rs#662 & cleanup
* Update CHANGELOG.md
* fix another unit test
If `content_length` was set explicitly, we were erroneously duplicating it for non-streaming bodies. This commit:
- Uses `set_header_if_absent` to avoid double setting content length
- Adds a trace level log of the canonical request during signing
- Adds an additional protocol test that fails prior to this change
* Create Profile File Provider for Region
As part of this work, I unified handling of provider configuration into `ProviderConfig`. This simplifies and removes boilerplate from the credential provider builders.
* Fix profile name bug, add test
* More cleanups around connection management
* Lots of cleanups around connector handling and crate features
* Update Changelog
* Remove unecessary sleep module
* Add builder convenience method
* CR feedback
* Update aws/rust-runtime/aws-config/src/default_provider.rs
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Clean up `sync-models.py`
* Add hack to `sync-models.py` to correct the S3 model
* Add disabled S3 customization
* Run S3 model through `jq .` to make diffing nicer
* Sync S3 model
* Add integration test for the customization
* Update changelog
The endpoint middleware was adding a host header to the request, and
this worked when using HTTP/1.1. However, when the connection gets
upgraded to h2, this results in the remote service expecting the
canonical request to have two `host` headers.
This change moves the addition of the host header into the signing code,
and lets hyper take charge of the host header.
* Update changelog
* Remove `transcribestreaming` exclusion from full SDK build
* Fix failing tests
* CR feedback
* create an AWS config module
This commit adds a new AWS config module. It only currently supports region resolution. A follow up commit will remove `ProvideRegion` from AWS types.
* create aws-config
This commit introduces `aws-config`, the configuration loader entry point for the SDK. Currently, this adds very little new code, instead, it migrates code from `aws_types` into the shared-config package.
* Update Examples to use shared-config
* Fix KMS IT
* Fix cargo docs
* Fix clippy
* Clarify doc comment on EnvLoader
* Clarify region chain impl, add tests
* Update CHANGELOG.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Delete dead module
* CR feedback
* Add more docs to aws-config
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Add generic error support to event stream unmarshallers
* Validate content-type in event stream unmarshaller
* Implement header marshalling and test
* Introduce SharedPropertyBag
* Send empty end frame
* Add `try_recv_initial()` to Receiver
* Set up Event Stream approval list and shrink default service list
* Add support and example for S3 SelectObjectContent
* Improve Event Stream error ergonomics
* Update changelog
* Fix CI
* Split generic error parsing in `Protocol`
* Incorporate CR feedback
* Make raw message available when failng to unmarshall into event or error
* Improve documentation on collection builders
Generated builders include "magic" collection methods that will append to the builder. However, the generated names of these methods are confusing because they are often pluralized. To alleviate this, this diff will generate doc hints on these methods to clarify their behavior.
* Update CHANGELOG
* Update CHANGELOG.md
* Update region interface to be async
* Update all examples
* Update aws-auth-providers to support async regions
* Fix KMS tests
* Fix all examples again
* Update CHANGELOG, fix broken test
* Fix ses examples
* fix ses examples take 2
* Add incomplete Event Stream support with working Amazon Transcribe example
* Make the raw response in SdkError generic
* Fix XmlBindingTraitSerializerGeneratorTest
* Make the build aware of the SMITHYRS_EXPERIMENTAL_EVENTSTREAM switch
* Fix SigV4SigningCustomizationTest
* Update changelog
* Fix build when SMITHYRS_EXPERIMENTAL_EVENTSTREAM is not set
* Add initial unit test for EventStreamUnmarshallerGenerator
* Add event header unmarshalling support
* Don't pull in event stream dependencies by default
* Only add event stream signer to config for services that need it
* Move event stream inlineables into smithy-eventstream
* Fix some clippy lints
* Transform event stream unions
* Fix crash in SigV4SigningDecorator
* Add test for unmarshalling errors
* Incorporate CR feedback
* Add support for web identity token providers
This diff adds support for WebIdentity token providers which may be utilized in three ways:
1. Via environment variables
2. Via a profile directly
3. As a source profile of another assume role profile
Along the way, I overhauled the way that tests work to be primarily self-contained test directories.
* make fs::read_to_end async
For future compatibility I updated read_to_end to be an async function. This drove a subsequent change to push profile file parsing into credentials loading. This should be generally useful anyway since we'll want a way to force reparsing of the profile file.
* Revert change to env
This removes the need for an allocation in the non-test case.
* Fix broken doc tests
* Fix clippy
* Update changelog, fix docs
* Remove caching from profile provider
* fix sigv4 tests to work on httparse 1.5
httparse 1.5 has a small behavior change: https://github.com/seanmonstar/httparse/issues/102 which
changes the parsing behavior of headers when the request is not terminated with a second newline.
Although 1.5 may eventually fix this issue, this works around the build failure by inserting an additional
newline into the parser prior to parsing the test requests.
* update changelog
* Proper test fix
* Add support for the Smithy Auth trait
Some services have explicitly disabled authentication. This adds two things:
1. Customization to remove auth schemes for 2 STS operations
2. Add codegen support for the OptionalAuth and Auth trait to code generation.
CredentialsStage now will pass through unset credentials and the signer will check the signing trait.
A future enhancement may remove the signing middleware entirely.
* Update changelog
* Remove unused STS import
* remove unused variable
* Update CHANGELOG.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Remove jcenter / bintray from gradle
Our build was referencing the old bintray repositories. This would 403 and make the build much slower as at retried 5 times against the broken URL.
* Update CHANGELOG.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Remove serde dependency from aws-sigv4
* Clean up aws-sigv4 `sign` module
* Move HTTP-specific sigv4 code into its own module
* Clean up `http_request` module
* Eliminate serde dependency
* Move bytes to dev-dependencies
* Fix aws-sig-auth build
* Add Event Stream signing
* Update changelog
* Return signature from signing functions and add it to property bag in requests
* CR feedback
* Further simplify parameter sorting
* Add Default Provider Chain
This commit adds an initial implementation of the default credentials provder chain. First, it will use environment variables. Next it will use shared config / profiles.
* Update CHANGELOG.md
* Apply suggestions from code review
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* add initial profile file provider support
This commit establishes baseline support for profile file providers. The only named credential source currently supported is `Environment` but we'll be adding more sources in the future. To support testing, the `dvr` module was added to smithy-client. There are some limitations in this which will be addressed going forward, primarily around time control so we can do request verification.
* Fix missed rename
* CR feedback: add doc comments, cleanup tests
* Improve take requests API
* Fix missed refactoring
* Add missing test data
* Fix intradoc link
* Update changelog
* resolve clippy errors
* Implement Event Stream Sender/Receiver for use in generated types
* Update CHANGELOG
* Fix AWS runtime build
* Fix warning
* Make `Sender` create the body channel and add signing
* Replace `Sender` with `MessageStreamAdapter` to take a `Stream` input
* Make signer mutable and change Arc to Box