@cat-factory/gatekeeper-worker 0.6.0 → 0.6.2
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 +36 -2
- package/dist/os/protocol.d.ts.map +1 -1
- package/dist/os/protocol.js +16 -0
- package/dist/os/protocol.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -351,12 +351,46 @@ What that deliberately does not cover is a delivery that TRAVELLED: the platform
|
|
|
351
351
|
a loopback endpoint, so the receiver is driven with an envelope the suite signs around the
|
|
352
352
|
platform's own notification object.
|
|
353
353
|
|
|
354
|
+
`test/os-live/` is the third leg, and it takes away the fake the other two share: the workspace.
|
|
355
|
+
Cloudflare OS's own `@gadgets/integration-tests` toolkit boots the real `workshop-backend` beside
|
|
356
|
+
this Worker under wrangler's test harness, so a real workspace discovers the vendor off a service
|
|
357
|
+
binding, mints an account, binds the paired deployment as a resource and shares it. Nightly, pinned
|
|
358
|
+
to a partner commit by `GATEKEEPER_OS_REF`, and non-blocking by living in a workflow of its own
|
|
359
|
+
(`.github/workflows/gatekeeper-os.yml`). To run it yourself, clone the partner repository **inside
|
|
360
|
+
this one** and point the suite at it, from the repository root:
|
|
361
|
+
|
|
362
|
+
```sh
|
|
363
|
+
git clone https://github.com/cloudflare/cloudflare-os.git .cloudflare-os
|
|
364
|
+
# The commit the nightly pins is GATEKEEPER_OS_REF in .github/workflows/gatekeeper-os.yml.
|
|
365
|
+
# Running against a different one is fine; it is then your run that is unpinned, not the lane's.
|
|
366
|
+
git -C .cloudflare-os checkout <that commit>
|
|
367
|
+
(cd .cloudflare-os && pnpm install --frozen-lockfile --ignore-scripts \
|
|
368
|
+
&& pnpm --filter @gadgets/workshop-backend run build:format-blueprints)
|
|
369
|
+
GATEKEEPER_OS_DIR="$PWD/.cloudflare-os" pnpm --filter @cat-factory/gatekeeper-worker test:os
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
The clone goes inside this repository because wrangler's test harness boots the partner's Worker and
|
|
373
|
+
this one under a single root, and the root the suite hands it is this repository: a checkout beside
|
|
374
|
+
it cannot be booted, and the config refuses one rather than letting the harness report a Worker it
|
|
375
|
+
could not find. `.cloudflare-os` is gitignored for this.
|
|
376
|
+
|
|
377
|
+
It exists for the three seams no other suite here structurally reaches: the entrypoint NAMES (the
|
|
378
|
+
workspace resolves them and never asks this package what they are called), the stubs handed over
|
|
379
|
+
(`createAccount()` returns something the workspace persists, and `getGatekeeperClassFor()` a class
|
|
380
|
+
only the workspace's own machinery can instantiate), and the transcribed protocol in
|
|
381
|
+
`src/os/protocol.ts`, which a hermetic suite cannot tell from a shape that has fallen behind. Its
|
|
382
|
+
first run found a real one: without the `allow_irrevocable_stub_storage` compatibility flag, a
|
|
383
|
+
workspace cannot store the account stub, so every account anyone connected failed. What it does NOT
|
|
384
|
+
reach is a session: the harness runs no gadget code, so `startSession` is never called and the
|
|
385
|
+
approval queue, the argument checks and the answerers stay with the hermetic suite. Two legs, two
|
|
386
|
+
questions.
|
|
387
|
+
|
|
354
388
|
## References
|
|
355
389
|
|
|
356
390
|
- [`deploy/gatekeeper`](https://github.com/kibertoad/cat-factory/tree/main/deploy/gatekeeper): the
|
|
357
391
|
template you copy, its configuration walkthrough and the OS-side usage example.
|
|
358
|
-
- [
|
|
359
|
-
design
|
|
392
|
+
- [ADR 0052](https://github.com/kibertoad/cat-factory/blob/main/backend/docs/adr/0052-cloudflare-os-gatekeeper.md):
|
|
393
|
+
the design record, the decisions behind each half, and what each suite deliberately does not cover.
|
|
360
394
|
- [`backend/docs/public-api.md`](https://github.com/kibertoad/cat-factory/blob/main/backend/docs/public-api.md):
|
|
361
395
|
the API this rides (keys, scopes, webhooks, endpoint semantics).
|
|
362
396
|
- [`@cat-factory/gatekeeper-bindings`](https://www.npmjs.com/package/@cat-factory/gatekeeper-bindings):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/os/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/os/protocol.ts"],"names":[],"mappings":"AAqCA,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yFAAyF;IACzF,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IACnB,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAA;CACtC;AAED,0FAA0F;AAC1F,MAAM,WAAW,mBAAmB;IAClC,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,0EAA0E;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AI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC/C,SAAS,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtC;AAED,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,QAAQ,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACxC,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IACrC,YAAY,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5D,wBAAwB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACjD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;IAC3E,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1C;AAED,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC3C"}
|
package/dist/os/protocol.js
CHANGED
|
@@ -18,5 +18,21 @@
|
|
|
18
18
|
// constructs: the OS reaches a bound Worker's entrypoint over native RPC and calls methods by
|
|
19
19
|
// name, so what has to match is the SHAPE. These interfaces exist to make our shape a compile-time
|
|
20
20
|
// claim rather than a hope.
|
|
21
|
+
//
|
|
22
|
+
// Where this file is NARROWER than the published one, and deliberately. A reader diffing the two
|
|
23
|
+
// finds three, and each is a stronger true statement about what we do rather than a shape that has
|
|
24
|
+
// fallen behind, so none of them is drift to fix:
|
|
25
|
+
//
|
|
26
|
+
// - `HookInitiator.startHook` is published as handing back a full `ApprovalQueue`. We take it as
|
|
27
|
+
// an `ObservationAuthorizer`, because a delivery is a read and this Worker registers no action
|
|
28
|
+
// from one.
|
|
29
|
+
// - `rejectAction` and `revertAction` are published as unions including a `restart` flag, which a
|
|
30
|
+
// gatekeeper that SIMULATES an action needs in order to say the session cannot be rolled back.
|
|
31
|
+
// We do not simulate, so ours cannot ask for one.
|
|
32
|
+
// - `ensureResources` is published as `{url?: string}`, the URL a grant flow would continue at.
|
|
33
|
+
// This vendor's single resource comes with the account, so ours is always empty.
|
|
34
|
+
//
|
|
35
|
+
// The nightly leg is what keeps the rest honest, and it is the ONLY thing that can: a shape that
|
|
36
|
+
// drifted still compiles here and fails there.
|
|
21
37
|
export {};
|
|
22
38
|
//# sourceMappingURL=protocol.js.map
|
package/dist/os/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/os/protocol.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,kGAAkG;AAClG,8FAA8F;AAC9F,iGAAiG;AACjG,6FAA6F;AAC7F,8FAA8F;AAC9F,gGAAgG;AAChG,0EAA0E;AAC1E,EAAE;AACF,iGAAiG;AACjG,wFAAwF;AACxF,4FAA4F;AAC5F,4FAA4F;AAC5F,mBAAmB;AACnB,EAAE;AACF,2FAA2F;AAC3F,8FAA8F;AAC9F,mGAAmG;AACnG,4BAA4B"}
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/os/protocol.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,kGAAkG;AAClG,8FAA8F;AAC9F,iGAAiG;AACjG,6FAA6F;AAC7F,8FAA8F;AAC9F,gGAAgG;AAChG,0EAA0E;AAC1E,EAAE;AACF,iGAAiG;AACjG,wFAAwF;AACxF,4FAA4F;AAC5F,4FAA4F;AAC5F,mBAAmB;AACnB,EAAE;AACF,2FAA2F;AAC3F,8FAA8F;AAC9F,mGAAmG;AACnG,4BAA4B;AAC5B,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,kDAAkD;AAClD,EAAE;AACF,mGAAmG;AACnG,mGAAmG;AACnG,gBAAgB;AAChB,oGAAoG;AACpG,mGAAmG;AACnG,sDAAsD;AACtD,kGAAkG;AAClG,qFAAqF;AACrF,EAAE;AACF,iGAAiG;AACjG,+CAA+C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/gatekeeper-worker",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "The Cloudflare OS Gatekeeper machinery for cat-factory as an installable library: policy-compiled Cap'n Web capabilities over the /api/v1 operation table, per-actor API-key minting, a verified outbound-webhook receiver and the approval inbox that answers every park a run stops on. A deployment supplies only its policy; deploy/gatekeeper is the template it copies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"capnweb",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"capnweb": "^0.10.0",
|
|
40
|
-
"@cat-factory/gatekeeper-bindings": "0.
|
|
41
|
-
"@cat-factory/sdk": "0.
|
|
40
|
+
"@cat-factory/gatekeeper-bindings": "0.12.0",
|
|
41
|
+
"@cat-factory/sdk": "0.30.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@cloudflare/vitest-pool-workers": "^0.20.3",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.dev.json --noEmit",
|
|
58
58
|
"test": "vitest",
|
|
59
59
|
"test:run": "vitest run",
|
|
60
|
-
"test:live": "vitest run --config vitest.live.config.ts"
|
|
60
|
+
"test:live": "vitest run --config vitest.live.config.ts",
|
|
61
|
+
"test:os": "vitest run --config vitest.os.config.ts"
|
|
61
62
|
}
|
|
62
63
|
}
|