1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Start a modular password manager

This commit is contained in:
Quentin Gliech
2022-12-09 16:22:20 +01:00
parent ba486a4773
commit a6c3951d8c
13 changed files with 627 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ mod compat;
mod graphql;
mod health;
mod oauth2;
pub mod passwords;
mod upstream_oauth2;
mod views;
@@ -350,6 +351,8 @@ where
async fn test_state(pool: PgPool) -> Result<AppState, anyhow::Error> {
use mas_email::MailTransport;
use crate::passwords::{Hasher, PasswordManager};
let workspace_root = camino::Utf8Path::new(env!("CARGO_MANIFEST_DIR"))
.join("..")
.join("..");
@@ -363,6 +366,8 @@ async fn test_state(pool: PgPool) -> Result<AppState, anyhow::Error> {
let encrypter = Encrypter::new(&[0x42; 32]);
let password_manager = PasswordManager::new([(1, Hasher::argon2id(None))])?;
let transport = MailTransport::blackhole();
let mailbox = "server@example.com".parse()?;
let mailer = Mailer::new(&templates, &transport, &mailbox, &mailbox);
@@ -397,6 +402,7 @@ async fn test_state(pool: PgPool) -> Result<AppState, anyhow::Error> {
policy_factory,
graphql_schema,
http_client_factory,
password_manager,
})
}