pub struct MemoryBruteForceStore { /* private fields */ }Expand description
In-memory implementation of brute force store for testing
Implementations§
Trait Implementations§
Source§impl BruteForceStore for MemoryBruteForceStore
impl BruteForceStore for MemoryBruteForceStore
Source§fn record_failed_attempt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
ip_address: Option<&'life3 str>,
user_agent: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn record_failed_attempt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
ip_address: Option<&'life3 str>,
user_agent: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Record a failed authentication attempt
Source§fn get_failed_attempts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FailedAttempt>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_failed_attempts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FailedAttempt>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get failed attempts for a user
Source§fn clear_failed_attempts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn clear_failed_attempts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Clear failed attempts for a user
Source§fn set_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
lockout: LockoutRecord,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
lockout: LockoutRecord,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Set lockout for a user
Source§fn get_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LockoutRecord>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LockoutRecord>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get lockout status for a user
Source§fn remove_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_lockout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove lockout for a user
Source§fn record_failed_attempt_by_ip<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_failed_attempt_by_ip<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Record failed attempt by IP
Source§fn get_failed_attempts_by_ip<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FailedAttempt>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_failed_attempts_by_ip<'life0, 'life1, 'async_trait>(
&'life0 self,
ip_address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<FailedAttempt>, BruteForceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get failed attempts by IP
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryBruteForceStore
impl !UnwindSafe for MemoryBruteForceStore
impl Freeze for MemoryBruteForceStore
impl Send for MemoryBruteForceStore
impl Sync for MemoryBruteForceStore
impl Unpin for MemoryBruteForceStore
impl UnsafeUnpin for MemoryBruteForceStore
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