refactor auth_repo to server_app
This commit is contained in:
24
src/server/models.rs
Normal file
24
src/server/models.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use uuid::Uuid;
|
||||
use opaque_ke::ServerLogin;
|
||||
use crate::server::repository::opaque_repo::{AuthRepoError, OpaqueDatabaseRepo};
|
||||
use crate::shared::models::opaque::{NKodeCipherSuite, PasswordFile};
|
||||
|
||||
pub struct RegCache {
|
||||
pub session_id: Uuid,
|
||||
pub identifier: Vec<u8>,
|
||||
}
|
||||
|
||||
pub struct LoginCache {
|
||||
pub session_id: Uuid,
|
||||
pub identifiers: Vec<u8>,
|
||||
pub server_login: ServerLogin<NKodeCipherSuite>,
|
||||
}
|
||||
|
||||
pub trait CredKind {
|
||||
fn has<R: OpaqueDatabaseRepo>(repo: &R, id: &[u8]) -> bool;
|
||||
fn get_password_file<R: OpaqueDatabaseRepo>(repo: &R, id: &[u8]) -> Result<PasswordFile, AuthRepoError>;
|
||||
fn set_password_file<R: OpaqueDatabaseRepo>(repo: &mut R, id: &[u8], pf: PasswordFile) -> Result<(), AuthRepoError>;
|
||||
fn prereq_for_register<R: OpaqueDatabaseRepo>(_repo: &R, _id: &[u8]) -> Result<(), AuthRepoError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user