Enum bonsaidb_core::connection::Authentication
source · pub enum Authentication {
Token {
id: u64,
now: TimestampAsNanoseconds,
now_hash: Bytes,
algorithm: TokenChallengeAlgorithm,
},
TokenChallengeResponse(Bytes),
Password {
user: NamedReference<'static, u64>,
password: SensitiveString,
},
}
Expand description
Authentication methods.
Variants§
Token
Fields
§
now: TimestampAsNanoseconds
The current timestamp of the authenticating device. This must be within 5 minutes of the server’s time for token authentication to succeed.
§
now_hash: Bytes
The hash of now
, using the private token as key matter.
§
algorithm: TokenChallengeAlgorithm
The token challenge algorithm used to generate now_hash
.
Initialize token-based authentication.
TokenChallengeResponse(Bytes)
A response to the server’s token authentication challenge.
Password
Fields
§
user: NamedReference<'static, u64>
The username or the user id to authenticate as.
§
password: SensitiveString
The password of the user.
Authenticate a user with a password.
Implementations§
source§impl Authentication
impl Authentication
Trait Implementations§
source§impl Clone for Authentication
impl Clone for Authentication
source§fn clone(&self) -> Authentication
fn clone(&self) -> Authentication
Returns a copy 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 Authentication
impl Debug for Authentication
source§impl<'de> Deserialize<'de> for Authentication
impl<'de> Deserialize<'de> for Authentication
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
Auto Trait Implementations§
impl RefUnwindSafe for Authentication
impl Send for Authentication
impl Sync for Authentication
impl Unpin for Authentication
impl UnwindSafe for Authentication
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