Skip to main content

TokenBackend

Trait TokenBackend 

Source
pub trait TokenBackend: Send + Sync {
    // Required methods
    fn set_config(&mut self, g: Config);
    fn decode(&self, credential: &str) -> Result<Token, TokenProviderError>;
    fn encode(&self, token: &Token) -> Result<String, TokenProviderError>;
}
Expand description

Token Provider backend interface.

Required Methods§

Source

fn set_config(&mut self, g: Config)

Set config.

Source

fn decode(&self, credential: &str) -> Result<Token, TokenProviderError>

Extract the token from string.

Source

fn encode(&self, token: &Token) -> Result<String, TokenProviderError>

Extract the token from string.

Implementors§