Repository navigation
fix(auth): name .sentryclirc as token source in ignored-token hint - #1346
Conversation
|
|
marked ready — all required checks are green (Build/Unit Tests, Lint & Typecheck, Warden, Semgrep, Secret Scan, Dependency Review). self-review turned up nothing. @BYK, tagged you since you filed the issue; this only fixes the incorrect source in the hint, the token-trust/precedence rework is left for a separate discussion. |
BYK
left a comment
There was a problem hiding this comment.
Looks good except for the one question I asked.
When you are done with this PR, move on to the other one. Make sure we don't violate our security model in that.
When a token is set in .sentryclirc, the env shim copies it into SENTRY_AUTH_TOKEN. The env-token-ignored hint then claimed the user set a SENTRY_AUTH_TOKEN env var, which is misleading — the source was a config file. Record the injecting .sentryclirc path in the shim and have the hint name it instead. Fixes #1345
Collapse the redundant getter JSDoc into a one-liner and note the module-local + getter mirrors the pinnedHost snapshot pattern already used in env-token-host.ts, per review feedback.
6878e04 to
913102c
Compare
|
heads up: the required |
The env-token-ignored hint claimed the user set a
SENTRY_AUTH_TOKENenv var even when the token actually came from a[auth] tokenin.sentryclirc(the shim copies it intoSENTRY_AUTH_TOKENat boot). The shim now records the injecting.sentryclircpath and the hint names it instead, so the source is accurate.Scoped to the incorrect-source bug from #1345. The larger behavior proposal in the issue (trust org/host-embedded tokens, only fall back to the stored DB token when the other fails/can't be trusted) is a separate design change and isn't included here.
Testing
pnpm exec vitest run test/lib/auth-hint.test.ts test/lib/sentryclirc.test.ts(39 passed), pluspnpm run typecheckandpnpm run lintclean.Closes #1345