pub struct UserKey {
pub key_id: PublicKey,
pub storage: KeyStorage,
pub display_name: Option<String>,
pub created_at: i64,
pub last_used: Option<i64>,
pub is_default: bool,
pub database_sigkeys: HashMap<ID, Option<SigKey>>,
}Expand description
User’s private key with database mappings
Keys can be either encrypted (for password-protected users) or unencrypted (for passwordless single-user mode).
Fields§
§key_id: PublicKeyKey identifier (the public key)
storage: KeyStorageKey storage (encrypted ciphertext or plaintext PrivateKey)
display_name: Option<String>Display name for this key
created_at: i64When this key was created (Unix timestamp)
last_used: Option<i64>Last time this key was used (Unix timestamp)
is_default: boolWhether this is the user’s default key, which has admin access on the user’s DB Only one key should be marked as default at a time
database_sigkeys: HashMap<ID, Option<SigKey>>Database-specific SigKey mappings Maps: Database ID → SigKey identity for that database
None = default identity (pubkey derived from this key’s key_id)
Some(sigkey) = non-default identity (global wildcard, name-based, delegation)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserKey
impl<'de> Deserialize<'de> for UserKey
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 Freeze for UserKey
impl RefUnwindSafe for UserKey
impl Send for UserKey
impl Sync for UserKey
impl Unpin for UserKey
impl UnwindSafe for UserKey
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> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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