1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Move secrets and oauth2 clients config

This commit is contained in:
Quentin Gliech
2022-02-01 09:34:18 +01:00
parent c0e5b66ea4
commit 7e24cd0948
30 changed files with 462 additions and 454 deletions

View File

@ -251,13 +251,15 @@ impl ServerCommand {
// Initialize the key store
let key_store = config
.oauth2
.secrets
.key_store()
.await
.context("could not import keys from config")?;
// Wrap the key store in an Arc
let key_store = Arc::new(key_store);
let encrypter = config.secrets.encrypter();
// Load and compile the templates
let templates = Templates::load_from_config(&config.templates)
.await
@ -283,7 +285,10 @@ impl ServerCommand {
}
// Start the server
let root = mas_handlers::root(&pool, &templates, &key_store, &mailer, &config);
let root = mas_handlers::root(&pool, &templates, &key_store, &encrypter, &mailer, &config);
// Explicitely the config to properly zeroize secret keys
drop(config);
let warp_service = warp::service(root);