diff --git a/Cargo.lock b/Cargo.lock index 9809ba67..2947eaf3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -510,289 +510,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "aws-config" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcdcf0d683fe9c23d32cf5b53c9918ea0a500375a9fb20109802552658e576c9" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-sdk-sts", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand 1.9.0", - "http", - "hyper", - "time", - "tokio", - "tower", - "tracing", -] - -[[package]] -name = "aws-credential-types" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcdb2f7acbc076ff5ad05e7864bdb191ca70a6fd07668dc3a1a8bcd051de5ae" -dependencies = [ - "aws-smithy-async", - "aws-smithy-types", - "fastrand 1.9.0", - "tokio", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-endpoint" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cce1c41a6cfaa726adee9ebb9a56fcd2bbfd8be49fd8a04c5e20fd968330b04" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "http", - "regex", - "tracing", -] - -[[package]] -name = "aws-http" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadbc44e7a8f3e71c8b374e03ecd972869eb91dd2bc89ed018954a52ba84bc44" -dependencies = [ - "aws-credential-types", - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "http-body", - "lazy_static", - "percent-encoding", - "pin-project-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-sesv2" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4891169a246b580136f4d3682c11a68b710bdc1027dd7774023fa651a87f10b6" -dependencies = [ - "aws-credential-types", - "aws-endpoint", - "aws-http", - "aws-sig-auth", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "regex", - "tokio-stream", - "tower", - "tracing", -] - -[[package]] -name = "aws-sdk-sts" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265fac131fbfc188e5c3d96652ea90ecc676a934e3174eaaee523c6cec040b3b" -dependencies = [ - "aws-credential-types", - "aws-endpoint", - "aws-http", - "aws-sig-auth", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-query", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "bytes", - "http", - "regex", - "tower", - "tracing", -] - -[[package]] -name = "aws-sig-auth" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b94acb10af0c879ecd5c7bdf51cda6679a0a4f4643ce630905a77673bfa3c61" -dependencies = [ - "aws-credential-types", - "aws-sigv4", - "aws-smithy-http", - "aws-types", - "http", - "tracing", -] - -[[package]] -name = "aws-sigv4" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2ce6f507be68e968a33485ced670111d1cbad161ddbbab1e313c03d37d8f4c" -dependencies = [ - "aws-smithy-http", - "form_urlencoded", - "hex", - "hmac", - "http", - "once_cell", - "percent-encoding", - "regex", - "sha2", - "time", - "tracing", -] - -[[package]] -name = "aws-smithy-async" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bda3996044c202d75b91afeb11a9afae9db9a721c6a7a427410018e286b880" -dependencies = [ - "futures-util", - "pin-project-lite", - "tokio", - "tokio-stream", -] - -[[package]] -name = "aws-smithy-client" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a86aa6e21e86c4252ad6a0e3e74da9617295d8d6e374d552be7d3059c41cedd" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-types", - "bytes", - "fastrand 1.9.0", - "http", - "http-body", - "hyper", - "pin-project-lite", - "tokio", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-http" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b3b693869133551f135e1f2c77cb0b8277d9e3e17feaf2213f735857c4f0d28" -dependencies = [ - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "http", - "http-body", - "hyper", - "once_cell", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tracing", -] - -[[package]] -name = "aws-smithy-http-tower" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae4f6c5798a247fac98a867698197d9ac22643596dc3777f0c76b91917616b9" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "http", - "http-body", - "pin-project-lite", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-json" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f9f42fbfa96d095194a632fbac19f60077748eba536eb0b9fecc28659807f8" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-query" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98819eb0b04020a1c791903533b638534ae6c12e2aceda3e6e6fba015608d51d" -dependencies = [ - "aws-smithy-types", - "urlencoding", -] - -[[package]] -name = "aws-smithy-types" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a3d0bf4f324f4ef9793b86a1701d9700fbcdbd12a846da45eed104c634c6e8" -dependencies = [ - "base64-simd", - "itoa", - "num-integer", - "ryu", - "time", -] - -[[package]] -name = "aws-smithy-xml" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b9d12875731bd07e767be7baad95700c3137b56730ec9ddeedb52a5e5ca63b" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "aws-types" -version = "0.55.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd209616cc8d7bfb82f87811a5c655dc97537f592689b18743bddf5dc5c4829" -dependencies = [ - "aws-credential-types", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-types", - "http", - "rustc_version", - "tracing", -] - [[package]] name = "axum" version = "0.6.20" @@ -910,16 +627,6 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "base64ct" version = "1.6.0" @@ -1046,16 +753,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bytes-utils" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" -dependencies = [ - "bytes", - "either", -] - [[package]] name = "camino" version = "1.1.6" @@ -2930,14 +2627,12 @@ name = "mas-cli" version = "0.1.0" dependencies = [ "anyhow", - "apalis-core", "axum", "camino", "clap", "dotenvy", "httpdate", "hyper", - "indoc", "itertools 0.11.0", "listenfd", "mas-config", @@ -3037,18 +2732,9 @@ name = "mas-email" version = "0.1.0" dependencies = [ "async-trait", - "aws-config", - "aws-sdk-sesv2", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-types", "headers", "lettre", - "mas-http", "mas-templates", - "mas-tower", "thiserror", "tracing", ] @@ -3091,7 +2777,6 @@ dependencies = [ "futures-util", "headers", "hyper", - "indoc", "insta", "lettre", "mas-axum-utils", @@ -3139,8 +2824,6 @@ name = "mas-http" version = "0.1.0" dependencies = [ "anyhow", - "aws-smithy-http", - "aws-types", "axum", "bytes", "futures-util", @@ -3490,7 +3173,6 @@ dependencies = [ name = "mas-tower" version = "0.1.0" dependencies = [ - "aws-smithy-http", "http", "opentelemetry", "opentelemetry-http", @@ -3711,7 +3393,6 @@ dependencies = [ "chrono", "data-encoding", "http", - "indoc", "language-tags", "mas-iana", "mas-jose", @@ -3993,12 +3674,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "outref" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" - [[package]] name = "overload" version = "0.1.1" @@ -6391,12 +6066,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - [[package]] name = "waker-fn" version = "1.1.0" @@ -7026,12 +6695,6 @@ dependencies = [ "url", ] -[[package]] -name = "xmlparser" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index 5bb2421f..3c242671 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,43 +4,59 @@ members = ["crates/*"] [workspace.dependencies] +# High-level error handling +[workspace.dependencies.anyhow] +version = "1.0.72" + +# Time utilities [workspace.dependencies.chrono] version = "0.4.26" default-features = false features = ["serde", "clock"] -[profile.dev.package.num-bigint-dig] -opt-level = 3 +# HTTP request/response +[workspace.dependencies.http] +version = "0.2.9" -[profile.dev.package.sqlx-macros] -opt-level = 3 +# Random values +[workspace.dependencies.rand] +version = "0.8.5" -[profile.dev.package.cranelift-codegen] -opt-level = 3 +# Serialization and deserialization +[workspace.dependencies.serde] +version = "1.0.183" +features = ["derive"] # Most of the time, if we need serde, we need derive -[profile.dev.package.regalloc2] -opt-level = 3 +# JSON serialization and deserialization +[workspace.dependencies.serde_json] +version = "1.0.104" -[profile.dev.package.argon2] -opt-level = 3 +# Custom error types +[workspace.dependencies.thiserror] +version = "1.0.44" -[profile.dev.package.pbkdf2] -opt-level = 3 +# Logging and tracing +[workspace.dependencies.tracing] +version = "0.1.37" -[profile.dev.package.bcrypt] -opt-level = 3 +# URL manipulation +[workspace.dependencies.url] +version = "2.4.0" +features = ["serde"] -[profile.dev.package.sha2] -opt-level = 3 - -[profile.dev.package.digest] -opt-level = 3 - -[profile.dev.package.block-buffer] -opt-level = 3 - -[profile.dev.package.generic-array] -opt-level = 3 +# A few profile opt-level tweaks to make the test suite run faster +[profile.dev.package] +num-bigint-dig.opt-level = 3 +sqlx-macros.opt-level = 3 +cranelift-codegen.opt-level = 3 +regalloc2.opt-level = 3 +argon2.opt-level = 3 +pbkdf2.opt-level = 3 +bcrypt.opt-level = 3 +sha2.opt-level = 3 +digest.opt-level = 3 +block-buffer.opt-level = 3 +generic-array.opt-level = 3 # Until https://github.com/dylanhart/ulid-rs/pull/56 gets released diff --git a/crates/axum-utils/Cargo.toml b/crates/axum-utils/Cargo.toml index d490b34d..034bf0b1 100644 --- a/crates/axum-utils/Cargo.toml +++ b/crates/axum-utils/Cargo.toml @@ -13,20 +13,20 @@ chrono.workspace = true data-encoding = "2.4.0" futures-util = "0.3.28" headers = "0.3.8" -http = "0.2.9" +http.workspace = true http-body = "0.4.5" mime = "0.3.17" -rand = "0.8.5" +rand.workspace = true sentry = { version = "0.31.5", default-features = false } -serde = "1.0.183" +serde.workspace = true serde_with = "3.2.0" serde_urlencoded = "0.7.1" -serde_json = "1.0.104" -thiserror = "1.0.44" +serde_json.workspace = true +thiserror.workspace = true tokio = "1.30.0" tower = { version = "0.4.13", features = ["util"] } -tracing = "0.1.37" -url = "2.4.0" +tracing.workspace = true +url.workspace = true ulid = { version = "1.0.0", features = ["serde"] } mas-data-model = { path = "../data-model" } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index b28f69e7..ab082cfb 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -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"] diff --git a/crates/cli/src/commands/server.rs b/crates/cli/src/commands/server.rs index 4b091a3d..de91fa7e 100644 --- a/crates/cli/src/commands/server.rs +++ b/crates/cli/src/commands/server.rs @@ -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)] diff --git a/crates/cli/src/commands/worker.rs b/crates/cli/src/commands/worker.rs index 1c11256f..dbdd4af4 100644 --- a/crates/cli/src/commands/worker.rs +++ b/crates/cli/src/commands/worker.rs @@ -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); diff --git a/crates/cli/src/util.rs b/crates/cli/src/util.rs index 8fb6bd7e..20a1a84b 100644 --- a/crates/cli/src/util.rs +++ b/crates/cli/src/util.rs @@ -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 { @@ -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)) diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index 462351e2..dc1ea443 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -7,26 +7,26 @@ license = "Apache-2.0" [dependencies] tokio = { version = "1.30.0", features = ["fs", "rt"] } -tracing = "0.1.37" +tracing.workspace = true async-trait = "0.1.72" -thiserror = "1.0.44" -anyhow = "1.0.72" +thiserror.workspace = true +anyhow.workspace = true camino = { version = "1.1.6", features = ["serde1"] } chrono.workspace = true figment = { version = "0.10.10", features = ["env", "yaml", "test"] } schemars = { version = "0.8.12", features = ["url", "chrono"] } ulid = { version = "1.0.0", features = ["serde"] } -url = { version = "2.4.0", features = ["serde"] } +url.workspace = true -serde = { version = "1.0.183", features = ["derive"] } +serde.workspace = true serde_with = { version = "3.2.0", features = ["hex", "chrono"] } -serde_json = "1.0.104" +serde_json.workspace = true pem-rfc7468 = "0.7.0" rustls-pemfile = "1.0.3" -rand = "0.8.5" +rand.workspace = true rand_chacha = "0.3.1" indoc = "2.0.3" diff --git a/crates/config/src/sections/email.rs b/crates/config/src/sections/email.rs index efeacd7d..3bf85106 100644 --- a/crates/config/src/sections/email.rs +++ b/crates/config/src/sections/email.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![allow(deprecated)] + use std::num::NonZeroU16; use async_trait::async_trait; @@ -78,6 +80,7 @@ pub enum EmailTransportConfig { }, /// Send emails via the AWS SESv2 API + #[deprecated(note = "The AWS SESv2 backend has be removed.")] AwsSes, } diff --git a/crates/data-model/Cargo.toml b/crates/data-model/Cargo.toml index d03e994b..04a2c1c2 100644 --- a/crates/data-model/Cargo.toml +++ b/crates/data-model/Cargo.toml @@ -7,12 +7,12 @@ license = "Apache-2.0" [dependencies] chrono.workspace = true -thiserror = "1.0.44" -serde = "1.0.183" -url = { version = "2.4.0", features = ["serde"] } +thiserror.workspace = true +serde.workspace = true +url.workspace = true crc = "3.0.1" ulid = { version = "1.0.0", features = ["serde"] } -rand = "0.8.5" +rand.workspace = true rand_chacha = "0.3.1" mas-iana = { path = "../iana" } diff --git a/crates/email/Cargo.toml b/crates/email/Cargo.toml index 3fbe7c5c..33ab46e2 100644 --- a/crates/email/Cargo.toml +++ b/crates/email/Cargo.toml @@ -7,27 +7,13 @@ license = "Apache-2.0" [dependencies] async-trait = "0.1.72" -tracing = "0.1.37" -thiserror = "1.0.44" +tracing.workspace = true +thiserror.workspace = true headers = "0.3.8" -aws-sdk-sesv2 = { version = "0.28.0", default-features = false } -aws-config = { version = "0.55.3", default-features = false } -aws-smithy-client = { version = "0.55.3", default-features = false, features = ["client-hyper"] } -aws-smithy-async = { version = "0.55.3", default-features = false, features = ["rt-tokio"] } -aws-smithy-http = { version = "0.55.3", default-features = false } -aws-smithy-http-tower = { version = "0.55.3", default-features = false } -aws-types = "0.55.3" - mas-templates = { path = "../templates" } -mas-http = { path = "../http", features = ["aws-sdk", "client"] } -mas-tower = { path = "../tower", features = ["aws-sdk"] } [dependencies.lettre] version = "0.10.4" default-features = false -features = ["tokio1-rustls-tls", "hostname", "builder", "tracing", "pool", "smtp-transport", "sendmail-transport"] - -[features] -native-roots = ["mas-http/native-roots"] -webpki-roots = ["mas-http/webpki-roots"] +features = ["tokio1-rustls-tls", "hostname", "builder", "tracing", "pool", "smtp-transport", "sendmail-transport"] \ No newline at end of file diff --git a/crates/email/src/lib.rs b/crates/email/src/lib.rs index 4d87a6ae..f9140696 100644 --- a/crates/email/src/lib.rs +++ b/crates/email/src/lib.rs @@ -33,5 +33,5 @@ pub use mas_templates::EmailVerificationContext; pub use self::{ mailer::Mailer, - transport::{aws_ses::Transport as AwsSesTransport, SmtpMode, Transport as MailTransport}, + transport::{SmtpMode, Transport as MailTransport}, }; diff --git a/crates/email/src/transport/mod.rs b/crates/email/src/transport.rs similarity index 87% rename from crates/email/src/transport/mod.rs rename to crates/email/src/transport.rs index 3df5e6f1..435ef5d1 100644 --- a/crates/email/src/transport/mod.rs +++ b/crates/email/src/transport.rs @@ -25,11 +25,8 @@ use lettre::{ }, AsyncTransport, Tokio1Executor, }; -use mas_http::ClientInitError; use thiserror::Error; -pub mod aws_ses; - /// Encryption mode to use #[derive(Debug, Clone, Copy)] pub enum SmtpMode { @@ -51,7 +48,6 @@ enum TransportInner { Blackhole, Smtp(AsyncSmtpTransport), Sendmail(AsyncSendmailTransport), - AwsSes(aws_ses::Transport), } impl Transport { @@ -101,16 +97,6 @@ impl Transport { AsyncSendmailTransport::new_with_command(command), )) } - - /// Construct a AWS SES transport - /// - /// # Errors - /// - /// Returns an error if the HTTP client failed to initialize - pub async fn aws_ses() -> Result { - let transport = aws_ses::Transport::from_env().await?; - Ok(Self::new(TransportInner::AwsSes(transport))) - } } impl Transport { @@ -125,8 +111,7 @@ impl Transport { TransportInner::Smtp(t) => { t.test_connection().await?; } - TransportInner::Blackhole | TransportInner::Sendmail(_) | TransportInner::AwsSes(_) => { - } + TransportInner::Blackhole | TransportInner::Sendmail(_) => {} } Ok(()) @@ -144,7 +129,6 @@ impl Default for TransportInner { pub enum Error { Smtp(#[from] lettre::transport::smtp::Error), Sendmail(#[from] lettre::transport::sendmail::Error), - AwsSes(#[from] self::aws_ses::Error), } #[async_trait] @@ -165,9 +149,6 @@ impl AsyncTransport for Transport { TransportInner::Sendmail(t) => { t.send_raw(envelope, email).await?; } - TransportInner::AwsSes(t) => { - t.send_raw(envelope, email).await?; - } }; Ok(()) diff --git a/crates/email/src/transport/aws_ses.rs b/crates/email/src/transport/aws_ses.rs deleted file mode 100644 index f87083ed..00000000 --- a/crates/email/src/transport/aws_ses.rs +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2022 The Matrix.org Foundation C.I.C. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use std::sync::Arc; - -use async_trait::async_trait; -use aws_config::provider_config::ProviderConfig; -use aws_sdk_sesv2::{ - middleware::DefaultMiddleware, - operation::send_email::{SendEmailError, SendEmailOutput}, - primitives::Blob, - types::{EmailContent, RawMessage}, - Client, -}; -use aws_smithy_async::rt::sleep::TokioSleep; -use aws_smithy_client::erase::{DynConnector, DynMiddleware}; -use headers::{ContentLength, HeaderMapExt, Host, UserAgent}; -use lettre::{address::Envelope, AsyncTransport}; -use mas_http::ClientInitError; -use mas_tower::{enrich_span_fn, make_span_fn, TraceContextLayer, TraceLayer}; -use tracing::{info_span, Span}; - -pub type Error = aws_smithy_client::SdkError; - -/// An asynchronous email transport that sends email via the AWS Simple Email -/// Service v2 API -pub struct Transport { - client: Client, -} - -impl Transport { - /// Construct a [`Transport`] from the environment - /// - /// # Errors - /// - /// Returns an error if the HTTP client failed to initialize - pub async fn from_env() -> Result { - let sleep = Arc::new(TokioSleep::new()); - - // Create the TCP connector from mas-http. This way we share the root - // certificate loader with it - let http_connector = mas_http::make_traced_connector() - .await - .expect("failed to create HTTPS connector"); - - let http_connector = aws_smithy_client::hyper_ext::Adapter::builder() - .sleep_impl(sleep.clone()) - .build(http_connector); - - let http_connector = DynConnector::new(http_connector); - - // Middleware to add tracing to AWS SDK operations - let middleware = DynMiddleware::new(( - DefaultMiddleware::default(), - // TODO: factor this out somewhere else - TraceLayer::new(make_span_fn(|op: &aws_smithy_http::operation::Request| { - let properties = op.properties(); - let request = op.http(); - let span = info_span!( - "aws.sdk.operation", - "otel.kind" = "client", - "otel.name" = tracing::field::Empty, - "otel.status_code" = tracing::field::Empty, - "rpc.system" = "aws-api", - "rpc.service" = tracing::field::Empty, - "rpc.method" = tracing::field::Empty, - "http.method" = %request.method(), - "http.url" = %request.uri(), - "http.host" = tracing::field::Empty, - "http.request_content_length" = tracing::field::Empty, - "http.response_content_length" = tracing::field::Empty, - "http.status_code" = tracing::field::Empty, - "user_agent.original" = tracing::field::Empty, - ); - - if let Some(metadata) = properties.get::() { - span.record("rpc.service", metadata.service()); - span.record("rpc.method", metadata.name()); - let name = format!("{}::{}", metadata.service(), metadata.name()); - span.record("otel.name", name); - } else if let Some(service) = properties.get::() { - span.record("rpc.service", tracing::field::debug(service)); - span.record("otel.name", tracing::field::debug(service)); - } - - let headers = request.headers(); - - if let Some(host) = headers.typed_get::() { - span.record("http.host", tracing::field::display(host)); - } - - if let Some(user_agent) = headers.typed_get::() { - span.record("user_agent.original", tracing::field::display(user_agent)); - } - - if let Some(ContentLength(content_length)) = headers.typed_get() { - span.record("http.request_content_length", content_length); - } - - span - })) - .on_response(enrich_span_fn( - |span: &Span, res: &aws_smithy_http::operation::Response| { - span.record("otel.status_code", "OK"); - let response = res.http(); - - let status = response.status(); - span.record("http.status_code", status.as_u16()); - - let headers = response.headers(); - if let Some(ContentLength(content_length)) = headers.typed_get() { - span.record("http.response_content_length", content_length); - } - }, - )) - .on_error(enrich_span_fn( - |span: &Span, err: &aws_smithy_http_tower::SendOperationError| { - span.record("otel.status_code", "ERROR"); - span.record("exception.message", tracing::field::debug(err)); - }, - )), - TraceContextLayer::new(), - )); - - // Use that connector for discovering the config - let config = ProviderConfig::default().with_http_connector(http_connector.clone()); - let config = aws_config::from_env().configure(config).load().await; - let config = aws_sdk_sesv2::Config::from(&config); - - // As well as for the client itself - let client = aws_smithy_client::Client::builder() - .sleep_impl(sleep) - .connector(http_connector) - .middleware(middleware) - .build_dyn(); - - let client = Client::with_config(client, config); - Ok(Self { client }) - } -} - -#[async_trait] -impl AsyncTransport for Transport { - type Ok = SendEmailOutput; - type Error = Error; - - async fn send_raw(&self, _envelope: &Envelope, email: &[u8]) -> Result { - let email = Blob::new(email); - let email = RawMessage::builder().data(email).build(); - let email = EmailContent::builder().raw(email).build(); - - let request = self.client.send_email().content(email); - let response = request.send().await?; - - Ok(response) - } -} diff --git a/crates/graphql/Cargo.toml b/crates/graphql/Cargo.toml index fae571d1..ae80c20a 100644 --- a/crates/graphql/Cargo.toml +++ b/crates/graphql/Cargo.toml @@ -6,18 +6,18 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.72" +anyhow.workspace = true async-graphql = { version = "6.0.1", features = ["chrono", "url"] } async-trait = "0.1.72" chrono.workspace = true lettre = { version = "0.10.4", default-features = false } -serde = { version = "1.0.183", features = ["derive"] } -thiserror = "1.0.44" +serde.workspace = true +thiserror.workspace = true tokio = { version = "1.30.0", features = ["sync"] } -tracing = "0.1.37" +tracing.workspace = true tower = { version = "0.4.13", features = ["util"] } ulid = "1.0.0" -url = "2.4.0" +url.workspace = true oauth2-types = { path = "../oauth2-types" } mas-data-model = { path = "../data-model" } diff --git a/crates/handlers/Cargo.toml b/crates/handlers/Cargo.toml index 0cb07b74..e007fbe6 100644 --- a/crates/handlers/Cargo.toml +++ b/crates/handlers/Cargo.toml @@ -11,13 +11,13 @@ tokio = { version = "1.30.0", features = ["macros"] } futures-util = "0.3.28" # Logging and tracing -tracing = "0.1.37" +tracing.workspace = true opentelemetry = "0.20.0" opentelemetry-semantic-conventions = "0.12.0" # Error management -thiserror = "1.0.44" -anyhow = "1.0.72" +thiserror.workspace = true +anyhow.workspace = true sentry = { version = "0.31.5", default-features = false } # Web server @@ -37,9 +37,9 @@ lettre = { version = "0.10.4", default-features = false, features = ["builder"] sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] } # Various structure (de)serialization -serde = { version = "1.0.183", features = ["derive"] } +serde.workspace = true serde_with = { version = "3.2.0", features = ["hex", "chrono"] } -serde_json = "1.0.104" +serde_json.workspace = true serde_urlencoded = "0.7.1" # Password hashing @@ -52,9 +52,9 @@ zeroize = "1.6.0" camino = "1.1.6" chrono.workspace = true time = "0.3.25" -url = { version = "2.4.0", features = ["serde"] } +url.workspace = true mime = "0.3.17" -rand = "0.8.5" +rand.workspace = true rand_chacha = "0.3.1" headers = "0.3.8" ulid = "1.0.0" @@ -77,7 +77,6 @@ mas-templates = { path = "../templates" } oauth2-types = { path = "../oauth2-types" } [dev-dependencies] -indoc = "2.0.3" insta = "1.31.0" tracing-subscriber = "0.3.17" diff --git a/crates/http/Cargo.toml b/crates/http/Cargo.toml index 3e465042..70a06c7f 100644 --- a/crates/http/Cargo.toml +++ b/crates/http/Cargo.toml @@ -6,13 +6,11 @@ edition = "2021" license = "Apache-2.0" [dependencies] -aws-smithy-http = { version = "0.55.3", optional = true } -aws-types = { version = "0.55.3", optional = true } axum = { version = "0.6.20", optional = true } bytes = "1.4.0" futures-util = "0.3.28" headers = "0.3.8" -http = "0.2.9" +http.workspace = true http-body = "0.4.5" hyper = "0.14.27" hyper-rustls = { version = "0.24.1", features = ["http1", "http2"], default-features = false, optional = true } @@ -20,14 +18,14 @@ once_cell = "1.18.0" opentelemetry = "0.20.0" rustls = { version = "0.21.6", optional = true } rustls-native-certs = { version = "0.6.3", optional = true } -serde = "1.0.183" -serde_json = "1.0.104" +serde.workspace = true +serde_json.workspace = true serde_urlencoded = "0.7.1" -thiserror = "1.0.44" +thiserror.workspace = true tokio = { version = "1.30.0", features = ["sync", "parking_lot"], optional = true } tower = { version = "0.4.13", features = [] } tower-http = { version = "0.4.3", features = ["cors"] } -tracing = "0.1.37" +tracing.workspace = true tracing-opentelemetry = "0.20.0" webpki = { version = "0.22.0", optional = true } webpki-roots = { version = "0.25.2", optional = true } @@ -35,14 +33,12 @@ webpki-roots = { version = "0.25.2", optional = true } mas-tower = { path = "../tower" } [dev-dependencies] -anyhow = "1.0.72" -serde = { version = "1.0.183", features = ["derive"] } +anyhow.workspace = true tokio = { version = "1.30.0", features = ["macros", "rt"] } tower = { version = "0.4.13", features = ["util"] } [features] axum = ["dep:axum"] -aws-sdk = ["dep:aws-smithy-http", "dep:aws-types"] native-roots = ["dep:rustls-native-certs"] webpki-roots = ["dep:webpki-roots"] client = [ diff --git a/crates/iana-codegen/Cargo.toml b/crates/iana-codegen/Cargo.toml index 7f886ddf..9eabf6cb 100644 --- a/crates/iana-codegen/Cargo.toml +++ b/crates/iana-codegen/Cargo.toml @@ -6,14 +6,14 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.72" +anyhow.workspace = true async-trait = "0.1.72" camino = "1.1.6" convert_case = "0.6.0" csv = "1.2.2" futures-util = "0.3.28" hyper = { version = "0.14.27", features = ["tcp", "client", "http1"] } -serde = { version = "1.0.183", features = ["derive"] } +serde.workspace = true tokio = { version = "1.30.0", features = ["macros", "rt-multi-thread", "fs", "io-util"] } -tracing = "0.1.37" +tracing.workspace = true tracing-subscriber = "0.3.17" diff --git a/crates/iana/Cargo.toml b/crates/iana/Cargo.toml index 9e12c350..da3b6a83 100644 --- a/crates/iana/Cargo.toml +++ b/crates/iana/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.183", optional = true } +serde = { workspace = true, optional = true } schemars = { version = "0.8.12", default-features = false, optional = true } [features] diff --git a/crates/jose/Cargo.toml b/crates/jose/Cargo.toml index 767f0ff1..247ac2a2 100644 --- a/crates/jose/Cargo.toml +++ b/crates/jose/Cargo.toml @@ -16,18 +16,18 @@ hmac = "0.12.1" k256 = { version = "0.13.1", features = ["ecdsa"] } p256 = { version = "0.13.2", features = ["ecdsa"] } p384 = { version = "0.13.0", features = ["ecdsa"] } -rand = "0.8.5" +rand.workspace = true rsa = "0.9.2" schemars = "0.8.12" sec1 = "0.7.3" -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" +serde.workspace = true +serde_json.workspace = true serde_with = { version = "3.2.0", features = ["base64"] } sha2 = { version = "0.10.7", features = ["oid"] } signature = "2.1.0" -thiserror = "1.0.44" -tracing = "0.1.37" -url = { version = "2.4.0", features = ["serde"] } +thiserror.workspace = true +tracing.workspace = true +url.workspace = true mas-iana = { path = "../iana" } diff --git a/crates/keystore/Cargo.toml b/crates/keystore/Cargo.toml index b072868a..d9834a40 100644 --- a/crates/keystore/Cargo.toml +++ b/crates/keystore/Cargo.toml @@ -18,11 +18,11 @@ p384 = { version = "0.13.0", features = ["std"] } pem-rfc7468 = { version = "0.7.0", features = ["std"] } pkcs1 = { version = "0.7.5", features = ["std"] } pkcs8 = { version = "0.10.2", features = ["std", "pkcs5", "encryption"] } -rand = "0.8.5" +rand.workspace = true rsa = { version = "0.9.2", features = ["std", "pem"] } sec1 = { version = "0.7.3", features = ["std"] } spki = { version = "0.7.2", features = ["std"] } -thiserror = "1.0.44" +thiserror.workspace = true generic-array = "0.14.7" chacha20poly1305 = { version = "0.10.1", features = ["std"] } base64ct = "1.6.0" diff --git a/crates/listener/Cargo.toml b/crates/listener/Cargo.toml index bcc0abd1..10a07cea 100644 --- a/crates/listener/Cargo.toml +++ b/crates/listener/Cargo.toml @@ -11,16 +11,16 @@ futures-util = "0.3.28" http-body = "0.4.5" hyper = { version = "0.14.27", features = ["server", "http1", "http2", "tcp"] } pin-project-lite = "0.2.12" -thiserror = "1.0.44" +thiserror.workspace = true tokio = { version = "1.30.0", features = ["net", "rt", "macros", "signal", "time"] } tokio-rustls = "0.24.1" tower-http = { version = "0.4.3", features = ["add-extension"] } tower-service = "0.3.2" -tracing = "0.1.37" +tracing.workspace = true libc = "0.2.147" [dev-dependencies] -anyhow = "1.0.72" +anyhow.workspace = true rustls-pemfile = "1.0.3" tokio = { version = "1.30.0", features = ["net", "rt", "macros", "signal", "time", "rt-multi-thread"] } tokio-test = "0.4.2" diff --git a/crates/matrix-synapse/Cargo.toml b/crates/matrix-synapse/Cargo.toml index 08cc5957..dcd6aa65 100644 --- a/crates/matrix-synapse/Cargo.toml +++ b/crates/matrix-synapse/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.72" +anyhow.workspace = true async-trait = "0.1.72" -http = "0.2.9" -serde = { version = "1.0.183", features = ["derive"] } +http.workspace = true +serde.workspace = true tower = { version = "0.4.13", features = ["util"] } -tracing = "0.1.37" -url = "2.4.0" +tracing.workspace = true +url.workspace = true mas-axum-utils = { path = "../axum-utils" } mas-http = { path = "../http" } diff --git a/crates/matrix/Cargo.toml b/crates/matrix/Cargo.toml index 4b5c0717..7ceea5c9 100644 --- a/crates/matrix/Cargo.toml +++ b/crates/matrix/Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.71" -serde = { version = "1.0.183", features = ["derive"] } +anyhow.workspace = true +serde.workspace = true async-trait = "0.1.72" -http = "0.2.9" +http.workspace = true tokio = { version = "1.30.0", features = ["sync", "macros", "rt"] } -url = "2.4.0" +url.workspace = true diff --git a/crates/oauth2-types/Cargo.toml b/crates/oauth2-types/Cargo.toml index 21ff252c..77da8adb 100644 --- a/crates/oauth2-types/Cargo.toml +++ b/crates/oauth2-types/Cargo.toml @@ -6,18 +6,17 @@ edition = "2021" license = "Apache-2.0" [dependencies] -http = "0.2.9" -serde = "1.0.183" -serde_json = "1.0.104" +http.workspace = true +serde.workspace = true +serde_json.workspace = true language-tags = { version = "0.3.2", features = ["serde"] } -url = { version = "2.4.0", features = ["serde"] } +url.workspace = true parse-display = "0.8.2" -indoc = "2.0.3" serde_with = { version = "3.2.0", features = ["chrono"] } chrono.workspace = true sha2 = "0.10.7" data-encoding = "2.4.0" -thiserror = "1.0.44" +thiserror.workspace = true mas-iana = { path = "../iana" } mas-jose = { path = "../jose" } diff --git a/crates/oidc-client/Cargo.toml b/crates/oidc-client/Cargo.toml index fb4bed8b..ed721cfd 100644 --- a/crates/oidc-client/Cargo.toml +++ b/crates/oidc-client/Cargo.toml @@ -25,20 +25,20 @@ form_urlencoded = "1.2.0" futures = "0.3.28" futures-util = "0.3.28" headers = "0.3.8" -http = "0.2.9" +http.workspace = true language-tags = "0.3.2" once_cell = "1.18.0" mime = "0.3.17" -rand = "0.8.5" -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" +rand.workspace = true +serde.workspace = true +serde_json.workspace = true serde_urlencoded = "0.7.1" serde_with = "3.2.0" -thiserror = "1.0.44" +thiserror.workspace = true tokio = { version = "1.30.0", features = ["rt", "macros", "rt-multi-thread"] } tower = { version = "0.4.13", features = ["full"] } -tracing = "0.1.37" -url = { version = "2.4.0", features = ["serde"] } +tracing.workspace = true +url.workspace = true mas-http = { path = "../http" } mas-iana = { path = "../iana" } diff --git a/crates/policy/Cargo.toml b/crates/policy/Cargo.toml index e4abd3dc..d47e3230 100644 --- a/crates/policy/Cargo.toml +++ b/crates/policy/Cargo.toml @@ -6,13 +6,13 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.72" +anyhow.workspace = true opa-wasm = { git = "https://github.com/matrix-org/rust-opa-wasm.git" } -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" -thiserror = "1.0.44" +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true tokio = { version = "1.30.0", features = ["io-util"] } -tracing = "0.1.37" +tracing.workspace = true wasmtime = { version = "11.0.1", default-features = false, features = ["async", "cranelift"] } mas-data-model = { path = "../data-model" } diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index 32c3b1c7..8d628d9f 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" [dependencies] axum = { version = "0.6.20", default-features = false } -serde = { version = "1.0.183", features = ["derive"] } +serde.workspace = true serde_urlencoded = "0.7.1" -url = "2.4.0" +url.workspace = true ulid = "1.0.0" diff --git a/crates/spa/Cargo.toml b/crates/spa/Cargo.toml index 5b68c132..f0c2da24 100644 --- a/crates/spa/Cargo.toml +++ b/crates/spa/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -serde = { version = "1.0.183", features = ["derive"] } -thiserror = "1.0.44" +serde.workspace = true +thiserror.workspace = true camino = { version = "1.1.6", features = ["serde1"] } diff --git a/crates/storage-pg/Cargo.toml b/crates/storage-pg/Cargo.toml index 94443ca0..d46ffeba 100644 --- a/crates/storage-pg/Cargo.toml +++ b/crates/storage-pg/Cargo.toml @@ -11,15 +11,15 @@ sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres", "mig sea-query = { version = "0.30.0", features = ["derive", "attr", "with-uuid", "with-chrono"] } sea-query-binder = { version = "0.5.0", features = ["sqlx-postgres", "with-uuid", "with-chrono"] } chrono.workspace = true -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" -thiserror = "1.0.44" -tracing = "0.1.37" +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true +tracing.workspace = true futures-util = "0.3.28" -rand = "0.8.5" +rand.workspace = true rand_chacha = "0.3.1" -url = { version = "2.4.0", features = ["serde"] } +url.workspace = true uuid = "1.4.1" ulid = { version = "1.0.0", features = ["uuid", "serde"] } diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index ac225b0d..461bc7b2 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -8,17 +8,17 @@ license = "Apache-2.0" [dependencies] async-trait = "0.1.72" chrono.workspace = true -thiserror = "1.0.44" +thiserror.workspace = true futures-util = "0.3.28" apalis-core = { version = "0.4.4", features = ["tokio-comp"] } opentelemetry = "0.20.0" rand_core = "0.6.4" -serde = "1.0.183" -serde_json = "1.0.104" -tracing = "0.1.37" +serde.workspace = true +serde_json.workspace = true +tracing.workspace = true tracing-opentelemetry = "0.20.0" -url = "2.4.0" +url.workspace = true ulid = "1.0.0" oauth2-types = { path = "../oauth2-types" } diff --git a/crates/tasks/Cargo.toml b/crates/tasks/Cargo.toml index 47f08e25..ea2c88c9 100644 --- a/crates/tasks/Cargo.toml +++ b/crates/tasks/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" [dependencies] -anyhow = "1.0.72" +anyhow.workspace = true apalis-core = { version = "0.4.4", features = ["extensions", "tokio-comp", "storage"] } apalis-cron = "0.4.4" async-stream = "0.3.5" @@ -14,19 +14,19 @@ async-trait = "0.1.72" chrono.workspace = true event-listener = "2.5.3" futures-lite = "1.13.0" -rand = "0.8.5" +rand.workspace = true rand_chacha = "0.3.1" sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] } -thiserror = "1.0.44" +thiserror.workspace = true tokio = { version = "1.30.0", features = ["rt"] } tower = "0.4.13" -tracing = "0.1.37" +tracing.workspace = true tracing-opentelemetry = "0.20.0" opentelemetry = "0.20.0" ulid = "1.0.0" -url = "2.4.0" -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" +url.workspace = true +serde.workspace = true +serde_json.workspace = true mas-data-model = { path = "../data-model" } mas-email = { path = "../email" } diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index 8a6f8737..69ec559f 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -6,23 +6,23 @@ edition = "2021" license = "Apache-2.0" [dependencies] -tracing = "0.1.37" +tracing.workspace = true tokio = { version = "1.30.0", features = ["macros", "rt", "fs"] } -anyhow = "1.0.72" -thiserror = "1.0.44" +anyhow.workspace = true +thiserror.workspace = true tera = { version = "1.19.0", default-features = false } -serde = { version = "1.0.183", features = ["derive"] } -serde_json = "1.0.104" +serde.workspace = true +serde_json.workspace = true serde_urlencoded = "0.7.1" camino = "1.1.6" chrono.workspace = true -url = "2.4.0" -http = "0.2.9" +url.workspace = true +http.workspace = true ulid = { version = "1.0.0", features = ["serde"] } -rand = "0.8.5" +rand.workspace = true oauth2-types = { path = "../oauth2-types" } mas-data-model = { path = "../data-model" } diff --git a/crates/tower/Cargo.toml b/crates/tower/Cargo.toml index c2968d3d..31d47dfa 100644 --- a/crates/tower/Cargo.toml +++ b/crates/tower/Cargo.toml @@ -6,16 +6,12 @@ edition = "2021" license = "Apache-2.0" [dependencies] -aws-smithy-http = { version = "0.55.3", optional = true } -http = "0.2.9" -tracing = "0.1.37" +http.workspace = true +tracing.workspace = true tracing-opentelemetry = "0.20.0" tower = "0.4.13" tokio = { version = "1.30.0", features = ["time"] } opentelemetry = { version = "0.20.0", features = ["metrics"] } opentelemetry-http = "0.9.0" opentelemetry-semantic-conventions = "0.12.0" -pin-project-lite = "0.2.12" - -[features] -aws-sdk = ["dep:aws-smithy-http"] +pin-project-lite = "0.2.12" \ No newline at end of file diff --git a/crates/tower/src/trace_context.rs b/crates/tower/src/trace_context.rs index b41ae2c3..c203e374 100644 --- a/crates/tower/src/trace_context.rs +++ b/crates/tower/src/trace_context.rs @@ -36,15 +36,6 @@ impl AsInjector for Request { } } -#[cfg(feature = "aws-sdk")] -impl AsInjector for aws_smithy_http::operation::Request { - type Injector<'a> = HeaderInjector<'a> where Self: 'a; - - fn as_injector(&mut self) -> Self::Injector<'_> { - HeaderInjector(self.http_mut().headers_mut()) - } -} - /// A [`Layer`] that adds a trace context to the request. #[derive(Debug, Clone, Copy, Default)] pub struct TraceContextLayer { diff --git a/docs/config.schema.json b/docs/config.schema.json index a2b85910..835163db 100644 --- a/docs/config.schema.json +++ b/docs/config.schema.json @@ -655,6 +655,7 @@ }, { "description": "Send emails via the AWS SESv2 API", + "deprecated": true, "type": "object", "required": [ "transport"