Skip to content

feat(api): Let getsentry add API authentication classes - #127086

Merged
scttcper merged 2 commits into
masterfrom
scttcper/extra-api-authentication
Oct 13, 2026
Merged

scttcper merged 2 commits into
masterfrom
scttcper/extra-api-authentication

Conversation

@scttcper

@scttcper scttcper commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Vercel Marketplace builds are moving from SENTRY_AUTH_TOKEN to short-lived OIDC tokens from Vercel. The class that checks them lives in getsentry (getsentry/getsentry#22439), this adds a hook so getsentry can put it in front of our token auth. Empty by default, also adds the organizations:integrations-vercel-oidc-auth flag.

getsentry builds an AuthenticatedToken(kind="api_token") from the org’s Vercel internal integration, since there’s no ApiToken row behind it.

scttcper and others added 2 commits October 9, 2026 12:05
Adds SENTRY_EXTRA_API_AUTHENTICATION, import paths of authentication
classes tried before Sentry's own. getsentry will use it to accept
Vercel's OIDC tokens from builds, so the Vercel code stays in getsentry.

Also registers organizations:integrations-vercel-oidc-auth to gate it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
they can't import sentry.api.base at the top level, even indirectly, or
you get a circular import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 9, 2026
@linear-code

linear-code Bot commented Oct 9, 2026

Copy link
Copy Markdown

IE-68

@scttcper
scttcper marked this pull request as ready for review October 9, 2026 20:38
@scttcper
scttcper requested a review from a team as a code owner October 9, 2026 20:38
@scttcper
scttcper requested review from a team and removed request for a team October 9, 2026 20:38
@scttcper
scttcper merged commit ba45e3d into master Oct 13, 2026
98 checks passed
@scttcper
scttcper deleted the scttcper/extra-api-authentication branch October 13, 2026 21:25
scttcper added a commit that referenced this pull request Oct 16, 2026
`AuthenticationMiddleware` doesn't know about
`SENTRY_EXTRA_API_AUTHENTICATION` (#127086), so getsentry's Vercel build
tokens get rate limited per IP instead of per org like the token they
replace.

The middleware now tries those classes first, and `get_rate_limit_key`
uses the token's org when there's no `ApiToken` row. No change without
getsentry, tested end to end in getsentry/getsentry#22522.

refs
https://linear.app/getsentry/issue/IE-89/rate-limit-vercel-build-tokens-per-org-not-per-ip

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
RudraPatel2003 pushed a commit that referenced this pull request Oct 19, 2026
`AuthenticationMiddleware` doesn't know about
`SENTRY_EXTRA_API_AUTHENTICATION` (#127086), so getsentry's Vercel build
tokens get rate limited per IP instead of per org like the token they
replace.

The middleware now tries those classes first, and `get_rate_limit_key`
uses the token's org when there's no `ApiToken` row. No change without
getsentry, tested end to end in getsentry/getsentry#22522.

refs
https://linear.app/getsentry/issue/IE-89/rate-limit-vercel-build-tokens-per-org-not-per-ip

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants