pub struct GeneralAuthenticationRequirement(/* private fields */);Expand description
Authentication requirement.
Implementations§
Source§impl GeneralAuthenticationRequirement
impl GeneralAuthenticationRequirement
Sourcepub fn password(
min_size: usize,
should_contain_different_case: bool,
should_contain_symbols: bool,
) -> Self
pub fn password( min_size: usize, should_contain_different_case: bool, should_contain_symbols: bool, ) -> Self
Simple password.
You can specify minimal size, lower & upper case requirement and symbols requirement.
Sourcepub fn totp() -> Self
pub fn totp() -> Self
Standard TOTP 2FA.
Default algorithm is SHA1, default length in bytes - 20 (160 bits).
It’s recommended to use SHA256/SHA512 and 32 bytes of secret, if your
2FA application supports this.
Other parameters: 6 digits, 1 skew step, 30 seconds to step.
Related RFC:
Rust realization: totp-rs.
Sourcepub fn totp_with_opts(
algorithm: TOTPAlgorithm,
secret_length_bytes: Option<usize>,
) -> Self
pub fn totp_with_opts( algorithm: TOTPAlgorithm, secret_length_bytes: Option<usize>, ) -> Self
TOTP 2FA with options.
Default algorithm is SHA1, default length in bytes - 20 (160 bits).
It’s recommended to use SHA256/SHA512 and 32 bytes of secret, if your
2FA application supports this.
Other parameters: 6 digits, 1 skew step, 30 seconds to step.
Related RFC:
Rust realization: totp-rs.
Sourcepub fn question() -> Self
pub fn question() -> Self
Question.
According to this requirement, the user must give the correct answer to the question that he had given to him.
Sourcepub fn email_confirm() -> Self
pub fn email_confirm() -> Self
Email confirmation.
Note that this requirement is already satisfy excluded domain identication requirement. It just requests email code every time user signs in.
Sourcepub fn as_variant(&self) -> &GeneralAuthenticationRequirementVariant
pub fn as_variant(&self) -> &GeneralAuthenticationRequirementVariant
Returns variant.
Source§impl GeneralAuthenticationRequirement
impl GeneralAuthenticationRequirement
Sourcepub fn generate_requirement_for_user(&self) -> AuthenticationRequirement
pub fn generate_requirement_for_user(&self) -> AuthenticationRequirement
Generates authentication requirement you can provide to users.
Trait Implementations§
Source§impl Clone for GeneralAuthenticationRequirement
impl Clone for GeneralAuthenticationRequirement
Source§fn clone(&self) -> GeneralAuthenticationRequirement
fn clone(&self) -> GeneralAuthenticationRequirement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for GeneralAuthenticationRequirement
impl<'de> Deserialize<'de> for GeneralAuthenticationRequirement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for GeneralAuthenticationRequirement
Source§impl PartialEq for GeneralAuthenticationRequirement
impl PartialEq for GeneralAuthenticationRequirement
Source§fn eq(&self, other: &GeneralAuthenticationRequirement) -> bool
fn eq(&self, other: &GeneralAuthenticationRequirement) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GeneralAuthenticationRequirement
Auto Trait Implementations§
impl Freeze for GeneralAuthenticationRequirement
impl RefUnwindSafe for GeneralAuthenticationRequirement
impl Send for GeneralAuthenticationRequirement
impl Sync for GeneralAuthenticationRequirement
impl Unpin for GeneralAuthenticationRequirement
impl UnsafeUnpin for GeneralAuthenticationRequirement
impl UnwindSafe for GeneralAuthenticationRequirement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.