feat: Phase 2 - Authentication and authorization (T-010 to T-013)

This commit is contained in:
2026-02-06 13:15:25 +01:00
parent ec65991ac1
commit 508f0723af
11 changed files with 321 additions and 20 deletions

View File

View File

@@ -0,0 +1,33 @@
"""Pydantic schemas for authentication endpoints."""
import uuid
from pydantic import BaseModel
class LoginRequest(BaseModel):
"""Body for the login endpoint (unused directly — we rely on
``OAuth2PasswordRequestForm``, but kept for documentation / testing)."""
username: str
password: str
class TokenResponse(BaseModel):
"""Response returned after a successful login."""
access_token: str
token_type: str = "bearer"
class UserOut(BaseModel):
"""Public representation of a user (no password hash)."""
id: uuid.UUID
username: str
email: str | None = None
role: str
is_active: bool
class Config:
from_attributes = True