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

New JWT/JOSE crate

Still WIP, needs to handle time related claims
This commit is contained in:
Quentin Gliech
2022-01-04 22:28:00 +01:00
parent 694a0bff03
commit f933ace007
20 changed files with 1942 additions and 726 deletions

View File

@ -14,6 +14,7 @@
use std::{
net::{SocketAddr, TcpListener},
sync::Arc,
time::Duration,
};
@ -236,6 +237,14 @@ impl ServerCommand {
queue.recuring(Duration::from_secs(15), mas_tasks::cleanup_expired(&pool));
queue.start();
// Initialize the key store
let key_store = config
.oauth2
.key_store()
.context("could not import keys from config")?;
// Wrap the key store in an Arc
let key_store = Arc::new(key_store);
// Load and compile the templates
let templates = Templates::load_from_config(&config.templates)
.await
@ -254,7 +263,7 @@ impl ServerCommand {
}
// Start the server
let root = mas_handlers::root(&pool, &templates, &config);
let root = mas_handlers::root(&pool, &templates, &key_store, &config);
let warp_service = warp::service(root);