pub trait AuthProvider: Send + Sync {
// Required methods
fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn validate_api_key<'life0, 'life1, 'async_trait>(
&'life0 self,
api_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ClientInfo>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn validate_jwt<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenClaims>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn scheme(&self) -> AuthScheme;
}Expand description
Authentication provider trait
Required Methods§
Sourcefn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Authenticate a request
Sourcefn validate_api_key<'life0, 'life1, 'async_trait>(
&'life0 self,
api_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ClientInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_api_key<'life0, 'life1, 'async_trait>(
&'life0 self,
api_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ClientInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate API key
Sourcefn validate_jwt<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenClaims>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_jwt<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenClaims>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate JWT token
Sourcefn scheme(&self) -> AuthScheme
fn scheme(&self) -> AuthScheme
Get authentication scheme
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".