pub enum AuthenticationApprovalVerifier {
Password {
salt: String,
hash: Vec<u8>,
},
TotpCode {
alg: TOTPAlgorithm,
secret: String,
},
Question {
question: String,
salt: String,
hash: Vec<u8>,
},
EmailConfirmation,
Proxy,
U2fKey {
registration: Registration,
},
X509Certificate {
public_certificate: Vec<u8>,
},
RawDilithium5Certificate {
public_key: Vec<u8>,
signatures: Vec<Dilithium5Signature>,
},
}Expand description
Information about authentication that is stored in key-value DB.
Each info about authentication step should be mitigation-prone.
Variants§
Password
Password verifier.
TotpCode
TOTP verifier.
Question
Question-answer pair verifier.
EmailConfirmation
Email verifier.
Proxy
IP address verifier.
U2fKey
U2F verifier.
Fields
§
registration: RegistrationX509Certificate
X.509 verifier.
RawDilithium5Certificate
Dilithium (mode 5) verifier.
Implementations§
Source§impl<'a> AuthenticationApprovalVerifier
impl<'a> AuthenticationApprovalVerifier
Sourcepub fn to_requirement(&self) -> AuthenticationRequirement
pub fn to_requirement(&self) -> AuthenticationRequirement
Converts stored information to authentication requirement.
Sourcepub fn validate(
&'a self,
request: &'a AuthenticationApproval,
password_validator: Option<&'a impl Fn(&'a str, &'a str, &'a [u8]) -> bool>,
metatada: &'a AuthenticationState,
) -> bool
pub fn validate( &'a self, request: &'a AuthenticationApproval, password_validator: Option<&'a impl Fn(&'a str, &'a str, &'a [u8]) -> bool>, metatada: &'a AuthenticationState, ) -> bool
Validates requirement with given approval.
WARNING: still can’t validate: Proxy, U2FKey, X509Certificate and RawDilithium5Certificate.
Trait Implementations§
Source§impl Clone for AuthenticationApprovalVerifier
impl Clone for AuthenticationApprovalVerifier
Source§fn clone(&self) -> AuthenticationApprovalVerifier
fn clone(&self) -> AuthenticationApprovalVerifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for AuthenticationApprovalVerifier
impl<'de> Deserialize<'de> for AuthenticationApprovalVerifier
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AuthenticationApprovalVerifier
Source§impl PartialEq for AuthenticationApprovalVerifier
impl PartialEq for AuthenticationApprovalVerifier
Source§fn eq(&self, other: &AuthenticationApprovalVerifier) -> bool
fn eq(&self, other: &AuthenticationApprovalVerifier) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AuthenticationApprovalVerifier
Auto Trait Implementations§
impl Freeze for AuthenticationApprovalVerifier
impl RefUnwindSafe for AuthenticationApprovalVerifier
impl Send for AuthenticationApprovalVerifier
impl Sync for AuthenticationApprovalVerifier
impl Unpin for AuthenticationApprovalVerifier
impl UnsafeUnpin for AuthenticationApprovalVerifier
impl UnwindSafe for AuthenticationApprovalVerifier
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
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
Compare self to
key and return true if they are equal.