pub struct KeyRecord {
pub id: String,
pub name: String,
pub hash: [u8; 32],
pub created_at: i64,
pub valid_after: Option<i64>,
pub valid_before: Option<i64>,
pub webhook_url: Option<String>,
}Expand description
An API authentication credential. Stored in three redb tables:
keys_by_id, keys_by_hash (blake3 token hash → id), keys_by_name (name → id).
Fields§
§id: StringULID — sortable, displayed in CLI output.
name: StringOperator-chosen human label. Unique per server.
hash: [u8; 32]blake3 hash of the bearer token. The plaintext token is shown once and discarded.
created_at: i64Unix seconds when the key was created.
valid_after: Option<i64>Optional time-window start (unix seconds). None = no lower bound.
valid_before: Option<i64>Optional time-window end (unix seconds). None = no upper bound.
webhook_url: Option<String>Optional webhook URL fired on lifecycle events for secrets owned by this key.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyRecord
impl<'de> Deserialize<'de> for KeyRecord
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 StructuralPartialEq for KeyRecord
Auto Trait Implementations§
impl Freeze for KeyRecord
impl RefUnwindSafe for KeyRecord
impl Send for KeyRecord
impl Sync for KeyRecord
impl Unpin for KeyRecord
impl UnsafeUnpin for KeyRecord
impl UnwindSafe for KeyRecord
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