rustical_oidc/
user_store.rs

1use async_trait::async_trait;
2use axum::response::IntoResponse;
3
4#[async_trait]
5pub trait UserStore: 'static + Send + Sync + Clone {
6    type Error: IntoResponse;
7
8    async fn user_exists(&self, id: &str) -> Result<bool, Self::Error>;
9    /// Ensures a user with id and memberhips exists
10    /// Note that memberships is ONLY ADDITIVE
11    async fn ensure_user(&self, id: &str, memberships: &[&str]) -> Result<(), Self::Error>;
12}