pub struct TotpSecondaryAuth { /* private fields */ }Expand description
TOTP MFA secondary authentication for tests.
When applied, sets the X-MFA-Code header with either an auto-generated
valid TOTP code or a manually specified code.
Implementations§
Source§impl TotpSecondaryAuth
impl TotpSecondaryAuth
Sourcepub fn new(manager: MFAAuthentication) -> Self
pub fn new(manager: MFAAuthentication) -> Self
Create a new TOTP secondary auth using the given MFA manager.
Sourcepub fn with_code_only(code: impl Into<String>) -> Self
pub fn with_code_only(code: impl Into<String>) -> Self
Create a TOTP secondary auth with a pre-generated code.
Use this when you don’t have access to the MFAAuthentication manager,
or when testing with a specific code (including invalid codes).
Trait Implementations§
Source§impl SecondaryAuth for TotpSecondaryAuth
impl SecondaryAuth for TotpSecondaryAuth
Source§fn apply_to_client<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client: &'life1 APIClient,
primary: &'life2 SessionIdentity,
) -> Pin<Box<dyn Future<Output = Result<(), TestAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn apply_to_client<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client: &'life1 APIClient,
primary: &'life2 SessionIdentity,
) -> Pin<Box<dyn Future<Output = Result<(), TestAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Apply this secondary auth layer to an HTTP test client. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TotpSecondaryAuth
impl !UnwindSafe for TotpSecondaryAuth
impl Freeze for TotpSecondaryAuth
impl Send for TotpSecondaryAuth
impl Sync for TotpSecondaryAuth
impl Unpin for TotpSecondaryAuth
impl UnsafeUnpin for TotpSecondaryAuth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more