pub fn into_credentials(
        sts_credentials: Option<StsCredentials>,
        provider_name: &'static str,
    ) -> credentials::Result {
        let sts_credentials = sts_credentials
            .ok_or_else(|| CredentialsError::Unhandled("STS credentials must be defined".into()))?;
        let expiration = sts_credentials
            .expiration
            .ok_or_else(|| CredentialsError::Unhandled("missing expiration".into()))?;
        let expiration = expiration.to_system_time().ok_or_else(|| {
            CredentialsError::Unhandled(
                format!("expiration is before unix epoch: {:?}", &expiration).into(),
            )
        })?;
        Ok(AwsCredentials::new(
            sts_credentials.access_key_id.ok_or_else(|| {
                CredentialsError::Unhandled("access key id missing from result".into())
            })?,
            sts_credentials
                .secret_access_key
                .ok_or_else(|| CredentialsError::Unhandled("secret access token missing".into()))?,
            sts_credentials.session_token,
            Some(expiration),
            provider_name,
        ))
    }
/// Convert STS credentials to aws_auth::Credentials
Convert STS credentials to aws_auth::Credentials
Convert STS credentials to aws_auth :: Credentials
pub fn into_credentials(
        sts_credentials: Option<StsCredentials>,
        provider_name: &'static str,
    ) -> credentials::Result {
        let sts_credentials = sts_credentials
            .ok_or_else(|| CredentialsError::Unhandled("STS credentials must be defined".into()))?;
        let expiration = sts_credentials
            .expiration
            .ok_or_else(|| CredentialsError::Unhandled("missing expiration".into()))?;
        let expiration = expiration.to_system_time().ok_or_else(|| {
            CredentialsError::Unhandled(
                format!("expiration is before unix epoch: {:?}", &expiration).into(),
            )
        })?;
        Ok(AwsCredentials::new(
            sts_credentials.access_key_id.ok_or_else(|| {
                CredentialsError::Unhandled("access key id missing from result".into())
            })?,
            sts_credentials
                .secret_access_key
                .ok_or_else(|| CredentialsError::Unhandled("secret access token missing".into()))?,
            sts_credentials.session_token,
            Some(expiration),
            provider_name,
        ))
    }
pub fn into_credentials ( sts_credentials : Option < StsCredentials > , provider_name : & ' static str , ) -> credentials :: Result { let sts_credentials = sts_credentials . ok_or_else ( | | CredentialsError :: Unhandled ( " " . into ( ) ) ) ? ; let expiration = sts_credentials . expiration . ok_or_else ( | | CredentialsError :: Unhandled ( " " . into ( ) ) ) ? ; let expiration = expiration . to_system_time ( ) . ok_or_else ( | | { CredentialsError :: Unhandled ( format ! ( " " expiration ) . into ( ) , ) } ) ? ; Ok ( AwsCredentials :: new ( sts_credentials . access_key_id . ok_or_else ( | | { CredentialsError :: Unhandled ( " " . into ( ) ) } ) ? , sts_credentials . secret_access_key . ok_or_else ( | | CredentialsError :: Unhandled ( " " . into ( ) ) ) ? , sts_credentials . session_token , Some ( expiration ) , provider_name , ) ) }
Convert STS credentials to aws_auth::Credentials
Convert STS credentials to aws_auth :: Credentials
sts_credentials
Option<StsCredentials>
provider_name
&'static str
sts_credentials
Option<StsCredentials>
provider_name
&'static str