Auth: JWT tokens (sb-auth) with argon2 password hashing, login/register endpoints, Bearer token middleware protecting all routes except auth. Authorization checks ensure users can only access their own characters. Persistence: SQLite via rusqlite (sb-db) with write-through on all mutations. Optional via SB_DB_PATH env var; falls back to in-memory. Typed responses: ~20 response DTOs in sb-shared replacing ad-hoc JSON. Combat: Injectable RNG via &mut impl Rng for deterministic tests. Clean Architecture: Combat types and response DTOs in sb-shared; domain services in sb-core; auth in sb-auth; persistence in sb-db.
20 lines
657 B
TOML
20 lines
657 B
TOML
[package]
|
|
name = "sb-api"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
axum = { version = "0.8", features = ["ws", "macros"] }
|
|
tokio = { version = "1", features = ["full"] }
|
|
tower = "0.5"
|
|
tower-http = { version = "0.6", features = ["cors", "trace", "compression-gzip"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
rand = "0.9"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
sb-core = { path = "../sb-core" }
|
|
sb-db = { path = "../sb-db" }
|
|
sb-auth = { path = "../sb-auth" }
|
|
sb-shared = { path = "../sb-shared" }
|
|
sb-common = { path = "/home/jan/Development/skara-brae/skara-brae-common/rust" }
|