pub struct ApiKeyRecord {
pub id: String,
pub key_hash: String,
pub tenant_id: String,
pub name: String,
pub scopes: Vec<String>,
pub expires_at: Option<String>,
pub last_used_at: Option<String>,
pub created_at: String,
pub revoked_at: Option<String>,
}Expand description
Full stored record used by super::ApiKeyBackend implementations.
Contains the hash and revocation fields that are stripped when
converting to ApiKeyMeta via into_meta.
Fields§
§id: StringULID primary key.
key_hash: Stringhex(sha256(secret)).
tenant_id: StringTenant this key belongs to.
name: StringHuman-readable name.
scopes: Vec<String>Scopes as Vec<String> (serialized as JSON in DB).
expires_at: Option<String>Expiration timestamp (ISO 8601), or None for lifetime.
last_used_at: Option<String>Last use timestamp (ISO 8601).
created_at: StringCreation timestamp (ISO 8601).
revoked_at: Option<String>Revocation timestamp (ISO 8601), or None if active.
Implementations§
Source§impl ApiKeyRecord
impl ApiKeyRecord
Sourcepub fn into_meta(self) -> ApiKeyMeta
pub fn into_meta(self) -> ApiKeyMeta
Convert to public metadata, stripping hash and revocation fields.
Trait Implementations§
Source§impl Clone for ApiKeyRecord
impl Clone for ApiKeyRecord
Source§fn clone(&self) -> ApiKeyRecord
fn clone(&self) -> ApiKeyRecord
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for ApiKeyRecord
impl RefUnwindSafe for ApiKeyRecord
impl Send for ApiKeyRecord
impl Sync for ApiKeyRecord
impl Unpin for ApiKeyRecord
impl UnsafeUnpin for ApiKeyRecord
impl UnwindSafe for ApiKeyRecord
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