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:
2026-10-01 18:50:42 +03:00
co-authored by Claude Opus 5.5
parent ee2643d21e
commit ae4154eaf5
68 changed files with 2946 additions and 314 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ from concurrent.futures import ThreadPoolExecutor
import httpx
import pytest
from api_client import API, Api, order_key, unique_username
from api_client import API, Api, order_key, registration, unique_username
from contract import assert_error, assert_ok
CLIENTS = 10
@@ -113,7 +113,7 @@ def test_same_username_at_once(base_url: str) -> None:
resp = own.request(
"POST",
f"{API}/users",
json={"username": username, "display_name": f"Racer {number}"},
json=registration(username, f"Racer {number}"),
)
return resp, start, time.monotonic()