Skip to main content

ToolAuthStore

Trait ToolAuthStore 

Source
pub trait ToolAuthStore: Send + Sync {
    // Required methods
    fn get_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        auth_entity: &'life1 str,
        user_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthSession>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn store_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        auth_entity: &'life1 str,
        user_id: &'life2 str,
        session: AuthSession,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn remove_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        auth_entity: &'life1 str,
        user_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn store_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        auth_entity: Option<&'life2 str>,
        secret: AuthSecret,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        auth_entity: Option<&'life2 str>,
        key: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthSecret>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn remove_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        auth_entity: Option<&'life2 str>,
        key: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn store_oauth2_state<'life0, 'async_trait>(
        &'life0 self,
        state: OAuth2State,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_oauth2_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<OAuth2State>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_oauth2_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_secrets<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AuthSecret>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_sessions<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AuthSession>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Storage-only trait for authentication stores Implementations only need to handle storage operations

Required Methods§

Source

fn get_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, auth_entity: &'life1 str, user_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthSession>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Session Management Get current authentication session for an entity

Source

fn store_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, auth_entity: &'life1 str, user_id: &'life2 str, session: AuthSession, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store authentication session

Source

fn remove_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, auth_entity: &'life1 str, user_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove authentication session

Source

fn store_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 str, auth_entity: Option<&'life2 str>, secret: AuthSecret, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Secret Management Store secret for a user (optionally scoped to auth_entity)

Source

fn get_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, user_id: &'life1 str, auth_entity: Option<&'life2 str>, key: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthSecret>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Get stored secret by key (optionally scoped to auth_entity)

Source

fn remove_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, user_id: &'life1 str, auth_entity: Option<&'life2 str>, key: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Remove stored secret by key (optionally scoped to auth_entity)

Source

fn store_oauth2_state<'life0, 'async_trait>( &'life0 self, state: OAuth2State, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

State Management (for OAuth2 flows) Store OAuth2 state for security

Source

fn get_oauth2_state<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<OAuth2State>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get OAuth2 state by state parameter

Source

fn remove_oauth2_state<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove OAuth2 state (after successful callback)

Source

fn list_secrets<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AuthSecret>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_sessions<'life0, 'life1, 'async_trait>( &'life0 self, _user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AuthSession>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§