TokenExchangeService

Trait TokenExchangeService 

Source
pub trait TokenExchangeService: Send + Sync {
    type Request: Send + Sync;
    type Response: Send + Sync;
    type Config: Send + Sync;

    // Required methods
    fn exchange_token<'life0, 'async_trait>(
        &'life0 self,
        request: Self::Request,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn validate_token<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
        token_type: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<TokenValidationResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn supported_subject_token_types(&self) -> Vec<String>;
    fn supported_requested_token_types(&self) -> Vec<String>;
    fn capabilities(&self) -> TokenExchangeCapabilities;
}
Expand description

Common token exchange service trait implemented by both managers

Required Associated Types§

Source

type Request: Send + Sync

Exchange token request type

Source

type Response: Send + Sync

Exchange token response type

Source

type Config: Send + Sync

Configuration type

Required Methods§

Source

fn exchange_token<'life0, 'async_trait>( &'life0 self, request: Self::Request, ) -> Pin<Box<dyn Future<Output = Result<Self::Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Exchange a token according to RFC 8693

Source

fn validate_token<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, token: &'life1 str, token_type: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<TokenValidationResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Validate a token of the specified type

Source

fn supported_subject_token_types(&self) -> Vec<String>

Get supported subject token types

Source

fn supported_requested_token_types(&self) -> Vec<String>

Get supported requested token types

Source

fn capabilities(&self) -> TokenExchangeCapabilities

Get service capabilities

Implementors§