Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/default-token-service.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion docs/public-npm-release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/auth/vending-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Comment thread
agorovyi marked this conversation as resolved.
Resolved
export const VENDING_URL_ENV = 'REACTIV_VENDING_API_URL'

export const REQUEST_TIMEOUT_MS = 10_000
Expand Down
4 changes: 2 additions & 2 deletions scripts/internal-reference-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/pack-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/pack-rules.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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), [])
})

Expand Down
Loading