You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Split the core crate
This commit is contained in:
@ -20,6 +20,7 @@ warp = "0.3.2"
|
||||
url = "2.2.2"
|
||||
argon2 = { version = "0.3.2", features = ["password-hash"] }
|
||||
reqwest = { version = "0.11.7", features = ["rustls-tls"], default-features = false, optional = true }
|
||||
watchman_client = "0.7.1"
|
||||
|
||||
tracing = "0.1.29"
|
||||
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
|
||||
@ -32,17 +33,18 @@ opentelemetry-otlp = { version = "0.9.0", features = ["trace", "metrics"], optio
|
||||
opentelemetry-zipkin = { version = "0.14.0", features = ["reqwest-client", "reqwest-rustls"], default-features = false, optional = true }
|
||||
|
||||
mas-config = { path = "../config" }
|
||||
mas-core = { path = "../core" }
|
||||
mas-handlers = { path = "../handlers" }
|
||||
mas-templates = { path = "../templates" }
|
||||
mas-storage = { path = "../storage" }
|
||||
watchman_client = "0.7.1"
|
||||
mas-tasks = { path = "../tasks" }
|
||||
mas-warp-utils = { path = "../warp-utils" }
|
||||
|
||||
[dev-dependencies]
|
||||
indoc = "1.0.3"
|
||||
|
||||
[features]
|
||||
default = ["otlp", "jaeger", "zipkin"]
|
||||
dev = ["mas-templates/dev", "mas-core/dev"]
|
||||
dev = ["mas-templates/dev", "mas-handlers/dev"]
|
||||
# Enable OpenTelemetry OTLP exporter. Requires "protoc"
|
||||
otlp = ["opentelemetry-otlp"]
|
||||
# Enable OpenTelemetry Jaeger exporter and propagator.
|
||||
|
@ -22,8 +22,8 @@ use clap::Parser;
|
||||
use futures::{future::TryFutureExt, stream::TryStreamExt};
|
||||
use hyper::{header, Server, Version};
|
||||
use mas_config::RootConfig;
|
||||
use mas_core::tasks::{self, TaskQueue};
|
||||
use mas_storage::MIGRATOR;
|
||||
use mas_tasks::TaskQueue;
|
||||
use mas_templates::Templates;
|
||||
use opentelemetry_http::HeaderExtractor;
|
||||
use tower::{make::Shared, ServiceBuilder};
|
||||
@ -233,7 +233,7 @@ impl ServerCommand {
|
||||
|
||||
info!("Starting task scheduler");
|
||||
let queue = TaskQueue::default();
|
||||
queue.recuring(Duration::from_secs(15), tasks::cleanup_expired(&pool));
|
||||
queue.recuring(Duration::from_secs(15), mas_tasks::cleanup_expired(&pool));
|
||||
queue.start();
|
||||
|
||||
// Load and compile the templates
|
||||
@ -254,7 +254,7 @@ impl ServerCommand {
|
||||
}
|
||||
|
||||
// Start the server
|
||||
let root = mas_core::handlers::root(&pool, &templates, &config);
|
||||
let root = mas_handlers::root(&pool, &templates, &config);
|
||||
|
||||
let warp_service = warp::service(root);
|
||||
|
||||
|
@ -40,7 +40,7 @@ pub fn setup(config: &TelemetryConfig) -> anyhow::Result<Option<Tracer>> {
|
||||
|
||||
// The CORS filter needs to know what headers it should whitelist for
|
||||
// CORS-protected requests.
|
||||
mas_core::set_propagator(&propagator);
|
||||
mas_warp_utils::filters::cors::set_propagator(&propagator);
|
||||
global::set_text_map_propagator(propagator);
|
||||
|
||||
let tracer = tracer(&config.tracing.exporter)?;
|
||||
|
Reference in New Issue
Block a user