test(rbac): test-mode bypass to revive api/v1 suite (CI-rehab 1/3) #1030
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1030
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "chore/test-mode-rbac-bypass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CI-rehab 1/3: test-mode RBAC bypass — оживляет api/v1 тест-сьют.
Весь api/v1-сьют бьёт по
appмимо Caddy →rbac_guard401-ил каждый authed-запрос (нет X-Authenticated-User) → 112 тестов red, сьют по сути мёртв (так #994 district-500 и ушёл незамеченным). Добавленsettings.testing(default False — прод RBAC не тронут) + строго-gated bypass в начале rbac_guard;tests/conftest.pyвключает его (env TESTING=1 + settings.testing=True до импорта app).Security: bypass срабатывает ТОЛЬКО при settings.testing=True, который в проде не ставится нигде (default False; флипает лишь conftest). RBAC 401/403 логика покрыта
test_rbac.py(своя копия middleware, на флаг не смотрит).Эффект: 112→42 failed, 1590→1660 passed. Остаток 42 (+5 mv_layout env-errors) = дрейф моков/ассертов + env-тесты → CI-rehab 2/3. Фундамент под реальный Forgejo pytest-гейт (3/3).
Refs #944.