pub struct TwoFactorConfig {Show 21 fields
pub allow_passwordless: bool,
pub totp_allow_passwordless: Option<bool>,
pub backup_allow_passwordless: Option<bool>,
pub backup_code_amount: f64,
pub backup_code_length: f64,
pub custom_backup_codes_generate: Option<Arc<dyn Fn() -> AuthResult<Vec<String>> + Send + Sync>>,
pub backup_storage: TwoFactorBackupStorage,
pub account_lockout: AccountLockoutConfig,
pub issuer: Option<String>,
pub skip_verification_on_enable: bool,
pub two_factor_cookie_max_age: f64,
pub trust_device_max_age: f64,
pub totp_period: f64,
pub totp_digits: f64,
pub totp_issuer: Option<String>,
pub totp_disabled: bool,
pub send_otp: Option<Arc<dyn SendTwoFactorOtp>>,
pub otp_digits: f64,
pub otp_period_minutes: f64,
pub otp_allowed_attempts: f64,
pub otp_storage: TwoFactorOtpStorage,
}Expand description
Public configuration for the two-factor plugin.
Fields§
§allow_passwordless: boolAllow omission of passwords for users without a stored credential hash.
totp_allow_passwordless: Option<bool>Override the global passwordless policy for existing TOTP URI retrieval.
backup_allow_passwordless: Option<bool>Override the global passwordless policy for backup regeneration.
backup_code_amount: f64Number of generated backup codes, using JS array-length coercion.
backup_code_length: f64Generated characters per code, before the separator after character five.
custom_backup_codes_generate: Option<Arc<dyn Fn() -> AuthResult<Vec<String>> + Send + Sync>>Optional synchronous generator. Its strings are persisted unchanged.
backup_storage: TwoFactorBackupStorage§account_lockout: AccountLockoutConfig§issuer: Option<String>Override the issuer embedded in enrollment TOTP URIs.
skip_verification_on_enable: boolSkip the enrollment verification step and enable 2FA immediately.
Pending challenge lifetime in seconds, including fractions and explicit zero.
trust_device_max_age: f64Trusted proof lifetime in seconds; negative values omit cookie Max-Age.
totp_period: f64TOTP period in seconds, retaining Source fractional and signed counters.
totp_digits: f64Raw TOTP digits. Fractional values retain Source decimal-remainder output.
totp_issuer: Option<String>Issuer used when retrieving an existing authenticator URI.
totp_disabled: boolReject TOTP enrollment, URI retrieval, verification and server generation.
send_otp: Option<Arc<dyn SendTwoFactorOtp>>Optional OTP sender callback. When absent, /two-factor/send-otp is disabled.
otp_digits: f64Number of decimal digits in delivered OTPs, following JS numeric length.
otp_period_minutes: f64OTP lifetime in minutes; zero selects the pinned three-minute default.
otp_allowed_attempts: f64Failed OTP budget; zero selects the pinned five-attempt default.
otp_storage: TwoFactorOtpStorageTrait Implementations§
Source§impl Clone for TwoFactorConfig
impl Clone for TwoFactorConfig
Source§impl Debug for TwoFactorConfig
impl Debug for TwoFactorConfig
Auto Trait Implementations§
impl !RefUnwindSafe for TwoFactorConfig
impl !UnwindSafe for TwoFactorConfig
impl Freeze for TwoFactorConfig
impl Send for TwoFactorConfig
impl Sync for TwoFactorConfig
impl Unpin for TwoFactorConfig
impl UnsafeUnpin for TwoFactorConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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