use jacquard_common::IntoStatic;
use jacquard_common::session::SessionStoreError;
use jacquard_common::types::did::Did;
use jacquard_oauth::authstore::ClientAuthStore;
use jacquard_oauth::session::{AuthRequestData, ClientSessionData};
use sqlx::SqlitePool;
fn sqlx_to_session_err(e: sqlx::Error) -> SessionStoreError {
SessionStoreError::Other(Box::new(e))
}
#[derive(Clone)]
pub struct SqlAuthStore {
pool: SqlitePool,
}
impl SqlAuthStore {
pub fn new(pool: SqlitePool) -> Self {
Self { pool }
}
}
impl ClientAuthStore for SqlAuthStore {
async fn get_session(
&self,
did: &Did<'_>,
session_id: &str,
) -> Result