Skip to main content

FactorStrengthStorage

Trait FactorStrengthStorage 

Source
pub trait FactorStrengthStorage: Send + Sync {
    // Required methods
    fn get_policy<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tenant_id: &'life1 TenantId,
    ) -> Pin<Box<dyn Future<Output = Result<FactorStrengthPolicy, FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_policy<'life0, 'life1, 'async_trait>(
        &'life0 self,
        policy: &'life1 FactorStrengthPolicy,
    ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_user_factors<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EnrolledFactor>, FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_factor_usage<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        factor_id: &'life1 FactorId,
        operation: &'life2 str,
        risk_level: OperationRiskLevel,
    ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn is_in_grace_period<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Result<bool, FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_promotion_shown<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
        promotion_type: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Storage trait for factor strength policies

Required Methods§

Source

fn get_policy<'life0, 'life1, 'async_trait>( &'life0 self, tenant_id: &'life1 TenantId, ) -> Pin<Box<dyn Future<Output = Result<FactorStrengthPolicy, FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get policy for a tenant

Source

fn save_policy<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 FactorStrengthPolicy, ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save or update policy

Source

fn get_user_factors<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<Vec<EnrolledFactor>, FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get enrolled factors for a user

Source

fn record_factor_usage<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, factor_id: &'life1 FactorId, operation: &'life2 str, risk_level: OperationRiskLevel, ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record factor usage

Source

fn is_in_grace_period<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<bool, FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if user is in grace period

Source

fn record_promotion_shown<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 UserId, promotion_type: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), FactorStrengthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record factor promotion shown

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§