@cef-ai/vault-sdk 4.0.0 → 4.2.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/dist/core/grant-doc.d.ts +160 -28
- package/dist/core/grant-doc.d.ts.map +1 -1
- package/dist/core/grant-doc.js +202 -37
- package/dist/core/grant-doc.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/memberships.d.ts +27 -0
- package/dist/internal/memberships.d.ts.map +1 -1
- package/dist/internal/memberships.js +48 -5
- package/dist/internal/memberships.js.map +1 -1
- package/package.json +3 -3
package/dist/core/grant-doc.d.ts
CHANGED
|
@@ -1,13 +1,75 @@
|
|
|
1
1
|
import type { SignedGrant, SignedRoster } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
* The schema string
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* handing a v2 document's fields to a v1 reader under a signature that is
|
|
8
|
-
* perfectly valid for the v2 meaning.
|
|
3
|
+
* The schema string a CEILING-LESS grant carries inside its signed bytes
|
|
4
|
+
* (`authz.GrantSchemaV1`). Still emitted, still the common case: a grant that
|
|
5
|
+
* sets no privacy ceiling is encoded at v1, byte for byte as it always was,
|
|
6
|
+
* so every signature minted before v2 existed goes on verifying.
|
|
9
7
|
*/
|
|
10
8
|
export declare const GRANT_SCHEMA = "cere.vault.grant.v1";
|
|
9
|
+
/**
|
|
10
|
+
* The schema string a ceiling-carrying grant carries (`authz.GrantSchemaV2`).
|
|
11
|
+
*
|
|
12
|
+
* A document is v2 if and only if it carries a privacy ceiling. There is no
|
|
13
|
+
* v2 spelling of "no ceiling" — that is v1, and giving it two spellings is
|
|
14
|
+
* the ambiguity `NO_GRANT_EXPIRY`'s comment spends a paragraph refusing.
|
|
15
|
+
*
|
|
16
|
+
* The version is a FUNCTION of the ceiling rather than an unconditional bump:
|
|
17
|
+
* bumping it always would change the bytes of every grant, including the
|
|
18
|
+
* overwhelming majority that sets no ceiling, which is a flag day on every
|
|
19
|
+
* stored signature. See `canonicalGrantBytesWithCeiling`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const GRANT_SCHEMA_V2 = "cere.vault.grant.v2";
|
|
22
|
+
/**
|
|
23
|
+
* The most sensitive class of fact a membership may see, when the grant
|
|
24
|
+
* carries one — Go's `vault.PrivacyCeiling`, reproduced.
|
|
25
|
+
*
|
|
26
|
+
* # IT IS NOT A SCOPE LEVEL, AND THE TWO MUST NEVER BE COMPARED
|
|
27
|
+
*
|
|
28
|
+
* Level (audit|reader|member) is WHAT a member may do in a place. Privacy is
|
|
29
|
+
* HOW SENSITIVE a thing is, independent of where it lives. The two enums
|
|
30
|
+
* share no value, which is what makes a mix-up a refusal rather than a silent
|
|
31
|
+
* widening: `isValidPrivacyCeiling("member")` is false.
|
|
32
|
+
*
|
|
33
|
+
* A BRANDED string for the same reason `GrantExpiry` is one: it sits next to
|
|
34
|
+
* `expiresAt` in the encoder's parameter list, and two adjacent parameters of
|
|
35
|
+
* the same underlying kind are the slip that compiles and signs valid bytes
|
|
36
|
+
* for the wrong document. Use {@link privacyCeiling} to make one.
|
|
37
|
+
*/
|
|
38
|
+
export type PrivacyCeiling = string & {
|
|
39
|
+
readonly __privacyCeiling: unique symbol;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The ONE spelling of "no privacy ceiling was ever signed for this
|
|
43
|
+
* membership" — and it is NOT a synonym for `"public"`.
|
|
44
|
+
*
|
|
45
|
+
* It means NOTHING VISIBLE, and that is a decision on the record: a caller
|
|
46
|
+
* whose ceiling is this sees no memory-graph row at all, because a ceiling
|
|
47
|
+
* nobody signed is not a ceiling. Picking `"internal"` as the default would
|
|
48
|
+
* invent an authorisation the vault owner never attested on the axis whose
|
|
49
|
+
* whole job is disclosure — the same ruling `NO_GRANT_EXPIRY` makes one field
|
|
50
|
+
* earlier, except that there the failure direction WIDENS an unsigned grant
|
|
51
|
+
* and here it NARROWS to zero, which is why failing closed is free.
|
|
52
|
+
*
|
|
53
|
+
* Selects {@link GRANT_SCHEMA} in the encoder: a grant carrying this is a v1
|
|
54
|
+
* document, byte for byte.
|
|
55
|
+
*/
|
|
56
|
+
export declare const NO_PRIVACY_CEILING: PrivacyCeiling;
|
|
57
|
+
/**
|
|
58
|
+
* Every ceiling a grant may carry, least to most sensitive — Go's
|
|
59
|
+
* `validPrivacyCeilings`. {@link NO_PRIVACY_CEILING} is deliberately ABSENT:
|
|
60
|
+
* it is a legal decoded state (the document is v1) but never a value a caller
|
|
61
|
+
* may SET, and admitting `""` at the writer would give the state two
|
|
62
|
+
* spellings.
|
|
63
|
+
*/
|
|
64
|
+
export declare const PRIVACY_CEILINGS: readonly ["public", "internal", "private", "restricted"];
|
|
65
|
+
/** The literal union of {@link PRIVACY_CEILINGS} — what `privacyCeiling` accepts. */
|
|
66
|
+
export type PrivacyCeilingName = (typeof PRIVACY_CEILINGS)[number];
|
|
67
|
+
/** Is `c` a ceiling a v2 grant may carry? The WRITER-side guard. */
|
|
68
|
+
export declare function isValidPrivacyCeiling(c: PrivacyCeiling): boolean;
|
|
69
|
+
/** Tags a string as a privacy ceiling. The parameter type is the literal
|
|
70
|
+
* union, so a misspelling is a compile error and an as-yet-unknown ceiling
|
|
71
|
+
* from a newer peer has to be cast deliberately. */
|
|
72
|
+
export declare function privacyCeiling(c: PrivacyCeilingName): PrivacyCeiling;
|
|
11
73
|
/**
|
|
12
74
|
* The header a membership write carries the vault owner's grant signature in
|
|
13
75
|
* (`authz.GrantSignatureHeader`), hex, with or without an `0x` prefix.
|
|
@@ -186,16 +248,31 @@ export interface Grant {
|
|
|
186
248
|
* see the header's rule.
|
|
187
249
|
*/
|
|
188
250
|
expiresAt: GrantExpiry;
|
|
251
|
+
/**
|
|
252
|
+
* The most sensitive class of fact this membership may see, or
|
|
253
|
+
* {@link NO_PRIVACY_CEILING} when the document is v1 and no ceiling was
|
|
254
|
+
* signed.
|
|
255
|
+
*
|
|
256
|
+
* NO_PRIVACY_CEILING HERE MEANS NOTHING VISIBLE, not "public". Read that
|
|
257
|
+
* as "this membership was signed before the memory surface existed and
|
|
258
|
+
* attests no disclosure at all" — the vault owner opts a member in by
|
|
259
|
+
* signing a v2 grant, which is a ceremony, not a default.
|
|
260
|
+
*
|
|
261
|
+
* Mirrors Go's `Grant.PrivacyCeiling`, which decodes v1 documents to
|
|
262
|
+
* `NoPrivacyCeiling` for the same reason.
|
|
263
|
+
*/
|
|
264
|
+
privacyCeiling: PrivacyCeiling;
|
|
189
265
|
}
|
|
190
266
|
/**
|
|
191
267
|
* A signed grant that could not be trusted: the signature does not verify,
|
|
192
268
|
* the document does not decode, its schema is unknown, or it describes a
|
|
193
269
|
* different membership from the one it was served under.
|
|
194
270
|
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
271
|
+
* THROWN by {@link verifyGrant}, where one grant IS the whole question and a
|
|
272
|
+
* failure must stop the caller. REPORTED (and the entry skipped) by
|
|
273
|
+
* {@link verifySignedRoster}, where the same failure on one entry used to
|
|
274
|
+
* fail the whole roster for every other member — see that function's doc
|
|
275
|
+
* comment for the outage that ruling turned out to be. `memberPubkey` names
|
|
199
276
|
* the entry so an operator can find it.
|
|
200
277
|
*/
|
|
201
278
|
export declare class GrantVerificationError extends Error {
|
|
@@ -214,8 +291,17 @@ export declare class GrantVerificationError extends Error {
|
|
|
214
291
|
memberPubkey?: string);
|
|
215
292
|
}
|
|
216
293
|
/**
|
|
217
|
-
* The exact bytes a grant signature covers,
|
|
218
|
-
* `authz.CanonicalGrantBytes
|
|
294
|
+
* The exact bytes a CEILING-LESS grant signature covers — v1, byte for byte
|
|
295
|
+
* as `authz.CanonicalGrantBytes` has always emitted them. Delegates to
|
|
296
|
+
* {@link canonicalGrantBytesWithCeiling}; see that function for the full
|
|
297
|
+
* contract, and this file's header for why the version is a function of the
|
|
298
|
+
* ceiling rather than an unconditional bump.
|
|
299
|
+
*/
|
|
300
|
+
export declare function canonicalGrantBytes(vaultId: string, memberPubkey: string, role: string, scopes: Record<string, string>, issuedAt: string, expiresAt: GrantExpiry): Uint8Array;
|
|
301
|
+
/**
|
|
302
|
+
* The encoder, mirroring `authz.CanonicalGrantBytesWithCeiling`. Emits
|
|
303
|
+
* {@link GRANT_SCHEMA} when the grant sets no privacy ceiling and
|
|
304
|
+
* {@link GRANT_SCHEMA_V2} when it sets one.
|
|
219
305
|
*
|
|
220
306
|
* Every bound value is inside the output: a document proves ONE member's
|
|
221
307
|
* standing on ONE vault and nothing else. `scopes` is emitted as an ARRAY
|
|
@@ -230,12 +316,16 @@ export declare class GrantVerificationError extends Error {
|
|
|
230
316
|
* document with no mint time that verifies exactly as well as one with a mint
|
|
231
317
|
* time.
|
|
232
318
|
*
|
|
233
|
-
* `
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
319
|
+
* `privacyCeiling` is emitted LAST, after `expiresAt`, and ONLY when set —
|
|
320
|
+
* `omitempty` in Go, an append here — so a ceiling-less grant is
|
|
321
|
+
* byte-identical to a v1 document and every signature already stored goes on
|
|
322
|
+
* matching what this encoder rebuilds.
|
|
323
|
+
*
|
|
324
|
+
* The ceiling is REFUSED, never coerced: an unrecognised value throws, because
|
|
325
|
+
* a document that verifies perfectly and confers a ceiling nobody named is,
|
|
326
|
+
* on the disclosure axis, the one output this function must never hand back.
|
|
327
|
+
* {@link NO_PRIVACY_CEILING} is the single exception and is not a value: it
|
|
328
|
+
* selects v1.
|
|
239
329
|
*
|
|
240
330
|
* `issuedAt` has NO DEFAULT on purpose: a `new Date().toISOString()` fallback
|
|
241
331
|
* would be a hidden clock inside the encoder, and a caller who forgot to pass
|
|
@@ -247,15 +337,19 @@ export declare class GrantVerificationError extends Error {
|
|
|
247
337
|
*
|
|
248
338
|
* `expiresAt` is the ONE parameter with no emptiness check, because `""` is
|
|
249
339
|
* {@link NO_GRANT_EXPIRY} — a legal, common, deliberate value rather than a
|
|
250
|
-
* missing one.
|
|
340
|
+
* missing one. `ceiling` shares the exemption for the same reason.
|
|
251
341
|
*/
|
|
252
|
-
export declare function
|
|
342
|
+
export declare function canonicalGrantBytesWithCeiling(vaultId: string, memberPubkey: string, role: string, scopes: Record<string, string>, issuedAt: string, expiresAt: GrantExpiry, privacyCeiling: PrivacyCeiling): Uint8Array;
|
|
253
343
|
/**
|
|
254
344
|
* Reads a canonical grant document back into its parts, mirroring
|
|
255
345
|
* `authz.DecodeGrantDoc`. Never re-encodes; the bytes stay the authority.
|
|
256
346
|
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
347
|
+
* Accepts BOTH current schemas — {@link GRANT_SCHEMA} and
|
|
348
|
+
* {@link GRANT_SCHEMA_V2} — with the field that distinguishes them checked in
|
|
349
|
+
* both directions (a v1 document carrying a `privacyCeiling` is a forgery
|
|
350
|
+
* shape; a v2 document without a recognised one has given "no ceiling" a
|
|
351
|
+
* second spelling). Throws on any other schema and on the same three required
|
|
352
|
+
* fields the encoder refuses to omit.
|
|
259
353
|
*/
|
|
260
354
|
export declare function decodeGrantDoc(doc: Uint8Array): Grant;
|
|
261
355
|
/**
|
|
@@ -271,6 +365,25 @@ export declare function decodeGrantDoc(doc: Uint8Array): Grant;
|
|
|
271
365
|
* wallets and SDKs disagree about both.
|
|
272
366
|
*/
|
|
273
367
|
export declare function verifyGrantSig(orgWalletPubkeyHex: string, doc: Uint8Array, sigHex: string): Promise<boolean>;
|
|
368
|
+
/**
|
|
369
|
+
* Options for {@link verifySignedRoster}.
|
|
370
|
+
*/
|
|
371
|
+
export interface RosterVerifyOptions {
|
|
372
|
+
/**
|
|
373
|
+
* Called once for EVERY entry the roster serves that could not be verified,
|
|
374
|
+
* with the failure. The entry is DEGRADED — omitted from the returned
|
|
375
|
+
* grants — and the roster as a whole still verifies; this callback is the
|
|
376
|
+
* only place the degradation is visible, so a caller that enforces on the
|
|
377
|
+
* result should treat every reported member as holding NOTHING PROVEN
|
|
378
|
+
* rather than as absent from the vault.
|
|
379
|
+
*
|
|
380
|
+
* A v2 grant minted by a server newer than this SDK decodes fine and is
|
|
381
|
+
* NOT reported here; what lands in this callback is an entry whose bytes
|
|
382
|
+
* could not be trusted at all — a future schema, a corrupt row, a
|
|
383
|
+
* signature that does not verify.
|
|
384
|
+
*/
|
|
385
|
+
onUnverifiableGrant?: (err: GrantVerificationError) => void;
|
|
386
|
+
}
|
|
274
387
|
/**
|
|
275
388
|
* Verifies EVERY grant in a signed roster against the vault owner's key and
|
|
276
389
|
* returns the grants decoded from the verified bytes.
|
|
@@ -282,16 +395,35 @@ export declare function verifyGrantSig(orgWalletPubkeyHex: string, doc: Uint8Arr
|
|
|
282
395
|
* of the same document and are not covered by anything you checked.
|
|
283
396
|
*
|
|
284
397
|
* Three bindings are checked per entry, and the last two matter as much as
|
|
285
|
-
* the signature: the document must carry
|
|
398
|
+
* the signature: the document must carry a schema this SDK understands, it
|
|
286
399
|
* must name the vault the roster is FOR, and it must name the member it was
|
|
287
400
|
* served UNDER. A document that verifies but describes a different membership
|
|
288
401
|
* is a valid signature over somebody else's grant — the substitution the
|
|
289
402
|
* canonical bytes bind all four values to prevent.
|
|
290
403
|
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
404
|
+
* # One unverifiable entry degrades the ENTRY, not the roster
|
|
405
|
+
*
|
|
406
|
+
* An entry that fails any of its checks is skipped and reported to
|
|
407
|
+
* {@link RosterVerifyOptions.onUnverifiableGrant} (when given) rather than
|
|
408
|
+
* thrown, and the remaining entries are returned. This is deliberate, and it
|
|
409
|
+
* is the second half of the condition ddc-node's `allowV2GrantMint` hold
|
|
410
|
+
* names for lifting: the loop this replaces threw on the FIRST bad entry, so
|
|
411
|
+
* one grant a consumer could not read — a ceiling-carrying v2 under 4.0.0, a
|
|
412
|
+
* future v3, a corrupt row — made the WHOLE roster fail verification for
|
|
413
|
+
* every member of that vault. An outage with a bystander list that long is
|
|
414
|
+
* not fail-closed, it is fail-everyone-else's.
|
|
415
|
+
*
|
|
416
|
+
* The envelope is still fail-closed: a roster naming the wrong vault, a
|
|
417
|
+
* signing key that does not derive the vault, or a malformed roster shape
|
|
418
|
+
* throws `GrantVerificationError` and NOTHING is returned — until the anchor
|
|
419
|
+
* holds, every entry is attacker-supplied, and there is no per-entry question
|
|
420
|
+
* to degrade to.
|
|
421
|
+
*
|
|
422
|
+
* SILENT SHORTENING IS THE RESIDUAL RISK, and the callback is the mitigation:
|
|
423
|
+
* a caller that ignores `onUnverifiableGrant` sees a shorter roster that
|
|
424
|
+
* looks complete. Treat a reported member as UNPROVEN — absence from the
|
|
425
|
+
* returned list means "no verified standing", which for authorization means
|
|
426
|
+
* deny, not "not in the vault".
|
|
295
427
|
*
|
|
296
428
|
* # `expectedVaultId` is the trust anchor, and it is why this is a
|
|
297
429
|
* # verification rather than a consistency check
|
|
@@ -330,7 +462,7 @@ export declare function verifyGrantSig(orgWalletPubkeyHex: string, doc: Uint8Arr
|
|
|
330
462
|
* itself learned from an untrusted party, the result is trust in THAT party's
|
|
331
463
|
* choice of vault. Anchor it to something you already knew.
|
|
332
464
|
*/
|
|
333
|
-
export declare function verifySignedRoster(roster: SignedRoster, expectedVaultId: string): Promise<Grant[]>;
|
|
465
|
+
export declare function verifySignedRoster(roster: SignedRoster, expectedVaultId: string, options?: RosterVerifyOptions): Promise<Grant[]>;
|
|
334
466
|
/**
|
|
335
467
|
* One entry of `verifySignedRoster`, exposed for a caller holding a single
|
|
336
468
|
* grant (a member proving their own standing, say) rather than a whole
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant-doc.d.ts","sourceRoot":"","sources":["../../src/core/grant-doc.ts"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK5D
|
|
1
|
+
{"version":3,"file":"grant-doc.d.ts","source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,EAAE,cAAc,GAC7B,UAAU,CAuCZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,KAAK,CA4FrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,kBAAkB,EAAE,MAAM,EAC1B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAkBlB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,KAAK,EAAE,CAAC,CA4DlB;AAQD;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,KAAK,CAAC,CAwChB"}
|
package/dist/core/grant-doc.js
CHANGED
|
@@ -90,14 +90,69 @@ import { decodeBase64, hexToBytes, strip0xHex } from "./canonical.js";
|
|
|
90
90
|
const enc = new TextEncoder();
|
|
91
91
|
const dec = new TextDecoder();
|
|
92
92
|
/**
|
|
93
|
-
* The schema string
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* handing a v2 document's fields to a v1 reader under a signature that is
|
|
98
|
-
* perfectly valid for the v2 meaning.
|
|
93
|
+
* The schema string a CEILING-LESS grant carries inside its signed bytes
|
|
94
|
+
* (`authz.GrantSchemaV1`). Still emitted, still the common case: a grant that
|
|
95
|
+
* sets no privacy ceiling is encoded at v1, byte for byte as it always was,
|
|
96
|
+
* so every signature minted before v2 existed goes on verifying.
|
|
99
97
|
*/
|
|
100
98
|
export const GRANT_SCHEMA = "cere.vault.grant.v1";
|
|
99
|
+
/**
|
|
100
|
+
* The schema string a ceiling-carrying grant carries (`authz.GrantSchemaV2`).
|
|
101
|
+
*
|
|
102
|
+
* A document is v2 if and only if it carries a privacy ceiling. There is no
|
|
103
|
+
* v2 spelling of "no ceiling" — that is v1, and giving it two spellings is
|
|
104
|
+
* the ambiguity `NO_GRANT_EXPIRY`'s comment spends a paragraph refusing.
|
|
105
|
+
*
|
|
106
|
+
* The version is a FUNCTION of the ceiling rather than an unconditional bump:
|
|
107
|
+
* bumping it always would change the bytes of every grant, including the
|
|
108
|
+
* overwhelming majority that sets no ceiling, which is a flag day on every
|
|
109
|
+
* stored signature. See `canonicalGrantBytesWithCeiling`.
|
|
110
|
+
*/
|
|
111
|
+
export const GRANT_SCHEMA_V2 = "cere.vault.grant.v2";
|
|
112
|
+
/**
|
|
113
|
+
* The ONE spelling of "no privacy ceiling was ever signed for this
|
|
114
|
+
* membership" — and it is NOT a synonym for `"public"`.
|
|
115
|
+
*
|
|
116
|
+
* It means NOTHING VISIBLE, and that is a decision on the record: a caller
|
|
117
|
+
* whose ceiling is this sees no memory-graph row at all, because a ceiling
|
|
118
|
+
* nobody signed is not a ceiling. Picking `"internal"` as the default would
|
|
119
|
+
* invent an authorisation the vault owner never attested on the axis whose
|
|
120
|
+
* whole job is disclosure — the same ruling `NO_GRANT_EXPIRY` makes one field
|
|
121
|
+
* earlier, except that there the failure direction WIDENS an unsigned grant
|
|
122
|
+
* and here it NARROWS to zero, which is why failing closed is free.
|
|
123
|
+
*
|
|
124
|
+
* Selects {@link GRANT_SCHEMA} in the encoder: a grant carrying this is a v1
|
|
125
|
+
* document, byte for byte.
|
|
126
|
+
*/
|
|
127
|
+
export const NO_PRIVACY_CEILING = "";
|
|
128
|
+
/**
|
|
129
|
+
* Every ceiling a grant may carry, least to most sensitive — Go's
|
|
130
|
+
* `validPrivacyCeilings`. {@link NO_PRIVACY_CEILING} is deliberately ABSENT:
|
|
131
|
+
* it is a legal decoded state (the document is v1) but never a value a caller
|
|
132
|
+
* may SET, and admitting `""` at the writer would give the state two
|
|
133
|
+
* spellings.
|
|
134
|
+
*/
|
|
135
|
+
export const PRIVACY_CEILINGS = [
|
|
136
|
+
"public",
|
|
137
|
+
"internal",
|
|
138
|
+
"private",
|
|
139
|
+
"restricted",
|
|
140
|
+
];
|
|
141
|
+
/** Is `c` a ceiling a v2 grant may carry? The WRITER-side guard. */
|
|
142
|
+
export function isValidPrivacyCeiling(c) {
|
|
143
|
+
return PRIVACY_CEILINGS.includes(c);
|
|
144
|
+
}
|
|
145
|
+
/** Renders the valid ceilings for an error, as Go's `PrivacyCeilingsList`. */
|
|
146
|
+
function privacyCeilingsList() {
|
|
147
|
+
const quoted = PRIVACY_CEILINGS.map((c) => `"${c}"`);
|
|
148
|
+
return quoted.slice(0, -1).join(", ") + " or " + quoted[quoted.length - 1];
|
|
149
|
+
}
|
|
150
|
+
/** Tags a string as a privacy ceiling. The parameter type is the literal
|
|
151
|
+
* union, so a misspelling is a compile error and an as-yet-unknown ceiling
|
|
152
|
+
* from a newer peer has to be cast deliberately. */
|
|
153
|
+
export function privacyCeiling(c) {
|
|
154
|
+
return c;
|
|
155
|
+
}
|
|
101
156
|
/**
|
|
102
157
|
* The header a membership write carries the vault owner's grant signature in
|
|
103
158
|
* (`authz.GrantSignatureHeader`), hex, with or without an `0x` prefix.
|
|
@@ -239,10 +294,11 @@ export function grantExpiry(rfc3339) {
|
|
|
239
294
|
* the document does not decode, its schema is unknown, or it describes a
|
|
240
295
|
* different membership from the one it was served under.
|
|
241
296
|
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
297
|
+
* THROWN by {@link verifyGrant}, where one grant IS the whole question and a
|
|
298
|
+
* failure must stop the caller. REPORTED (and the entry skipped) by
|
|
299
|
+
* {@link verifySignedRoster}, where the same failure on one entry used to
|
|
300
|
+
* fail the whole roster for every other member — see that function's doc
|
|
301
|
+
* comment for the outage that ruling turned out to be. `memberPubkey` names
|
|
246
302
|
* the entry so an operator can find it.
|
|
247
303
|
*/
|
|
248
304
|
export class GrantVerificationError extends Error {
|
|
@@ -260,8 +316,19 @@ export class GrantVerificationError extends Error {
|
|
|
260
316
|
}
|
|
261
317
|
}
|
|
262
318
|
/**
|
|
263
|
-
* The exact bytes a grant signature covers,
|
|
264
|
-
* `authz.CanonicalGrantBytes
|
|
319
|
+
* The exact bytes a CEILING-LESS grant signature covers — v1, byte for byte
|
|
320
|
+
* as `authz.CanonicalGrantBytes` has always emitted them. Delegates to
|
|
321
|
+
* {@link canonicalGrantBytesWithCeiling}; see that function for the full
|
|
322
|
+
* contract, and this file's header for why the version is a function of the
|
|
323
|
+
* ceiling rather than an unconditional bump.
|
|
324
|
+
*/
|
|
325
|
+
export function canonicalGrantBytes(vaultId, memberPubkey, role, scopes, issuedAt, expiresAt) {
|
|
326
|
+
return canonicalGrantBytesWithCeiling(vaultId, memberPubkey, role, scopes, issuedAt, expiresAt, NO_PRIVACY_CEILING);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* The encoder, mirroring `authz.CanonicalGrantBytesWithCeiling`. Emits
|
|
330
|
+
* {@link GRANT_SCHEMA} when the grant sets no privacy ceiling and
|
|
331
|
+
* {@link GRANT_SCHEMA_V2} when it sets one.
|
|
265
332
|
*
|
|
266
333
|
* Every bound value is inside the output: a document proves ONE member's
|
|
267
334
|
* standing on ONE vault and nothing else. `scopes` is emitted as an ARRAY
|
|
@@ -276,12 +343,16 @@ export class GrantVerificationError extends Error {
|
|
|
276
343
|
* document with no mint time that verifies exactly as well as one with a mint
|
|
277
344
|
* time.
|
|
278
345
|
*
|
|
279
|
-
* `
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
346
|
+
* `privacyCeiling` is emitted LAST, after `expiresAt`, and ONLY when set —
|
|
347
|
+
* `omitempty` in Go, an append here — so a ceiling-less grant is
|
|
348
|
+
* byte-identical to a v1 document and every signature already stored goes on
|
|
349
|
+
* matching what this encoder rebuilds.
|
|
350
|
+
*
|
|
351
|
+
* The ceiling is REFUSED, never coerced: an unrecognised value throws, because
|
|
352
|
+
* a document that verifies perfectly and confers a ceiling nobody named is,
|
|
353
|
+
* on the disclosure axis, the one output this function must never hand back.
|
|
354
|
+
* {@link NO_PRIVACY_CEILING} is the single exception and is not a value: it
|
|
355
|
+
* selects v1.
|
|
285
356
|
*
|
|
286
357
|
* `issuedAt` has NO DEFAULT on purpose: a `new Date().toISOString()` fallback
|
|
287
358
|
* would be a hidden clock inside the encoder, and a caller who forgot to pass
|
|
@@ -293,9 +364,9 @@ export class GrantVerificationError extends Error {
|
|
|
293
364
|
*
|
|
294
365
|
* `expiresAt` is the ONE parameter with no emptiness check, because `""` is
|
|
295
366
|
* {@link NO_GRANT_EXPIRY} — a legal, common, deliberate value rather than a
|
|
296
|
-
* missing one.
|
|
367
|
+
* missing one. `ceiling` shares the exemption for the same reason.
|
|
297
368
|
*/
|
|
298
|
-
export function
|
|
369
|
+
export function canonicalGrantBytesWithCeiling(vaultId, memberPubkey, role, scopes, issuedAt, expiresAt, privacyCeiling) {
|
|
299
370
|
if (vaultId === "")
|
|
300
371
|
throw new Error("canonical grant: vaultId is required");
|
|
301
372
|
if (memberPubkey === "")
|
|
@@ -304,26 +375,44 @@ export function canonicalGrantBytes(vaultId, memberPubkey, role, scopes, issuedA
|
|
|
304
375
|
throw new Error("canonical grant: role is required");
|
|
305
376
|
if (issuedAt === "")
|
|
306
377
|
throw new Error("canonical grant: issuedAt is required");
|
|
378
|
+
// The version gate, and the writer-side refusal, in one place: anything
|
|
379
|
+
// that is neither "no ceiling" nor a recognised class stops here.
|
|
380
|
+
let schema = GRANT_SCHEMA;
|
|
381
|
+
if (privacyCeiling !== NO_PRIVACY_CEILING) {
|
|
382
|
+
if (!isValidPrivacyCeiling(privacyCeiling)) {
|
|
383
|
+
throw new Error(`canonical grant: privacyCeiling ${JSON.stringify(privacyCeiling)} must be ${privacyCeilingsList()}`);
|
|
384
|
+
}
|
|
385
|
+
schema = GRANT_SCHEMA_V2;
|
|
386
|
+
}
|
|
307
387
|
const names = Object.keys(scopes).sort(compareCodePoints);
|
|
308
388
|
const parts = names.map((name) => `{"name":${goString(name)},"level":${goString(scopes[name])}}`);
|
|
309
389
|
// Hand-assembled rather than `JSON.stringify`d because the field ORDER is
|
|
310
390
|
// the wire contract (Go emits struct fields in declaration order) and
|
|
311
391
|
// because `goString` has to do the HTML escaping `JSON.stringify` will not.
|
|
312
|
-
const doc = `{"schema":${goString(
|
|
392
|
+
const doc = `{"schema":${goString(schema)},` +
|
|
313
393
|
`"vaultId":${goString(vaultId)},` +
|
|
314
394
|
`"memberPubkey":${goString(memberPubkey)},` +
|
|
315
395
|
`"role":${goString(role)},` +
|
|
316
396
|
`"scopes":[${parts.join(",")}],` +
|
|
317
397
|
`"issuedAt":${goString(issuedAt)},` +
|
|
318
|
-
`"expiresAt":${goString(expiresAt)}
|
|
398
|
+
`"expiresAt":${goString(expiresAt)}` +
|
|
399
|
+
// omitempty: the ceiling key is present in a v2 document ONLY. Appending
|
|
400
|
+
// it unconditionally would give v1 a second spelling and break every
|
|
401
|
+
// stored signature's rebuild.
|
|
402
|
+
(privacyCeiling === NO_PRIVACY_CEILING ? "" : `,"privacyCeiling":${goString(privacyCeiling)}`) +
|
|
403
|
+
"}";
|
|
319
404
|
return enc.encode(doc);
|
|
320
405
|
}
|
|
321
406
|
/**
|
|
322
407
|
* Reads a canonical grant document back into its parts, mirroring
|
|
323
408
|
* `authz.DecodeGrantDoc`. Never re-encodes; the bytes stay the authority.
|
|
324
409
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
410
|
+
* Accepts BOTH current schemas — {@link GRANT_SCHEMA} and
|
|
411
|
+
* {@link GRANT_SCHEMA_V2} — with the field that distinguishes them checked in
|
|
412
|
+
* both directions (a v1 document carrying a `privacyCeiling` is a forgery
|
|
413
|
+
* shape; a v2 document without a recognised one has given "no ceiling" a
|
|
414
|
+
* second spelling). Throws on any other schema and on the same three required
|
|
415
|
+
* fields the encoder refuses to omit.
|
|
327
416
|
*/
|
|
328
417
|
export function decodeGrantDoc(doc) {
|
|
329
418
|
if (doc.length === 0)
|
|
@@ -340,8 +429,39 @@ export function decodeGrantDoc(doc) {
|
|
|
340
429
|
}
|
|
341
430
|
const obj = raw;
|
|
342
431
|
const schema = stringField(obj, "schema");
|
|
343
|
-
|
|
344
|
-
|
|
432
|
+
// THE VERSION GATE, AND IT IS TWO-WAY — mirroring `DecodeGrantDoc`'s switch.
|
|
433
|
+
//
|
|
434
|
+
// It used to be one equality against one constant. Two schema strings are
|
|
435
|
+
// current, and the field that distinguishes them must be checked in BOTH
|
|
436
|
+
// directions, because a JSON reader ignores unknown keys by default:
|
|
437
|
+
//
|
|
438
|
+
// - a v1 document carrying a privacyCeiling key would otherwise decode
|
|
439
|
+
// as a clean v1 grant with the field silently dropped. That is a
|
|
440
|
+
// forgery shape — the owner attested v1 semantics and somebody
|
|
441
|
+
// appended a field — and dropping it quietly is how a reader comes to
|
|
442
|
+
// disagree with the bytes it verified.
|
|
443
|
+
// - a v2 document with no usable ceiling would otherwise decode to
|
|
444
|
+
// NO_PRIVACY_CEILING, giving "no ceiling" a second spelling under a
|
|
445
|
+
// schema string that promises one.
|
|
446
|
+
//
|
|
447
|
+
// Refusing both is what keeps the schema string an honest description of
|
|
448
|
+
// the bytes rather than a label. Note the emptiness (not presence) check
|
|
449
|
+
// on v1: Go unmarshals `"privacyCeiling":""` into the empty string and
|
|
450
|
+
// treats it as absent, so a v1 document with an EMPTY ceiling key decodes
|
|
451
|
+
// as v1 here too — matching the bytes Go accepts, not a stricter rule.
|
|
452
|
+
const rawCeiling = stringField(obj, "privacyCeiling", true);
|
|
453
|
+
if (schema === GRANT_SCHEMA) {
|
|
454
|
+
if (rawCeiling !== "") {
|
|
455
|
+
throw new Error(`decode grant: schema ${JSON.stringify(schema)} carries a privacyCeiling; that is ${JSON.stringify(GRANT_SCHEMA_V2)}`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
else if (schema === GRANT_SCHEMA_V2) {
|
|
459
|
+
if (!isValidPrivacyCeiling(rawCeiling)) {
|
|
460
|
+
throw new Error(`decode grant: schema ${JSON.stringify(schema)} requires a privacyCeiling of ${privacyCeilingsList()}, got ${JSON.stringify(rawCeiling)}`);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
throw new Error(`decode grant: schema ${JSON.stringify(schema)} is not ${JSON.stringify(GRANT_SCHEMA)} or ${JSON.stringify(GRANT_SCHEMA_V2)}`);
|
|
345
465
|
}
|
|
346
466
|
const vaultId = stringField(obj, "vaultId");
|
|
347
467
|
const memberPubkey = stringField(obj, "memberPubkey");
|
|
@@ -382,7 +502,10 @@ export function decodeGrantDoc(doc) {
|
|
|
382
502
|
// what Go's `raw.ExpiresAt == nil` refuses; an `=== ""` guard here would make
|
|
383
503
|
// "this membership never expires" undecodable.
|
|
384
504
|
const expiresAt = stringField(obj, "expiresAt");
|
|
385
|
-
|
|
505
|
+
// v1 decodes to NO_PRIVACY_CEILING — the version gate above has already
|
|
506
|
+
// proved the key was absent-or-empty for v1 and valid for v2.
|
|
507
|
+
const ceiling = (schema === GRANT_SCHEMA_V2 ? rawCeiling : "");
|
|
508
|
+
return { schema, vaultId, memberPubkey, role, scopes, issuedAt, expiresAt, privacyCeiling: ceiling };
|
|
386
509
|
}
|
|
387
510
|
/**
|
|
388
511
|
* Is `sigHex` `orgWalletPubkeyHex`'s ed25519 signature over `doc`?
|
|
@@ -430,16 +553,35 @@ export async function verifyGrantSig(orgWalletPubkeyHex, doc, sigHex) {
|
|
|
430
553
|
* of the same document and are not covered by anything you checked.
|
|
431
554
|
*
|
|
432
555
|
* Three bindings are checked per entry, and the last two matter as much as
|
|
433
|
-
* the signature: the document must carry
|
|
556
|
+
* the signature: the document must carry a schema this SDK understands, it
|
|
434
557
|
* must name the vault the roster is FOR, and it must name the member it was
|
|
435
558
|
* served UNDER. A document that verifies but describes a different membership
|
|
436
559
|
* is a valid signature over somebody else's grant — the substitution the
|
|
437
560
|
* canonical bytes bind all four values to prevent.
|
|
438
561
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
562
|
+
* # One unverifiable entry degrades the ENTRY, not the roster
|
|
563
|
+
*
|
|
564
|
+
* An entry that fails any of its checks is skipped and reported to
|
|
565
|
+
* {@link RosterVerifyOptions.onUnverifiableGrant} (when given) rather than
|
|
566
|
+
* thrown, and the remaining entries are returned. This is deliberate, and it
|
|
567
|
+
* is the second half of the condition ddc-node's `allowV2GrantMint` hold
|
|
568
|
+
* names for lifting: the loop this replaces threw on the FIRST bad entry, so
|
|
569
|
+
* one grant a consumer could not read — a ceiling-carrying v2 under 4.0.0, a
|
|
570
|
+
* future v3, a corrupt row — made the WHOLE roster fail verification for
|
|
571
|
+
* every member of that vault. An outage with a bystander list that long is
|
|
572
|
+
* not fail-closed, it is fail-everyone-else's.
|
|
573
|
+
*
|
|
574
|
+
* The envelope is still fail-closed: a roster naming the wrong vault, a
|
|
575
|
+
* signing key that does not derive the vault, or a malformed roster shape
|
|
576
|
+
* throws `GrantVerificationError` and NOTHING is returned — until the anchor
|
|
577
|
+
* holds, every entry is attacker-supplied, and there is no per-entry question
|
|
578
|
+
* to degrade to.
|
|
579
|
+
*
|
|
580
|
+
* SILENT SHORTENING IS THE RESIDUAL RISK, and the callback is the mitigation:
|
|
581
|
+
* a caller that ignores `onUnverifiableGrant` sees a shorter roster that
|
|
582
|
+
* looks complete. Treat a reported member as UNPROVEN — absence from the
|
|
583
|
+
* returned list means "no verified standing", which for authorization means
|
|
584
|
+
* deny, not "not in the vault".
|
|
443
585
|
*
|
|
444
586
|
* # `expectedVaultId` is the trust anchor, and it is why this is a
|
|
445
587
|
* # verification rather than a consistency check
|
|
@@ -478,7 +620,7 @@ export async function verifyGrantSig(orgWalletPubkeyHex, doc, sigHex) {
|
|
|
478
620
|
* itself learned from an untrusted party, the result is trust in THAT party's
|
|
479
621
|
* choice of vault. Anchor it to something you already knew.
|
|
480
622
|
*/
|
|
481
|
-
export async function verifySignedRoster(roster, expectedVaultId) {
|
|
623
|
+
export async function verifySignedRoster(roster, expectedVaultId, options = {}) {
|
|
482
624
|
if (typeof expectedVaultId !== "string" || expectedVaultId === "") {
|
|
483
625
|
throw new GrantVerificationError("expectedVaultId is required: verifying a roster against the vault id it " +
|
|
484
626
|
"carries only proves the response agrees with itself");
|
|
@@ -508,10 +650,26 @@ export async function verifySignedRoster(roster, expectedVaultId) {
|
|
|
508
650
|
}
|
|
509
651
|
const out = [];
|
|
510
652
|
for (const grant of roster.grants) {
|
|
653
|
+
// A non-object entry is an ENTRY-level malformation — it belongs to no
|
|
654
|
+
// member in particular, but it is one row's bytes that are wrong, not the
|
|
655
|
+
// envelope's, so it degrades like any other unverifiable entry rather
|
|
656
|
+
// than poisoning the roster.
|
|
511
657
|
if (typeof grant !== "object" || grant === null) {
|
|
512
|
-
|
|
658
|
+
const err = new GrantVerificationError(`signed roster holds a grant that is not an object`);
|
|
659
|
+
options.onUnverifiableGrant?.(err);
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
try {
|
|
663
|
+
out.push(await verifyGrant(expectedVaultId, roster.orgWalletPubkey, grant));
|
|
664
|
+
}
|
|
665
|
+
catch (err) {
|
|
666
|
+
if (!(err instanceof GrantVerificationError))
|
|
667
|
+
throw err;
|
|
668
|
+
// DEGRADE THE ENTRY, NOT THE ROSTER — see the doc comment above for why
|
|
669
|
+
// this replaced the first-bad-entry throw, and what a caller owes the
|
|
670
|
+
// members reported here.
|
|
671
|
+
options.onUnverifiableGrant?.(err);
|
|
513
672
|
}
|
|
514
|
-
out.push(await verifyGrant(expectedVaultId, roster.orgWalletPubkey, grant));
|
|
515
673
|
}
|
|
516
674
|
return out;
|
|
517
675
|
}
|
|
@@ -559,9 +717,16 @@ export async function verifyGrant(vaultId, orgWalletPubkey, grant) {
|
|
|
559
717
|
}
|
|
560
718
|
return decoded;
|
|
561
719
|
}
|
|
562
|
-
/**
|
|
563
|
-
|
|
720
|
+
/**
|
|
721
|
+
* A required string field, or a typed failure naming it. With `absentOk`, an
|
|
722
|
+
* ABSENT key reads as `""` — for `privacyCeiling`, whose absence is v1's
|
|
723
|
+
* whole spelling and whose empty-string presence Go's decoder treats the
|
|
724
|
+
* same way. A present-but-non-string value still fails either way.
|
|
725
|
+
*/
|
|
726
|
+
function stringField(obj, key, absentOk = false) {
|
|
564
727
|
const v = obj[key];
|
|
728
|
+
if (v === undefined && absentOk)
|
|
729
|
+
return "";
|
|
565
730
|
if (typeof v !== "string") {
|
|
566
731
|
throw new Error(`decode grant: ${key} must be a string, got ${v === undefined ? "nothing" : typeof v}`);
|
|
567
732
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant-doc.js","sourceRoot":"","sources":["../../src/core/grant-doc.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,gCAAgC;AAChC,EAAE;AACF,8CAA8C;AAC9C,wEAAwE;AACxE,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,WAAW;AACX,8EAA8E;AAC9E,qEAAqE;AACrE,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,wEAAwE;AACxE,yEAAyE;AACzE,+EAA+E;AAC/E,4BAA4B;AAC5B,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,iEA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ED;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,CAAS,EAAE,CAAS;IAC7C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAI,EAAE,CAAC,CAAC,CAAY,CAAC,WAAW,CAAC,CAAC,CAAW,CAAC;QACrD,MAAM,CAAC,GAAI,EAAE,CAAC,CAAC,CAAY,CAAC,WAAW,CAAC,CAAC,CAAW,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;AAC/B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ export type { HealthResponse } from "./internal/health.js";
|
|
|
20
20
|
export { GarClient, signAndSubmitAgreement, getAsPubkey, } from "./agreements/index.js";
|
|
21
21
|
export type { SignedAgreementEnvelope, SignAndSubmitAgreementOptions, SignAndSubmitAgreementResult, } from "./agreements/index.js";
|
|
22
22
|
export { VaultRequestError, VaultNotImplementedError, VaultSignerRequiredError, } from "./core/errors.js";
|
|
23
|
-
export { GRANT_ISSUED_AT_HEADER, GRANT_SCHEMA, GRANT_SIGNATURE_HEADER, GrantVerificationError, NO_GRANT_EXPIRY, canonicalGrantBytes, canonicalPubkeyHex, decodeGrantDoc, grantExpiry, vaultIdFor, verifyGrant, verifyGrantSig, verifySignedRoster, } from "./core/grant-doc.js";
|
|
24
|
-
export type { Grant, GrantExpiry } from "./core/grant-doc.js";
|
|
23
|
+
export { GRANT_ISSUED_AT_HEADER, GRANT_SCHEMA, GRANT_SCHEMA_V2, GRANT_SIGNATURE_HEADER, GrantVerificationError, NO_GRANT_EXPIRY, NO_PRIVACY_CEILING, PRIVACY_CEILINGS, canonicalGrantBytes, canonicalGrantBytesWithCeiling, canonicalPubkeyHex, decodeGrantDoc, grantExpiry, isValidPrivacyCeiling, privacyCeiling, vaultIdFor, verifyGrant, verifyGrantSig, verifySignedRoster, } from "./core/grant-doc.js";
|
|
24
|
+
export type { Grant, GrantExpiry, PrivacyCeiling, PrivacyCeilingName, RosterVerifyOptions } from "./core/grant-doc.js";
|
|
25
25
|
export type { PutMemberOptions, PutScopesOptions } from "./internal/memberships.js";
|
|
26
26
|
export type { Task, TasksPage, TaskState, AgentConnection, AgentConnectionStatus, ConnectAgentRequest, CubbyQueryResponse, CubbyExecResponse, EventInput, EventRole, EventsPage, IngestOrigin, Job, JobsPage, JobState, Member, MemberRole, MembershipState, MembershipSummary, PublishResult, Scope, ScopeGrants, ScopeLevel, SignedGrant, SignedRoster, StreamSummary, StreamsListResponse, VaultCredentialStatus, VaultEvent, VaultRecord, VaultSigType, } from "./core/types.js";
|
|
27
27
|
export { VaultInfo } from "./internal/vault-info.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO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M,0BAA0B,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { VaultRequestError, VaultNotImplementedError, VaultSignerRequiredError,
|
|
|
19
19
|
// `/internal`, because a consumer that cannot reach it easily will read
|
|
20
20
|
// `SignedGrant.role`/`.scopes` instead and end up with a signature it checked
|
|
21
21
|
// and did not act on.
|
|
22
|
-
export { GRANT_ISSUED_AT_HEADER, GRANT_SCHEMA, GRANT_SIGNATURE_HEADER, GrantVerificationError, NO_GRANT_EXPIRY, canonicalGrantBytes, canonicalPubkeyHex, decodeGrantDoc, grantExpiry, vaultIdFor, verifyGrant, verifyGrantSig, verifySignedRoster, } from "./core/grant-doc.js";
|
|
22
|
+
export { GRANT_ISSUED_AT_HEADER, GRANT_SCHEMA, GRANT_SCHEMA_V2, GRANT_SIGNATURE_HEADER, GrantVerificationError, NO_GRANT_EXPIRY, NO_PRIVACY_CEILING, PRIVACY_CEILINGS, canonicalGrantBytes, canonicalGrantBytesWithCeiling, canonicalPubkeyHex, decodeGrantDoc, grantExpiry, isValidPrivacyCeiling, privacyCeiling, vaultIdFor, verifyGrant, verifyGrantSig, verifySignedRoster, } from "./core/grant-doc.js";
|
|
23
23
|
// Delegate-grant surface — `vault.delegate.{pubkey,grant,revoke}` (see
|
|
24
24
|
// `client.ts`) covers the common connect-time flow, but the frontend also
|
|
25
25
|
// needs direct access to `VaultInfo`'s `DelegateInfo` type (Task 3 left
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,kCAAkC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c,EACd,WAAW,EACX,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AA0C7B,uEAAuE;AACvE,0EAA0E;AAC1E,wEAAwE;AACxE,8EAA8E;AAC9E,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,wEAAwE;AACxE,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GACrB,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Signer } from "@cef-ai/signer";
|
|
2
2
|
import type { VaultHttpClient } from "../core/http.js";
|
|
3
|
+
import type { PrivacyCeilingName } from "../core/grant-doc.js";
|
|
3
4
|
import type { Member, MemberRole, MembershipSummary, ScopeGrants, SignedRoster } from "../core/types.js";
|
|
4
5
|
/**
|
|
5
6
|
* What the caller already knows about the membership's OTHER half, so the
|
|
@@ -15,6 +16,17 @@ import type { Member, MemberRole, MembershipSummary, ScopeGrants, SignedRoster }
|
|
|
15
16
|
export interface PutMemberOptions {
|
|
16
17
|
/** The scope grants this member ALREADY holds. Default: read back. */
|
|
17
18
|
scopes?: ScopeGrants;
|
|
19
|
+
/**
|
|
20
|
+
* The most sensitive class of fact this membership may see. Default: send
|
|
21
|
+
* no `privacyCeiling` field and sign the v1 document — byte-identical to
|
|
22
|
+
* the request 4.1.0 sent, which is the property that keeps this option
|
|
23
|
+
* additive.
|
|
24
|
+
*
|
|
25
|
+
* `NO_PRIVACY_CEILING` is deliberately not a settable value here (see its
|
|
26
|
+
* own doc): "no ceiling was ever signed" has exactly one spelling, absence,
|
|
27
|
+
* and admitting `""` at the writer would give the state two.
|
|
28
|
+
*/
|
|
29
|
+
privacyCeiling?: PrivacyCeilingName;
|
|
18
30
|
}
|
|
19
31
|
/** @see PutMemberOptions */
|
|
20
32
|
export interface PutScopesOptions {
|
|
@@ -240,6 +252,14 @@ export declare class Memberships {
|
|
|
240
252
|
* member with grants signs those grants too. They are read back with `scopes()` (a 404 — the new
|
|
241
253
|
* member case — is `{}`); pass `{ scopes }` to skip that GET when they are
|
|
242
254
|
* already in hand.
|
|
255
|
+
*
|
|
256
|
+
* `{ privacyCeiling }` widens the SAME document to v2 rather than adding a
|
|
257
|
+
* second one: the ceiling joins `expiresAt` as the last field, the schema
|
|
258
|
+
* string flips to `cere.vault.grant.v2`, and the body carries the ceiling
|
|
259
|
+
* beside the role it constrains. The scopes in the document are STILL the
|
|
260
|
+
* held ones and the expiry is STILL the body's exact string — the ceiling
|
|
261
|
+
* changes which encoder builds the document, never what the document is
|
|
262
|
+
* built FROM.
|
|
243
263
|
*/
|
|
244
264
|
put(vaultId: string, memberPubkey: string, role: MemberRole, expiresAt?: string, opts?: PutMemberOptions): Promise<Member>;
|
|
245
265
|
/**
|
|
@@ -320,6 +340,13 @@ export declare class Memberships {
|
|
|
320
340
|
* sr25519), so an sr25519 owner can authenticate the request and still
|
|
321
341
|
* never produce a document the server will accept. Named up front rather
|
|
322
342
|
* than left to surface as an opaque signature refusal.
|
|
343
|
+
*
|
|
344
|
+
* `ceiling` is the ONE input that changes which encoder runs, because it is
|
|
345
|
+
* the one field whose absence is a document VERSION: unset builds the v1
|
|
346
|
+
* bytes exactly as before this option existed, set appends the ceiling and
|
|
347
|
+
* flips the schema string. An invalid value never gets this far — `put()`
|
|
348
|
+
* vets it before its read-back — and the encoder re-checks regardless, so
|
|
349
|
+
* a typo cannot become a stored grant on any path in.
|
|
323
350
|
*/
|
|
324
351
|
private grantHeader;
|
|
325
352
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../src/internal/memberships.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE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;;;;;;;;;;;;;;OA4CG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAIpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,GAAG,CACP,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC;IAuClB;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC;IAI/E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,SAAS,CACb,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;YACW,WAAW;IAgEzB;;;;;;;;;;;OAWG;YACW,UAAU;IASxB;;;;;;;;;;;;;;;;;;;OAmBG;YACW,YAAY;CAkB3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { endpoints } from "../core/endpoints.js";
|
|
2
2
|
import { bytesToHex } from "../core/canonical.js";
|
|
3
|
-
import { GRANT_SIGNATURE_HEADER, GRANT_ISSUED_AT_HEADER, NO_GRANT_EXPIRY, canonicalGrantBytes, canonicalPubkeyHex, grantExpiry, } from "../core/grant-doc.js";
|
|
3
|
+
import { GRANT_SIGNATURE_HEADER, GRANT_ISSUED_AT_HEADER, NO_GRANT_EXPIRY, PRIVACY_CEILINGS, canonicalGrantBytes, canonicalGrantBytesWithCeiling, canonicalPubkeyHex, grantExpiry, isValidPrivacyCeiling, privacyCeiling, } from "../core/grant-doc.js";
|
|
4
4
|
import { VaultRequestError, VaultSignerRequiredError } from "../core/errors.js";
|
|
5
5
|
/**
|
|
6
6
|
* Who belongs to a vault, in what role, holding which scope grants — and,
|
|
@@ -212,8 +212,30 @@ export class Memberships {
|
|
|
212
212
|
* member with grants signs those grants too. They are read back with `scopes()` (a 404 — the new
|
|
213
213
|
* member case — is `{}`); pass `{ scopes }` to skip that GET when they are
|
|
214
214
|
* already in hand.
|
|
215
|
+
*
|
|
216
|
+
* `{ privacyCeiling }` widens the SAME document to v2 rather than adding a
|
|
217
|
+
* second one: the ceiling joins `expiresAt` as the last field, the schema
|
|
218
|
+
* string flips to `cere.vault.grant.v2`, and the body carries the ceiling
|
|
219
|
+
* beside the role it constrains. The scopes in the document are STILL the
|
|
220
|
+
* held ones and the expiry is STILL the body's exact string — the ceiling
|
|
221
|
+
* changes which encoder builds the document, never what the document is
|
|
222
|
+
* built FROM.
|
|
215
223
|
*/
|
|
216
224
|
async put(vaultId, memberPubkey, role, expiresAt, opts = {}) {
|
|
225
|
+
// Branded and VETTED before anything else this method does. The brand is
|
|
226
|
+
// a COMPILE-TIME distinction only — `privacyCeiling()` casts and accepts
|
|
227
|
+
// any string at runtime — so the `isValidPrivacyCeiling` check is the
|
|
228
|
+
// actual refusal, and it runs ahead of the read-back GET because a caller
|
|
229
|
+
// error must cost no round trip (the encoder re-checks at the document,
|
|
230
|
+
// for whoever builds one without passing through here). It refuses `""`
|
|
231
|
+
// as well: NO_PRIVACY_CEILING is not a value a caller may SET — see the
|
|
232
|
+
// option — and the encoder alone would treat it as "unset" while the body
|
|
233
|
+
// below still carried the key.
|
|
234
|
+
const ceiling = opts.privacyCeiling === undefined ? undefined : privacyCeiling(opts.privacyCeiling);
|
|
235
|
+
if (ceiling !== undefined && !isValidPrivacyCeiling(ceiling)) {
|
|
236
|
+
throw new Error(`put: privacyCeiling ${JSON.stringify(ceiling)} must be one of ` +
|
|
237
|
+
PRIVACY_CEILINGS.map((c) => `"${c}"`).join(", "));
|
|
238
|
+
}
|
|
217
239
|
const scopes = opts.scopes ?? (await this.heldScopes(vaultId, memberPubkey));
|
|
218
240
|
// ONE STRING, SENT AND SIGNED. `expiresAt` goes into the body and into the
|
|
219
241
|
// signed bytes unchanged; absent is NO_GRANT_EXPIRY, which is the empty
|
|
@@ -221,8 +243,17 @@ export class Memberships {
|
|
|
221
243
|
// expiry" has a spelling of its own rather than being a missing key.
|
|
222
244
|
const expiry = expiresAt === undefined ? NO_GRANT_EXPIRY : grantExpiry(expiresAt);
|
|
223
245
|
return this.http.send("PUT", endpoints.vaultMember(vaultId, memberPubkey), {
|
|
224
|
-
|
|
225
|
-
|
|
246
|
+
// The ceiling key rides ALONGSIDE the fields 4.1.0 sent, and only when
|
|
247
|
+
// set: an unconditional `privacyCeiling: undefined` would rely on every
|
|
248
|
+
// downstream serialiser (auth canonicalisation included) dropping it to
|
|
249
|
+
// keep the no-ceiling request byte-identical.
|
|
250
|
+
body: {
|
|
251
|
+
role,
|
|
252
|
+
expiresAt,
|
|
253
|
+
...(ceiling === undefined ? {} : { privacyCeiling: ceiling }),
|
|
254
|
+
timestamp: new Date().toISOString(),
|
|
255
|
+
},
|
|
256
|
+
headers: await this.grantHeader(vaultId, memberPubkey, role, scopes, expiry, ceiling),
|
|
226
257
|
});
|
|
227
258
|
}
|
|
228
259
|
/**
|
|
@@ -314,8 +345,15 @@ export class Memberships {
|
|
|
314
345
|
* sr25519), so an sr25519 owner can authenticate the request and still
|
|
315
346
|
* never produce a document the server will accept. Named up front rather
|
|
316
347
|
* than left to surface as an opaque signature refusal.
|
|
348
|
+
*
|
|
349
|
+
* `ceiling` is the ONE input that changes which encoder runs, because it is
|
|
350
|
+
* the one field whose absence is a document VERSION: unset builds the v1
|
|
351
|
+
* bytes exactly as before this option existed, set appends the ceiling and
|
|
352
|
+
* flips the schema string. An invalid value never gets this far — `put()`
|
|
353
|
+
* vets it before its read-back — and the encoder re-checks regardless, so
|
|
354
|
+
* a typo cannot become a stored grant on any path in.
|
|
317
355
|
*/
|
|
318
|
-
async grantHeader(vaultId, memberPubkey, role, scopes, expiresAt) {
|
|
356
|
+
async grantHeader(vaultId, memberPubkey, role, scopes, expiresAt, ceiling) {
|
|
319
357
|
const signer = this.signer;
|
|
320
358
|
if (signer === undefined || typeof signer.sign !== "function") {
|
|
321
359
|
throw new VaultSignerRequiredError(`A membership write must carry the VAULT OWNER's signature over the grant's ` +
|
|
@@ -340,7 +378,12 @@ export class Memberships {
|
|
|
340
378
|
// two copies drift by a trimmed fractional zero and the signature fails
|
|
341
379
|
// as though the key were wrong.
|
|
342
380
|
const issuedAt = new Date().toISOString();
|
|
343
|
-
|
|
381
|
+
// The ceiling decides the document's VERSION, and only that: the v1 call
|
|
382
|
+
// stays literally the 4.1.0 line (not merely byte-equal to it), so the
|
|
383
|
+
// no-ceiling path keeps the exact code history has exercised.
|
|
384
|
+
const doc = ceiling === undefined
|
|
385
|
+
? canonicalGrantBytes(vaultId, canonicalPubkeyHex(memberPubkey), role, scopes, issuedAt, expiresAt)
|
|
386
|
+
: canonicalGrantBytesWithCeiling(vaultId, canonicalPubkeyHex(memberPubkey), role, scopes, issuedAt, expiresAt, ceiling);
|
|
344
387
|
return {
|
|
345
388
|
[GRANT_SIGNATURE_HEADER]: bytesToHex(await signer.sign(doc, "data")),
|
|
346
389
|
[GRANT_ISSUED_AT_HEADER]: issuedAt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memberships.js","sourceRoot":"","sources":["../../src/internal/memberships.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,kBAAk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AE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,cAAc,SAAS,6BAA6B,OAAO,wBAAwB;gBACjF,+DAA+D;gBAC/D,8EAA8E;gBAC9E,oBAAoB,CACvB,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;IACtD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cef-ai/vault-sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@polkadot/keyring": "^14.0.3",
|
|
26
26
|
"@polkadot/util": "^14.0.3",
|
|
27
27
|
"@polkadot/util-crypto": "^14.0.3",
|
|
28
|
+
"@cef-ai/account": "1.3.1",
|
|
28
29
|
"@cef-ai/signer": "1.0.0",
|
|
29
|
-
"@cef-ai/transport": "1.1.0"
|
|
30
|
-
"@cef-ai/account": "1.3.1"
|
|
30
|
+
"@cef-ai/transport": "1.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^20.11.0",
|