#[non_exhaustive]pub enum Auth {
Anonymous,
Static(Credentials),
Provider(DynCredentialsProvider),
}Expand description
Authentication configuration for requests.
Most applications use one of the constructor helpers on Auth:
Auth::from_envfor static credentials from environment variablesAuth::providerfor a custom refreshable providerAuth::Anonymousfor unsigned requests
Optional credential features also add profile, IMDS, and STS-based constructors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Anonymous
Send unsigned requests.
Static(Credentials)
Static access keys (and optional session token).
Provider(DynCredentialsProvider)
Dynamic credentials provider.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Loads static credentials from standard AWS env vars.
Reads AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optionally AWS_SESSION_TOKEN.
Sourcepub fn provider(provider: DynCredentialsProvider) -> Self
pub fn provider(provider: DynCredentialsProvider) -> Self
Uses a dynamic credentials provider.
Sourcepub fn from_profile(profile: impl AsRef<str>) -> Result<Self>
Available on crate feature credentials-profile only.
pub fn from_profile(profile: impl AsRef<str>) -> Result<Self>
credentials-profile only.Loads credentials from a named profile.
Sourcepub fn from_profile_env() -> Result<Self>
Available on crate feature credentials-profile only.
pub fn from_profile_env() -> Result<Self>
credentials-profile only.Loads credentials from the profile defined by environment variables.
Sourcepub async fn from_imds() -> Result<Self>
Available on crate features credentials-imds and async only.
pub async fn from_imds() -> Result<Self>
credentials-imds and async only.Loads IMDS credentials and wraps them in a cached provider.
Sourcepub async fn from_imds_with_tls_root_store(
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-imds and async only.
pub async fn from_imds_with_tls_root_store( tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-imds and async only.Loads IMDS credentials and wraps them in a cached provider.
Sourcepub fn from_imds_blocking() -> Result<Self>
Available on crate features credentials-imds and blocking only.
pub fn from_imds_blocking() -> Result<Self>
credentials-imds and blocking only.Loads IMDS credentials and wraps them in a cached provider.
Sourcepub fn from_imds_blocking_with_tls_root_store(
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-imds and blocking only.
pub fn from_imds_blocking_with_tls_root_store( tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-imds and blocking only.Loads IMDS credentials and wraps them in a cached provider.
Sourcepub async fn assume_role(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source_credentials: Credentials,
) -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn assume_role( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source_credentials: Credentials, ) -> Result<Self>
credentials-sts and async only.Assumes a role using static source credentials (async).
Sourcepub async fn assume_role_with_tls_root_store(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source_credentials: Credentials,
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn assume_role_with_tls_root_store( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source_credentials: Credentials, tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and async only.Assumes a role using static source credentials and a specific trust root policy (async).
Sourcepub fn assume_role_blocking(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source_credentials: Credentials,
) -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn assume_role_blocking( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source_credentials: Credentials, ) -> Result<Self>
credentials-sts and blocking only.Assumes a role using static source credentials (blocking).
Sourcepub fn assume_role_blocking_with_tls_root_store(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source_credentials: Credentials,
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn assume_role_blocking_with_tls_root_store( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source_credentials: Credentials, tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and blocking only.Assumes a role using static source credentials and a specific trust root policy (blocking).
Sourcepub async fn from_web_identity_env() -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn from_web_identity_env() -> Result<Self>
credentials-sts and async only.Loads web identity credentials from env vars (async).
Sourcepub async fn from_web_identity_env_with_tls_root_store(
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn from_web_identity_env_with_tls_root_store( tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and async only.Loads web identity credentials from env vars and a specific trust root policy (async).
Sourcepub fn from_web_identity_env_blocking() -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn from_web_identity_env_blocking() -> Result<Self>
credentials-sts and blocking only.Loads web identity credentials from env vars (blocking).
Sourcepub fn from_web_identity_env_blocking_with_tls_root_store(
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn from_web_identity_env_blocking_with_tls_root_store( tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and blocking only.Loads web identity credentials from env vars and a specific trust root policy (blocking).
Sourcepub async fn assume_role_with_provider(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source: DynCredentialsProvider,
) -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn assume_role_with_provider( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source: DynCredentialsProvider, ) -> Result<Self>
credentials-sts and async only.Assumes a role using a credentials provider (async).
Sourcepub async fn assume_role_with_provider_with_tls_root_store(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source: DynCredentialsProvider,
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and async only.
pub async fn assume_role_with_provider_with_tls_root_store( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source: DynCredentialsProvider, tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and async only.Assumes a role using a credentials provider and a specific trust root policy (async).
Sourcepub fn assume_role_with_provider_blocking(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source: DynCredentialsProvider,
) -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn assume_role_with_provider_blocking( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source: DynCredentialsProvider, ) -> Result<Self>
credentials-sts and blocking only.Assumes a role using a credentials provider (blocking).
Sourcepub fn assume_role_with_provider_blocking_with_tls_root_store(
region: Region,
role_arn: impl Into<String>,
role_session_name: impl Into<String>,
source: DynCredentialsProvider,
tls_root_store: CredentialsTlsRootStore,
) -> Result<Self>
Available on crate features credentials-sts and blocking only.
pub fn assume_role_with_provider_blocking_with_tls_root_store( region: Region, role_arn: impl Into<String>, role_session_name: impl Into<String>, source: DynCredentialsProvider, tls_root_store: CredentialsTlsRootStore, ) -> Result<Self>
credentials-sts and blocking only.Assumes a role using a credentials provider and a specific trust root policy (blocking).