e2c99058855913aa6520b6f44b7f629cbbe9ccba
Favorites / now-playing / playlists were being served by the platform router straight from Postgres, which violated the intended split (officer = auth + proxy; officer-music = the whole /api/music/* contract). Move them into the sidecar so it owns ALL music endpoints — library AND user state. - sidecar (index.ts): serves /favorites, /now-playing, /playlists[/:id[/items]] backed by Postgres (the same officerdb queries other sidecars already use). The authenticated user id arrives in X-Officer-User; the sidecar is loopback- only, so it trusts the header (401 if absent). HTTP-contract comment updated. - platform (router.ts): reduced to a pure auth+proxy catch-all — it now injects X-Officer-User from the authenticated ctx user and forwards the request body (favorites/now-playing/playlist writes carry JSON) in addition to Range/query. No schema change — the tables are unchanged, only WHERE they're served moves. Verified live: booted the real sidecar against the live DB and exercised the endpoints with the X-Officer-User header — 401-without-header, favorites round- trip, and full playlist CRUD with ownership scoping all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
No description provided
51 MiB
Languages
TypeScript
84.6%
CSS
6.7%
Shell
5%
JavaScript
3.7%