Dashboard › cli › Distillation
34386b08-211c-4e3c-b055-c412100ce056["lore_tm_v1_TJ0QP6vX5yqXS03YHmSRfOEyCnYUBMJUK36X24OSbfk","lore_tm_v1_u9EuYza5OUGQH20iaN8HOEtAPii9cEoY7tNMe0sbcmM","lore_tm_v1_wtz9cFqZ4ljLKoyXgFO9fTT54vlomSSWHlr74J5ij7k","lore_tm_v1_TivjGowaVfaGBNskafTEz9iSJyb_Gv1IrrfKQnbo1fc"]
Date: Sep 10, 2026
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus; repository branch is chore/preshape-monorepo, HEAD is 605e8318d1f316bd28f53763f71ed716d1869616 (605e8318d chore: regenerate docs), base reference shown is 0b43edad47386844ece1f9f288310e2683afce49, and the patch checksum shown is d23acb520090d4c7431575e80a0497b112a8ce284254e36cd10edca27e01c08c..lore.md; 10 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/*.md files (dashboard.md, event.md, explore.md, feedback.md, issue.md, log.md, replay.md, span.md, trace.md); packages/cli/src/lib/constants.ts; packages/cli/src/lib/sentry-client.ts; packages/cli/test/lib/constants.test.ts; and packages/cli/test/lib/security/sntrys-claim-mismatch.test.ts.packages/cli/src/lib/constants.ts: getConfiguredSentryUrl() now reads const env = getEnv(); and returns normalizeUrl(env.SENTRY_HOST) ?? normalizeUrl(env.SENTRY_URL) rather than normalizeUrl(getEnv().SENTRY_HOST || getEnv().SENTRY_URL || undefined). This makes a whitespace/invalid SENTRY_HOST fall through to a valid normalized SENTRY_URL; documentation now calls these βexplicit environment configuration.βpackages/cli/test/lib/constants.test.ts test "ignores an empty SENTRY_HOST in favor of SENTRY_URL": with SENTRY_HOST = " " and SENTRY_URL = "https://configured.example.com", getConfiguredSentryUrl() must equal "https://configured.example.com".packages/cli/src/lib/sentry-client.ts: both getApiBaseUrl() and getControlSiloUrl() now resolve getConfiguredSentryUrl() ?? getActiveTokenHost() ?? DEFAULT_SENTRY_URL, adding active credential trusted-host routing after explicit SENTRY_HOST/SENTRY_URL configuration and before SaaS fallback.packages/cli/test/lib/security/sntrys-claim-mismatch.test.ts: imports useTestConfigDir from ../../helpers.js; adds SENTRY_FORCE_ENV_TOKEN to sandboxed ENV_KEYS; and calls useTestConfigDir("sntrys-claim-mismatch-")."claim URL routes requests when no explicit URL is configured" in sntrys-claim-mismatch.test.ts: a minted sntrys_ SENTRY_AUTH_TOKEN claim with iat: 1_700_000_000, url: "http://localhost:8000", and org: "x" makes getApiBaseUrl() return "http://localhost:8000"; apiRequestToRegion(baseUrl, "/organizations/", { method: "GET" }) performs one request to "http://localhost:8000/api/0/organizations/" with Bearer authorization."stored OAuth host takes precedence over an inactive env token claim": setAuthToken("stored-oauth-token", undefined, undefined, { host: "https://stored.example.com" }) plus an env sntrys_ token claiming "https://claimed.example.com" produces base URL "https://stored.example.com" and one request to "https://stored.example.com/api/0/organizations/" with exactly auth: "Bearer stored-oauth-token"."invalid claim URL falls back to SaaS": a minted env sntrys_ token with claim url: "not a URL" makes getApiBaseUrl() return "https://sentry.io".packages/cli/src/lib/token-host.ts as defining isHostTrusted() and getActiveTokenHost(); getActiveTokenHost() accounts for SENTRY_FORCE_ENV_TOKEN, and isHostTrustedForClaim() is specifically claim-anchored. packages/cli/src/lib/token-claims.ts documents sntrys_<base64(JSON{iat, url, region_url, org})>_<random-secret>; claims are not signed, and claim parsing returns undefined for non-sntrys_ tokens or invalid payloads.packages/cli/src/lib/env-token-host.ts policy: for sntrys_ org-auth tokens, the embedded url claim is authoritative; SENTRY_HOST/SENTRY_URL are fallback host signals for non-sntrys_ tokens. packages/cli/src/lib/env-registry.ts documents stored OAuth login as default precedence over SENTRY_AUTH_TOKEN/SENTRY_TOKEN, with SENTRY_FORCE_ENV_TOKEN=1 overriding stored OAuth.packages/cli/src/lib/sentry-client.ts around lines 125β134: request authorization evaluates active token host and then, for sntrys_ claim URLs, rejects request inputs not trusted by isHostTrustedForClaim(input, claimUrl); comments state this claim check fails open on parse errors and supports multi-region behavior.