pub trait ApiKeyBackend: Send + Sync {
// Required methods
fn put(&self, key: &ApiKey);
fn get(&self, id: &str) -> Option<ApiKey>;
fn delete(&self, id: &str) -> bool;
fn list_for_user(&self, user_id: &str) -> Vec<ApiKey>;
fn touch(&self, id: &str, now: u64);
}Expand description
Storage backend for API keys. Same pluggable pattern as sessions
- magic codes — in-memory default, runtime injects SQLite/Postgres.
Required Methods§
fn put(&self, key: &ApiKey)
fn get(&self, id: &str) -> Option<ApiKey>
fn delete(&self, id: &str) -> bool
Sourcefn list_for_user(&self, user_id: &str) -> Vec<ApiKey>
fn list_for_user(&self, user_id: &str) -> Vec<ApiKey>
All keys for a given user, used by management endpoints.