Systemet til håndtering af Fælles Vinindkøb
Find a file
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
app Add sudo-style elevation for superadmin actions 2026-09-28 13:19:35 +02:00
migrations Add admin CRUD for participants (incl. active/inactive) 2026-09-28 13:05:08 +02:00
scripts Add one-off participant import script for legacy MongoDB data 2026-09-27 19:16:26 +02:00
.env.example Add sudo-style elevation for superadmin actions 2026-09-28 13:19:35 +02:00
.gitignore Add one-off participant import script for legacy MongoDB data 2026-09-27 19:16:26 +02:00
.python-version Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
alembic.ini Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
CLAUDE.md Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
pyproject.toml Add simple JWT login for User 2026-09-27 22:23:25 +02:00
README.md Scaffold FastAPI + SQLModel + Alembic project, Postgres-backed 2026-09-27 15:57:44 +02:00
uv.lock Add simple JWT login for User 2026-09-27 22:23:25 +02:00

Vinindkøb v2

Admin-backend til fælles vinindkøb (FastAPI + SQLModel + PostgreSQL + Alembic). Se CLAUDE.md for projektplan og datamodel.

Kom i gang

uv sync
cp .env.example .env   # udfyld DATABASE_URL med din egen Postgres-instans
uv run alembic upgrade head
uv run fastapi dev app/main.py

GET /health bekræfter at appen kan nå databasen.