fix(migrate-tool): use apiKey+apiSecret for server-side SDK auth instead of bearer token#14496
Merged
Merged
Conversation
…ead of bearer token The server-side SDK in api/_lib/audius.ts now initializes createSdkWithServices with apiKey + apiSecret (Basic auth) rather than a bearer token. apiSecret authenticates the developer app and signs its requests server-side, which is cleaner for app-level operations and never exposed to the browser. Updates .env.example and README accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #14392. Switches the migrate-tool's server-side SDK initialization from a bearer token to
apiKey+apiSecret(Basic auth), which is cleaner for app-level server-side operations.The SDK's EntityManager relay call in
manageEntityaccepts eitherAuthorization: Bearer <bearerToken>orBasic base64(apiKey:apiSecret). UsingapiKey+apiSecretlets the developer app authenticate and sign its own requests server-side without an OAuth-derived bearer token.Changes
api/_lib/audius.ts—getServerSDK()now readsAUDIUS_API_SECRETand passesapiSecrettocreateSdkWithServicesinstead ofbearerToken. Updated error message and doc comment..env.example—AUDIUS_BEARER_TOKEN→AUDIUS_API_SECRET.README.md— env var documentation updated to reference the API Secret.The unrelated
ADMIN_BEARER_TOKENescape hatch for admin endpoints is untouched.Verification
tsc -bpasses.vite buildpasses (polyfill issue resolved by the vite-plugin-node-polyfills 0.17.0 pin from feat(migrate-tool): add track migration tool #14392).🤖 Generated with Claude Code