feat(auth): replace stub auth with real JWT + bcrypt

- RealAuthManager: JWT signing/validation + bcrypt password hashing
- MemUserStore: in-memory user store with default admin
- Register endpoint: user creation with hashed password
- Login endpoint: bcrypt verification + JWT generation
- AuthManager interface extended with Login/Register methods
This commit is contained in:
Aska committed 2026-08-12 12:21:36 +08:00
1 parent 6811480786
commit fbb331ed4b
4 files changed
+158 -10

No files matched your search

+2 -1
View File
@@ -176,7 +176,8 @@ func main() {
log.Printf("[orchestrator] pipeline ready")
// === 12. Gateway ===
authMgr := api.NewStubAuthManager()
userStore := api.NewMemUserStore(cfg.AdminPassword)
authMgr := api.NewRealAuthManager(cfg.JWTSecret, cfg.JWTExpiryHours, userStore)
// Build dependencies for gateway handlers
gwDeps := api.Dependencies{