Skip to content

Pass solana wallet via user context for all track endpoints#741

Merged
raymondjacobson merged 2 commits intomainfrom
ray/solana-wallet-context
Mar 27, 2026
Merged

Pass solana wallet via user context for all track endpoints#741
raymondjacobson merged 2 commits intomainfrom
ray/solana-wallet-context

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

Summary

  • Moves solana wallet from TracksParams.SolanaWallet to the Go context, so every endpoint that fetches tracks gets wallet-based token gate checks automatically
  • Middleware now calls c.SetUserContext(context.WithValue(...)) alongside c.Locals()
  • TracksKeyed reads the wallet from ctx.Value("solanaWallet") instead of arg.SolanaWallet
  • Removes per-endpoint wiring (previously only v1_track_stream passed it through)

Test plan

  • Wallet-only auth: connect Solana wallet, track listing shows "Access granted" for coin-gated tracks
  • OAuth auth: sign in with Audius, access checks still work via sol_user_balances
  • Stream endpoint still works with wallet auth
  • No regression on unauthenticated track listing

🤖 Generated with Claude Code

raymondjacobson and others added 2 commits March 27, 2026 16:33
The middleware now sets the verified wallet on the Go context
(c.SetUserContext) in addition to fiber Locals. TracksKeyed reads
it from ctx.Value, so every endpoint that fetches tracks gets
wallet-based token gate checks automatically — no per-handler
wiring needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@raymondjacobson raymondjacobson changed the title Pass solana wallet via Go context for all track endpoints Pass solana wallet via user context for all track endpoints Mar 27, 2026
@raymondjacobson raymondjacobson merged commit fe05114 into main Mar 27, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the ray/solana-wallet-context branch March 27, 2026 23:50
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.

1 participant