- FastAPI-App mit SQLite-Schema (admins, sessions, connections) - Login mit Argon2, serverseitige Sessions (Token nur gehasht gespeichert) - Cookie HttpOnly/Secure/SameSite=Strict, CSRF-Token für schreibende Requests - scripts/create_admin.py zum Anlegen und Zurücksetzen von Admins - Einfaches Frontend mit Login - pytest-Tests, gepinnte requirements.txt, .env.example, .gitignore - SETUP.md Teil 4 ergänzt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
324 B
Python
15 lines
324 B
Python
"""Pydantic-Modelle für Requests und Responses."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
benutzername: str = Field(min_length=1, max_length=64)
|
|
passwort: str = Field(min_length=1, max_length=1024)
|
|
|
|
|
|
class AdminInfo(BaseModel):
|
|
id: int
|
|
benutzername: str
|
|
csrf_token: str
|