[package]
edition = "2021"
name = "tenancy"
version = "0.1.0"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Multi-tenant primitives for Rust services: resolution, lifecycle, bootstrappers, single-DB scoping and multi-DB support"
documentation = "https://docs.rs/tenancy"
readme = "README.md"
keywords = [
"multi-tenancy",
"tenant",
"sqlx",
"axum",
"saas",
]
categories = [
"database",
"web-programming",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/abdasis/tenancy-rs"
[features]
axum = [
"dep:axum",
"dep:tower",
]
default = []
encryption = [
"dep:aes-gcm",
"dep:hex",
]
impersonation = [
"dep:hmac",
"dep:sha2",
"dep:hex",
]
postgres = ["dep:sqlx"]
postgres-rls = ["postgres"]
redis = ["dep:redis"]
testing = []
[lib]
name = "tenancy"
path = "src/lib.rs"
[[example]]
name = "axum_single_db"
path = "examples/axum_single_db.rs"
required-features = ["axum"]
[[test]]
name = "admin"
path = "tests/admin.rs"
[[test]]
name = "axum_layer"
path = "tests/axum_layer.rs"
[[test]]
name = "bootstrappers"
path = "tests/bootstrappers.rs"
[[test]]
name = "config"
path = "tests/config.rs"
[[test]]
name = "domain"
path = "tests/domain.rs"
[[test]]
name = "lifecycle"
path = "tests/lifecycle.rs"
[[test]]
name = "multi_db"
path = "tests/multi_db.rs"
[[test]]
name = "ports"
path = "tests/ports.rs"
[[test]]
name = "repository"
path = "tests/repository.rs"
[[test]]
name = "resolvers"
path = "tests/resolvers.rs"
[[test]]
name = "single_db"
path = "tests/single_db.rs"
[[test]]
name = "testing_helpers"
path = "tests/testing_helpers.rs"
[dependencies.aes-gcm]
version = "0.10"
optional = true
[dependencies.async-trait]
version = "0.1"
[dependencies.axum]
version = "0.8"
optional = true
[dependencies.chrono]
version = "0.4"
features = ["serde"]
[dependencies.hex]
version = "0.4"
optional = true
[dependencies.hmac]
version = "0.12"
optional = true
[dependencies.redis]
version = "0.27"
features = ["tokio-comp"]
optional = true
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1"
[dependencies.sha2]
version = "0.10"
optional = true
[dependencies.sqlx]
version = "0.8"
features = [
"runtime-tokio-rustls",
"postgres",
"chrono",
"json",
"macros",
"migrate",
]
optional = true
default-features = false
[dependencies.thiserror]
version = "2"
[dependencies.tokio]
version = "1"
features = [
"sync",
"rt",
"macros",
"time",
"fs",
]
[dependencies.tower]
version = "0.5"
optional = true
[dependencies.tracing]
version = "0.1"
[dev-dependencies.http-body-util]
version = "0.1"
[dev-dependencies.tokio]
version = "1"
features = [
"test-util",
"macros",
"net",
"rt-multi-thread",
]
[dev-dependencies.tower]
version = "0.5"
features = ["util"]