pub struct AccountStore { /* private fields */ }Expand description
Account store. Wraps an AccountBackend and provides the methods the
OAuth callback / API endpoints actually call.
Implementations§
Source§impl AccountStore
impl AccountStore
pub fn new() -> Self
pub fn with_backend(backend: Box<dyn AccountBackend>) -> Self
pub fn upsert(&self, account: &Account)
pub fn find_by_provider( &self, provider_id: &str, account_id: &str, ) -> Option<Account>
pub fn find_for_user(&self, user_id: &str) -> Vec<Account>
pub fn delete_for_user(&self, user_id: &str) -> usize
pub fn unlink(&self, provider_id: &str, account_id: &str) -> bool
Sourcepub fn list_all_unfiltered(&self) -> Vec<Account>
pub fn list_all_unfiltered(&self) -> Vec<Account>
Every account in the store. Powers the Studio “Auth tables” view; not for app use. Implemented by walking the backend’s per-user index — doable because account counts per user are small (typically ≤ 5) and total account count tracks user count.
We don’t add a list_all method to the AccountBackend trait
because the in-memory + sqlite + postgres impls would each
need a separate implementation, and the operational use case
(Studio inspector) is narrow enough to live behind a wrapper
that walks the underlying store directly. For PG/SQLite that
means a SELECT * FROM _pylon_accounts — which the backends
can grow if we ever need this at scale.