pub trait ApiAuthenticator: TokenGenerator {
    // Provided methods
    fn type_name(&self) -> &str { ... }
    fn get_carrier(&self) -> &Carrier { ... }
    fn authenticate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: Request,
        _extensions: &'life1 Extensions
    ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

This trait is used to authenticate request

Provided Methods§

source

fn type_name(&self) -> &str

Get type_name, used in Debug

source

fn get_carrier(&self) -> &Carrier

Get Carrier

source

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, req: Request, _extensions: &'life1 Extensions ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Authenticate request

  • req: HTTP request
  • extensions: Extensions

Trait Implementations§

source§

impl ApiAuthenticator for Box<dyn ApiAuthenticator>

source§

fn get_carrier(&self) -> &Carrier

Get Carrier
source§

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, req: Request, extensions: &'life1 Extensions ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Authenticate request Read more
source§

fn type_name(&self) -> &str

Get type_name, used in Debug
source§

impl TokenGenerator for Box<dyn ApiAuthenticator>

source§

fn generate_token<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 Request ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a new token

Implementations on Foreign Types§

source§

impl ApiAuthenticator for Box<dyn ApiAuthenticator>

source§

fn get_carrier(&self) -> &Carrier

source§

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, req: Request, extensions: &'life1 Extensions ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§