backend: add user management system with SQLite database #1

Open
restitux wants to merge 1 commits from auth/1-user-management into main

1 Commits

Author SHA1 Message Date
restitux 22f9405229 backend: add user management system with SQLite database
Add authentication and authorization infrastructure:
- SQLite database (db.rs) with users, sessions, and app permissions tables
- Password hashing with argon2
- Session-based auth with random 256-bit tokens
- Auth middleware (session validation) and admin middleware
- Login/logout/me endpoints
- Admin CRUD endpoints for user and permission management
- Auto-seed default admin user on first run
- 23 unit tests covering all DB operations

Existing API endpoints are not yet gated behind auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 02:34:02 +00:00