Unverified Commit a46e4899 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Discourage use of hardcoded credentials (#875)

* Add missing documentation to `aws-types`

* Discourage use of hardcoded credentials

* Update the changelog

* Fix doc comments

* Fix the changelog
parent 61c9fde7
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -4,21 +4,21 @@ vNext (Month Day, Year)
**TODO Upon release**
- Update README & aws-sdk-rust CI for MSRV upgrade to 1.54

**New this week**
**New this release**

- :tada: Timeouts for requests are now configurable. You can set a timeout for each individual request attempt or for all attempts made for a request. (smithy-rs#831)
- Improve docs on `aws-smithy-client` (smithy-rs#855)

**Breaking changes**

- `RetryConfigBuilder::merge_with` has been renamed to `RetryConfigBuilder::take_unset_from`
- `Credentials::from_keys` is now behind a feature flag named `hardcoded-credentials` in `aws-types`.
  It is __NOT__ secure to hardcode credentials into your application, and the credentials
  providers that come with the AWS SDK should be preferred. (smithy-rs#875, smithy-rs#317)
- (aws-smithy-client): Extraneous `pub use SdkSuccess` removed from `aws_smithy_client::hyper_ext`. (smithy-rs#855)

v0.0.26-alpha (TBD)
===================================
**New this release**
- Improve docs on `aws-smithy-client` (smithy-rs#855)

**Breaking Changes**
- (aws-smithy-client): Extraneous `pub use SdkSuccess` removed from `aws_smithy_client::hyper_ext`. (smithy-rs#855)

**Breaking Changes**

+9 −3
Original line number Diff line number Diff line
@@ -216,14 +216,20 @@ mod loader {
        }

        /// Override the credentials provider used to build [`Config`](aws_types::config::Config).
        ///
        /// # Examples
        ///
        /// Override the credentials provider but load the default value for region:
        /// ```rust
        /// # use aws_types::Credentials;
        ///  async fn create_config() {
        /// # fn create_my_credential_provider() -> Credentials {
        /// #     Credentials::new("example", "example", None, None, "example")
        /// # }
        /// # async fn create_config() {
        /// let config = aws_config::from_env()
        ///     .credentials_provider(Credentials::from_keys("accesskey", "secretkey", None))
        ///     .load().await;
        ///     .credentials_provider(create_my_credential_provider())
        ///     .load()
        ///     .await;
        /// # }
        /// ```
        pub fn credentials_provider(
+4 −3
Original line number Diff line number Diff line
@@ -19,13 +19,14 @@ use tracing::Instrument;
/// * Finally, if a provider returns any other error condition, an error will be returned immediately.
///
/// # Examples
///
/// ```rust
/// use aws_config::meta::credentials::CredentialsProviderChain;
/// use aws_types::Credentials;
/// use aws_config::environment;
/// use aws_config::environment::credentials::EnvironmentVariableCredentialsProvider;
/// use aws_config::profile::ProfileFileCredentialsProvider;
///
/// let provider = CredentialsProviderChain::first_try("Environment", EnvironmentVariableCredentialsProvider::new())
///     .or_else("Static", Credentials::from_keys("someacceskeyid", "somesecret", None));
///     .or_else("Profile", ProfileFileCredentialsProvider::builder().build());
/// ```
#[derive(Debug)]
pub struct CredentialsProviderChain {
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ mod test {
    async fn provide_credentials_fn_closure_can_borrow() {
        fn check_is_str_ref(_input: &str) {}
        async fn test_async_provider(input: String) -> credentials::Result {
            Ok(Credentials::from_keys(&input, &input, None))
            Ok(Credentials::new(&input, &input, None, None, "test"))
        }

        let things_to_borrow = vec!["one".to_string(), "two".to_string()];
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ mod builder {
    /// let provider = LazyCachingCredentialsProvider::builder()
    ///     .load(provide_credentials_fn(|| async {
    ///         // An async process to retrieve credentials would go here:
    ///         Ok(Credentials::from_keys("example", "example", None))
    ///         Ok(Credentials::new("example", "example", None, None, "my_provider_name"))
    ///     }))
    ///     .build();
    /// ```
Loading