@coderifts/agent-guard 14.0.0 → 15.0.0
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 +28 -2
- package/dist/cjs/adapters/vercel.d.ts +153 -0
- package/dist/cjs/adapters/vercel.d.ts.map +1 -0
- package/dist/cjs/adapters/vercel.js +255 -0
- package/dist/cjs/adapters/vercel.js.map +1 -0
- package/dist/cjs/atomic-profile.d.ts +68 -8
- package/dist/cjs/atomic-profile.d.ts.map +1 -1
- package/dist/cjs/atomic-profile.js +122 -2
- package/dist/cjs/atomic-profile.js.map +1 -1
- package/dist/cjs/deny-remedy.d.ts +74 -0
- package/dist/cjs/deny-remedy.d.ts.map +1 -0
- package/dist/cjs/deny-remedy.js +127 -0
- package/dist/cjs/deny-remedy.js.map +1 -0
- package/dist/cjs/deploy-gate.d.ts +14 -1
- package/dist/cjs/deploy-gate.d.ts.map +1 -1
- package/dist/cjs/deploy-gate.js.map +1 -1
- package/dist/cjs/deploy-receipt-token.d.ts +2 -2
- package/dist/cjs/deploy-receipt-token.d.ts.map +1 -1
- package/dist/cjs/deploy-receipt-token.js +64 -1
- package/dist/cjs/deploy-receipt-token.js.map +1 -1
- package/dist/cjs/execute-tool-call.d.ts +16 -1
- package/dist/cjs/execute-tool-call.d.ts.map +1 -1
- package/dist/cjs/execute-tool-call.js +26 -0
- package/dist/cjs/execute-tool-call.js.map +1 -1
- package/dist/cjs/execution-grant.d.ts +100 -0
- package/dist/cjs/execution-grant.d.ts.map +1 -1
- package/dist/cjs/execution-grant.js +101 -0
- package/dist/cjs/execution-grant.js.map +1 -1
- package/dist/cjs/gate-refusal.js +1 -1
- package/dist/cjs/guard.d.ts.map +1 -1
- package/dist/cjs/guard.js +56 -8
- package/dist/cjs/guard.js.map +1 -1
- package/dist/cjs/index.d.ts +8 -4
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +22 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/policy.d.ts.map +1 -1
- package/dist/cjs/policy.js +1 -1
- package/dist/cjs/policy.js.map +1 -1
- package/dist/cjs/posture-receipt.d.ts +118 -0
- package/dist/cjs/posture-receipt.d.ts.map +1 -0
- package/dist/cjs/posture-receipt.js +220 -0
- package/dist/cjs/posture-receipt.js.map +1 -0
- package/dist/cjs/types.d.ts +23 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/with-coderifts.d.ts +17 -2
- package/dist/cjs/with-coderifts.d.ts.map +1 -1
- package/dist/cjs/with-coderifts.js +22 -5
- package/dist/cjs/with-coderifts.js.map +1 -1
- package/dist/esm/adapters/vercel.d.ts +153 -0
- package/dist/esm/adapters/vercel.d.ts.map +1 -0
- package/dist/esm/adapters/vercel.js +247 -0
- package/dist/esm/adapters/vercel.js.map +1 -0
- package/dist/esm/atomic-profile.d.ts +68 -8
- package/dist/esm/atomic-profile.d.ts.map +1 -1
- package/dist/esm/atomic-profile.js +120 -1
- package/dist/esm/atomic-profile.js.map +1 -1
- package/dist/esm/deny-remedy.d.ts +74 -0
- package/dist/esm/deny-remedy.d.ts.map +1 -0
- package/dist/esm/deny-remedy.js +122 -0
- package/dist/esm/deny-remedy.js.map +1 -0
- package/dist/esm/deploy-gate.d.ts +14 -1
- package/dist/esm/deploy-gate.d.ts.map +1 -1
- package/dist/esm/deploy-gate.js.map +1 -1
- package/dist/esm/deploy-receipt-token.d.ts +2 -2
- package/dist/esm/deploy-receipt-token.d.ts.map +1 -1
- package/dist/esm/deploy-receipt-token.js +64 -1
- package/dist/esm/deploy-receipt-token.js.map +1 -1
- package/dist/esm/execute-tool-call.d.ts +16 -1
- package/dist/esm/execute-tool-call.d.ts.map +1 -1
- package/dist/esm/execute-tool-call.js +25 -0
- package/dist/esm/execute-tool-call.js.map +1 -1
- package/dist/esm/execution-grant.d.ts +100 -0
- package/dist/esm/execution-grant.d.ts.map +1 -1
- package/dist/esm/execution-grant.js +98 -0
- package/dist/esm/execution-grant.js.map +1 -1
- package/dist/esm/gate-refusal.js +1 -1
- package/dist/esm/guard.d.ts.map +1 -1
- package/dist/esm/guard.js +57 -9
- package/dist/esm/guard.js.map +1 -1
- package/dist/esm/index.d.ts +8 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/policy.d.ts.map +1 -1
- package/dist/esm/policy.js +1 -1
- package/dist/esm/policy.js.map +1 -1
- package/dist/esm/posture-receipt.d.ts +118 -0
- package/dist/esm/posture-receipt.d.ts.map +1 -0
- package/dist/esm/posture-receipt.js +216 -0
- package/dist/esm/posture-receipt.js.map +1 -0
- package/dist/esm/types.d.ts +23 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/with-coderifts.d.ts +17 -2
- package/dist/esm/with-coderifts.d.ts.map +1 -1
- package/dist/esm/with-coderifts.js +21 -5
- package/dist/esm/with-coderifts.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ATOMIC_INVARIANTS = exports.ATOMIC_PROFILE_UNSATISFIED = exports.GUARD_ATOMIC_WIRE_VALUE = exports.PROFILE_ENFORCING_ATOMIC_V1 = void 0;
|
|
3
|
+
exports.CREDENTIAL_BOUNDARY_BARE_REJECTED = exports.ATOMIC_V2_MAX_AGE_MS_CAP = exports.ATOMIC_INVARIANTS = exports.ATOMIC_PROFILE_UNSATISFIED = exports.GUARD_ATOMIC_WIRE_VALUE = exports.PROFILE_ENFORCING_ATOMIC_V2 = exports.PROFILE_ENFORCING_ATOMIC_V1 = void 0;
|
|
4
4
|
exports.createMutatorRegister = createMutatorRegister;
|
|
5
5
|
exports.isEnforcingAtomic = isEnforcingAtomic;
|
|
6
|
+
exports.isEnforcingAtomicV2 = isEnforcingAtomicV2;
|
|
6
7
|
exports.atomicConstructionProblems = atomicConstructionProblems;
|
|
7
8
|
exports.throwAtomicUnsatisfied = throwAtomicUnsatisfied;
|
|
8
9
|
exports.atomicOutcome = atomicOutcome;
|
|
@@ -14,7 +15,47 @@ exports.atomicOutcome = atomicOutcome;
|
|
|
14
15
|
* wired. Executor behaviour (nonce consume-once, CAS, read-back, attestation)
|
|
15
16
|
* is still observed per call; construction only demands the wiring.
|
|
16
17
|
*/
|
|
18
|
+
const posture_receipt_js_1 = require("./posture-receipt.js");
|
|
17
19
|
exports.PROFILE_ENFORCING_ATOMIC_V1 = 'ENFORCING_ATOMIC_V1';
|
|
20
|
+
/**
|
|
21
|
+
* ENFORCING_ATOMIC_V2 (roadmap 1167) — V1 plus a VERIFIED credential boundary.
|
|
22
|
+
*
|
|
23
|
+
* WHY A NEW NAME RATHER THAN A STRICTER _V1. with-coderifts.ts:228 states the
|
|
24
|
+
* rule this package learned from its own 10.0.0 and 12.0.0 releases: "The next
|
|
25
|
+
* tightening MUST be `_V2`; adding a condition to `_V1` reintroduces the defect
|
|
26
|
+
* this type exists to remove." A caller who wrote `_V1` keeps exactly the
|
|
27
|
+
* contract they asked for; the stricter check costs them nothing.
|
|
28
|
+
*
|
|
29
|
+
* WHAT V2's credential_boundary PROVES:
|
|
30
|
+
* A signed `cr.posture.receipt.v1` verified against a caller-supplied key
|
|
31
|
+
* (registry or pinned PEM) asserts `verdict: 'PASS'` — the credential
|
|
32
|
+
* boundary was read back out of the live catalog at `measured_at`, that
|
|
33
|
+
* reading is inside the caller's freshness window, and the receipt is bound
|
|
34
|
+
* to this `deployment_id`.
|
|
35
|
+
*
|
|
36
|
+
* WHAT IT DOES NOT PROVE, and this list is the point rather than a caveat:
|
|
37
|
+
* · NOT a tuple the CALLER did not name. executor_id, adapter_id, target_uri
|
|
38
|
+
* and policy_hash ARE now bound (AUDIT P1 / RES-3) — but each only when the
|
|
39
|
+
* construction configures it. The earlier text here said the producer does
|
|
40
|
+
* not sign those fields; re-measured 2026-08-29 against capability-demo
|
|
41
|
+
* demo/src/posture.js, the issuer spreads them into the SIGNED canonical
|
|
42
|
+
* body whenever they carry real content, so binding them is backed by the
|
|
43
|
+
* producer rather than asserted over it. What has NOT changed is the rule
|
|
44
|
+
* underneath: a field nobody configured is reported in the verifier's
|
|
45
|
+
* `not_bound` list, never defaulted into looking checked.
|
|
46
|
+
* · NOT an expiry. The receipt carries `measured_at` and no `expires_at`, so
|
|
47
|
+
* the age check is a FRESHNESS window the CALLER supplies via `maxAgeMs`.
|
|
48
|
+
* A guard-side default would present our policy as the receipt's statement.
|
|
49
|
+
* · NOT executor behaviour. Same honest limit as every other invariant here:
|
|
50
|
+
* construction demands wiring, and a read-back at `measured_at` is a fact
|
|
51
|
+
* about that moment, not about the write that happens afterwards.
|
|
52
|
+
*/
|
|
53
|
+
exports.PROFILE_ENFORCING_ATOMIC_V2 = 'ENFORCING_ATOMIC_V2';
|
|
54
|
+
/**
|
|
55
|
+
* The unsuffixed wire value stays pinned to V1 FOREVER (with-coderifts.ts:231-233).
|
|
56
|
+
* Re-pointing it at V2 would silently move every existing caller — the migration
|
|
57
|
+
* the versioned names exist to refuse.
|
|
58
|
+
*/
|
|
18
59
|
exports.GUARD_ATOMIC_WIRE_VALUE = 'ENFORCING_ATOMIC';
|
|
19
60
|
exports.ATOMIC_PROFILE_UNSATISFIED = 'ATOMIC_PROFILE_UNSATISFIED';
|
|
20
61
|
/** Frozen invariant names — adding one is ATOMIC_V2, not an edit here. */
|
|
@@ -51,8 +92,22 @@ function createMutatorRegister() {
|
|
|
51
92
|
return api;
|
|
52
93
|
}
|
|
53
94
|
function isEnforcingAtomic(profile) {
|
|
54
|
-
return profile === 'ENFORCING_ATOMIC'
|
|
95
|
+
return profile === 'ENFORCING_ATOMIC'
|
|
96
|
+
|| profile === exports.PROFILE_ENFORCING_ATOMIC_V1
|
|
97
|
+
|| profile === exports.PROFILE_ENFORCING_ATOMIC_V2;
|
|
98
|
+
}
|
|
99
|
+
/** V2 only. The unsuffixed alias is V1 and must never answer true here. */
|
|
100
|
+
function isEnforcingAtomicV2(profile) {
|
|
101
|
+
return profile === exports.PROFILE_ENFORCING_ATOMIC_V2;
|
|
55
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* V2 caller-supplied freshness window must be finite, positive, and ≤ 24h.
|
|
105
|
+
* A larger value is not a freshness check (the receipt has no expires_at).
|
|
106
|
+
*/
|
|
107
|
+
exports.ATOMIC_V2_MAX_AGE_MS_CAP = 86_400_000;
|
|
108
|
+
exports.CREDENTIAL_BOUNDARY_BARE_REJECTED = 'credential_boundary: a verified cr.posture.receipt.v1 is required; a bare assertion is no '
|
|
109
|
+
+ 'longer accepted. ENFORCING_ATOMIC_V1 still accepts the bare form and is frozen — move to '
|
|
110
|
+
+ '_V2 to get this check.';
|
|
56
111
|
function atomicConstructionProblems(input) {
|
|
57
112
|
const problems = [];
|
|
58
113
|
const grant = input.executionGrant;
|
|
@@ -90,6 +145,71 @@ function atomicConstructionProblems(input) {
|
|
|
90
145
|
if (input.credentialBoundary !== true && typeof input.credentialBoundary !== 'object') {
|
|
91
146
|
problems.push('credential_boundary: credentialBoundary assertion required');
|
|
92
147
|
}
|
|
148
|
+
// ── V2 ONLY (1167). The two lines above are the FROZEN V1 check and are not
|
|
149
|
+
// edited: on V1 a bare `true` still satisfies credential_boundary, exactly as
|
|
150
|
+
// it did before this file gained a V2. Everything below runs only when the
|
|
151
|
+
// caller asked for _V2, which is what makes the tightening opt-in.
|
|
152
|
+
if (isEnforcingAtomicV2(input.profile)) {
|
|
153
|
+
const cb = input.credentialBoundary;
|
|
154
|
+
if (cb === true || !cb || typeof cb !== 'object' || typeof cb.postureReceipt !== 'string') {
|
|
155
|
+
problems.push(exports.CREDENTIAL_BOUNDARY_BARE_REJECTED);
|
|
156
|
+
}
|
|
157
|
+
else if (!cb.registry && !cb.pinnedKeyPem) {
|
|
158
|
+
problems.push('credential_boundary: credentialBoundary.registry or .pinnedKeyPem required — the posture '
|
|
159
|
+
+ 'receipt is verified against a caller-supplied key; this package never fetches one.');
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
const deploymentId = typeof cb.deploymentId === 'string' ? cb.deploymentId : '';
|
|
163
|
+
if (deploymentId.length === 0) {
|
|
164
|
+
problems.push('credential_boundary: credentialBoundary.deploymentId required under ENFORCING_ATOMIC_V2 — '
|
|
165
|
+
+ 'the posture receipt must be bound to this deployment.');
|
|
166
|
+
}
|
|
167
|
+
const maxAgeMs = cb.maxAgeMs;
|
|
168
|
+
const maxAgeOk = typeof maxAgeMs === 'number'
|
|
169
|
+
&& Number.isFinite(maxAgeMs)
|
|
170
|
+
&& maxAgeMs > 0
|
|
171
|
+
&& maxAgeMs <= exports.ATOMIC_V2_MAX_AGE_MS_CAP;
|
|
172
|
+
if (typeof maxAgeMs !== 'number' || !Number.isFinite(maxAgeMs) || maxAgeMs <= 0) {
|
|
173
|
+
problems.push('credential_boundary: credentialBoundary.maxAgeMs required under ENFORCING_ATOMIC_V2 — '
|
|
174
|
+
+ 'a finite positive freshness window; the receipt signs measured_at and no expires_at.');
|
|
175
|
+
}
|
|
176
|
+
else if (maxAgeMs > exports.ATOMIC_V2_MAX_AGE_MS_CAP) {
|
|
177
|
+
problems.push(`credential_boundary: credentialBoundary.maxAgeMs exceeds the ${exports.ATOMIC_V2_MAX_AGE_MS_CAP}ms `
|
|
178
|
+
+ 'cap (24h). A larger window is not a freshness check.');
|
|
179
|
+
}
|
|
180
|
+
// V2 calls the verifier only with both mandatory args present — a call with neither
|
|
181
|
+
// is itself a construction problem (the verifier stays permissive when invoked directly).
|
|
182
|
+
if (deploymentId.length > 0 && maxAgeOk) {
|
|
183
|
+
// The credential-boundary tuple, from the construction input rather than
|
|
184
|
+
// from anywhere this function could invent it. Each is passed ONLY when
|
|
185
|
+
// configured: an absent one reaches the verifier as undefined and comes
|
|
186
|
+
// back named in `not_bound` — the honest record of a boundary this
|
|
187
|
+
// deployment never stated.
|
|
188
|
+
const r = (0, posture_receipt_js_1.verifyPostureReceipt)(cb.postureReceipt, {
|
|
189
|
+
registry: cb.registry,
|
|
190
|
+
pinnedKeyPem: cb.pinnedKeyPem,
|
|
191
|
+
expectedDeploymentId: deploymentId,
|
|
192
|
+
expectedExecutorId: input.executorId,
|
|
193
|
+
expectedAdapterId: input.adapterId,
|
|
194
|
+
expectedTargetUri: input.targetUri,
|
|
195
|
+
expectedPolicyHash: input.policyHash,
|
|
196
|
+
maxAgeMs,
|
|
197
|
+
now: cb.now,
|
|
198
|
+
});
|
|
199
|
+
if (!r.valid) {
|
|
200
|
+
problems.push(`credential_boundary: posture receipt not verified — ${r.status} (${r.reason}). `
|
|
201
|
+
+ (r.status === 'POSTURE_STALE'
|
|
202
|
+
? 'This is the caller-supplied freshness window (maxAgeMs), not a receipt-carried '
|
|
203
|
+
+ 'expiry: cr.posture.receipt.v1 signs measured_at and no expires_at.'
|
|
204
|
+
: r.status === 'POSTURE_FAIL'
|
|
205
|
+
? 'The signature verified; the posture did not. A signed FAIL is a drift artifact — '
|
|
206
|
+
+ 'the boundary regressed, the receipt is intact.'
|
|
207
|
+
: 'Supply a posture receipt signed by a key in the registry, bound to this '
|
|
208
|
+
+ 'deployment_id, with verdict PASS.'));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
93
213
|
return problems;
|
|
94
214
|
}
|
|
95
215
|
function throwAtomicUnsatisfied(problems) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-profile.js","sourceRoot":"","sources":["../../src/atomic-profile.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"atomic-profile.js","sourceRoot":"","sources":["../../src/atomic-profile.ts"],"names":[],"mappings":";;;AAiFA,sDAkBC;AAED,8CAIC;AAGD,kDAEC;AA8CD,gEAgHC;AAED,wDAOC;AAKD,sCA4BC;AAtTD;;;;;;;GAOG;AACH,6DAA4D;AAG/C,QAAA,2BAA2B,GAAG,qBAA8B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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C,YAAY,EAAE,CAAC;QAC7D,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,MAAM,EAAE,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,aAAa;WACxE,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,iBAAiB;WAChE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,gBAAgB;WAChE,KAAK,CAAC,iBAAiB,CAAC;IAC7B,IAAI,EAAE,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,sBAAsB,CAAC;IAChE,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deny-remedy.v1 — the machine-readable next step attached to a refusal.
|
|
3
|
+
*
|
|
4
|
+
* CANONICAL SCHEMA: capability-demo/docs/deny-remedy.v1.json
|
|
5
|
+
* sha256 3f51c5afd1708a9185075a4f19f6386ea7d63ad39b0104e31f0e4e887b6e167f
|
|
6
|
+
*
|
|
7
|
+
* This builder is the TypeScript transliteration of the copy carried by the
|
|
8
|
+
* JavaScript deny surfaces — same three classes, same refusal to invent a
|
|
9
|
+
* fourth, same schema. It is a copy rather than a shared package on purpose:
|
|
10
|
+
* these repos are installed independently and a shared
|
|
11
|
+
* dependency would make one of them unable to refuse a request because another
|
|
12
|
+
* failed to resolve.
|
|
13
|
+
*
|
|
14
|
+
* WHERE IT SITS IN THE FLOW. The remedy is attached AFTER a verdict is reached,
|
|
15
|
+
* never inside verification. Nothing here reads a key, checks a signature, or
|
|
16
|
+
* can change allow into deny. A surface that emits a remedy has already refused.
|
|
17
|
+
*
|
|
18
|
+
* WHAT IT REFUSES TO EMIT. Three error classes exist and no more. A refusal
|
|
19
|
+
* whose reason does not map to one of them gets NO remedy — an unmapped reason
|
|
20
|
+
* is a refusal we cannot yet describe as a next step, and inventing a fourth
|
|
21
|
+
* class, or defaulting to the nearest one, would send a caller to a step that
|
|
22
|
+
* does not address why they were refused.
|
|
23
|
+
*/
|
|
24
|
+
/** The closed set from the schema. */
|
|
25
|
+
export declare const DENY_ERROR: Readonly<{
|
|
26
|
+
GRANT_REQUIRED: "CODERIFTS_GRANT_REQUIRED";
|
|
27
|
+
GRANT_INVALID: "CODERIFTS_GRANT_INVALID";
|
|
28
|
+
GRANT_MISMATCH: "CODERIFTS_GRANT_MISMATCH";
|
|
29
|
+
}>;
|
|
30
|
+
/** Carried verbatim from the schema so it cannot be softened in rendering. */
|
|
31
|
+
export declare const DOES_NOT_PROMISE = "a grant does not guarantee execution (CAS may still fail)";
|
|
32
|
+
export declare const ARGS_SHAPE: Readonly<{
|
|
33
|
+
artifacts: "Array<{ id, type, before, after }> — the change set being authorized";
|
|
34
|
+
context: "{ operation, environment?, repository?, branch?, pull_request? } — operation is required for authorize";
|
|
35
|
+
}>;
|
|
36
|
+
/** The three classes, as a type. */
|
|
37
|
+
export type DenyError = (typeof DENY_ERROR)[keyof typeof DENY_ERROR];
|
|
38
|
+
/** The emitted object — exactly the shape the schema describes. */
|
|
39
|
+
export interface DenyRemedy {
|
|
40
|
+
error: DenyError;
|
|
41
|
+
target: string | null;
|
|
42
|
+
fingerprint: string | null;
|
|
43
|
+
action_required: {
|
|
44
|
+
tool: 'preflight_change_set';
|
|
45
|
+
mode: 'authorize';
|
|
46
|
+
args_shape: Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
does_not_promise: string;
|
|
49
|
+
observed?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build the remedy object, or return null when this refusal has no remedy.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} o.error one of DENY_ERROR; anything else returns null
|
|
55
|
+
* @param {string} [o.target] the surface's own addressing for what was refused
|
|
56
|
+
* @param {string} [o.fingerprint] the change-set fingerprint the deny was evaluated
|
|
57
|
+
* against, when the surface has one
|
|
58
|
+
* @param {object} [o.observed] free-form, for an operator reading a log
|
|
59
|
+
* @returns {object|null}
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildDenyRemedy({ error, target, fingerprint, observed }: {
|
|
62
|
+
error: DenyError | null;
|
|
63
|
+
target?: string | null;
|
|
64
|
+
fingerprint?: string | null;
|
|
65
|
+
observed?: Record<string, unknown> | null;
|
|
66
|
+
}): DenyRemedy | null;
|
|
67
|
+
/**
|
|
68
|
+
* Map a surface's own refusal reason to an error class.
|
|
69
|
+
*
|
|
70
|
+
* The mapping is explicit and closed. An unlisted reason returns null, which
|
|
71
|
+
* means no remedy — see the note at the top of this file.
|
|
72
|
+
*/
|
|
73
|
+
export declare function denyErrorForReason(reason: unknown): DenyError | null;
|
|
74
|
+
//# sourceMappingURL=deny-remedy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deny-remedy.d.ts","sourceRoot":"","sources":["../../src/deny-remedy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,sCAAsC;AACtC,eAAO,MAAM,UAAU;;;;EAIrB,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,8DAA8D,CAAC;AAE5F,eAAO,MAAM,UAAU;;;EAGrB,CAAC;AAIH,oCAAoC;AACpC,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAC;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IACzG,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,EAAE,KAAK,EAAE,MAAa,EAAE,WAAkB,EAAE,QAAe,EAAE,EAAE;IAC7D,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC3C,GACA,UAAU,GAAG,IAAI,CAsBnB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CA+CpE"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ARGS_SHAPE = exports.DOES_NOT_PROMISE = exports.DENY_ERROR = void 0;
|
|
4
|
+
exports.buildDenyRemedy = buildDenyRemedy;
|
|
5
|
+
exports.denyErrorForReason = denyErrorForReason;
|
|
6
|
+
/**
|
|
7
|
+
* deny-remedy.v1 — the machine-readable next step attached to a refusal.
|
|
8
|
+
*
|
|
9
|
+
* CANONICAL SCHEMA: capability-demo/docs/deny-remedy.v1.json
|
|
10
|
+
* sha256 3f51c5afd1708a9185075a4f19f6386ea7d63ad39b0104e31f0e4e887b6e167f
|
|
11
|
+
*
|
|
12
|
+
* This builder is the TypeScript transliteration of the copy carried by the
|
|
13
|
+
* JavaScript deny surfaces — same three classes, same refusal to invent a
|
|
14
|
+
* fourth, same schema. It is a copy rather than a shared package on purpose:
|
|
15
|
+
* these repos are installed independently and a shared
|
|
16
|
+
* dependency would make one of them unable to refuse a request because another
|
|
17
|
+
* failed to resolve.
|
|
18
|
+
*
|
|
19
|
+
* WHERE IT SITS IN THE FLOW. The remedy is attached AFTER a verdict is reached,
|
|
20
|
+
* never inside verification. Nothing here reads a key, checks a signature, or
|
|
21
|
+
* can change allow into deny. A surface that emits a remedy has already refused.
|
|
22
|
+
*
|
|
23
|
+
* WHAT IT REFUSES TO EMIT. Three error classes exist and no more. A refusal
|
|
24
|
+
* whose reason does not map to one of them gets NO remedy — an unmapped reason
|
|
25
|
+
* is a refusal we cannot yet describe as a next step, and inventing a fourth
|
|
26
|
+
* class, or defaulting to the nearest one, would send a caller to a step that
|
|
27
|
+
* does not address why they were refused.
|
|
28
|
+
*/
|
|
29
|
+
/** The closed set from the schema. */
|
|
30
|
+
exports.DENY_ERROR = Object.freeze({
|
|
31
|
+
GRANT_REQUIRED: 'CODERIFTS_GRANT_REQUIRED',
|
|
32
|
+
GRANT_INVALID: 'CODERIFTS_GRANT_INVALID',
|
|
33
|
+
GRANT_MISMATCH: 'CODERIFTS_GRANT_MISMATCH',
|
|
34
|
+
});
|
|
35
|
+
/** Carried verbatim from the schema so it cannot be softened in rendering. */
|
|
36
|
+
exports.DOES_NOT_PROMISE = 'a grant does not guarantee execution (CAS may still fail)';
|
|
37
|
+
exports.ARGS_SHAPE = Object.freeze({
|
|
38
|
+
artifacts: 'Array<{ id, type, before, after }> — the change set being authorized',
|
|
39
|
+
context: '{ operation, environment?, repository?, branch?, pull_request? } — operation is required for authorize',
|
|
40
|
+
});
|
|
41
|
+
const FINGERPRINT_RE = /^sha256:[0-9a-f]{64}$/;
|
|
42
|
+
/**
|
|
43
|
+
* Build the remedy object, or return null when this refusal has no remedy.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} o.error one of DENY_ERROR; anything else returns null
|
|
46
|
+
* @param {string} [o.target] the surface's own addressing for what was refused
|
|
47
|
+
* @param {string} [o.fingerprint] the change-set fingerprint the deny was evaluated
|
|
48
|
+
* against, when the surface has one
|
|
49
|
+
* @param {object} [o.observed] free-form, for an operator reading a log
|
|
50
|
+
* @returns {object|null}
|
|
51
|
+
*/
|
|
52
|
+
function buildDenyRemedy({ error, target = null, fingerprint = null, observed = null }) {
|
|
53
|
+
if (!error || !Object.values(exports.DENY_ERROR).includes(error))
|
|
54
|
+
return null;
|
|
55
|
+
const remedy = {
|
|
56
|
+
error,
|
|
57
|
+
// Null, never a wildcard: a surface that cannot name what it refused must
|
|
58
|
+
// not emit a value a reader could take for "everything".
|
|
59
|
+
target: typeof target === 'string' && target.length > 0 ? target : null,
|
|
60
|
+
// Only a well-formed fingerprint. A malformed one is dropped rather than
|
|
61
|
+
// passed through, because a caller comparing it would get a false mismatch.
|
|
62
|
+
fingerprint: typeof fingerprint === 'string' && FINGERPRINT_RE.test(fingerprint)
|
|
63
|
+
? fingerprint
|
|
64
|
+
: null,
|
|
65
|
+
action_required: {
|
|
66
|
+
tool: 'preflight_change_set',
|
|
67
|
+
mode: 'authorize',
|
|
68
|
+
args_shape: { ...exports.ARGS_SHAPE },
|
|
69
|
+
},
|
|
70
|
+
does_not_promise: exports.DOES_NOT_PROMISE,
|
|
71
|
+
};
|
|
72
|
+
if (observed && typeof observed === 'object')
|
|
73
|
+
remedy.observed = observed;
|
|
74
|
+
return remedy;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Map a surface's own refusal reason to an error class.
|
|
78
|
+
*
|
|
79
|
+
* The mapping is explicit and closed. An unlisted reason returns null, which
|
|
80
|
+
* means no remedy — see the note at the top of this file.
|
|
81
|
+
*/
|
|
82
|
+
function denyErrorForReason(reason) {
|
|
83
|
+
switch (String(reason || '').toLowerCase()) {
|
|
84
|
+
// Nothing was presented.
|
|
85
|
+
case 'receipt_missing':
|
|
86
|
+
case 'missing_receipt':
|
|
87
|
+
case 'missing_grant_header':
|
|
88
|
+
case 'decision_missing':
|
|
89
|
+
case 'missing_decision_result':
|
|
90
|
+
case 'no_preflight_response':
|
|
91
|
+
case 'grant_not_supplied':
|
|
92
|
+
return exports.DENY_ERROR.GRANT_REQUIRED;
|
|
93
|
+
// Something was presented and did not hold up.
|
|
94
|
+
case 'receipt_invalid':
|
|
95
|
+
case 'receipt_unverified':
|
|
96
|
+
case 'invalid_signature':
|
|
97
|
+
case 'unknown_key':
|
|
98
|
+
case 'unknown_kid':
|
|
99
|
+
case 'dsse_malformed':
|
|
100
|
+
case 'dsse_unsupported':
|
|
101
|
+
case 'dsse_predicate_mismatch':
|
|
102
|
+
case 'malformed':
|
|
103
|
+
case 'grant_malformed':
|
|
104
|
+
case 'grant_unverified':
|
|
105
|
+
case 'grant_expired':
|
|
106
|
+
return exports.DENY_ERROR.GRANT_INVALID;
|
|
107
|
+
// It held up, but it is not about this request.
|
|
108
|
+
case 'scope_mismatch':
|
|
109
|
+
case 'target_mismatch':
|
|
110
|
+
case 'operation_mismatch':
|
|
111
|
+
case 'grant_scope_mismatch':
|
|
112
|
+
case 'mode_mismatch':
|
|
113
|
+
case 'repo_mismatch':
|
|
114
|
+
case 'base_mismatch':
|
|
115
|
+
case 'head_mismatch':
|
|
116
|
+
case 'grant_does_not_cover_path':
|
|
117
|
+
case 'grant_bound_elsewhere':
|
|
118
|
+
case 'receipt_envelope_mismatch':
|
|
119
|
+
case 'artifact_mismatch':
|
|
120
|
+
case 'grant_unbound':
|
|
121
|
+
case 'grant_wrong_audience':
|
|
122
|
+
return exports.DENY_ERROR.GRANT_MISMATCH;
|
|
123
|
+
default:
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=deny-remedy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deny-remedy.js","sourceRoot":"","sources":["../../src/deny-remedy.ts"],"names":[],"mappings":";;;AA+DA,0CA6BC;AAQD,gDA+CC;AAnJD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,sCAAsC;AACzB,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,cAAc,EAAE,0BAA0B;IAC1C,aAAa,EAAE,yBAAyB;IACxC,cAAc,EAAE,0BAA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AI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3C,yBAAyB;QACzB,KAAK,iBAAiB,CAAC;QACvB,KAAK,iBAAiB,CAAC;QACvB,KAAK,sBAAsB,CAAC;QAC5B,KAAK,kBAAkB,CAAC;QACxB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,uBAAuB,CAAC;QAC7B,KAAK,oBAAoB;YACvB,OAAO,kBAAU,CAAC,cAAc,CAAC;QAEnC,+CAA+C;QAC/C,KAAK,iBAAiB,CAAC;QACvB,KAAK,oBAAoB,CAAC;QAC1B,KAAK,mBAAmB,CAAC;QACzB,KAAK,aAAa,CAAC;QACnB,KAAK,aAAa,CAAC;QACnB,KAAK,gBAAgB,CAAC;QACtB,KAAK,kBAAkB,CAAC;QACxB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,WAAW,CAAC;QACjB,KAAK,iBAAiB,CAAC;QACvB,KAAK,kBAAkB,CAAC;QACxB,KAAK,eAAe;YAClB,OAAO,kBAAU,CAAC,aAAa,CAAC;QAElC,gDAAgD;QAChD,KAAK,gBAAgB,CAAC;QACtB,KAAK,iBAAiB,CAAC;QACvB,KAAK,oBAAoB,CAAC;QAC1B,KAAK,sBAAsB,CAAC;QAC5B,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe,CAAC;QACrB,KAAK,eAAe,CAAC;QACrB,KAAK,2BAA2B,CAAC;QACjC,KAAK,uBAAuB,CAAC;QAC7B,KAAK,2BAA2B,CAAC;QACjC,KAAK,mBAAmB,CAAC;QACzB,KAAK,eAAe,CAAC;QACrB,KAAK,sBAAsB;YACzB,OAAO,kBAAU,CAAC,cAAc,CAAC;QAEnC;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -59,7 +59,20 @@ export type DeployGateReason = 'allow_current_deploy' | 'no_receipt' | 'receipt_
|
|
|
59
59
|
* guard-defined view_spec provenance. Distinct from receipt_not_authorized: "you didn't prove
|
|
60
60
|
* it" ≠ "verification says no".
|
|
61
61
|
*/
|
|
62
|
-
| 'unverified_receipt_view' | 'invalid_signature' | 'expired' | 'unknown_key' | 'retired_key'
|
|
62
|
+
| 'unverified_receipt_view' | 'invalid_signature' | 'expired' | 'unknown_key' | 'retired_key'
|
|
63
|
+
/**
|
|
64
|
+
* The registry has withdrawn this key: status `revoked`, or a `revoked_at`
|
|
65
|
+
* timestamp on the entry. Distinct from retired_key, which is a planned
|
|
66
|
+
* rotation whose pre-rotation receipts stay meaningful. NOT repairable by
|
|
67
|
+
* re-requesting a receipt — the same key would sign it.
|
|
68
|
+
*/
|
|
69
|
+
| 'revoked_key'
|
|
70
|
+
/**
|
|
71
|
+
* The registry carries a key status this verifier does not understand. Fails
|
|
72
|
+
* closed rather than reading it as healthy: an unrecognised status is more
|
|
73
|
+
* likely a withdrawal we cannot parse than a permission we should grant.
|
|
74
|
+
*/
|
|
75
|
+
| 'unknown_key_status';
|
|
63
76
|
/** What is being deployed — all fields are INPUTS (the pure function performs no discovery). */
|
|
64
77
|
export type DeployTarget = {
|
|
65
78
|
environment: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-gate.d.ts","sourceRoot":"","sources":["../../src/deploy-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAG,wBAAiC,CAAC;AAE1E;;sFAEsF;AACtF,MAAM,MAAM,gBAAgB,GACxB,sBAAsB,GACtB,YAAY,GACZ,wBAAwB,GACxB,oBAAoB,GACpB,cAAc,GACd,gBAAgB,GAChB,sBAAsB,GACtB,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,mBAAmB,GACnB,4BAA4B,GAC5B,aAAa;AACf;;;;;GAKG;GACD,wBAAwB;AAC1B;;;;GAIG;GACD,yBAAyB,GACzB,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-gate.d.ts","sourceRoot":"","sources":["../../src/deploy-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAG,wBAAiC,CAAC;AAE1E;;sFAEsF;AACtF,MAAM,MAAM,gBAAgB,GACxB,sBAAsB,GACtB,YAAY,GACZ,wBAAwB,GACxB,oBAAoB,GACpB,cAAc,GACd,gBAAgB,GAChB,sBAAsB,GACtB,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,mBAAmB,GACnB,4BAA4B,GAC5B,aAAa;AACf;;;;;GAKG;GACD,wBAAwB;AAC1B;;;;GAIG;GACD,yBAAyB,GACzB,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,aAAa;AACf;;;;;GAKG;GACD,aAAa;AACf;;;;GAIG;GACD,oBAAoB,CAAC;AAEzB,gGAAgG;AAChG,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,iGAAiG;IACjG,WAAW,EAAE,MAAM,CAAC;IACpB,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AAC;IAC1B,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;OAGG;IACH,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IACF;;OAEG;IACH,YAAY,EAAE,6BAA6B,CAAC;CAC7C,CAAC;AAkCF;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,CAqJrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-gate.js","sourceRoot":"","sources":["../../src/deploy-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;
|
|
1
|
+
{"version":3,"file":"deploy-gate.js","sourceRoot":"","sources":["../../src/deploy-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;AAmHH,kEAUC;AAED,kEAIC;AA6GD,gCAqJC;AAlYD,uEAGmC;AAKnC;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,wBAAiC,CAAC;AAkG1E,uFAAuF;AACvF,SAAgB,2BAA2B,CACzC,IAAuB,EACvB,aAAa,GAAG,kBAAkB;IAElC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GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,OAAO;QACL,cAAc,EAAE,IAAI;QACpB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,sBAAsB;QAC9B,iBAAiB;QACjB,kBAAkB;QAClB,SAAS;QACT,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;QACzB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -36,7 +36,7 @@ export type DeployTokenReceipt = {
|
|
|
36
36
|
/** Air-gap single PEM (kid-agnostic). */
|
|
37
37
|
pinnedKeyPem?: string;
|
|
38
38
|
};
|
|
39
|
-
export type DeployTokenVerifyStatus = 'VERIFIED_CURRENT' | 'VERIFIED_EXPIRED' | 'RETIRED_KEY_VALID_AT_ISSUE' | 'INVALID_SIGNATURE' | 'MALFORMED' | 'UNKNOWN_KEY' | 'UNSUPPORTED_VERSION';
|
|
39
|
+
export type DeployTokenVerifyStatus = 'VERIFIED_CURRENT' | 'VERIFIED_EXPIRED' | 'RETIRED_KEY_VALID_AT_ISSUE' | 'INVALID_SIGNATURE' | 'MALFORMED' | 'UNKNOWN_KEY' | 'UNSUPPORTED_VERSION' | 'KEY_REVOKED' | 'REVOKED_KEY' | 'REVOKED_KEY_UNDECIDABLE' | 'KEY_RETIRED_AFTER_SIGNING' | 'UNKNOWN_KEY_STATUS';
|
|
40
40
|
export type DeployTokenVerifyResult = {
|
|
41
41
|
valid: boolean;
|
|
42
42
|
status: DeployTokenVerifyStatus;
|
|
@@ -46,7 +46,7 @@ export type DeployTokenVerifyResult = {
|
|
|
46
46
|
denyReason: string | null;
|
|
47
47
|
payload?: Record<string, unknown>;
|
|
48
48
|
view: TokenDerivedReceiptView | null;
|
|
49
|
-
key_status: 'active' | 'retired' | null;
|
|
49
|
+
key_status: 'active' | 'retired' | 'revoked' | 'unknown' | null;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Verify a chain-receipt token against a registry or pinned PEM. Pure (no I/O).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-receipt-token.d.ts","sourceRoot":"","sources":["../../src/deploy-receipt-token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,6FAA6F;AAC7F,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,wGAAwG;IACxG,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,kBAAkB,GAClB,4BAA4B,GAC5B,mBAAmB,GACnB,WAAW,GACX,aAAa,GACb,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-receipt-token.d.ts","s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C;IAC5B,uEAAuE;IACvE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;CACjE,CAAC;AA2LF;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,kBAAkB,EACzB,SAAS,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,EAClF,KAAK,CAAC,EAAE,MAAM,GACb,uBAAuB,CA0IzB"}
|
|
@@ -36,6 +36,48 @@ function reconstructInput(payload) {
|
|
|
36
36
|
}
|
|
37
37
|
return v1;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* The key-withdrawal half of the published verifier's status taxonomy
|
|
41
|
+
* (`receipt-verifier/verify.js` deriveStatus, RECEIPT_FORMAT.md §7.1),
|
|
42
|
+
* transliterated. Returns the refusal status, or null to continue.
|
|
43
|
+
*
|
|
44
|
+
* Order matters and matches the reference: an unknown status fails closed before
|
|
45
|
+
* anything else is read; `revoked_at` kills the whole key history because the
|
|
46
|
+
* attacker chooses `ts`; `retired_at` only rejects receipts signed at or after
|
|
47
|
+
* it. A revoked key is never valid — UNDECIDABLE is not a softer accept, it
|
|
48
|
+
* reports that a legitimate pre-compromise receipt cannot be told apart from a
|
|
49
|
+
* backdated forgery.
|
|
50
|
+
*
|
|
51
|
+
* Kept as a small local function rather than a shared import: this package ships
|
|
52
|
+
* pure and dependency-light, and the reference core is CommonJS with a CLI and
|
|
53
|
+
* `fs` at module scope. `test/vendor-core.test.js` pins agreement with a
|
|
54
|
+
* byte-identical copy of that core, so the two cannot drift silently.
|
|
55
|
+
*/
|
|
56
|
+
function deriveKeyWithdrawalStatus(ts, keyMeta) {
|
|
57
|
+
const KNOWN_STATUSES = ['active', 'retired', 'revoked', null];
|
|
58
|
+
if (!KNOWN_STATUSES.includes(keyMeta.status))
|
|
59
|
+
return 'UNKNOWN_KEY_STATUS';
|
|
60
|
+
if (typeof keyMeta.revoked_at === 'string' && keyMeta.revoked_at.length > 0)
|
|
61
|
+
return 'KEY_REVOKED';
|
|
62
|
+
if (typeof keyMeta.retired_at === 'string' && keyMeta.retired_at.length > 0 && ts) {
|
|
63
|
+
const issued = Date.parse(ts);
|
|
64
|
+
const retired = Date.parse(keyMeta.retired_at);
|
|
65
|
+
if (Number.isFinite(issued) && Number.isFinite(retired) && issued >= retired) {
|
|
66
|
+
return 'KEY_RETIRED_AFTER_SIGNING';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (keyMeta.status === 'revoked') {
|
|
70
|
+
const at = keyMeta.compromised_at;
|
|
71
|
+
if (typeof at !== 'string' || at.length === 0)
|
|
72
|
+
return 'REVOKED_KEY_UNDECIDABLE';
|
|
73
|
+
const boundary = Date.parse(at);
|
|
74
|
+
const issued = typeof ts === 'string' ? Date.parse(ts) : NaN;
|
|
75
|
+
if (!Number.isFinite(boundary) || !Number.isFinite(issued))
|
|
76
|
+
return 'REVOKED_KEY_UNDECIDABLE';
|
|
77
|
+
return issued >= boundary ? 'REVOKED_KEY' : 'REVOKED_KEY_UNDECIDABLE';
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
39
81
|
function isIssueTimeWithinKeyWindow(ts, keyMeta) {
|
|
40
82
|
if (!keyMeta || keyMeta.status === 'active')
|
|
41
83
|
return true;
|
|
@@ -60,6 +102,12 @@ function isIssueTimeWithinKeyWindow(ts, keyMeta) {
|
|
|
60
102
|
return false;
|
|
61
103
|
return true;
|
|
62
104
|
}
|
|
105
|
+
function optionalString(source, field) {
|
|
106
|
+
if (!source || typeof source !== 'object')
|
|
107
|
+
return null;
|
|
108
|
+
const v = source[field];
|
|
109
|
+
return typeof v === 'string' && v.length > 0 ? v : null;
|
|
110
|
+
}
|
|
63
111
|
function resolveKey(kid, registry, pinnedKeyPem) {
|
|
64
112
|
if (typeof pinnedKeyPem === 'string' && pinnedKeyPem.trim().length > 0) {
|
|
65
113
|
try {
|
|
@@ -68,6 +116,8 @@ function resolveKey(kid, registry, pinnedKeyPem) {
|
|
|
68
116
|
status: 'active',
|
|
69
117
|
valid_from: null,
|
|
70
118
|
retired_at: null,
|
|
119
|
+
revoked_at: null,
|
|
120
|
+
compromised_at: null,
|
|
71
121
|
};
|
|
72
122
|
}
|
|
73
123
|
catch {
|
|
@@ -83,9 +133,11 @@ function resolveKey(kid, registry, pinnedKeyPem) {
|
|
|
83
133
|
try {
|
|
84
134
|
return {
|
|
85
135
|
publicKey: (0, node_crypto_1.createPublicKey)(entry.public_key_pem),
|
|
86
|
-
status: entry.status === '
|
|
136
|
+
status: typeof entry.status === 'string' ? entry.status : null,
|
|
87
137
|
valid_from: entry.valid_from || null,
|
|
88
138
|
retired_at: entry.retired_at || null,
|
|
139
|
+
revoked_at: optionalString(entry, 'revoked_at'),
|
|
140
|
+
compromised_at: optionalString(entry, 'compromised_at'),
|
|
89
141
|
};
|
|
90
142
|
}
|
|
91
143
|
catch {
|
|
@@ -168,6 +220,17 @@ function verifyDeployReceiptToken(input, _intended = {}, nowMs) {
|
|
|
168
220
|
return fail('INVALID_SIGNATURE', 'invalid_signature', { payload, authz_reason: 'delimiter_in_field' });
|
|
169
221
|
}
|
|
170
222
|
}
|
|
223
|
+
// A key the registry has withdrawn is judged BEFORE any authorization path.
|
|
224
|
+
// The signature verified — that is precisely the problem a withdrawal exists
|
|
225
|
+
// to answer, and no timestamp on a receipt the attacker minted may rehabilitate it.
|
|
226
|
+
const withdrawn = deriveKeyWithdrawalStatus(typeof payload.ts === 'string' ? payload.ts : undefined, resolved);
|
|
227
|
+
if (withdrawn) {
|
|
228
|
+
return fail(withdrawn, withdrawn === 'UNKNOWN_KEY_STATUS' ? 'unknown_key_status' : 'revoked_key', {
|
|
229
|
+
payload,
|
|
230
|
+
authz_reason: withdrawn.toLowerCase(),
|
|
231
|
+
key_status: withdrawn === 'UNKNOWN_KEY_STATUS' ? 'unknown' : 'revoked',
|
|
232
|
+
});
|
|
233
|
+
}
|
|
171
234
|
if (resolved.status === 'retired') {
|
|
172
235
|
if (!isIssueTimeWithinKeyWindow(typeof payload.ts === 'string' ? payload.ts : undefined, resolved)) {
|
|
173
236
|
return fail('INVALID_SIGNATURE', 'invalid_signature', { payload, authz_reason: 'retired_key_outside_window' });
|