pub struct InMemoryFactorStrengthStorage { /* private fields */ }Expand description
In-memory storage for testing
Implementations§
Trait Implementations§
Source§impl FactorStrengthStorage for InMemoryFactorStrengthStorage
impl FactorStrengthStorage for InMemoryFactorStrengthStorage
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,
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,
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,
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,
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,
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,
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
Auto Trait Implementations§
impl !Freeze for InMemoryFactorStrengthStorage
impl !RefUnwindSafe for InMemoryFactorStrengthStorage
impl Send for InMemoryFactorStrengthStorage
impl Sync for InMemoryFactorStrengthStorage
impl Unpin for InMemoryFactorStrengthStorage
impl UnsafeUnpin for InMemoryFactorStrengthStorage
impl UnwindSafe for InMemoryFactorStrengthStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more