requestshield 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -68
- package/config/.env.prod +1 -0
- package/package.json +1 -1
- package/skills/requestshield/SKILL.md +20 -17
- package/skills/requestshield/assets/AGENTS.codex.md +5 -3
- package/skills/requestshield/references/backend-java-core.md +3 -3
- package/skills/requestshield/references/backend-spring-boot.md +3 -3
- package/skills/requestshield/references/browser-manual.md +1 -1
- package/skills/requestshield/references/cli.md +92 -28
- package/skills/requestshield/references/integration-planning.md +10 -8
- package/skills/requestshield/references/troubleshooting.md +2 -2
- package/src/api-client.mjs +1 -1
- package/src/args.mjs +98 -106
- package/src/cli.mjs +69 -243
- package/src/command-registry.mjs +97 -0
- package/src/commands/agent-setup.mjs +24 -17
- package/src/commands/agent-status.mjs +60 -0
- package/src/commands/application-mutations.mjs +8 -4
- package/src/commands/apps-get.mjs +12 -4
- package/src/commands/apps-list.mjs +20 -13
- package/src/commands/contract.mjs +25 -0
- package/src/commands/keys-create.mjs +5 -2
- package/src/commands/mutation-support.mjs +26 -12
- package/src/commands/output.mjs +21 -0
- package/src/commands/secret-commands.mjs +13 -6
- package/src/commands/signin.mjs +17 -8
- package/src/commands/signout.mjs +7 -3
- package/src/commands/update-check.mjs +97 -43
- package/src/config.mjs +29 -3
- package/src/entrypoint.mjs +20 -13
- package/src/integration-contract-client.mjs +81 -0
- package/src/integration-contract.mjs +104 -0
- package/src/oauth-client.mjs +2 -2
- package/src/oauth-loopback.mjs +1 -1
- package/src/session-files.mjs +4 -4
- package/src/session-store.mjs +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# RequestShield CLI
|
|
2
2
|
|
|
3
3
|
Customer-facing CLI for IntelliFend RequestShield. It allows customers to sign
|
|
4
|
-
in, manage applications and their credentials, install the RequestShield Skill
|
|
4
|
+
in, inspect public SDK integration metadata, manage applications and their credentials, install the RequestShield Skill
|
|
5
5
|
for Codex or Claude, and update an npm-installed CLI.
|
|
6
6
|
|
|
7
|
-
Current package version: `0.1.
|
|
7
|
+
Current package version: `0.1.5`.
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
11
|
- Node.js 22.13 or newer.
|
|
12
|
-
- A RequestShield customer management API
|
|
12
|
+
- A RequestShield customer management API for application/secret commands and a
|
|
13
|
+
public customer-docs host for `contract`.
|
|
13
14
|
- npm for local development and publishing.
|
|
14
15
|
|
|
15
16
|
The public npm package installs only `requestshield`, using production
|
|
@@ -31,58 +32,157 @@ runners, not packages fetched from the registry. From the parent
|
|
|
31
32
|
and may search dependencies or the registry instead.
|
|
32
33
|
|
|
33
34
|
Each runner reads its package-relative file directly with Node.js `parseEnv`.
|
|
34
|
-
It does not load a `.env` from the current working directory or read OAuth/API
|
|
35
|
+
It does not load a `.env` from the current working directory or read OAuth/API/docs
|
|
35
36
|
settings from `process.env`. Shell variables cannot switch the selected profile
|
|
36
37
|
or override its configuration. Missing STG/PROD values fail explicitly and never
|
|
37
38
|
fall back to QAT.
|
|
38
39
|
|
|
39
40
|
These files contain only public product settings: `OAUTH_ISSUER`,
|
|
40
|
-
`OAUTH_CLIENT_ID`, `API_URL` and optional `OAUTH_AUTHORIZATION_ISSUER`. They must never contain
|
|
41
|
+
`OAUTH_CLIENT_ID`, `API_URL`, `DOCS_URL` and optional `OAUTH_AUTHORIZATION_ISSUER`. They must never contain
|
|
41
42
|
access tokens, refresh tokens, client secrets or application API secrets. Release
|
|
42
43
|
maintainers must populate the production public settings before publishing a
|
|
43
44
|
working production sign-in flow. The npm package includes only `.env.prod`;
|
|
44
45
|
QAT/STG files and the private development package are excluded.
|
|
45
46
|
|
|
46
|
-
##
|
|
47
|
+
## Command reference
|
|
47
48
|
|
|
48
49
|
Examples use the production command. From `requestshield-cli/`, substitute
|
|
49
50
|
`npx --offline --prefix ./dev requestshield-qat` or `requestshield-stg` for local
|
|
50
51
|
QAT/STG runs. Plain `npx requestshield-qat` requires `requestshield-cli/dev/`.
|
|
51
52
|
|
|
53
|
+
General commands such as `login`, `logout` and `contract` run at the top level.
|
|
54
|
+
Resource commands use groups with positional names and App Keys. All result
|
|
55
|
+
commands support `--json`; help and version remain text. Group names alone show
|
|
56
|
+
their help, and `requestshield app create --help` shows command-specific help
|
|
57
|
+
without configuration, authentication or network access.
|
|
58
|
+
The catalog contains 23 entrypoints: 19 implemented commands and four placeholders.
|
|
59
|
+
|
|
60
|
+
| Command after `requestshield` | Availability | Purpose |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| `--help`, `-h` | Implemented | Show all commands. |
|
|
63
|
+
| `--version`, `-v` | Implemented | Show the CLI version. |
|
|
64
|
+
| `login [--no-open]` | Implemented | Sign in through the browser. |
|
|
65
|
+
| `logout` | Implemented | Delete the selected local session. |
|
|
66
|
+
| `auth status` | Implemented | Inspect local session metadata. |
|
|
67
|
+
| `app create <name>` | Implemented | Create an app and its initial secret. |
|
|
68
|
+
| `app list` | Implemented | List applications. |
|
|
69
|
+
| `app get <app-key>` | Implemented | Inspect application metadata. |
|
|
70
|
+
| `app rename <app-key> <name>` | Implemented | Rename an application. |
|
|
71
|
+
| `app enable <app-key>` | Implemented | Enable an application. |
|
|
72
|
+
| `app disable <app-key>` | Implemented | Disable an application, retaining its secret. |
|
|
73
|
+
| `secret rotate <app-key>` | Implemented | Replace the current secret. |
|
|
74
|
+
| `secret reveal <app-key>` | Implemented | Retrieve the current secret. |
|
|
75
|
+
| `secret revoke <app-key>` | Implemented | Revoke the current secret. |
|
|
76
|
+
| `agent setup [--codex \| --claude] [--force]` | Implemented | Install agent guidance. |
|
|
77
|
+
| `agent status [--codex \| --claude]` | Implemented | Inspect installed Skill files. |
|
|
78
|
+
| `update check` | Implemented | Check for a newer CLI. |
|
|
79
|
+
| `update apply [--yes]` | Implemented | Install an available update globally. |
|
|
80
|
+
| `contract` | Implemented | Read the public SDK integration manifest. |
|
|
81
|
+
| `service status` | [coming soon] | Service health. |
|
|
82
|
+
| `secret status <app-key>` | [coming soon] | Secret-status metadata. |
|
|
83
|
+
| `usage challenges <app-key>` | [coming soon] | Challenge usage. |
|
|
84
|
+
| `billing get <app-key>` | [coming soon] | Application plan and billing. |
|
|
85
|
+
|
|
86
|
+
`app list` accepts `--limit <1-100>`, `--cursor <cursor>` or `--all`.
|
|
87
|
+
Create, rename, enable, disable, rotate and revoke accept
|
|
88
|
+
`--idempotency-key <key>`. Disable, rotate, reveal and revoke accept `--yes`.
|
|
89
|
+
The usage placeholder accepts `--from <time>`, `--to <time>` and
|
|
90
|
+
`--granularity <hour|day>`.
|
|
91
|
+
|
|
92
|
+
The four `[coming soon]` commands validate syntax, then return
|
|
93
|
+
`COMMAND_UNAVAILABLE` with exit code `2` before configuration, authentication,
|
|
94
|
+
network access or filesystem changes. They never produce sample success data.
|
|
95
|
+
Secret status does not infer credentials from app status or retrieve a secret.
|
|
96
|
+
`doctor` and `app get --watch` are not supported.
|
|
97
|
+
|
|
98
|
+
### Migrating command names and output
|
|
99
|
+
|
|
100
|
+
Legacy aliases are removed: `signin`, `signout`, `apps`, `keys`, `secrets`,
|
|
101
|
+
`auth login/logout`, `server` and `get billing` are not executable commands.
|
|
102
|
+
Use `login`, `logout`, `app` and `secret` with the spellings above. Create and
|
|
103
|
+
rename take positional names; `--app-name` and `--name` are not supported.
|
|
104
|
+
Use the top-level `contract` command; `contract get` is rejected without an alias.
|
|
105
|
+
|
|
106
|
+
Human-readable output is the default. Add `--json` to scripts, including those
|
|
107
|
+
that previously parsed detail or rename without it. JSON stdout contains one
|
|
108
|
+
document; progress, prompts, idempotency keys, warnings and npm output use stderr.
|
|
109
|
+
Existing auth-status JSON and app/list/detail/rename shapes are preserved;
|
|
110
|
+
new result shapes use `{data: ...}` and errors use `{error: {code, message}}`.
|
|
111
|
+
`--json` does not grant confirmation: provide `--yes` for commands requiring it.
|
|
112
|
+
|
|
113
|
+
### Read the public integration contract
|
|
114
|
+
|
|
52
115
|
```console
|
|
53
|
-
requestshield
|
|
54
|
-
requestshield
|
|
55
|
-
requestshield signout
|
|
56
|
-
requestshield keys create --app-name <name> [--idempotency-key <key>]
|
|
57
|
-
requestshield keys rotate <app-key> [--idempotency-key <key>] [--yes]
|
|
58
|
-
requestshield keys reveal <app-key> [--yes]
|
|
59
|
-
requestshield keys revoke <app-key> [--idempotency-key <key>] [--yes]
|
|
60
|
-
requestshield apps list [--json] [--limit <1-100>] [--cursor <cursor> | --all]
|
|
61
|
-
requestshield apps get <app-key>
|
|
62
|
-
requestshield apps rename <app-key> --name <name> [--idempotency-key <key>]
|
|
63
|
-
requestshield apps enable <app-key> [--idempotency-key <key>]
|
|
64
|
-
requestshield apps disable <app-key> [--idempotency-key <key>] [--yes]
|
|
65
|
-
requestshield agent setup [--codex | --claude] [--force]
|
|
66
|
-
requestshield update check
|
|
67
|
-
requestshield --help
|
|
68
|
-
requestshield --version
|
|
116
|
+
requestshield contract
|
|
117
|
+
requestshield contract --json
|
|
69
118
|
```
|
|
70
119
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
120
|
+
This read-only command fetches `/integration-contract.json` from the selected
|
|
121
|
+
profile's public `DOCS_URL`. It works without login, saved-session access or
|
|
122
|
+
Management API requests. Missing OAuth/API settings do not prevent this command
|
|
123
|
+
when the documentation configuration is valid. It sends no authorization header
|
|
124
|
+
or cookies and writes no local files.
|
|
125
|
+
Use `requestshield contract --help` for its options.
|
|
126
|
+
|
|
127
|
+
| Profile | Configured `DOCS_URL` |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| PROD | `https://docs.intellifend.ai` |
|
|
130
|
+
| QAT | `https://docs-qat.intellifend.ai` |
|
|
131
|
+
| STG | `https://docs-stg.intellifend.ai` |
|
|
132
|
+
|
|
133
|
+
The docs build selects immutable SDK release metadata for each environment.
|
|
134
|
+
The manifest has a `{data: ...}` envelope with `schemaVersion: 1`, a
|
|
135
|
+
`contractVersion`, the selected `environment`, and these sections:
|
|
136
|
+
|
|
137
|
+
- `services`: the challenge service URL.
|
|
138
|
+
- `browser`: SDK version, versioned script URL, SHA-384 Subresource Integrity
|
|
139
|
+
(`integrity`), token header, supported modes and `cspAdditions` for
|
|
140
|
+
`script-src`, `connect-src` and `worker-src`. Merge those additions into the
|
|
141
|
+
application's policy; they are not a complete CSP.
|
|
142
|
+
- `backend`: Java SDK version, minimum JDK, Maven repository, core coordinates
|
|
143
|
+
and Spring Boot 3 MVC starter coordinates.
|
|
144
|
+
- `documentation`: links to Browser SDK installation, Java SDK installation,
|
|
145
|
+
and domains/CSP guidance.
|
|
146
|
+
|
|
147
|
+
Human output shows the metadata; `--json` preserves the validated envelope in
|
|
148
|
+
one stdout document. The CLI rejects unsupported schemas, mismatched environments
|
|
149
|
+
and invalid or oversized content. Publishing the manifest is a separate docs
|
|
150
|
+
release; its contents do not prove that linked artifacts or services are reachable.
|
|
151
|
+
|
|
152
|
+
| Failure | Error code | Exit |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| Manifest URL returns HTTP 404 | `CONTRACT_NOT_PUBLISHED` | `1` |
|
|
155
|
+
| Network failure, timeout or another unsuccessful HTTP response | `CONTRACT_FETCH_FAILED` | `1` |
|
|
156
|
+
| Invalid, oversized or incompatible manifest | `CONTRACT_INVALID` | `1` |
|
|
157
|
+
| Missing or invalid documentation configuration | `CONTRACT_CONFIG_INVALID` | `2` |
|
|
158
|
+
|
|
159
|
+
`DOCS_URL` must use HTTPS without credentials, a query or a fragment; HTTP is
|
|
160
|
+
allowed only on loopback for local testing. The CLI does not substitute another
|
|
161
|
+
profile or a built-in manifest after failure.
|
|
162
|
+
|
|
163
|
+
### Get started
|
|
164
|
+
|
|
165
|
+
```console
|
|
166
|
+
requestshield login
|
|
167
|
+
requestshield app list
|
|
168
|
+
requestshield agent setup --codex
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Use the App Key of an existing app from the list, or explicitly create an app
|
|
172
|
+
with `requestshield app create "Checkout API"`. Store its initial secret in your
|
|
173
|
+
backend secret manager. Install agent guidance with `--codex` or `--claude` as
|
|
174
|
+
needed; app creation and Skill installation are separate commands.
|
|
75
175
|
|
|
76
176
|
### Sign in
|
|
77
177
|
|
|
78
178
|
```console
|
|
79
|
-
requestshield
|
|
179
|
+
requestshield login
|
|
80
180
|
```
|
|
81
181
|
|
|
82
182
|
Opens the configured login portal in your browser using Authorization Code with
|
|
83
183
|
S256 PKCE. Sign in, verify your email if needed, then approve the displayed
|
|
84
184
|
permissions. The browser must run on the same machine as the CLI. Use
|
|
85
|
-
`requestshield
|
|
185
|
+
`requestshield login --no-open` to open the printed authorization URL yourself.
|
|
86
186
|
If automatic browser opening fails, the CLI also prints that URL.
|
|
87
187
|
|
|
88
188
|
The CLI listens only on `127.0.0.1` at a dynamically allocated port and waits up
|
|
@@ -144,7 +244,7 @@ implemented.
|
|
|
144
244
|
|
|
145
245
|
```console
|
|
146
246
|
requestshield auth status --json
|
|
147
|
-
requestshield
|
|
247
|
+
requestshield logout
|
|
148
248
|
```
|
|
149
249
|
|
|
150
250
|
Status reads only the selected profile's saved session. It never refreshes,
|
|
@@ -160,15 +260,15 @@ revoke the provider grant, sign out the browser or remove another profile's sess
|
|
|
160
260
|
### Applications and credentials
|
|
161
261
|
|
|
162
262
|
```console
|
|
163
|
-
requestshield
|
|
164
|
-
requestshield
|
|
165
|
-
requestshield
|
|
166
|
-
requestshield
|
|
167
|
-
requestshield
|
|
168
|
-
requestshield
|
|
169
|
-
requestshield
|
|
170
|
-
requestshield
|
|
171
|
-
requestshield
|
|
263
|
+
requestshield app create "Checkout"
|
|
264
|
+
requestshield app list --json --all
|
|
265
|
+
requestshield app get <app-key>
|
|
266
|
+
requestshield app rename <app-key> "Checkout API"
|
|
267
|
+
requestshield app disable <app-key>
|
|
268
|
+
requestshield app enable <app-key>
|
|
269
|
+
requestshield secret rotate <app-key>
|
|
270
|
+
requestshield secret reveal <app-key>
|
|
271
|
+
requestshield secret revoke <app-key>
|
|
172
272
|
```
|
|
173
273
|
|
|
174
274
|
Create makes a new application and initial secret. Rotate replaces the current
|
|
@@ -191,7 +291,7 @@ For an uncertain result, repeat the **identical command and arguments with the
|
|
|
191
291
|
same key printed in the error**, within seven days of the original attempt.
|
|
192
292
|
A new key starts a new operation. After seven days, inspect the application before
|
|
193
293
|
acting. Create/rotate replay returns `apiSecret: null`; the CLI suggests explicit
|
|
194
|
-
`
|
|
294
|
+
`secret reveal` and never reveals or rotates automatically.
|
|
195
295
|
|
|
196
296
|
Enable, disable and revoke return HTTP `202` acceptance. Publication is
|
|
197
297
|
asynchronous; acceptance and an `enabled` status do not prove global propagation.
|
|
@@ -202,8 +302,8 @@ List defaults to one page. `--limit` accepts 1–100; `--cursor` continues a pre
|
|
|
202
302
|
page. `--all` traverses at most 100 pages and rejects repeated cursors or an
|
|
203
303
|
unfinished traversal at that bound. It cannot be combined with `--cursor`.
|
|
204
304
|
|
|
205
|
-
`
|
|
206
|
-
for an incomplete single-page listing). `
|
|
305
|
+
`app list --json` returns `{ "data": [...], "nextCursor": null }` (or a cursor
|
|
306
|
+
for an incomplete single-page listing). `app get --json` and rename with `--json` return
|
|
207
307
|
`{ "data": { ... } }`. Application objects have exactly `appKey`, `name`,
|
|
208
308
|
`status`, `createdAt` and `updatedAt`; unexpected fields and secrets are not printed.
|
|
209
309
|
|
|
@@ -253,15 +353,22 @@ packages use their bundled skill. Repository runners resolve the canonical
|
|
|
253
353
|
`../skills/requestshield` using source-checkout markers; they do not depend on
|
|
254
354
|
the working directory or require a staged packaging copy.
|
|
255
355
|
|
|
356
|
+
`requestshield agent status` inspects both agents' Skill files. Select only one
|
|
357
|
+
with `--codex` or `--claude`; add `--json` for automation. It reports `installed`,
|
|
358
|
+
`missing` or `invalid`, without installing anything or asserting that the agent
|
|
359
|
+
has loaded the Skill.
|
|
360
|
+
|
|
256
361
|
### Check for updates
|
|
257
362
|
|
|
258
363
|
```console
|
|
259
364
|
requestshield update check
|
|
365
|
+
requestshield update apply
|
|
366
|
+
requestshield update apply --yes --json
|
|
260
367
|
```
|
|
261
368
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
369
|
+
`update check` checks the npm registry for the latest `@intellifend/requestshield`
|
|
370
|
+
version and never prompts or installs. `update apply` checks the version and,
|
|
371
|
+
when a newer version exists, asks before installing that exact version:
|
|
265
372
|
|
|
266
373
|
```text
|
|
267
374
|
Install RequestShield <version> globally with npm? (y/N):
|
|
@@ -270,12 +377,13 @@ Install RequestShield <version> globally with npm? (y/N):
|
|
|
270
377
|
Entering `y` runs the equivalent of:
|
|
271
378
|
|
|
272
379
|
```console
|
|
273
|
-
npm install --global requestshield@<latest-version>
|
|
380
|
+
npm install --global @intellifend/requestshield@<latest-version>
|
|
274
381
|
```
|
|
275
382
|
|
|
276
|
-
|
|
383
|
+
Use `--yes` to explicitly confirm in a script, including with `--json`.
|
|
384
|
+
Applying an update requires Node.js and npm. It updates a
|
|
277
385
|
global npm installation. Repository checkouts and pinned `npx` invocations are
|
|
278
|
-
managed separately. QAT/STG `update check`
|
|
386
|
+
managed separately. QAT/STG `update check` and `update apply` print local Git/source guidance and
|
|
279
387
|
returns without querying the registry, prompting or installing anything.
|
|
280
388
|
|
|
281
389
|
## Install with npm
|
|
@@ -283,7 +391,7 @@ returns without querying the registry, prompting or installing anything.
|
|
|
283
391
|
Install globally:
|
|
284
392
|
|
|
285
393
|
```console
|
|
286
|
-
npm install --global requestshield
|
|
394
|
+
npm install --global @intellifend/requestshield
|
|
287
395
|
requestshield --help
|
|
288
396
|
requestshield --version
|
|
289
397
|
```
|
|
@@ -296,14 +404,14 @@ versions already published.
|
|
|
296
404
|
Run a specific version without installing globally:
|
|
297
405
|
|
|
298
406
|
```console
|
|
299
|
-
npx --yes --package
|
|
300
|
-
npx --yes --package
|
|
407
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield --help
|
|
408
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield login
|
|
301
409
|
```
|
|
302
410
|
|
|
303
411
|
To invoke the update command through npx, include the package name:
|
|
304
412
|
|
|
305
413
|
```console
|
|
306
|
-
npx --yes --package
|
|
414
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield update check
|
|
307
415
|
```
|
|
308
416
|
|
|
309
417
|
Do not run `npx update check`; npm interprets `update` as the name of a different
|
|
@@ -361,6 +469,7 @@ OAUTH_ISSUER=https://identity.example.com
|
|
|
361
469
|
OAUTH_AUTHORIZATION_ISSUER=
|
|
362
470
|
OAUTH_CLIENT_ID=public-client-id
|
|
363
471
|
API_URL=https://management.example.com
|
|
472
|
+
DOCS_URL=https://docs.example.com
|
|
364
473
|
```
|
|
365
474
|
|
|
366
475
|
Do not put credentials in these files. Session storage remains private and
|
|
@@ -392,14 +501,14 @@ From the repository root:
|
|
|
392
501
|
|
|
393
502
|
```console
|
|
394
503
|
cd requestshield-cli
|
|
395
|
-
npx --offline --prefix ./dev requestshield-qat
|
|
396
|
-
npx --offline --prefix ./dev requestshield-qat
|
|
504
|
+
npx --offline --prefix ./dev requestshield-qat login
|
|
505
|
+
npx --offline --prefix ./dev requestshield-qat app list --json
|
|
397
506
|
```
|
|
398
507
|
|
|
399
508
|
The prefix selects the local private package; do not omit it from this directory.
|
|
400
509
|
Alternatively, from `requestshield-cli/`, run
|
|
401
|
-
`npm run requestshield-qat --
|
|
402
|
-
`npm run requestshield-qat --
|
|
510
|
+
`npm run requestshield-qat -- login` and
|
|
511
|
+
`npm run requestshield-qat -- app list --json`.
|
|
403
512
|
|
|
404
513
|
The private developer package and its runners are excluded from the public npm
|
|
405
514
|
package. Old `REQUESTSHIELD_OAUTH_*`, `REQUESTSHIELD_API_URL` and
|
|
@@ -436,7 +545,7 @@ Source changes do not configure the provider or deploy the portal.
|
|
|
436
545
|
See the [Stytch CLI guide](https://stytch.com/docs/connected-apps/guides/cli-agents)
|
|
437
546
|
and [refresh contract](https://stytch.com/docs/api-reference/consumer/api/connected-apps/exchange-refresh-token).
|
|
438
547
|
|
|
439
|
-
Acceptance requires a real browser sign-in, then `
|
|
548
|
+
Acceptance requires a real browser sign-in, then `app list --json` accepted by
|
|
440
549
|
QAT. Wait until the access token expires and repeat the command to verify refresh.
|
|
441
550
|
An account with no apps should return an empty list; do not create an app just
|
|
442
551
|
for this test. Local mock checks do not establish provider or deployed API acceptance.
|
|
@@ -454,7 +563,7 @@ The manual update test mocks the registry and install operation, so it does not
|
|
|
454
563
|
publish a package or change the installed version:
|
|
455
564
|
|
|
456
565
|
```console
|
|
457
|
-
npm run test:update-check:manual -- 0.1.6
|
|
566
|
+
npm run test:update-check:manual -- 0.1.6 apply
|
|
458
567
|
```
|
|
459
568
|
|
|
460
569
|
After entering `y`, the test prints `[MOCK] Would install ...`.
|
|
@@ -496,7 +605,7 @@ npm pack ./build --dry-run
|
|
|
496
605
|
npm pack ./build --pack-destination ./build
|
|
497
606
|
```
|
|
498
607
|
|
|
499
|
-
The latter writes `build/requestshield-<version>.tgz`. Archives are
|
|
608
|
+
The latter writes `build/intellifend-requestshield-<version>.tgz`. Archives are
|
|
500
609
|
generated artifacts, ignored by Git, and are not required in source control or
|
|
501
610
|
before publishing. The package listing should contain `src/main.mjs`,
|
|
502
611
|
`config/.env.prod` and the complete Skill, with no QAT/STG configuration or
|
|
@@ -534,7 +643,7 @@ root and publish from this source package. Store a `.tgz` as a CI artifact only
|
|
|
534
643
|
when the release workflow needs a separately retained archive.
|
|
535
644
|
|
|
536
645
|
```console
|
|
537
|
-
npm view requestshield version
|
|
646
|
+
npm view @intellifend/requestshield version
|
|
538
647
|
npm run check
|
|
539
648
|
npm pack --dry-run
|
|
540
649
|
npm publish --access public
|
|
@@ -543,9 +652,9 @@ npm publish --access public
|
|
|
543
652
|
Verify the published package:
|
|
544
653
|
|
|
545
654
|
```console
|
|
546
|
-
npm view requestshield version
|
|
547
|
-
npm dist-tag ls requestshield
|
|
548
|
-
npx --yes --package
|
|
655
|
+
npm view @intellifend/requestshield version
|
|
656
|
+
npm dist-tag ls @intellifend/requestshield
|
|
657
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield --version
|
|
549
658
|
```
|
|
550
659
|
|
|
551
660
|
## Management API contract
|
|
@@ -556,12 +665,12 @@ operations are covered by the CLI-to-router contract gate.
|
|
|
556
665
|
|
|
557
666
|
| CLI command | Method and path |
|
|
558
667
|
| --- | --- |
|
|
559
|
-
| `
|
|
560
|
-
| `
|
|
561
|
-
| `
|
|
562
|
-
| `
|
|
563
|
-
| `
|
|
564
|
-
| `
|
|
668
|
+
| `app create <name>` | `POST /v1/applications` with `{name}` |
|
|
669
|
+
| `app list` | `GET /v1/applications` with optional `limit` and `cursor` |
|
|
670
|
+
| `app get <app-key>` | `GET /v1/applications/{appKey}` |
|
|
671
|
+
| `app rename <app-key> <name>` | `PATCH /v1/applications/{appKey}` with `{name}` |
|
|
672
|
+
| `app enable` / `app disable` | Bodyless `POST /v1/applications/{appKey}/enable` or `/disable` |
|
|
673
|
+
| `secret rotate` / `secret revoke` / `secret reveal` | Bodyless `POST /v1/applications/{appKey}/secret/rotate`, `/revoke` or `/reveal` |
|
|
565
674
|
|
|
566
675
|
Create and rotate return `{appKey,status,apiSecret}`; a matching replay has a
|
|
567
676
|
null secret. Reveal returns `{apiSecret}` and is not replayed. Application detail
|
package/config/.env.prod
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Public production settings shipped in the npm package. Never add secrets.
|
|
2
2
|
API_URL=https://api.intellifend.ai
|
|
3
|
+
DOCS_URL=https://docs.intellifend.ai
|
|
3
4
|
# Fill in the production Connected App values before releasing sign-in.
|
|
4
5
|
OAUTH_ISSUER=
|
|
5
6
|
# Optional callback iss pin; blank uses OAUTH_ISSUER.
|
package/package.json
CHANGED
|
@@ -32,11 +32,13 @@ requestshield auth status --json # local session metadata, no provider check
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
If `requestshield --version` fails, explain that CLI account/app operations need
|
|
35
|
-
an installed compatible version. Do not substitute invented HTTP calls.
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
an installed compatible version. Do not substitute invented HTTP calls. Use
|
|
36
|
+
`requestshield contract --json` for the selected environment's release manifest
|
|
37
|
+
and follow its documentation links. This public read needs no login. It returns
|
|
38
|
+
SDK URLs, integrity, modes, CSP additions and Java/Maven requirements; see
|
|
39
|
+
`references/cli.md` for failure handling and output fields.
|
|
38
40
|
|
|
39
|
-
If local status is `signed_out`, ask the user to complete `requestshield
|
|
41
|
+
If local status is `signed_out`, ask the user to complete `requestshield login`
|
|
40
42
|
themselves. Never ask for credentials. `valid` is a local state only; an expired
|
|
41
43
|
session may refresh during the next authenticated command.
|
|
42
44
|
|
|
@@ -50,16 +52,17 @@ single CLI call or a short answer. Match on what the user wants, not on exact wo
|
|
|
50
52
|
|
|
51
53
|
| Intent | Sounds like | Do this |
|
|
52
54
|
| --- | --- | --- |
|
|
53
|
-
| **General info** | "what version", "is there a newer CLI", "am I up to date" | Use `requestshield --version`.
|
|
54
|
-
| **
|
|
55
|
+
| **General info** | "what version", "is there a newer CLI", "am I up to date" | Use `requestshield --version`. Use `requestshield update check` for a read-only version check. Only `update apply` installs globally, with confirmation or `--yes`, when the user requests an update. |
|
|
56
|
+
| **Integration contract** | "which SDK", "SDK URL", "integration manifest" | Run `requestshield contract --json` without login. Use the returned release metadata and documentation links; it reports no account or service-health information. |
|
|
57
|
+
| **Authentication** | "sign me in", or preflight `auth status` came back unauthenticated | Ask the user to run `requestshield login` in their own terminal, and wait. It is interactive — never automate it, never run it for them, never ask for credentials. Re-run `auth status` once they confirm. |
|
|
55
58
|
| **Key / secret management** | "create an app key", "I need an API Secret", "rotate the secret", "deactivate a key" | **Hand the command over; do not run it.** → "Key and secret management" below. |
|
|
56
59
|
| **Install** | "add RequestShield", "protect /api/register" | `references/integration-planning.md` full flow → **Installing** → **Verifying** → **Negative test**. Do not reorder or skip a step. |
|
|
57
60
|
| **Uninstall** | "remove it", "roll it back" | `references/integration-planning.md` (Detect existing integration only) → **Uninstalling**. |
|
|
58
61
|
| **Verify / troubleshoot** | "is it set up right?", "why is it not blocking?", a reason code | `references/integration-planning.md` (Detect existing integration only) → **Verifying**. For a reason code, also read `references/troubleshooting.md`. |
|
|
59
|
-
| **Challenge volume** | "how much traffic", "how many challenges" | Explain that
|
|
60
|
-
| **Billing** | "am I being charged", "what plan", "what are my limits" | Explain that billing is
|
|
61
|
-
| **Service health** | "is the service up", "is it degraded" |
|
|
62
|
-
| **Agent setup** | "set this up for Codex too", "install the skill for Claude" | Run `requestshield agent setup` for auto-detection, or pass the requested agent: `--codex` or `--claude`. This installs agent guidance;
|
|
62
|
+
| **Challenge volume** | "how much traffic", "how many challenges" | Explain that `usage challenges` is a [coming soon] placeholder. Use existing authorized monitoring; do not infer volume from app status. |
|
|
63
|
+
| **Billing** | "am I being charged", "what plan", "what are my limits" | Explain that `billing get` is a [coming soon] placeholder; use the customer’s established billing/support channel. |
|
|
64
|
+
| **Service health** | "is the service up", "is it degraded" | `service status` is a [coming soon] placeholder and returns no health data. Inspect authorized health/monitoring evidence without exposing credentials. |
|
|
65
|
+
| **Agent setup** | "set this up for Codex too", "install the skill for Claude" | Run `requestshield agent setup` for auto-detection, or pass the requested agent: `--codex` or `--claude`. This installs agent guidance; `agent status` only inspects its files. Neither mints keys nor edits customer application code. |
|
|
63
66
|
| **Anything else** | | Look the command up in `references/cli.md`. If it is not there, run `requestshield --help` rather than guessing at a flag. |
|
|
64
67
|
|
|
65
68
|
Full CLI surface, output shapes, and which commands need auth: `references/cli.md`.
|
|
@@ -77,11 +80,11 @@ values never enter the agent's tool output or conversation. State-changing
|
|
|
77
80
|
commands must match the user's requested application and action.
|
|
78
81
|
|
|
79
82
|
```console
|
|
80
|
-
requestshield
|
|
81
|
-
requestshield
|
|
82
|
-
requestshield
|
|
83
|
-
requestshield
|
|
84
|
-
requestshield
|
|
83
|
+
requestshield app create <name>
|
|
84
|
+
requestshield secret rotate <app-key>
|
|
85
|
+
requestshield secret reveal <app-key>
|
|
86
|
+
requestshield secret revoke <app-key>
|
|
87
|
+
requestshield app disable <app-key>
|
|
85
88
|
```
|
|
86
89
|
|
|
87
90
|
Create makes a new application. Rotate keeps the App Key and replaces its secret.
|
|
@@ -135,7 +138,7 @@ hand-off and warning are in **Key and secret management** above. Afterwards refe
|
|
|
135
138
|
only as "the secret you just received".
|
|
136
139
|
|
|
137
140
|
If a secret has already reached a repo, a log, an artifact, or this transcript, the fix
|
|
138
|
-
is `requestshield
|
|
141
|
+
is `requestshield secret rotate <app-key>`, run by the user.
|
|
139
142
|
|
|
140
143
|
## Verifying
|
|
141
144
|
|
|
@@ -247,7 +250,7 @@ first:
|
|
|
247
250
|
other source and header in place.
|
|
248
251
|
5. Configuration keys and environment variable references.
|
|
249
252
|
|
|
250
|
-
Application disable is a separate action: `requestshield
|
|
253
|
+
Application disable is a separate action: `requestshield app disable <app-key>`.
|
|
251
254
|
Perform or hand it off only when the user requested that live-state change; removing
|
|
252
255
|
integration code does not itself authorize revocation or disable.
|
|
253
256
|
|
|
@@ -44,7 +44,7 @@ Orientation:
|
|
|
44
44
|
Five rules worth carrying without opening a file:
|
|
45
45
|
|
|
46
46
|
- The **API Secret** never enters source control, logs, or a reply. It belongs in backend
|
|
47
|
-
runtime secret storage, and `requestshield
|
|
47
|
+
runtime secret storage, and `requestshield secret rotate <app-key>` is the fix if it leaks. The
|
|
48
48
|
**App Key** is public and must be identical in browser and backend.
|
|
49
49
|
- **Keep secret output out of tool transcripts.** Have the user run create, rotate
|
|
50
50
|
and reveal in their own terminal, then have them
|
|
@@ -58,5 +58,7 @@ Five rules worth carrying without opening a file:
|
|
|
58
58
|
non-empty string**; when it is empty, omit the header and let the backend apply its
|
|
59
59
|
configured policy.
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
URL,
|
|
61
|
+
Use `requestshield contract --json` and its documentation links before changing
|
|
62
|
+
the script URL, matching integrity, header, modes or backend baseline. It is a public
|
|
63
|
+
read with no login. Use the intended environment, merge CSP additions and preserve
|
|
64
|
+
the selected release; report missing metadata instead of inventing values.
|
|
@@ -13,9 +13,9 @@ is not Spring Boot 3 MVC, including a Spring Boot 3 app built on WebFlux, which
|
|
|
13
13
|
Spring MVC. Also needed: the same App Key the browser uses, the backend-only API Secret,
|
|
14
14
|
and a web framework that can extract the token carrier.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
not promise an undocumented backend path; a browser-only install protects nothing.
|
|
16
|
+
Use `requestshield contract --json` for the selected release's Java baseline,
|
|
17
|
+
Maven coordinates and challenge URL, then follow its Java SDK documentation link.
|
|
18
|
+
Do not promise an undocumented backend path; a browser-only install protects nothing.
|
|
19
19
|
|
|
20
20
|
The browser mode does not decide this path. Either Seamless or Manual mode delivers the
|
|
21
21
|
token, and the application extracts it and passes the value unchanged to `verify()`.
|
|
@@ -13,9 +13,9 @@ writing anything — the detection recipes are in `integration-planning.md`, und
|
|
|
13
13
|
-> Run the check**. Also needed: the same
|
|
14
14
|
App Key the browser uses, and the backend-only API Secret.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
not promise an undocumented backend path; a browser-only install protects nothing.
|
|
16
|
+
Use `requestshield contract --json` for the selected release's Java baseline,
|
|
17
|
+
Maven coordinates and challenge URL, then follow its Java SDK documentation link.
|
|
18
|
+
Do not promise an undocumented backend path; a browser-only install protects nothing.
|
|
19
19
|
|
|
20
20
|
The browser mode does not decide this path. Either Seamless or Manual mode delivers the
|
|
21
21
|
token in `X-IntelliFend-Token`, and the starter reads that header without caring how it
|
|
@@ -24,7 +24,7 @@ Seamless interception:
|
|
|
24
24
|
|
|
25
25
|
| Attribute | Required | Notes |
|
|
26
26
|
| --- | --- | --- |
|
|
27
|
-
| `src` | Yes | Use
|
|
27
|
+
| `src` | Yes | Use `browser.scriptUrl` and its matching `browser.integrity` from `requestshield contract --json`; follow the manifest's Browser SDK documentation link for the selected release. |
|
|
28
28
|
| `data-app-key` | Yes | Public App Key. Must match the backend's configured key. |
|
|
29
29
|
| `defer` | Recommended | Keeps HTML parsing unblocked. |
|
|
30
30
|
|