summaryrefslogtreecommitdiff
path: root/player-server/internal/service/auth.go
AgeCommit message (Collapse)Author
2026-05-19Require explicit TokenManager in auth service (DIP)Paul Buetow
Remove the silent nil-fallback in NewAuthService that fabricated a default auth.TokenManager when callers passed nil. The service now panics on nil, forcing callers to inject their own TokenManager and keeping construction at the composition root. Production wiring (cmd/player/main.go) already constructs the TokenManager explicitly via auth.NewTokenManager(); test call sites in internal/api/handlers_test.go and handlers_podcast_test.go that used to pass nil now pass auth.NewTokenManager() to honour the new contract. Mirrors the pattern set in commit 622827c (http.Client in podcast service). Refs task 7a. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19Return error from tokenManager.Generate instead of panickingPaul Buetow
A crypto/rand.Read failure is a process-level emergency, but the previous implementation aborted the entire server. Propagate the error through the TokenManager interface so callers (CreateAPIToken) can surface it via the normal HTTP 500 path instead of crashing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17Add Bearer token authentication alongside session cookiesPaul Buetow
2026-05-17Restructure repo: move Go server into player-server/Paul Buetow