1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Move some common dependencies on the workspace level

Also deprecates the AWS SESv2 transport for emails
This commit is contained in:
Quentin Gliech
2023-08-14 12:08:32 +02:00
parent 21964cbeab
commit 7c83dce66e
36 changed files with 171 additions and 711 deletions

View File

@ -6,8 +6,7 @@ edition = "2021"
license = "Apache-2.0"
[dependencies]
apalis-core = "0.4.4"
anyhow = "1.0.72"
anyhow.workspace = true
axum = "0.6.20"
camino = "1.1.6"
clap = { version = "4.3.21", features = ["derive"] }
@ -16,19 +15,19 @@ httpdate = "1.0.2"
hyper = { version = "0.14.27", features = ["full"] }
itertools = "0.11.0"
listenfd = "1.0.1"
rand = "0.8.5"
rand.workspace = true
rand_chacha = "0.3.1"
rustls = "0.21.6"
serde_json = "1.0.104"
serde_json.workspace = true
serde_yaml = "0.9.25"
sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] }
tokio = { version = "1.30.0", features = ["full"] }
tower = { version = "0.4.13", features = ["full"] }
tower = "0.4.13"
tower-http = { version = "0.4.3", features = ["fs"] }
url = "2.4.0"
url.workspace = true
zeroize = "1.6.0"
tracing = "0.1.37"
tracing.workspace = true
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
tracing-opentelemetry = "0.20.0"
@ -64,9 +63,6 @@ mas-templates = { path = "../templates" }
mas-tower = { path = "../tower" }
oauth2-types = { path = "../oauth2-types" }
[dev-dependencies]
indoc = "2.0.3"
[features]
default = ["webpki-roots", "policy-cache"]

View File

@ -89,7 +89,7 @@ impl Options {
let templates = templates_from_config(&config.templates, &url_builder).await?;
if !self.no_worker {
let mailer = mailer_from_config(&config.email, &templates).await?;
let mailer = mailer_from_config(&config.email, &templates)?;
mailer.test_connection().await?;
#[allow(clippy::disallowed_methods)]

View File

@ -46,7 +46,7 @@ impl Options {
// Load and compile the templates
let templates = templates_from_config(&config.templates, &url_builder).await?;
let mailer = mailer_from_config(&config.email, &templates).await?;
let mailer = mailer_from_config(&config.email, &templates)?;
mailer.test_connection().await?;
let http_client_factory = HttpClientFactory::new(50);

View File

@ -55,7 +55,7 @@ pub async fn password_manager_from_config(
PasswordManager::new(schemes)
}
pub async fn mailer_from_config(
pub fn mailer_from_config(
config: &EmailConfig,
templates: &Templates,
) -> Result<Mailer, anyhow::Error> {
@ -83,7 +83,8 @@ pub async fn mailer_from_config(
.context("failed to build SMTP transport")?
}
EmailTransportConfig::Sendmail { command } => MailTransport::sendmail(command),
EmailTransportConfig::AwsSes => MailTransport::aws_ses().await?,
#[allow(deprecated)]
EmailTransportConfig::AwsSes => anyhow::bail!("AWS SESv2 backend has been removed"),
};
Ok(Mailer::new(templates.clone(), transport, from, reply_to))