Cargo.toml 121 lignes · 3924 octets
[package]
name = "rustwarden-core"
version = "1.2.0"
edition.workspace = true
rust-version.workspace = true
description = "Core library for Rustwarden – authentication, RBAC, user management framework"

[dependencies]
# Web framework
axum = { version = "0.8", features = ["macros"] }
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
# Streams (SSE / NotificationBus)
futures = "0.3"
tokio-stream = { version = "0.1", features = ["sync"] }
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# Middleware
tower = { version = "0.5", features = ["limit", "util"] }
tower-http = { version = "0.6", features = ["cors"] }
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Env
dotenvy = "0.15"
# Database ORM
sea-orm = { version = "2.0.0", features = ["sqlx-postgres", "runtime-tokio-native-tls", "macros"] }
sea-orm-migration = { version = "2.0.0", features = ["sqlx-postgres", "runtime-tokio-native-tls"] }
# Direct min so a fresh resolve cannot pick sea-bae 0.2.1 (proc-macro-error2 E0365).
sea-bae = "0.2.2"
# Password hashing
bcrypt = "0.19"
# Validation
validator = { version = "0.20", features = ["derive"] }
# There is no validator 0.20.1 crate; only the derive crate switched to proc-macro-error3.
validator_derive = "0.20.1"
# UUID & Datetime
uuid = { version = "1.0", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
time = { version = "0.3", features = ["macros", "serde"] }
# Error handling
thiserror = "2.0"
anyhow = "1.0"
# Authentication — JWT & Sessions
jsonwebtoken = { version = "10", features = ["rust_crypto"] }
tower-sessions = "0.14"
tower-sessions-redis-store = { version = "0.14", optional = true }
axum-extra = { version = "0.12", features = ["cookie"] }
rand = { version = "0.9", features = ["std"] }
# JWT Blacklist & crypto utilities
sha2 = "0.10"
base64 = "0.22"
hex = "0.4"
subtle = "2.6"
# Email
lettre = { version = "0.11.22", features = ["tokio1-native-tls", "builder"] }
# IMAP client for bounce processing
imap = "2.4"
native-tls = "0.2"
# i18n
yaml-rust2 = "0.11.0"
# Formatting
num-format = "0.4.4"
# Templates (macro + LayoutContext)
askama = "0.15"
# Encryption (for storing OAuth secrets and TOTP secrets in DB)
aes-gcm = "0.10"
# TOTP 2FA
totp-rs = { version = "5", features = ["otpauth", "gen_secret", "qr"] }
# URL encoding for redirect parameters
urlencoding = "2"
# OAuth2 / OpenID Connect (optional)
openidconnect = { version = "4", optional = true }
reqwest = { version = "0.12", features = ["json", "native-tls"], optional = true }

[features]
default = []
redis-session = ["tower-sessions-redis-store"]
oauth = ["dep:openidconnect", "dep:reqwest"]

[lints]
workspace = true

[[bin]]
name = "migrate"
path = "src/bin/migrate.rs"

[[bin]]
name = "hash_password"
path = "src/bin/hash_password.rs"

[[bin]]
name = "seed"
path = "src/bin/seed.rs"

[[bin]]
name = "change_password"
path = "src/bin/change_password.rs"

[[bin]]
name = "screen-select"
path = "src/bin/screen-select/main.rs"

[dev-dependencies]
hyper = { version = "1", features = ["full"] }
hyper-util = { version = "0.1", features = ["full"] }
tower = "0.5"
# Enable SeaORM mock backend for unit tests (RFC 0003+).
sea-orm = { version = "2.0.0", features = ["mock"] }
# Fediverse interop tests (RFC 0020): fake-Mastodon HTTP server for
# round-trip verification of HTTP signatures and outbound delivery.
wiremock = "0.6"
# E2E tests against the docker-compose fediverse testbed
# (tests/fediverse-testbed/). Used by `cargo test --test e2e_fediverse`.
reqwest = { version = "0.12", features = ["json"] }
# Serialise tests that mutate process-wide environment variables
# (ENCRYPTION_KEY, OAUTH_ENCRYPTION_KEY). Without this, parallel
# unit tests can race on `env::set_var` and produce intermittent
# failures (notably `services::crypto_service::tests::test_roundtrip`).
serial_test = "3"