CredentialProvider

Trait CredentialProvider 

Source
pub trait CredentialProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn resolve<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn refresh<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn supports_refresh(&self) -> bool { ... }
}
Expand description

Trait for resolving credentials from various sources.

Required Methods§

Source

fn name(&self) -> &str

Provider name for debugging.

Source

fn resolve<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resolve credential from this provider.

Provided Methods§

Source

fn refresh<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refresh expired credentials.

Source

fn supports_refresh(&self) -> bool

Whether this provider supports credential refresh.

Implementors§