mitbringsl/backend
Tronax a5ef8cf3ba
Backend Phase B (2/2): OIDC auth + config validation
- internal/auth/oidc.go: OIDCService mit go-oidc v3
  - id_token-Verifikation via JWKS (Signatur, iss, aud, exp)
  - Provider-Caching (sync.Map, lazy init per Issuer-URL)
  - Unterstützt Google + Generic OIDC
- internal/auth/user.go: GetByOIDCSubject + CreateOIDCUser
  (find-or-create via (oidc_issuer, oidc_subject))
- internal/httpapi/auth.go: POST /auth/oidc Handler
  (id_token verifiziern → find-or-create User → issueSession)
- internal/httpapi/api.go: /auth/oidc Route verdrahtet
- internal/config/config.go: OIDC-Validierung
  (enabled → client_id + issuer Pflicht)
- go.mod/go.sum: go-oidc/v3 + oauth2 Abhängigkeiten
- AGENTS.md: Phase B vollständig als erledigt markiert

Verifiziert: E2E gegen lokalen Mock-IdP (Discovery → JWKS →
signiertes id_token → User angelegt → 2. Login gleicher User →
tampered Token → 401). Alle Fehlerpfade geprüft.

go build ./... && go vet ./... && go test ./internal/auth/... 
2026-08-05 19:45:00 +02:00
..
cmd Backend Phase A: foundation, migrations, Docker setup 2026-08-05 15:14:37 +02:00
internal Backend Phase B (2/2): OIDC auth + config validation 2026-08-05 19:45:00 +02:00
migrations Backend Phase A: foundation, migrations, Docker setup 2026-08-05 15:14:37 +02:00
.dockerignore Backend Phase A: foundation, migrations, Docker setup 2026-08-05 15:14:37 +02:00
Dockerfile Backend Phase A: foundation, migrations, Docker setup 2026-08-05 15:14:37 +02:00
go.mod Backend Phase B (2/2): OIDC auth + config validation 2026-08-05 19:45:00 +02:00
go.sum Backend Phase B (2/2): OIDC auth + config validation 2026-08-05 19:45:00 +02:00