Attach authorization headers, api_key, app_name to SDK relay calls#14032
Open
raymondjacobson wants to merge 4 commits intomainfrom
Open
Attach authorization headers, api_key, app_name to SDK relay calls#14032raymondjacobson wants to merge 4 commits intomainfrom
raymondjacobson wants to merge 4 commits intomainfrom
Conversation
Relay calls from EntityManagerClient didn't include any API identification, causing them to fall back to IP-based rate limiting at 5 RPS. Batch uploads (e.g. 22 tracks) easily exceed this limit. Thread apiKey/appName through to EntityManagerClient and append them as query params on /relay requests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 33a97ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14032.audius.workers.dev Unique preview for this PR (deployed from this branch). |
Relay calls now send an Authorization header so the server's rate limit middleware can identify the app via getApiSigner. Prefers Bearer token (OAuth/PKCE), falls back to Basic auth (apiKey:apiSecret), with api_key/app_name query params as a final fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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
EntityManagerClient.manageEntitydidn't include any API identification, causing them to fall back to IP-based rate limiting at 5 RPS defaultPromise.all) exceed this limit, causing "API Rate Limit Exceeded" errorsAuthorizationheader to relay calls: prefersBearertoken (OAuth/PKCE), falls back toBasicauth (apiKey:apiSecret)api_keyandapp_nameas query params for fallback identificationCompanion server-side PR: AudiusProject/api#745
Test plan
Authorizationheader when bearerToken or apiSecret is configuredapi_key/app_namequery params in network tab🤖 Generated with Claude Code