Skip to main content

AuthStrategy

Trait AuthStrategy 

Source
pub trait AuthStrategy: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        parts: &'life1 Parts,
        db: &'life2 DatabaseConnection,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthIdentity>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A pluggable auth backend (cookie session, JWT bearer, LDAP, …).

Required Methods§

Source

fn name(&self) -> &str

Source

fn authenticate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parts: &'life1 Parts, db: &'life2 DatabaseConnection, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthIdentity>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§