pub struct MockAuthProvider {
pub should_succeed: bool,
pub mock_user: Option<User>,
pub mock_token: String,
}
Expand description
Mock authentication provider for testing
Fields§
§should_succeed: bool
Whether authentication should succeed
mock_user: Option<User>
Mock user to return
mock_token: String
Mock token to return
Trait Implementations§
Source§impl AuthProvider for MockAuthProvider
impl AuthProvider for MockAuthProvider
Source§fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
_credentials: &'life1 Credentials,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
_credentials: &'life1 Credentials,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Authenticate with the given credentials
Source§fn refresh_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Refresh an existing session
Source§fn validate_token<'life0, 'life1, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_token<'life0, 'life1, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate a session token
Source§impl Clone for MockAuthProvider
impl Clone for MockAuthProvider
Source§fn clone(&self) -> MockAuthProvider
fn clone(&self) -> MockAuthProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MockAuthProvider
impl Debug for MockAuthProvider
Auto Trait Implementations§
impl Freeze for MockAuthProvider
impl RefUnwindSafe for MockAuthProvider
impl Send for MockAuthProvider
impl Sync for MockAuthProvider
impl Unpin for MockAuthProvider
impl UnwindSafe for MockAuthProvider
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