diff --git a/.changeset/default-token-service.md b/.changeset/default-token-service.md new file mode 100644 index 0000000..8380d07 --- /dev/null +++ b/.changeset/default-token-service.md @@ -0,0 +1,7 @@ +--- +'@reactivapp/cli': minor +--- + +The default token service endpoint is now `plus-devtools.reactivapp.com`. `REACTIV_VENDING_API_URL` still overrides it. + +An API key issued for the earlier endpoint is not valid on this one: get a new key and run `reactiv login` again. diff --git a/docs/public-npm-release-checklist.md b/docs/public-npm-release-checklist.md index 009602c..70337d6 100644 --- a/docs/public-npm-release-checklist.md +++ b/docs/public-npm-release-checklist.md @@ -41,7 +41,7 @@ Every host in shipped code today (informational snapshot; the enforced source of | --- | --- | --- | | `127.0.0.1` | `dist/commands/app/run.js`, `dist/lib/auth/vending-client.js` | `reactiv app run` checks whether a Metro dev server already holds port 8081 on the developer's own machine; the token-service client accepts a plain-http `REACTIV_VENDING_API_URL` override only on loopback (mock servers) | | `[::1]` | `dist/lib/auth/vending-client.js` | IPv6 loopback literal for the same plain-http mock-server override | -| `plus-devtools-staging.dev.reactivapp.com` | `dist/lib/auth/vending-client.js` | The token service the CLI uses by default (`DEFAULT_VENDING_API_URL`); by default the only service the CLI sends the API key to, the `REACTIV_VENDING_API_URL` override being the one way to change that. This hostname is the shipped default today; a later release switches the default to `plus-devtools.reactivapp.com`. Other environments are reached through the `REACTIV_VENDING_API_URL` override | +| `plus-devtools.reactivapp.com` | `dist/lib/auth/vending-client.js` | The token service the CLI uses by default (`DEFAULT_VENDING_API_URL`); by default the only service the CLI sends the API key to, the `REACTIV_VENDING_API_URL` override being the one way to change that. Other environments are reached through the `REACTIV_VENDING_API_URL` override | | `github.com` | `package.json` `repository` | npm provenance requires the repository URL to match the publishing repository | No registry URL ships in the CLI: both registry URLs come from the token service's response, and the CLI writes a token only after checking each one is an https endpoint on the expected registry host shape. That check needs a generic host pattern (it names no account, domain or region), which the internal-infrastructure rule would otherwise flag; the exact pattern literal and its refusal message are the two entries in `allowedLiterals` in `scripts/pack-allowlist.json`. Only those exact strings are exempt; the same markers anywhere else still fail the gate. diff --git a/packages/cli/src/lib/auth/vending-client.ts b/packages/cli/src/lib/auth/vending-client.ts index 7fea325..fbaad39 100644 --- a/packages/cli/src/lib/auth/vending-client.ts +++ b/packages/cli/src/lib/auth/vending-client.ts @@ -3,7 +3,7 @@ import type {ErrorCode, ErrorResponse, MeResponse, TermsAcceptRequest, TermsAcce import type {SubmitRequest, SubmitResponse} from './contract/submit' import {AuthError} from './errors' -export const DEFAULT_VENDING_API_URL = 'https://plus-devtools-staging.dev.reactivapp.com' +export const DEFAULT_VENDING_API_URL = 'https://plus-devtools.reactivapp.com' export const VENDING_URL_ENV = 'REACTIV_VENDING_API_URL' export const REQUEST_TIMEOUT_MS = 10_000 diff --git a/scripts/internal-reference-allowlist.json b/scripts/internal-reference-allowlist.json index 30fa1ec..c15a930 100644 --- a/scripts/internal-reference-allowlist.json +++ b/scripts/internal-reference-allowlist.json @@ -10,11 +10,11 @@ }, { "host": "plus-devtools-staging.dev.reactivapp.com", - "reason": "the Reactiv token service the CLI talks to by default today" + "reason": "the earlier default hostname of the Reactiv token service, named in the changelog" }, { "host": "plus-devtools.reactivapp.com", - "reason": "the production hostname of the Reactiv token service, named in the release checklist as the default a later release switches to" + "reason": "the Reactiv token service the CLI talks to by default" }, { "host": "github.com", diff --git a/scripts/pack-allowlist.json b/scripts/pack-allowlist.json index 7a6646a..61bc933 100644 --- a/scripts/pack-allowlist.json +++ b/scripts/pack-allowlist.json @@ -38,7 +38,7 @@ "reason": "IPv6 loopback literal; the CLI accepts an http REACTIV_VENDING_API_URL override only on loopback addresses (mock servers)" }, { - "host": "plus-devtools-staging.dev.reactivapp.com", + "host": "plus-devtools.reactivapp.com", "reason": "default Reactiv token-vending API endpoint (DEFAULT_VENDING_API_URL); the only service the CLI sends the API key to" }, { diff --git a/scripts/test/pack-rules.test.mjs b/scripts/test/pack-rules.test.mjs index 7fdf63b..eb41016 100644 --- a/scripts/test/pack-rules.test.mjs +++ b/scripts/test/pack-rules.test.mjs @@ -161,7 +161,7 @@ describe('secret scan (scripts/secret-patterns.ere)', () => { describe('endpoint allowlist', () => { it('passes allowed hosts', () => { - const content = "http.get({host: '127.0.0.1'}); fetch('https://plus-devtools-staging.dev.reactivapp.com/v1/me'); 'git+https://github.com/reactivapp/cli.git'" + const content = "http.get({host: '127.0.0.1'}); fetch('https://plus-devtools.reactivapp.com/v1/me'); 'git+https://github.com/reactivapp/cli.git'" assert.deepEqual(findEndpointProblems('dist/x.js', content, config.allowedHosts), []) })