pub struct ApiKeyEntry {
pub id: String,
pub key_hash: String,
pub scopes: Vec<Scope>,
pub created_at: u64,
pub label: Option<String>,
pub team_id: Option<String>,
pub org_id: Option<String>,
pub key_lookup: Option<String>,
}Expand description
A stored API key entry with metadata.
Fields§
§id: StringUnique identifier for this key.
key_hash: StringArgon2 hash of the key (never store plaintext).
scopes: Vec<Scope>Scopes granted to this key.
created_at: u64Unix timestamp when the key was created.
label: Option<String>Optional human-readable label.
team_id: Option<String>AAASM-3139 — the team this key is scoped to. When present, a non-admin
key is confined to its own team for per-tenant data. None leaves the
key unscoped (admin-gated for cross-tenant data), preserving legacy keys.
org_id: Option<String>AAASM-3139 — the org this key is scoped to. See ApiKeyEntry::team_id.
key_lookup: Option<String>AAASM-4075 — the fast lookup index (ApiKey::lookup) for this key.
Populated when the entry is created from a known raw key so the store can
select it in O(1) and run argon2 only on this candidate. None marks a
legacy entry (e.g. loaded from a key file written before this field
existed); such entries fall back to the pre-index argon2 scan, so they do
not benefit from the anti-fan-out guarantee but remain fully valid.
Trait Implementations§
Source§impl Clone for ApiKeyEntry
impl Clone for ApiKeyEntry
Source§fn clone(&self) -> ApiKeyEntry
fn clone(&self) -> ApiKeyEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more