pub struct Key {
pub id: String,
pub owner_id: String,
pub name: String,
pub key_prefix: String,
pub key_digest: String,
pub scopes: Vec<String>,
pub is_active: bool,
pub expires_at: Option<DateTime<Utc>>,
pub grace_ends_at: Option<DateTime<Utc>>,
pub rotated_by_id: Option<String>,
pub last_used_at: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
}Expand description
Persisted API key metadata.
Fields§
§id: StringUnique identifier for this key.
owner_id: StringIdentifier of the key owner.
name: StringHuman-readable name for the key.
key_prefix: StringDisplay-safe key prefix used for candidate lookup.
key_digest: StringPepper-keyed HMAC-SHA-256 digest stored at rest.
scopes: Vec<String>Scopes granted to the key.
is_active: boolWhether the key is active.
expires_at: Option<DateTime<Utc>>Expiry time.
grace_ends_at: Option<DateTime<Utc>>Grace period end after rotation.
rotated_by_id: Option<String>Replacement key ID after rotation.
last_used_at: Option<DateTime<Utc>>Last successful validation time.
created_at: DateTime<Utc>Creation timestamp.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Key
impl<'de> Deserialize<'de> for Key
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 Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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