Skip to content

Commit f010216

Browse files
authored
Add auth module with register, login, and JWT (#2)
## Summary - Auth endpoints: POST /api/v1/auth/register, POST /api/v1/auth/login, GET /api/v1/auth/me - Reorganized project structure to match architecture doc (api/v1/, db/entities/, db/migrations/) - Typed AppConfig with `#[derive(Config)]` for HOST, PORT, DATABASE_URL - Migration converting all PKs to serial id + UUID pid for internal/external separation - Manual SeaORM entity for users (schema! macro doesn't support UUID fields yet) - 8 integration tests using Rapina TestClient against real Postgres - OpenAPI spec exported and committed - CI: added rapina openapi check and rapina doctor jobs ## Test plan - [x] `cargo test` passes all 8 auth integration tests locally - [x] `cargo clippy -- -D warnings` clean - [x] `cargo fmt --all -- --check` clean - [x] `rapina doctor` passes (1 warning on /health errors, acceptable) - [x] `rapina openapi check` passes - [ ] CI pipeline passes on GitHub --------- Signed-off-by: arferreira <arfs.antonio@gmail.com>
1 parent fe959ae commit f010216

27 files changed

Lines changed: 1887 additions & 12 deletions

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
DATABASE_URL=postgres://reeverb:secret@localhost:5432/reeverb
22
JWT_SECRET=change-me-in-production
3+
HOST=0.0.0.0
4+
PORT=3000
35
RUST_LOG=info

Cargo.lock

Lines changed: 47 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ serde_json = "1"
1818
uuid = { version = "1", features = ["v4", "serde"] }
1919
chrono = { version = "0.4", features = ["serde"] }
2020
dotenvy = "0.15"
21+
bcrypt = "0.16"
2122

2223
[profile.release]
2324
lto = true

0 commit comments

Comments
 (0)