pub trait CredentialsProvider {
type Credentials;
fn acquire_credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Credentials, CredentialsError>> + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn is_expired(&self, credentials: &Self::Credentials) -> bool;
}Required Associated Types§
type Credentials
Required Methods§
sourcefn acquire_credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Credentials, CredentialsError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acquire_credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Credentials, CredentialsError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acquire new credentials from the credentials provider.
Calling this method will often result in a network request to an identity provider
sourcefn is_expired(&self, credentials: &Self::Credentials) -> bool
fn is_expired(&self, credentials: &Self::Credentials) -> bool
Check whether the credentials since the last call to acquire_credentials have expired
This method should not make any network requests to identity providers so may still return true even if a token has been revoked.