Files
mtusi2026lab2/evidence/requirements.md
T
gamayunov2004 18b419cda2
Student application / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
ЛР 2: PostgreSQL, сессии и Valkey — на 4
2026-10-23 18:17:09 +03:00

17 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Матрица требований (до реализации, 2026-10-23)
| Критерий преподавателя | Решение / файлы | Проверка | Evidence |
| --- | --- | --- | --- |
| 3: API ЛР1, Bearer, права, cursor | src/models.py, pagination.py из собственной ЛР1; main.py, store.py | make test + student-tests | smoke.txt, student.txt |
| 3: PostgreSQL, PK/FK/UNIQUE, атомарный чат | migrations/001_initial.sql, src/db.py, store.py | с нуля; повтор миграций; ошибка FK после INSERT чата | migrations.txt, student.txt |
| 3: password KDF, Basic только login, expiry/logout | Argon2id, SHA-256 случайного 256-bit token, PG sessions | негативные, expiry=2, logout | student.txt, expiry.txt |
| 3: данные и сессии переживают все рестарты | PG named volume, restart.sh: api/postgres/valkey | make test-persistence, timestamps до/после | persistence.txt |
| 3: check/test, секреты вне Git | Docker tools, .gitignore/.dockerignore | make check/validate/test, git diff | checks.txt, audit.txt |
| 4: реальный Valkey с TTL | cache.py: immutable user profiles, PG truth, TTL 60; fail-open только кэш | cached key + TTL + hit; outage fallback | student.txt, failures.txt |
| 4: параметры, bounded pool/timeouts, гонка/rollback | psycopg, pool max8/wait2, SQL timeout2s | concurrent username + FK rollback | student.txt |
| 4: индекс истории, EXPLAIN >=10000 | (chat_id,created_at,id), keyset LIMIT n+1 | 10000 синтетических записей, ANALYZE, реальный EXPLAIN | explain.txt |
| 4: expiry/logout/wrong password/Redis/DB outage | student-tests, scripts | короткий TTL; stop/start только сервисов проекта | expiry.txt, failures.txt |
Не изменять README.md, COURSE.md, CONTRIBUTING.md, contracts/, tests/.
ЛР1: переносятся только собственные models/pagination/errors; in-memory store заменяется PostgreSQL; X-User-Id заменяется сессиями.