Шхуна не тонет: security, infra и доки на русском.

Безопасность довёл до ума — Cursor-генерацию переписал руками.
IDOR закрыл, CSRF задушил, refresh rotation теперь как надо.
HSTS на staging, ENABLE_DOCS=false, install.env recovery протестил.

Backend:
- jwt_denylist + auth_epoch: мгновенный revoke access JWT (logout/block/reset)
- auth/admin/users: bump epoch, logout с Bearer, forgot_password skip для blocked
- install_secrets: путь всегда apps/api/data/secrets/ (bootstrap из корня не ломает Docker)
- seed: SEED_DEMO_USERS=false на prod/staging
- тесты: jwt revoke, integration, coverage gate 90%

Frontend:
- logout шлёт Bearer, обработка TOKEN_REVOKED
- guards TypeScript fix
- E2E: blocked user → 401 сразу после block

Infra:
- staging/prod compose, TLS nginx, deploy-скрипты
- k6 §17.2, backup/health/smoke scripts

Docs:
- docs/ на русском: project, security, deploy, release (старые md слили)
- README короткий + план ТЗ + стандартные логины dev

Код готов к плаванию. Капитан может идти писать фронт.
This commit is contained in:
влад
2026-07-15 00:06:13 +03:00
parent 86cc3fa541
commit 12c983c0fc
66 changed files with 2377 additions and 520 deletions
@@ -1,6 +1,6 @@
from sqlalchemy import create_engine, inspect
from scripts.docker_entrypoint import INITIAL_REVISION, current_revision, run_migrations
from scripts.docker_entrypoint import HEAD_REVISION, INITIAL_REVISION, current_revision, run_migrations
def test_run_migrations_on_empty_sqlite(tmp_path, monkeypatch):
@@ -17,7 +17,7 @@ def test_run_migrations_on_empty_sqlite(tmp_path, monkeypatch):
tables = set(inspect(engine).get_table_names())
assert "users" in tables
assert current_revision(engine) == "20260714_0004"
assert current_revision(engine) == HEAD_REVISION
def test_run_migrations_stamps_existing_schema_without_alembic(tmp_path, monkeypatch):
@@ -52,7 +52,7 @@ def test_run_migrations_stamps_existing_schema_without_alembic(tmp_path, monkeyp
tables = set(inspect(engine).get_table_names())
assert "refresh_tokens" in tables
assert current_revision(engine) == "20260714_0004"
assert current_revision(engine) == HEAD_REVISION
assert INITIAL_REVISION == "20260711_0001"
@@ -98,4 +98,4 @@ def test_run_migrations_repairs_partial_schema_with_stale_alembic(tmp_path, monk
tables = set(inspect(engine).get_table_names())
assert "refresh_tokens" in tables
assert current_revision(engine) == "20260714_0004"
assert current_revision(engine) == HEAD_REVISION