Skip to main content

TokenProvider

Trait TokenProvider 

Source
pub trait TokenProvider: Send + Sync {
    // Required method
    fn get_token(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + '_>>;
}
Expand description

Trait for token providers that supply bearer tokens for API requests.

Implementations should handle caching and refresh automatically.

Required Methods§

Source

fn get_token( &self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + '_>>

Returns a valid bearer token, refreshing if necessary.

Implementors§