pub trait Auth: Send + Sync {
// Required methods
fn provider_id(&self) -> &str;
fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthCredentials>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_credentials<'life0, 'async_trait>(
&'life0 self,
credentials: AuthCredentials,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn has_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Authentication trait for provider credentials
Required Methods§
Sourcefn provider_id(&self) -> &str
fn provider_id(&self) -> &str
Get the provider ID this auth is for
Sourcefn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthCredentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthCredentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current valid credentials
Sourcefn set_credentials<'life0, 'async_trait>(
&'life0 self,
credentials: AuthCredentials,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_credentials<'life0, 'async_trait>(
&'life0 self,
credentials: AuthCredentials,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store new credentials