Trait AuthService

Source
pub trait AuthService: Service {
    // Required methods
    fn authenticate<'life0, 'async_trait>(
        &'life0 self,
        credentials: Credentials,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<(String, User)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn logout<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_current_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<User>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<HealthStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Service trait for Authentication operations

Required Methods§

Source

fn authenticate<'life0, 'async_trait>( &'life0 self, credentials: Credentials, ) -> Pin<Box<dyn Future<Output = ServiceResult<(String, User)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Authenticate with the API

Source

fn logout<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Logout from the API

Source

fn get_current_user<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ServiceResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get current user information

Source

fn validate_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ServiceResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate session

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ServiceResult<HealthStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check

Implementors§