Move types for AWS SDK credentials to a separate crate (#2108)
* 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>
Loading
Please register or sign in to comment