feat(api): Core-API mit Authentifizierung, CRUD und Monatsreport
- Anmeldung über Argon2id und JWT in httpOnly-Cookies, Refresh mit echter Rotation über die neue Tabelle refresh_token - AuthProvider-Protokoll als Vorbereitung für OIDC, Administrator-Anlage beim Erststart mit erzwungenem Passwortwechsel - CRUD für Konten, Kategorien (zweistufiger Baum), Firmen, Recurrences, Preisversionen, Buchungen, Budgets, Vorlagen und Sparziele - Fälligkeiten mit Overlay-Logik: abrufen, bestätigen, auslassen, zurücksetzen - Kontosalden zum Stichtag, Monatsübersicht mit Plan-Ist-Vergleich - SECRET_KEY jetzt mindestens 32 Zeichen; Platzhalter in Produktion abgelehnt - 61 neue Integrationstests, insgesamt 148 grün Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014e7t8UpmoVNMtWivY5LiSH
This commit is contained in:
@@ -1,8 +1,45 @@
|
||||
"""Sammelrouter für alle /api-Endpunkte."""
|
||||
"""Sammelrouter für alle /api-Endpunkte.
|
||||
|
||||
from fastapi import APIRouter
|
||||
Alle Routen außer `/api/auth/*`, `/api/me` und den Systemendpunkten erfordern
|
||||
eine gültige Anmeldung **und** einen abgeschlossenen Passwortwechsel.
|
||||
"""
|
||||
|
||||
from app.api.routes import system
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.api.deps import get_active_user
|
||||
from app.api.routes import (
|
||||
accounts,
|
||||
auth,
|
||||
budgets,
|
||||
categories,
|
||||
me,
|
||||
merchants,
|
||||
occurrences,
|
||||
recurrences,
|
||||
reports,
|
||||
savings_goals,
|
||||
system,
|
||||
transactions,
|
||||
)
|
||||
|
||||
api_router = APIRouter(prefix="/api")
|
||||
|
||||
# Ohne Authentifizierung erreichbar.
|
||||
api_router.include_router(system.router)
|
||||
api_router.include_router(auth.router)
|
||||
api_router.include_router(me.router)
|
||||
|
||||
# Alles Weitere nur für angemeldete Benutzer.
|
||||
protected = APIRouter(dependencies=[Depends(get_active_user)])
|
||||
protected.include_router(accounts.router)
|
||||
protected.include_router(categories.router)
|
||||
protected.include_router(merchants.router)
|
||||
protected.include_router(recurrences.router)
|
||||
protected.include_router(occurrences.router)
|
||||
protected.include_router(transactions.router)
|
||||
protected.include_router(budgets.router)
|
||||
protected.include_router(budgets.templates)
|
||||
protected.include_router(savings_goals.router)
|
||||
protected.include_router(reports.router)
|
||||
|
||||
api_router.include_router(protected)
|
||||
|
||||
Reference in New Issue
Block a user