forked from mtusi2026/mtusi2026lab2
feat: add password login and bearer sessions
- Argon2id password hashes, KDF in a thread with its own limit - POST /auth/sessions with Basic, DELETE /auth/sessions/current - Bearer sessions in PostgreSQL, X-User-Id ignored - migration drops lab 1 data without passwords - student-tests on tokens, sessions spec and synced specs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,17 @@ from uuid import UUID
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class UserFullDTO:
|
||||
"""Пользователь без хэша пароля: в таком виде он уходит в API."""
|
||||
|
||||
id: UUID
|
||||
username: str
|
||||
display_name: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class UserCredentialsDTO:
|
||||
"""Пользователь и хэш пароля — только для входа."""
|
||||
|
||||
user: UserFullDTO
|
||||
password_hash: str
|
||||
|
||||
Reference in New Issue
Block a user