Repository navigation
fix(tools): Explain whoami's 400 for tokens with no user - #2316
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Sentry's /auth/ endpoint returns a bodiless 400 when no user stands behind the token, as with org auth tokens. whoami passed that through as a generic HTTP 400 input error, so agents could not tell the token type was the problem. Say the token is not tied to a user and that org auth tokens only carry org:ci. Refs #2315
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was successfully deployed
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.
When no user stands behind a token, as with an org auth token (
sntrys_...), Sentry'sGET /api/0/auth/returns a 400 with no body (sentrysrc/sentry/api/endpoints/auth_index.py:63-65).whoamipassed that through the generic Input Error template as "There was an HTTP 400 error...", so the agent that hit it in MCP feedback couldn't tell that the token type was the problem.whoaminow turns that 400 into aUserInputError. The message says the token isn't tied to a user, that org auth tokens only carryorg:ci(sentrysrc/sentry/models/orgauthtoken.py:36), and that the user should connect with a personal auth token or OAuth instead. Other errors behave as before.Out of scope: rejecting
sntrys_tokens up front inSentry-Bearermode. The issue notes it as a follow-up.Refs #2315
via automation
evt_905b9c478746fd9deeb853f85ad7441b· Run IDdispatch_d428b39c5339ad27cbfcee6c1a8f7e77.--
View Session [Sentry]