Dashboard › cli › Distillation
dc5117e9-faf2-4a05-9437-55b5875a6fdc["lore_tm_v1_6UN8MeoiibGFOH3mYfdeE2o3Xzyb2k52wmP1TvkICfI","lore_tm_v1_fGkXTQA-wnvm7JsYGYGtFj8-GGP_-bOn7oalqbKzdgE","lore_tm_v1_2a5AW1NAwnf5tWxel4ZK17KuK3Mp8pJTKUegQMCvgho","lore_tm_v1_vKoYt7hhn2cGElnNdrJSTm9G2vJi5FZ-r7GKbtQsq-E","lore_tm_v1_woK6PVhkweUYf58GSjIFtGLD7fCbBr0Er31503ra0lQ"]
Date: Sep 10, 2026
sntrys_ token has format sntrys_<base64(JSON{iat, url, region_url, org})>_<random-secret> and that standard Base64 contains no _, so the second underscore always separates payload from secret..sentryclirc files are never consulted when snapshotting an environment-token host because they have weaker integrity than environment values or token claims.apiRequestToRegion always sends JSON and explicitly sets its Content-Type; SDK functions set their own Content-Type."done" or "throw".throwOnError for @sentry/api SDK request configuration is always false, because CLI code handles errors itself.parseSntrysClaim() in packages/cli/src/lib/token-claims.ts accepts only nonempty sntrys_ tokens up to MAX_TOKEN_LENGTH = 2048, requires exactly 2 underscores, Base64-decodes and JSON-parses the payload, requires truthy iat and nonempty string url, and returns { url, regionUrl, org } with optional nonempty region_url and org.packages/cli/src/lib/token-host.ts: exact normalized-origin equality is trusted; SaaS tokens scoped to https://sentry.io also trust https default-port *.sentry.io origins; non-SaaS origins never use suffix/subdomain matching. Invalid or absent trusted origins return false.getActiveTokenHost() uses stored OAuth token host over an environment token unless SENTRY_FORCE_ENV_TOKEN is nonempty; it otherwise uses getEnvTokenHost() when an environment token exists.registerLoginTrustAnchor() pins a normalized explicit login URL for the process; isLoginTrustAnchorFor() requires host-scoped matching rather than merely anchor existence, preventing stale anchors from admitting a different auth login --url <other-host> target in library/test mode. resetLoginTrustAnchorForTesting() clears it.isRequestOriginTrusted() permits all origins when no token is active; with a token, it requires host trust or isTrustedRegionOrigin(). isRequestOriginTrustedForCustomHeaders() permits custom headers only for an active token's trusted origin, or when no token exists for a matching explicit login trust anchor; otherwise it fails closed.captureEnvTokenHost() in packages/cli/src/lib/env-token-host.ts is idempotent and resolves the pinned environment-token host in this order: normalized sntrys_ embedded claim url; normalized SENTRY_HOST or SENTRY_URL; then DEFAULT_SENTRY_URL. getEnvTokenHost() auto-captures for library-mode callers; resetEnvTokenHostForTesting() clears the pin.src/cli.ts::preloadProjectContext before findProjectRoot, applySentryCliRcEnvShim, and getDefaultUrl(), because later paths may populate .sentryclirc state or write env.SENTRY_URL.User-Agent, response-cache age hints, automatic cache invalidation after successful non-GET mutations, and retry logging formatted as ${method} ${new URL(fullUrl).pathname} → retry ${attempt + 1}/${MAX_RETRIES} after ${delay}ms.