Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider: Send + Sync {
    // Required method
    fn authenticate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        headers: &'life1 HeaderMap,
    ) -> Pin<Box<dyn Future<Output = Result<AuthenticatedActor, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Resolves inbound request headers to an authenticated actor.

Implementations may look up bearer tokens, verify JWTs, call an external identity service, etc. fslite-server ships one reference implementation, BearerTokenAuthProvider; production deployments are expected to provide their own.

Required Methods§

Source

fn authenticate<'life0, 'life1, 'async_trait>( &'life0 self, headers: &'life1 HeaderMap, ) -> Pin<Box<dyn Future<Output = Result<AuthenticatedActor, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Authenticates a request from its headers alone.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§