Skip to main content

OAuthTokenStore

Trait OAuthTokenStore 

Source
pub trait OAuthTokenStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        provider: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Option<OAuthToken>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        provider: &'life2 str,
        token: OAuthToken,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        provider: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Pluggable storage for OAuth tokens.

Keys are (user_id, provider) pairs. Implement this to persist tokens across agent restarts (e.g. in a keyring, SQLite, or secrets manager).

Required Methods§

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 str, provider: &'life2 str, ) -> Pin<Box<dyn Future<Output = Option<OAuthToken>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve a stored token.

Source

fn set<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 str, provider: &'life2 str, token: OAuthToken, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store a token.

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 str, provider: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a token (e.g. on revocation).

Implementors§