Skip to main content

OAuthCredentialStorage

Trait OAuthCredentialStorage 

Source
pub trait OAuthCredentialStorage: Send + Sync {
    // Required methods
    fn load_credential<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<OAuthCredential>, OAuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_credential<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        credential: OAuthCredential,
    ) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_credential<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn has_credential(&self, key: &str) -> bool;
}
Expand description

Trait for loading and saving OAuth credentials, keyed by provider ID or credential key.

Implementations include OsKeyringStore (OS keychain, feature keyring) and the in-memory FakeOAuthCredentialStore for tests.

Required Methods§

Source

fn load_credential<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<OAuthCredential>, OAuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn save_credential<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, credential: OAuthCredential, ) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_credential<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn has_credential(&self, key: &str) -> bool

Implementors§