vinindkoeb/app/core
carsten 0ee6ef2e68 Add sudo-style elevation for superadmin actions
CurrentSuperuser now requires a short-lived (5 min) elevated JWT
claim in addition to the is_superadmin flag, obtained via the new
POST /auth/elevate (no re-authentication — the user is already the
only superadmin in practice; this is a deliberate-confirmation guard
against accidentally triggering a destructive action, not a defense
against a stolen session). Regular login tokens keep working unchanged
for all non-superadmin routes; DELETE /participants/{id} from task 5
now needs a fresh /auth/elevate call, no other code changes required
since CurrentSuperuser's meaning changed underneath it.

create_access_token gained an extra_claims param (backward compatible)
to carry the elevated flag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:19:35 +02:00
..
__init__.py Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
config.py Add sudo-style elevation for superadmin actions 2026-09-28 13:19:35 +02:00
security.py Add sudo-style elevation for superadmin actions 2026-09-28 13:19:35 +02:00