Skip to main content

TokenStore

Trait TokenStore 

Source
pub trait TokenStore: Send + Sync {
    // Required methods
    fn load<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TokenSet>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save<'life0, 'async_trait>(
        &'life0 self,
        tokens: TokenSet,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Persistence for OAuth tokens (memory, file, Redis, Postgres, …).

GoHighLevel rotates the refresh token on every use, so implementations must persist what TokenStore::save hands them or the integration will lose its session on restart.

Required Methods§

Source

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

Load the most recently saved tokens, if any.

Source

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

Persist a freshly rotated token set. Must be durable before returning.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§