ЛР 2: PostgreSQL, сессии Basic/Bearer, Redis-кэш, тесты и отчёт

This commit is contained in:
Anatoly Sanzharovskiy
2026-10-15 18:30:21 +03:00
parent 65003b6119
commit dbdb66456a
35 changed files with 2115 additions and 40 deletions
+21
View File
@@ -0,0 +1,21 @@
# 2026-10-15T10:02Z, локальный стенд; в Docker тот же скрипт по умолчанию делает docker compose stop/start
== 1. Redis недоступен ==
$ redis-cli shutdown nosave
ok - valid token still works without Redis (cache bypassed)
ok - writes still work without Redis
ok - login works without Redis
ok - forged token still rejected without Redis
$ redis-server --daemonize yes --save '' --appendonly no
== 2. PostgreSQL недоступен ==
$ su postgres -c '/usr/lib/postgresql/16/bin/pg_ctl -D /tmp/pgdata -m fast -w stop'
ok - history without DB -> 503, not a hang (got 503)
ok - unknown token is never trusted without DB (got 503)
ok - anonymous request -> 401
ok - /health/ready -> 503
ok - /health/live -> 200 (process is alive)
$ su postgres -c '/usr/lib/postgresql/16/bin/pg_ctl -D /tmp/pgdata -w start -o "-p 5432 -k /tmp" -l /tmp/pg.log'
== 3. восстановление ==
ok - /health/ready back to 200
ok - same token reads the same history after DB is back
11 passed, 0 failed