feat: Phase 2 - Authentication and authorization (T-010 to T-013)
This commit is contained in:
0
backend/app/schemas/__init__.py
Normal file
0
backend/app/schemas/__init__.py
Normal file
33
backend/app/schemas/auth.py
Normal file
33
backend/app/schemas/auth.py
Normal 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
|
||||
Reference in New Issue
Block a user