-
- Downloads
Add a test helper for creating a dummy Credentials (#2145)
* Add convenience method `Credentials::for_tests` This commit addresses https://github.com/awslabs/smithy-rs/pull/2122#discussion_r1056499862. We considered using `#[cfg(test)]` for it but the attribute only works within the defining crate. To work around it, we have added `#[doc(hidden)]` to it to prevent the method from appearing in the public doc, though still accessible in the source code. * Make AWS runtime crates use test credentials helper This commit updates the test code in the AWS runtime crates to use `Credentials::for_tests` wherever applicable. We intentionally did not replace the following `Credentials::new` occurrences: * those in public rustdoc * those that need to configure expiration time * Make EndpointsCredentialsTest use test credentials helper This commit replaces `Credentials::new` with `Credentials::for_tests` in the unit test for EndpointsCredentialsTest. * Make SDK integration tests use test credentials helper This commit replaces `Credentials::new` with `Credentials::for_tests` in the test code in the SDK integration tests wherever applicable. * Call `Credentials::for_tests` directly in calling `credentials_provider` * Feature gate `Credentials::for_tests` behind "test-util" This commit addresses https://github.com/awslabs/smithy-rs/pull/2145#discussion_r1059437196 * Use `Credentials::for_tests` rather than `new` This commit addresses https://github.com/awslabs/smithy-rs/pull/2145#discussion_r1059437435 Co-authored-by:Yuki Saito <awsaito@amazon.com>
Showing
- aws/rust-runtime/aws-config/Cargo.toml 1 addition, 0 deletionsaws/rust-runtime/aws-config/Cargo.toml
- aws/rust-runtime/aws-config/src/profile/credentials/exec.rs 1 addition, 1 deletionaws/rust-runtime/aws-config/src/profile/credentials/exec.rs
- aws/rust-runtime/aws-config/src/sts/assume_role.rs 2 additions, 14 deletionsaws/rust-runtime/aws-config/src/sts/assume_role.rs
- aws/rust-runtime/aws-credential-types/Cargo.toml 1 addition, 0 deletionsaws/rust-runtime/aws-credential-types/Cargo.toml
- aws/rust-runtime/aws-credential-types/src/credentials_impl.rs 12 additions, 0 deletions...rust-runtime/aws-credential-types/src/credentials_impl.rs
- aws/rust-runtime/aws-http/Cargo.toml 1 addition, 0 deletionsaws/rust-runtime/aws-http/Cargo.toml
- aws/rust-runtime/aws-http/src/auth.rs 1 addition, 1 deletionaws/rust-runtime/aws-http/src/auth.rs
- aws/rust-runtime/aws-inlineable/Cargo.toml 1 addition, 0 deletionsaws/rust-runtime/aws-inlineable/Cargo.toml
- aws/rust-runtime/aws-inlineable/tests/middleware_e2e_test.rs 5 additions, 9 deletionsaws/rust-runtime/aws-inlineable/tests/middleware_e2e_test.rs
- aws/rust-runtime/aws-sig-auth/Cargo.toml 1 addition, 0 deletionsaws/rust-runtime/aws-sig-auth/Cargo.toml
- aws/rust-runtime/aws-sig-auth/src/event_stream.rs 1 addition, 1 deletionaws/rust-runtime/aws-sig-auth/src/event_stream.rs
- aws/rust-runtime/aws-sig-auth/src/middleware.rs 6 additions, 5 deletionsaws/rust-runtime/aws-sig-auth/src/middleware.rs
- aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/EndpointsCredentialsTest.kt 6 additions, 2 deletions...oftware/amazon/smithy/rustsdk/EndpointsCredentialsTest.kt
- aws/sdk/integration-tests/dynamodb/Cargo.toml 1 addition, 1 deletionaws/sdk/integration-tests/dynamodb/Cargo.toml
- aws/sdk/integration-tests/dynamodb/tests/cloning.rs 1 addition, 3 deletionsaws/sdk/integration-tests/dynamodb/tests/cloning.rs
- aws/sdk/integration-tests/dynamodb/tests/endpoints.rs 2 additions, 2 deletionsaws/sdk/integration-tests/dynamodb/tests/endpoints.rs
- aws/sdk/integration-tests/dynamodb/tests/movies.rs 1 addition, 7 deletionsaws/sdk/integration-tests/dynamodb/tests/movies.rs
- aws/sdk/integration-tests/dynamodb/tests/paginators.rs 1 addition, 1 deletionaws/sdk/integration-tests/dynamodb/tests/paginators.rs
- aws/sdk/integration-tests/dynamodb/tests/shared-config.rs 1 addition, 1 deletionaws/sdk/integration-tests/dynamodb/tests/shared-config.rs
- aws/sdk/integration-tests/dynamodb/tests/timeouts.rs 2 additions, 6 deletionsaws/sdk/integration-tests/dynamodb/tests/timeouts.rs
Loading
Please register or sign in to comment