Trait graphql_starter::auth::AuthenticationService
source · pub trait AuthenticationService<S: Subject>: Send + Sync {
// Required methods
fn header_name(&self) -> &str;
fn cookie_name(&self) -> &str;
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: Option<&'life1 str>,
cookie: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<S>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Authentication service
Required Methods§
sourcefn header_name(&self) -> &str
fn header_name(&self) -> &str
Header name containing the authentication header
Cookie name containing the authentication cookie
sourcefn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: Option<&'life1 str>,
cookie: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<S>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: Option<&'life1 str>,
cookie: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<S>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validates if the given token or cookie is valid and returns the authenticated subject