idk what i did

This commit is contained in:
2025-12-18 11:19:11 -06:00
parent b03a23b280
commit c24b254b22
12 changed files with 155 additions and 118 deletions

View File

@@ -3,7 +3,7 @@ use std::sync::Arc;
use async_trait::async_trait;
use tokio::sync::Mutex;
use uuid::Uuid;
use crate::server::repository::user_repo::UserRepo;
use crate::shared::models::store::UserAuthStore;
use crate::shared::models::app::{CodeLoggedInSession, CodeLoginData, KeyLoggedInSession};
use crate::shared::models::email::Email;
@@ -30,7 +30,7 @@ impl Default for InMemoryUserDB {
}
#[async_trait]
impl UserRepo for InMemoryUserDB {
impl UserAuthStore for InMemoryUserDB {
async fn get_key_session(&self, session_id: &Uuid) -> Result<KeyLoggedInSession, String> {
self.key_session.lock().await
.get(&session_id)

View File

@@ -1,3 +1,2 @@
pub mod in_memory;
pub mod opaque_repo;
pub mod user_repo;

View File

@@ -1,16 +0,0 @@
use async_trait::async_trait;
use uuid::Uuid;
use crate::shared::models::app::{CodeLoggedInSession, CodeLoginData, KeyLoggedInSession};
use crate::shared::models::email::Email;
#[async_trait]
pub trait UserRepo {
async fn get_key_session(&self, session_id: &Uuid) -> Result<KeyLoggedInSession, String>;
async fn get_code_session(&self, session_id: &Uuid) -> Result<CodeLoggedInSession, String>;
async fn set_key_session(&self, session: KeyLoggedInSession) -> Result<(), String>;
async fn set_code_session(&self, session: CodeLoggedInSession) -> Result<(), String>;
async fn set_code_login_data(&self, email: Email, data: CodeLoginData) -> Result<(), String>;
async fn get_code_login_data(&self, email: &Email) -> Result<CodeLoginData, String>;
}