refactor file struct

This commit is contained in:
2025-12-14 11:49:50 -06:00
parent e6a7dc4993
commit 71552911b1
18 changed files with 86 additions and 76 deletions

View File

@@ -2,11 +2,11 @@ use std::sync::Arc;
use opaque_ke::rand::rngs::OsRng;
use tokio::sync::Mutex;
use nkode_protocol::opaque::client::{AuthenticationData, OpaqueAuthentication, ClientAuthError};
use nkode_protocol::opaque::in_memory_auth_repo::InMemoryAuthRepo;
use nkode_protocol::opaque::in_memory_auth_session::InMemoryAuthSession;
use nkode_protocol::opaque::in_memory_transport::{InMemoryKeyServer, InMemoryCodeServer, SharedServer};
use nkode_protocol::opaque::models::NKodeServerSetup;
use nkode_protocol::models::opaque::NKodeServerSetup;
use nkode_protocol::opaque::server::{Code, Key, OpaqueAuth};
use nkode_protocol::repository::opaque::in_memory::in_memory_auth_repo::InMemoryAuthRepo;
use nkode_protocol::repository::opaque::in_memory::in_memory_auth_session::InMemoryAuthSession;
use nkode_protocol::repository::opaque::in_memory::in_memory_transport::{InMemoryCodeServer, InMemoryKeyServer, InMemSharedServer};
#[tokio::test]
async fn opaque_key_registration_and_login_roundtrip() {
@@ -32,8 +32,8 @@ async fn opaque_code_registration_and_login_roundtrip() {
InMemoryAuthRepo::new(),
InMemoryAuthSession::new(),
)));
let mut key_server = SharedServer::<Key>::new(shared.clone());
let mut code_server = SharedServer::<Code>::new(shared.clone());
let mut key_server = InMemSharedServer::<Key>::new(shared.clone());
let mut code_server = InMemSharedServer::<Code>::new(shared.clone());
let email = "c@d.com";
let key_auth = AuthenticationData::from_secret_key(email, b"supersecret16bytes");
OpaqueAuthentication::register(&key_auth, &mut key_server)