feat: Multi-User-Unterstützung mit JWT-Authentifizierung

- User-Modell (username, password_hash, role admin/user, is_active)
- Standard-Admin-Benutzer wird beim ersten Start automatisch angelegt
- JWT-Tokens (HS256) für Benutzer-Sessions, konfigurierbare Ablaufzeit
- API-Key bleibt für service-to-service-Calls (backward-compatible)
- POST /api/v1/auth/login → JWT-Token
- GET  /api/v1/auth/me   → aktueller Benutzer
- CRUD /api/v1/users/    → Benutzerverwaltung (nur Admin)
- TUI zeigt Login-Screen beim Start; nach Erfolg → MainScreen
- Passwort-Hashing mit bcrypt (python-jose für JWT)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 20:55:13 +01:00
parent 6742242fe0
commit cd26b80d00
14 changed files with 421 additions and 10 deletions

View File

@@ -126,3 +126,40 @@ Screen {
#compose-buttons Button {
margin-left: 1;
}
/* ── Login-Screen ──────────────────────────────────────────────────────── */
#login-container {
align: center middle;
width: 100%;
height: 1fr;
}
#login-title {
text-style: bold;
text-align: center;
margin-bottom: 1;
color: $accent;
width: 40;
}
#login-container Label {
width: 40;
margin-top: 1;
}
#login-container Input {
width: 40;
}
#login-btn {
width: 40;
margin-top: 1;
}
#login-error {
width: 40;
color: $error;
text-align: center;
height: 1;
}