Dashboard › cli › Distillation
ab3a9c7d-e247-498c-a32c-22eada494a9c["lore_tm_v1_n8ZG947YeaXlZrXxWJrRbnPBvUfMpOc8hYeW4yUq41o","lore_tm_v1_jPCbEBC0snK_T9Fr1-NBLiJCvotTTx_cEimFvb7QGmU","lore_tm_v1_nJGrw57Nn4PY6pwmqpGpmTgyxX1XPQoEe2OydkIplo8","lore_tm_v1_vlDSOg_IL_8ULPB_fToBIs1Hh5s3CewvDjHuAb-DE6c","lore_tm_v1_j2Cq--OopE6bWAHC274dul9SQ4zASqGth-cL4kreLiM","lore_tm_v1_nfk0sqMa_fjSQ0wL6eQjrdbl55xgTKelqZHUb5tImsM"]
Date: Sep 10, 2026
getRawEnvToken() always returns the environment token if set, even when stored OAuth credentials would normally take priority; it reads trimmed SENTRY_AUTH_TOKEN first, then trimmed SENTRY_TOKEN, and returns undefined for absent, empty, or whitespace-only values.migrateNullHost() returns a migrated host and is never NULL on return.packages/cli/src/lib/db/auth.ts::migrateNullHost(row) lazily migrates pre-schema-v16 auth rows with host: NULL: obtains boot-time getEnvTokenHost(), normalizes it via normalizeOrigin(), falls back to DEFAULT_SENTRY_URL, executes UPDATE auth SET host = ? WHERE id = 1 within withDbSpan("migrateAuthHost", ...), logs the migrated host, assigns row.host, and retries on a later access if the non-fatal DB write fails.packages/cli/src/lib/db/auth.ts defines REFRESH_THRESHOLD = 0.1, DEFAULT_TOKEN_LIFETIME_MS = 3600 * 1000, ENV_SOURCE_PREFIX = "env:", AuthSource = "env:SENTRY_AUTH_TOKEN" | "env:SENTRY_TOKEN" | "oauth", and AuthConfig fields token, refreshToken, expiresAt, issuedAt, and required source.packages/cli/test/helpers.ts::useEnvSandbox(keys) saves each listed process.env value and deletes those keys before every test, then restores or deletes each key after every test; it must be invoked at module scope or inside a describe() block.packages/cli/test/helpers.ts::resetHostScopingState() dynamically imports and calls resetEnvTokenHostForTesting(), regions.resetTrustedRegionUrlsForTesting(), and resetLoginTrustAnchorForTesting() to prevent env-token snapshot, login trust-anchor, and trusted-region URL state from bleeding between tests.packages/cli/test/helpers.ts::mintSntrysToken(payload) produces sntrys_<base64-payload>_test-secret-tail; it JSON-serializes the payload, base64-encodes UTF-8 content, strips = padding to match the serverβs b64encode().rstrip("="), and uses a fixed irrelevant secret tail.packages/cli/package.json: package sentry is version 0.40.0-dev.0, uses ESM ("type": "module"), requires Node >=18.0 with development runtime Node >=22.15, and specifies pnpm@10.11.0.packages/cli/package.json test scripts: test runs pnpm run test:unit; test:unit generates docs and SDK then runs vitest run test/lib test/commands test/types test/script --coverage; test:changed runs vitest run --changed; test:e2e runs vitest run test/e2e; test:init-eval runs vitest run test/init-eval --testTimeout 600000.