Trait AuthGuard

Source
pub trait AuthGuard: Send + Sync {
    type User: Send + Sync;

    // Required methods
    fn authenticate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 Request,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &'static str;
}
Expand description

Trait for authentication guards

Required Associated Types§

Source

type User: Send + Sync

User type

Required Methods§

Source

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

Authenticates the request

Source

fn name(&self) -> &'static str

Guard name

Implementors§