Skip to content

Add proxy endpoints for iOS app secret migration#220

Open
jakebromberg wants to merge 1 commit intomainfrom
feature/proxy-endpoints
Open

Add proxy endpoints for iOS app secret migration#220
jakebromberg wants to merge 1 commit intomainfrom
feature/proxy-endpoints

Conversation

@jakebromberg
Copy link
Member

Summary

  • Add GET /config endpoint (unauthenticated) for iOS app bootstrap configuration
  • Add 5 proxy endpoints under /proxy/* with anonymous session auth and rate limiting: artwork search, album metadata, artist metadata, entity resolution, Spotify track lookup
  • Add proxyRateLimit middleware (120 req/60s per user)
  • All proxy handlers delegate to existing services (no new external API integrations)
  • 25 unit tests covering validation, happy paths, error handling, and cache headers

Closes #219

Test plan

  • npm run test:unit passes (25 new tests)
  • Lint clean on all new/modified files
  • Manual verification: curl localhost:8080/config returns config (no auth)
  • Manual verification: curl localhost:8080/proxy/artwork/search?artistName=Radiohead returns 401 without session
  • Manual verification: authenticated proxy requests return data with correct cache headers

Add server-side proxy endpoints that allow the iOS app to call Discogs, Spotify, and Apple Music APIs through Backend-Service instead of embedding API credentials in the binary.

New endpoints:
- GET /config -- unauthenticated bootstrap configuration (PostHog key, request-o-matic URL)
- GET /proxy/artwork/search -- artwork lookup via ArtworkFinder
- GET /proxy/metadata/album -- album metadata from Discogs + Spotify + Apple Music + search URLs
- GET /proxy/metadata/artist -- artist bio + Wikipedia from Discogs by artist ID
- GET /proxy/entity/resolve -- resolve Discogs entity (artist/release/master) by ID
- GET /proxy/spotify/track/:id -- Spotify track metadata using backend credentials

All /proxy/* endpoints require anonymous session auth (requireAnonymousAuth) and rate limiting (120 req/60s per user). The /config endpoint is intentionally unauthenticated since the app needs it before authenticating.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add proxy endpoints for iOS app secret migration

2 participants