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

337
Cargo.lock generated
View File

@ -510,289 +510,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 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]] [[package]]
name = "axum" name = "axum"
version = "0.6.20" version = "0.6.20"
@ -910,16 +627,6 @@ version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 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]] [[package]]
name = "base64ct" name = "base64ct"
version = "1.6.0" version = "1.6.0"
@ -1046,16 +753,6 @@ dependencies = [
"serde", "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]] [[package]]
name = "camino" name = "camino"
version = "1.1.6" version = "1.1.6"
@ -2930,14 +2627,12 @@ name = "mas-cli"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"apalis-core",
"axum", "axum",
"camino", "camino",
"clap", "clap",
"dotenvy", "dotenvy",
"httpdate", "httpdate",
"hyper", "hyper",
"indoc",
"itertools 0.11.0", "itertools 0.11.0",
"listenfd", "listenfd",
"mas-config", "mas-config",
@ -3037,18 +2732,9 @@ name = "mas-email"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"aws-config",
"aws-sdk-sesv2",
"aws-smithy-async",
"aws-smithy-client",
"aws-smithy-http",
"aws-smithy-http-tower",
"aws-types",
"headers", "headers",
"lettre", "lettre",
"mas-http",
"mas-templates", "mas-templates",
"mas-tower",
"thiserror", "thiserror",
"tracing", "tracing",
] ]
@ -3091,7 +2777,6 @@ dependencies = [
"futures-util", "futures-util",
"headers", "headers",
"hyper", "hyper",
"indoc",
"insta", "insta",
"lettre", "lettre",
"mas-axum-utils", "mas-axum-utils",
@ -3139,8 +2824,6 @@ name = "mas-http"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"aws-smithy-http",
"aws-types",
"axum", "axum",
"bytes", "bytes",
"futures-util", "futures-util",
@ -3490,7 +3173,6 @@ dependencies = [
name = "mas-tower" name = "mas-tower"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"aws-smithy-http",
"http", "http",
"opentelemetry", "opentelemetry",
"opentelemetry-http", "opentelemetry-http",
@ -3711,7 +3393,6 @@ dependencies = [
"chrono", "chrono",
"data-encoding", "data-encoding",
"http", "http",
"indoc",
"language-tags", "language-tags",
"mas-iana", "mas-iana",
"mas-jose", "mas-jose",
@ -3993,12 +3674,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "outref"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a"
[[package]] [[package]]
name = "overload" name = "overload"
version = "0.1.1" version = "0.1.1"
@ -6391,12 +6066,6 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "vsimd"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64"
[[package]] [[package]]
name = "waker-fn" name = "waker-fn"
version = "1.1.0" version = "1.1.0"
@ -7026,12 +6695,6 @@ dependencies = [
"url", "url",
] ]
[[package]]
name = "xmlparser"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd"
[[package]] [[package]]
name = "yaml-rust" name = "yaml-rust"
version = "0.4.5" version = "0.4.5"

View File

@ -4,43 +4,59 @@ members = ["crates/*"]
[workspace.dependencies] [workspace.dependencies]
# High-level error handling
[workspace.dependencies.anyhow]
version = "1.0.72"
# Time utilities
[workspace.dependencies.chrono] [workspace.dependencies.chrono]
version = "0.4.26" version = "0.4.26"
default-features = false default-features = false
features = ["serde", "clock"] features = ["serde", "clock"]
[profile.dev.package.num-bigint-dig] # HTTP request/response
opt-level = 3 [workspace.dependencies.http]
version = "0.2.9"
[profile.dev.package.sqlx-macros] # Random values
opt-level = 3 [workspace.dependencies.rand]
version = "0.8.5"
[profile.dev.package.cranelift-codegen] # Serialization and deserialization
opt-level = 3 [workspace.dependencies.serde]
version = "1.0.183"
features = ["derive"] # Most of the time, if we need serde, we need derive
[profile.dev.package.regalloc2] # JSON serialization and deserialization
opt-level = 3 [workspace.dependencies.serde_json]
version = "1.0.104"
[profile.dev.package.argon2] # Custom error types
opt-level = 3 [workspace.dependencies.thiserror]
version = "1.0.44"
[profile.dev.package.pbkdf2] # Logging and tracing
opt-level = 3 [workspace.dependencies.tracing]
version = "0.1.37"
[profile.dev.package.bcrypt] # URL manipulation
opt-level = 3 [workspace.dependencies.url]
version = "2.4.0"
features = ["serde"]
[profile.dev.package.sha2] # A few profile opt-level tweaks to make the test suite run faster
opt-level = 3 [profile.dev.package]
num-bigint-dig.opt-level = 3
[profile.dev.package.digest] sqlx-macros.opt-level = 3
opt-level = 3 cranelift-codegen.opt-level = 3
regalloc2.opt-level = 3
[profile.dev.package.block-buffer] argon2.opt-level = 3
opt-level = 3 pbkdf2.opt-level = 3
bcrypt.opt-level = 3
[profile.dev.package.generic-array] sha2.opt-level = 3
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 # Until https://github.com/dylanhart/ulid-rs/pull/56 gets released

View File

@ -13,20 +13,20 @@ chrono.workspace = true
data-encoding = "2.4.0" data-encoding = "2.4.0"
futures-util = "0.3.28" futures-util = "0.3.28"
headers = "0.3.8" headers = "0.3.8"
http = "0.2.9" http.workspace = true
http-body = "0.4.5" http-body = "0.4.5"
mime = "0.3.17" mime = "0.3.17"
rand = "0.8.5" rand.workspace = true
sentry = { version = "0.31.5", default-features = false } sentry = { version = "0.31.5", default-features = false }
serde = "1.0.183" serde.workspace = true
serde_with = "3.2.0" serde_with = "3.2.0"
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
serde_json = "1.0.104" serde_json.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
tokio = "1.30.0" tokio = "1.30.0"
tower = { version = "0.4.13", features = ["util"] } tower = { version = "0.4.13", features = ["util"] }
tracing = "0.1.37" tracing.workspace = true
url = "2.4.0" url.workspace = true
ulid = { version = "1.0.0", features = ["serde"] } ulid = { version = "1.0.0", features = ["serde"] }
mas-data-model = { path = "../data-model" } mas-data-model = { path = "../data-model" }

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ pub async fn password_manager_from_config(
PasswordManager::new(schemes) PasswordManager::new(schemes)
} }
pub async fn mailer_from_config( pub fn mailer_from_config(
config: &EmailConfig, config: &EmailConfig,
templates: &Templates, templates: &Templates,
) -> Result<Mailer, anyhow::Error> { ) -> Result<Mailer, anyhow::Error> {
@ -83,7 +83,8 @@ pub async fn mailer_from_config(
.context("failed to build SMTP transport")? .context("failed to build SMTP transport")?
} }
EmailTransportConfig::Sendmail { command } => MailTransport::sendmail(command), 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)) Ok(Mailer::new(templates.clone(), transport, from, reply_to))

View File

@ -7,26 +7,26 @@ license = "Apache-2.0"
[dependencies] [dependencies]
tokio = { version = "1.30.0", features = ["fs", "rt"] } tokio = { version = "1.30.0", features = ["fs", "rt"] }
tracing = "0.1.37" tracing.workspace = true
async-trait = "0.1.72" async-trait = "0.1.72"
thiserror = "1.0.44" thiserror.workspace = true
anyhow = "1.0.72" anyhow.workspace = true
camino = { version = "1.1.6", features = ["serde1"] } camino = { version = "1.1.6", features = ["serde1"] }
chrono.workspace = true chrono.workspace = true
figment = { version = "0.10.10", features = ["env", "yaml", "test"] } figment = { version = "0.10.10", features = ["env", "yaml", "test"] }
schemars = { version = "0.8.12", features = ["url", "chrono"] } schemars = { version = "0.8.12", features = ["url", "chrono"] }
ulid = { version = "1.0.0", features = ["serde"] } 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_with = { version = "3.2.0", features = ["hex", "chrono"] }
serde_json = "1.0.104" serde_json.workspace = true
pem-rfc7468 = "0.7.0" pem-rfc7468 = "0.7.0"
rustls-pemfile = "1.0.3" rustls-pemfile = "1.0.3"
rand = "0.8.5" rand.workspace = true
rand_chacha = "0.3.1" rand_chacha = "0.3.1"
indoc = "2.0.3" indoc = "2.0.3"

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(deprecated)]
use std::num::NonZeroU16; use std::num::NonZeroU16;
use async_trait::async_trait; use async_trait::async_trait;
@ -78,6 +80,7 @@ pub enum EmailTransportConfig {
}, },
/// Send emails via the AWS SESv2 API /// Send emails via the AWS SESv2 API
#[deprecated(note = "The AWS SESv2 backend has be removed.")]
AwsSes, AwsSes,
} }

View File

@ -7,12 +7,12 @@ license = "Apache-2.0"
[dependencies] [dependencies]
chrono.workspace = true chrono.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
serde = "1.0.183" serde.workspace = true
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
crc = "3.0.1" crc = "3.0.1"
ulid = { version = "1.0.0", features = ["serde"] } ulid = { version = "1.0.0", features = ["serde"] }
rand = "0.8.5" rand.workspace = true
rand_chacha = "0.3.1" rand_chacha = "0.3.1"
mas-iana = { path = "../iana" } mas-iana = { path = "../iana" }

View File

@ -7,27 +7,13 @@ license = "Apache-2.0"
[dependencies] [dependencies]
async-trait = "0.1.72" async-trait = "0.1.72"
tracing = "0.1.37" tracing.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
headers = "0.3.8" 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-templates = { path = "../templates" }
mas-http = { path = "../http", features = ["aws-sdk", "client"] }
mas-tower = { path = "../tower", features = ["aws-sdk"] }
[dependencies.lettre] [dependencies.lettre]
version = "0.10.4" version = "0.10.4"
default-features = false default-features = false
features = ["tokio1-rustls-tls", "hostname", "builder", "tracing", "pool", "smtp-transport", "sendmail-transport"] 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"]

View File

@ -33,5 +33,5 @@ pub use mas_templates::EmailVerificationContext;
pub use self::{ pub use self::{
mailer::Mailer, mailer::Mailer,
transport::{aws_ses::Transport as AwsSesTransport, SmtpMode, Transport as MailTransport}, transport::{SmtpMode, Transport as MailTransport},
}; };

View File

@ -25,11 +25,8 @@ use lettre::{
}, },
AsyncTransport, Tokio1Executor, AsyncTransport, Tokio1Executor,
}; };
use mas_http::ClientInitError;
use thiserror::Error; use thiserror::Error;
pub mod aws_ses;
/// Encryption mode to use /// Encryption mode to use
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
pub enum SmtpMode { pub enum SmtpMode {
@ -51,7 +48,6 @@ enum TransportInner {
Blackhole, Blackhole,
Smtp(AsyncSmtpTransport<Tokio1Executor>), Smtp(AsyncSmtpTransport<Tokio1Executor>),
Sendmail(AsyncSendmailTransport<Tokio1Executor>), Sendmail(AsyncSendmailTransport<Tokio1Executor>),
AwsSes(aws_ses::Transport),
} }
impl Transport { impl Transport {
@ -101,16 +97,6 @@ impl Transport {
AsyncSendmailTransport::new_with_command(command), 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<Self, ClientInitError> {
let transport = aws_ses::Transport::from_env().await?;
Ok(Self::new(TransportInner::AwsSes(transport)))
}
} }
impl Transport { impl Transport {
@ -125,8 +111,7 @@ impl Transport {
TransportInner::Smtp(t) => { TransportInner::Smtp(t) => {
t.test_connection().await?; t.test_connection().await?;
} }
TransportInner::Blackhole | TransportInner::Sendmail(_) | TransportInner::AwsSes(_) => { TransportInner::Blackhole | TransportInner::Sendmail(_) => {}
}
} }
Ok(()) Ok(())
@ -144,7 +129,6 @@ impl Default for TransportInner {
pub enum Error { pub enum Error {
Smtp(#[from] lettre::transport::smtp::Error), Smtp(#[from] lettre::transport::smtp::Error),
Sendmail(#[from] lettre::transport::sendmail::Error), Sendmail(#[from] lettre::transport::sendmail::Error),
AwsSes(#[from] self::aws_ses::Error),
} }
#[async_trait] #[async_trait]
@ -165,9 +149,6 @@ impl AsyncTransport for Transport {
TransportInner::Sendmail(t) => { TransportInner::Sendmail(t) => {
t.send_raw(envelope, email).await?; t.send_raw(envelope, email).await?;
} }
TransportInner::AwsSes(t) => {
t.send_raw(envelope, email).await?;
}
}; };
Ok(()) Ok(())

View File

@ -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<SendEmailError>;
/// 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<Self, ClientInitError> {
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::<aws_smithy_http::operation::Metadata>() {
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::<aws_types::SigningService>() {
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::<Host>() {
span.record("http.host", tracing::field::display(host));
}
if let Some(user_agent) = headers.typed_get::<UserAgent>() {
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<Self::Ok, Self::Error> {
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)
}
}

View File

@ -6,18 +6,18 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.72" anyhow.workspace = true
async-graphql = { version = "6.0.1", features = ["chrono", "url"] } async-graphql = { version = "6.0.1", features = ["chrono", "url"] }
async-trait = "0.1.72" async-trait = "0.1.72"
chrono.workspace = true chrono.workspace = true
lettre = { version = "0.10.4", default-features = false } lettre = { version = "0.10.4", default-features = false }
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
tokio = { version = "1.30.0", features = ["sync"] } tokio = { version = "1.30.0", features = ["sync"] }
tracing = "0.1.37" tracing.workspace = true
tower = { version = "0.4.13", features = ["util"] } tower = { version = "0.4.13", features = ["util"] }
ulid = "1.0.0" ulid = "1.0.0"
url = "2.4.0" url.workspace = true
oauth2-types = { path = "../oauth2-types" } oauth2-types = { path = "../oauth2-types" }
mas-data-model = { path = "../data-model" } mas-data-model = { path = "../data-model" }

View File

@ -11,13 +11,13 @@ tokio = { version = "1.30.0", features = ["macros"] }
futures-util = "0.3.28" futures-util = "0.3.28"
# Logging and tracing # Logging and tracing
tracing = "0.1.37" tracing.workspace = true
opentelemetry = "0.20.0" opentelemetry = "0.20.0"
opentelemetry-semantic-conventions = "0.12.0" opentelemetry-semantic-conventions = "0.12.0"
# Error management # Error management
thiserror = "1.0.44" thiserror.workspace = true
anyhow = "1.0.72" anyhow.workspace = true
sentry = { version = "0.31.5", default-features = false } sentry = { version = "0.31.5", default-features = false }
# Web server # 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"] } sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] }
# Various structure (de)serialization # Various structure (de)serialization
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_with = { version = "3.2.0", features = ["hex", "chrono"] } serde_with = { version = "3.2.0", features = ["hex", "chrono"] }
serde_json = "1.0.104" serde_json.workspace = true
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
# Password hashing # Password hashing
@ -52,9 +52,9 @@ zeroize = "1.6.0"
camino = "1.1.6" camino = "1.1.6"
chrono.workspace = true chrono.workspace = true
time = "0.3.25" time = "0.3.25"
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
mime = "0.3.17" mime = "0.3.17"
rand = "0.8.5" rand.workspace = true
rand_chacha = "0.3.1" rand_chacha = "0.3.1"
headers = "0.3.8" headers = "0.3.8"
ulid = "1.0.0" ulid = "1.0.0"
@ -77,7 +77,6 @@ mas-templates = { path = "../templates" }
oauth2-types = { path = "../oauth2-types" } oauth2-types = { path = "../oauth2-types" }
[dev-dependencies] [dev-dependencies]
indoc = "2.0.3"
insta = "1.31.0" insta = "1.31.0"
tracing-subscriber = "0.3.17" tracing-subscriber = "0.3.17"

View File

@ -6,13 +6,11 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [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 } axum = { version = "0.6.20", optional = true }
bytes = "1.4.0" bytes = "1.4.0"
futures-util = "0.3.28" futures-util = "0.3.28"
headers = "0.3.8" headers = "0.3.8"
http = "0.2.9" http.workspace = true
http-body = "0.4.5" http-body = "0.4.5"
hyper = "0.14.27" hyper = "0.14.27"
hyper-rustls = { version = "0.24.1", features = ["http1", "http2"], default-features = false, optional = true } 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" opentelemetry = "0.20.0"
rustls = { version = "0.21.6", optional = true } rustls = { version = "0.21.6", optional = true }
rustls-native-certs = { version = "0.6.3", optional = true } rustls-native-certs = { version = "0.6.3", optional = true }
serde = "1.0.183" serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
thiserror = "1.0.44" thiserror.workspace = true
tokio = { version = "1.30.0", features = ["sync", "parking_lot"], optional = true } tokio = { version = "1.30.0", features = ["sync", "parking_lot"], optional = true }
tower = { version = "0.4.13", features = [] } tower = { version = "0.4.13", features = [] }
tower-http = { version = "0.4.3", features = ["cors"] } tower-http = { version = "0.4.3", features = ["cors"] }
tracing = "0.1.37" tracing.workspace = true
tracing-opentelemetry = "0.20.0" tracing-opentelemetry = "0.20.0"
webpki = { version = "0.22.0", optional = true } webpki = { version = "0.22.0", optional = true }
webpki-roots = { version = "0.25.2", 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" } mas-tower = { path = "../tower" }
[dev-dependencies] [dev-dependencies]
anyhow = "1.0.72" anyhow.workspace = true
serde = { version = "1.0.183", features = ["derive"] }
tokio = { version = "1.30.0", features = ["macros", "rt"] } tokio = { version = "1.30.0", features = ["macros", "rt"] }
tower = { version = "0.4.13", features = ["util"] } tower = { version = "0.4.13", features = ["util"] }
[features] [features]
axum = ["dep:axum"] axum = ["dep:axum"]
aws-sdk = ["dep:aws-smithy-http", "dep:aws-types"]
native-roots = ["dep:rustls-native-certs"] native-roots = ["dep:rustls-native-certs"]
webpki-roots = ["dep:webpki-roots"] webpki-roots = ["dep:webpki-roots"]
client = [ client = [

View File

@ -6,14 +6,14 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.72" anyhow.workspace = true
async-trait = "0.1.72" async-trait = "0.1.72"
camino = "1.1.6" camino = "1.1.6"
convert_case = "0.6.0" convert_case = "0.6.0"
csv = "1.2.2" csv = "1.2.2"
futures-util = "0.3.28" futures-util = "0.3.28"
hyper = { version = "0.14.27", features = ["tcp", "client", "http1"] } 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"] } 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" tracing-subscriber = "0.3.17"

View File

@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
serde = { version = "1.0.183", optional = true } serde = { workspace = true, optional = true }
schemars = { version = "0.8.12", default-features = false, optional = true } schemars = { version = "0.8.12", default-features = false, optional = true }
[features] [features]

View File

@ -16,18 +16,18 @@ hmac = "0.12.1"
k256 = { version = "0.13.1", features = ["ecdsa"] } k256 = { version = "0.13.1", features = ["ecdsa"] }
p256 = { version = "0.13.2", features = ["ecdsa"] } p256 = { version = "0.13.2", features = ["ecdsa"] }
p384 = { version = "0.13.0", features = ["ecdsa"] } p384 = { version = "0.13.0", features = ["ecdsa"] }
rand = "0.8.5" rand.workspace = true
rsa = "0.9.2" rsa = "0.9.2"
schemars = "0.8.12" schemars = "0.8.12"
sec1 = "0.7.3" sec1 = "0.7.3"
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
serde_with = { version = "3.2.0", features = ["base64"] } serde_with = { version = "3.2.0", features = ["base64"] }
sha2 = { version = "0.10.7", features = ["oid"] } sha2 = { version = "0.10.7", features = ["oid"] }
signature = "2.1.0" signature = "2.1.0"
thiserror = "1.0.44" thiserror.workspace = true
tracing = "0.1.37" tracing.workspace = true
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
mas-iana = { path = "../iana" } mas-iana = { path = "../iana" }

View File

@ -18,11 +18,11 @@ p384 = { version = "0.13.0", features = ["std"] }
pem-rfc7468 = { version = "0.7.0", features = ["std"] } pem-rfc7468 = { version = "0.7.0", features = ["std"] }
pkcs1 = { version = "0.7.5", features = ["std"] } pkcs1 = { version = "0.7.5", features = ["std"] }
pkcs8 = { version = "0.10.2", features = ["std", "pkcs5", "encryption"] } pkcs8 = { version = "0.10.2", features = ["std", "pkcs5", "encryption"] }
rand = "0.8.5" rand.workspace = true
rsa = { version = "0.9.2", features = ["std", "pem"] } rsa = { version = "0.9.2", features = ["std", "pem"] }
sec1 = { version = "0.7.3", features = ["std"] } sec1 = { version = "0.7.3", features = ["std"] }
spki = { version = "0.7.2", features = ["std"] } spki = { version = "0.7.2", features = ["std"] }
thiserror = "1.0.44" thiserror.workspace = true
generic-array = "0.14.7" generic-array = "0.14.7"
chacha20poly1305 = { version = "0.10.1", features = ["std"] } chacha20poly1305 = { version = "0.10.1", features = ["std"] }
base64ct = "1.6.0" base64ct = "1.6.0"

View File

@ -11,16 +11,16 @@ futures-util = "0.3.28"
http-body = "0.4.5" http-body = "0.4.5"
hyper = { version = "0.14.27", features = ["server", "http1", "http2", "tcp"] } hyper = { version = "0.14.27", features = ["server", "http1", "http2", "tcp"] }
pin-project-lite = "0.2.12" 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 = { version = "1.30.0", features = ["net", "rt", "macros", "signal", "time"] }
tokio-rustls = "0.24.1" tokio-rustls = "0.24.1"
tower-http = { version = "0.4.3", features = ["add-extension"] } tower-http = { version = "0.4.3", features = ["add-extension"] }
tower-service = "0.3.2" tower-service = "0.3.2"
tracing = "0.1.37" tracing.workspace = true
libc = "0.2.147" libc = "0.2.147"
[dev-dependencies] [dev-dependencies]
anyhow = "1.0.72" anyhow.workspace = true
rustls-pemfile = "1.0.3" rustls-pemfile = "1.0.3"
tokio = { version = "1.30.0", features = ["net", "rt", "macros", "signal", "time", "rt-multi-thread"] } tokio = { version = "1.30.0", features = ["net", "rt", "macros", "signal", "time", "rt-multi-thread"] }
tokio-test = "0.4.2" tokio-test = "0.4.2"

View File

@ -6,13 +6,13 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.72" anyhow.workspace = true
async-trait = "0.1.72" async-trait = "0.1.72"
http = "0.2.9" http.workspace = true
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
tower = { version = "0.4.13", features = ["util"] } tower = { version = "0.4.13", features = ["util"] }
tracing = "0.1.37" tracing.workspace = true
url = "2.4.0" url.workspace = true
mas-axum-utils = { path = "../axum-utils" } mas-axum-utils = { path = "../axum-utils" }
mas-http = { path = "../http" } mas-http = { path = "../http" }

View File

@ -6,9 +6,9 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.71" anyhow.workspace = true
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
async-trait = "0.1.72" async-trait = "0.1.72"
http = "0.2.9" http.workspace = true
tokio = { version = "1.30.0", features = ["sync", "macros", "rt"] } tokio = { version = "1.30.0", features = ["sync", "macros", "rt"] }
url = "2.4.0" url.workspace = true

View File

@ -6,18 +6,17 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
http = "0.2.9" http.workspace = true
serde = "1.0.183" serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
language-tags = { version = "0.3.2", features = ["serde"] } language-tags = { version = "0.3.2", features = ["serde"] }
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
parse-display = "0.8.2" parse-display = "0.8.2"
indoc = "2.0.3"
serde_with = { version = "3.2.0", features = ["chrono"] } serde_with = { version = "3.2.0", features = ["chrono"] }
chrono.workspace = true chrono.workspace = true
sha2 = "0.10.7" sha2 = "0.10.7"
data-encoding = "2.4.0" data-encoding = "2.4.0"
thiserror = "1.0.44" thiserror.workspace = true
mas-iana = { path = "../iana" } mas-iana = { path = "../iana" }
mas-jose = { path = "../jose" } mas-jose = { path = "../jose" }

View File

@ -25,20 +25,20 @@ form_urlencoded = "1.2.0"
futures = "0.3.28" futures = "0.3.28"
futures-util = "0.3.28" futures-util = "0.3.28"
headers = "0.3.8" headers = "0.3.8"
http = "0.2.9" http.workspace = true
language-tags = "0.3.2" language-tags = "0.3.2"
once_cell = "1.18.0" once_cell = "1.18.0"
mime = "0.3.17" mime = "0.3.17"
rand = "0.8.5" rand.workspace = true
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
serde_with = "3.2.0" serde_with = "3.2.0"
thiserror = "1.0.44" thiserror.workspace = true
tokio = { version = "1.30.0", features = ["rt", "macros", "rt-multi-thread"] } tokio = { version = "1.30.0", features = ["rt", "macros", "rt-multi-thread"] }
tower = { version = "0.4.13", features = ["full"] } tower = { version = "0.4.13", features = ["full"] }
tracing = "0.1.37" tracing.workspace = true
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
mas-http = { path = "../http" } mas-http = { path = "../http" }
mas-iana = { path = "../iana" } mas-iana = { path = "../iana" }

View File

@ -6,13 +6,13 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.72" anyhow.workspace = true
opa-wasm = { git = "https://github.com/matrix-org/rust-opa-wasm.git" } opa-wasm = { git = "https://github.com/matrix-org/rust-opa-wasm.git" }
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
tokio = { version = "1.30.0", features = ["io-util"] } 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"] } wasmtime = { version = "11.0.1", default-features = false, features = ["async", "cranelift"] }
mas-data-model = { path = "../data-model" } mas-data-model = { path = "../data-model" }

View File

@ -7,7 +7,7 @@ license = "Apache-2.0"
[dependencies] [dependencies]
axum = { version = "0.6.20", default-features = false } axum = { version = "0.6.20", default-features = false }
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
url = "2.4.0" url.workspace = true
ulid = "1.0.0" ulid = "1.0.0"

View File

@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
camino = { version = "1.1.6", features = ["serde1"] } camino = { version = "1.1.6", features = ["serde1"] }

View File

@ -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 = { 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"] } sea-query-binder = { version = "0.5.0", features = ["sqlx-postgres", "with-uuid", "with-chrono"] }
chrono.workspace = true chrono.workspace = true
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
tracing = "0.1.37" tracing.workspace = true
futures-util = "0.3.28" futures-util = "0.3.28"
rand = "0.8.5" rand.workspace = true
rand_chacha = "0.3.1" rand_chacha = "0.3.1"
url = { version = "2.4.0", features = ["serde"] } url.workspace = true
uuid = "1.4.1" uuid = "1.4.1"
ulid = { version = "1.0.0", features = ["uuid", "serde"] } ulid = { version = "1.0.0", features = ["uuid", "serde"] }

View File

@ -8,17 +8,17 @@ license = "Apache-2.0"
[dependencies] [dependencies]
async-trait = "0.1.72" async-trait = "0.1.72"
chrono.workspace = true chrono.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
futures-util = "0.3.28" futures-util = "0.3.28"
apalis-core = { version = "0.4.4", features = ["tokio-comp"] } apalis-core = { version = "0.4.4", features = ["tokio-comp"] }
opentelemetry = "0.20.0" opentelemetry = "0.20.0"
rand_core = "0.6.4" rand_core = "0.6.4"
serde = "1.0.183" serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
tracing = "0.1.37" tracing.workspace = true
tracing-opentelemetry = "0.20.0" tracing-opentelemetry = "0.20.0"
url = "2.4.0" url.workspace = true
ulid = "1.0.0" ulid = "1.0.0"
oauth2-types = { path = "../oauth2-types" } oauth2-types = { path = "../oauth2-types" }

View File

@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
anyhow = "1.0.72" anyhow.workspace = true
apalis-core = { version = "0.4.4", features = ["extensions", "tokio-comp", "storage"] } apalis-core = { version = "0.4.4", features = ["extensions", "tokio-comp", "storage"] }
apalis-cron = "0.4.4" apalis-cron = "0.4.4"
async-stream = "0.3.5" async-stream = "0.3.5"
@ -14,19 +14,19 @@ async-trait = "0.1.72"
chrono.workspace = true chrono.workspace = true
event-listener = "2.5.3" event-listener = "2.5.3"
futures-lite = "1.13.0" futures-lite = "1.13.0"
rand = "0.8.5" rand.workspace = true
rand_chacha = "0.3.1" rand_chacha = "0.3.1"
sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] } sqlx = { version = "0.7.1", features = ["runtime-tokio-rustls", "postgres"] }
thiserror = "1.0.44" thiserror.workspace = true
tokio = { version = "1.30.0", features = ["rt"] } tokio = { version = "1.30.0", features = ["rt"] }
tower = "0.4.13" tower = "0.4.13"
tracing = "0.1.37" tracing.workspace = true
tracing-opentelemetry = "0.20.0" tracing-opentelemetry = "0.20.0"
opentelemetry = "0.20.0" opentelemetry = "0.20.0"
ulid = "1.0.0" ulid = "1.0.0"
url = "2.4.0" url.workspace = true
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
mas-data-model = { path = "../data-model" } mas-data-model = { path = "../data-model" }
mas-email = { path = "../email" } mas-email = { path = "../email" }

View File

@ -6,23 +6,23 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
tracing = "0.1.37" tracing.workspace = true
tokio = { version = "1.30.0", features = ["macros", "rt", "fs"] } tokio = { version = "1.30.0", features = ["macros", "rt", "fs"] }
anyhow = "1.0.72" anyhow.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
tera = { version = "1.19.0", default-features = false } tera = { version = "1.19.0", default-features = false }
serde = { version = "1.0.183", features = ["derive"] } serde.workspace = true
serde_json = "1.0.104" serde_json.workspace = true
serde_urlencoded = "0.7.1" serde_urlencoded = "0.7.1"
camino = "1.1.6" camino = "1.1.6"
chrono.workspace = true chrono.workspace = true
url = "2.4.0" url.workspace = true
http = "0.2.9" http.workspace = true
ulid = { version = "1.0.0", features = ["serde"] } ulid = { version = "1.0.0", features = ["serde"] }
rand = "0.8.5" rand.workspace = true
oauth2-types = { path = "../oauth2-types" } oauth2-types = { path = "../oauth2-types" }
mas-data-model = { path = "../data-model" } mas-data-model = { path = "../data-model" }

View File

@ -6,16 +6,12 @@ edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
[dependencies] [dependencies]
aws-smithy-http = { version = "0.55.3", optional = true } http.workspace = true
http = "0.2.9" tracing.workspace = true
tracing = "0.1.37"
tracing-opentelemetry = "0.20.0" tracing-opentelemetry = "0.20.0"
tower = "0.4.13" tower = "0.4.13"
tokio = { version = "1.30.0", features = ["time"] } tokio = { version = "1.30.0", features = ["time"] }
opentelemetry = { version = "0.20.0", features = ["metrics"] } opentelemetry = { version = "0.20.0", features = ["metrics"] }
opentelemetry-http = "0.9.0" opentelemetry-http = "0.9.0"
opentelemetry-semantic-conventions = "0.12.0" opentelemetry-semantic-conventions = "0.12.0"
pin-project-lite = "0.2.12" pin-project-lite = "0.2.12"
[features]
aws-sdk = ["dep:aws-smithy-http"]

View File

@ -36,15 +36,6 @@ impl<B> AsInjector for Request<B> {
} }
} }
#[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. /// A [`Layer`] that adds a trace context to the request.
#[derive(Debug, Clone, Copy, Default)] #[derive(Debug, Clone, Copy, Default)]
pub struct TraceContextLayer { pub struct TraceContextLayer {

View File

@ -655,6 +655,7 @@
}, },
{ {
"description": "Send emails via the AWS SESv2 API", "description": "Send emails via the AWS SESv2 API",
"deprecated": true,
"type": "object", "type": "object",
"required": [ "required": [
"transport" "transport"