@interop/wallet-core 0.40.0 → 0.41.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 +2 -1
- package/dist/clients/listing.d.ts +4 -3
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/policy.d.ts +3 -2
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +3 -3
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +14 -4
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +29 -14
- package/dist/clients/revocation.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +30 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +44 -4
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/enrollment/index.d.ts +4 -1
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +4 -1
- package/dist/enrollment/index.js.map +1 -1
- package/dist/keyring/index.d.ts +6 -5
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +6 -5
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts +30 -10
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +31 -15
- package/dist/keyring/record.js.map +1 -1
- package/dist/keys/index.d.ts +4 -2
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +2 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +18 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +28 -5
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +10 -3
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +10 -4
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +17 -21
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +17 -18
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +8 -0
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +7 -0
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +120 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -0
- package/dist/recovery/recoveryDelegation.js +216 -0
- package/dist/recovery/recoveryDelegation.js.map +1 -0
- package/dist/recovery/recoveryRecord.d.ts +5 -4
- package/dist/recovery/recoveryRecord.d.ts.map +1 -1
- package/dist/recovery/recoveryRecord.js +7 -9
- package/dist/recovery/recoveryRecord.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +20 -14
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +72 -1
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +111 -12
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +9 -2
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +8 -2
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/keyAgreement.d.ts +56 -0
- package/dist/webvh/keyAgreement.d.ts.map +1 -0
- package/dist/webvh/keyAgreement.js +47 -0
- package/dist/webvh/keyAgreement.js.map +1 -0
- package/dist/webvh/listClients.d.ts +69 -20
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +102 -14
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +21 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +31 -14
- package/dist/webvh/revokeClient.js.map +1 -1
- package/package.json +2 -2
package/dist/keyring/record.d.ts
CHANGED
|
@@ -133,12 +133,14 @@ export declare function mintRecordEncryption({ keyAgreementKey }: {
|
|
|
133
133
|
keyAgreementKey: IKeyAgreementKey;
|
|
134
134
|
}): Promise<CollectionEncryption>;
|
|
135
135
|
/**
|
|
136
|
-
* Builds the record cipher: an EDV cipher over the record's own
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* kind
|
|
136
|
+
* Builds the record's reading cipher: an EDV cipher over the record's own
|
|
137
|
+
* descriptor, from the reader's key-agreement key. The unwrap paths' cipher
|
|
138
|
+
* (and the recovery record's, which reuses the keyring cipher context
|
|
139
|
+
* verbatim); the wrap paths seal through {@link recordSealCipher} instead. An
|
|
140
|
+
* app's own record kind passes its own `collectionId` so its failures name
|
|
141
|
+
* the record kind. The context labels errors only -- the codec is agnostic to
|
|
142
|
+
* it, so a record kind's real swap protection is its contents validation on
|
|
143
|
+
* unwrap.
|
|
142
144
|
*
|
|
143
145
|
* @param options {object}
|
|
144
146
|
* @param options.keyAgreementKey {IKeyAgreementKey} the wrapping KAK (for
|
|
@@ -155,6 +157,25 @@ export declare function recordCipher({ keyAgreementKey, keyResolver, encryption,
|
|
|
155
157
|
encryption: CollectionEncryption;
|
|
156
158
|
collectionId?: string;
|
|
157
159
|
}): Promise<DocCipher>;
|
|
160
|
+
/**
|
|
161
|
+
* Builds the record's sealing cipher: an encrypt-only EDV cipher over the
|
|
162
|
+
* record's own descriptor, needing no key-agreement secret -- a write seals to
|
|
163
|
+
* the descriptor's epoch public key, reconstructed from the epoch id. This is
|
|
164
|
+
* what lets the recovery re-mint, which holds only the code's unlock KAK
|
|
165
|
+
* public half, re-seal a record it can never open; the issuance wraps go
|
|
166
|
+
* through the same construction and produce the same envelope shape. Decrypt
|
|
167
|
+
* on it refuses with was-client's typed `EncryptOnlyCipherError`.
|
|
168
|
+
*
|
|
169
|
+
* @param options {object}
|
|
170
|
+
* @param options.encryption {CollectionEncryption} the record's descriptor
|
|
171
|
+
* @param [options.collectionId] {string} the cipher context failures are
|
|
172
|
+
* labeled with; defaults to the keyring context
|
|
173
|
+
* @returns {Promise<DocCipher>}
|
|
174
|
+
*/
|
|
175
|
+
export declare function recordSealCipher({ encryption, collectionId }: {
|
|
176
|
+
encryption: CollectionEncryption;
|
|
177
|
+
collectionId?: string;
|
|
178
|
+
}): Promise<DocCipher>;
|
|
158
179
|
/**
|
|
159
180
|
* Validates the common `{ version, encryption, wrapped }` frame of a stored
|
|
160
181
|
* record (keyring or recovery -- `label` names the refusals) and returns its
|
|
@@ -251,8 +272,8 @@ export interface KeyringRecordContents {
|
|
|
251
272
|
* @param [options.email] {string} the account email, when known
|
|
252
273
|
* @param [options.pointer] {AccountPointer} the account pointer (absent on
|
|
253
274
|
* no-WAS deployments)
|
|
254
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK
|
|
255
|
-
*
|
|
275
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK (its
|
|
276
|
+
* public half is all the wrap uses: sealing needs no key-agreement secret)
|
|
256
277
|
* @param options.signer {RecordSigner} the unlock identity's signing key
|
|
257
278
|
* (`recordSignerFromAgent` over the unlock agent)
|
|
258
279
|
* @param [options.createdAt] {string} the bind timestamp to stamp, as an ISO
|
|
@@ -260,12 +281,11 @@ export interface KeyringRecordContents {
|
|
|
260
281
|
* so it knows the stamp without unwrapping the record it just wrote.
|
|
261
282
|
* @returns {Promise<SignedRecord>}
|
|
262
283
|
*/
|
|
263
|
-
export declare function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey,
|
|
284
|
+
export declare function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey, signer, createdAt }: {
|
|
264
285
|
controller: string;
|
|
265
286
|
email?: string;
|
|
266
287
|
pointer?: AccountPointer;
|
|
267
288
|
keyAgreementKey: IKeyAgreementKey;
|
|
268
|
-
keyResolver: IKeyResolver;
|
|
269
289
|
signer: RecordSigner;
|
|
270
290
|
createdAt?: string;
|
|
271
291
|
}): Promise<SignedRecord>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,yBAAyB,CAAA;AAGhC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACvD;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,WAAW,EAAE,gBAAgB,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,iBAAiB,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,oBAAoB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE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;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,UAAU,EACV,KAAK,EACL,OAAO,EACP,eAAe,EACf,MAAM,EACN,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,eAAe,EAAE,gBAAgB,CAAA;IACjC,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,YAAY,CAAC,CAyBxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,eAAe,EACf,WAAW,EACX,oBAAoB,EACrB,EAAE;IACD,MAAM,EAAE,OAAO,CAAA;IACf,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;IACzB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA2CjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACV,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,MAAM,CAQT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,KAAK,EACN,EAAE;IACD,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,MAAM,CAKT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAsB7E"}
|
package/dist/keyring/record.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* to a reader of the unlock Space.
|
|
32
32
|
*/
|
|
33
33
|
import { createDataIntegrityProofTemplate, defaultWebvhLogVerifier, signDataIntegrityProof, signerFromExternalKey, verifyEntryProofs } from '@interop/did-method-webvh';
|
|
34
|
-
import { createEdvDocCipher, initRecipients, ownerRecipient } from '@interop/was-client/edv';
|
|
34
|
+
import { createEdvDocCipher, createEdvEncryptOnlyDocCipher, initRecipients, ownerRecipient } from '@interop/was-client/edv';
|
|
35
35
|
import { KEYRING_COLLECTION } from '../space/collections.js';
|
|
36
36
|
/**
|
|
37
37
|
* The version stamped on the stored `{ version, encryption, wrapped, proof }`
|
|
@@ -186,12 +186,14 @@ export async function mintRecordEncryption({ keyAgreementKey }) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
|
-
* Builds the record cipher: an EDV cipher over the record's own
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* kind
|
|
189
|
+
* Builds the record's reading cipher: an EDV cipher over the record's own
|
|
190
|
+
* descriptor, from the reader's key-agreement key. The unwrap paths' cipher
|
|
191
|
+
* (and the recovery record's, which reuses the keyring cipher context
|
|
192
|
+
* verbatim); the wrap paths seal through {@link recordSealCipher} instead. An
|
|
193
|
+
* app's own record kind passes its own `collectionId` so its failures name
|
|
194
|
+
* the record kind. The context labels errors only -- the codec is agnostic to
|
|
195
|
+
* it, so a record kind's real swap protection is its contents validation on
|
|
196
|
+
* unwrap.
|
|
195
197
|
*
|
|
196
198
|
* @param options {object}
|
|
197
199
|
* @param options.keyAgreementKey {IKeyAgreementKey} the wrapping KAK (for
|
|
@@ -210,6 +212,24 @@ export async function recordCipher({ keyAgreementKey, keyResolver, encryption, c
|
|
|
210
212
|
encryption
|
|
211
213
|
});
|
|
212
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Builds the record's sealing cipher: an encrypt-only EDV cipher over the
|
|
217
|
+
* record's own descriptor, needing no key-agreement secret -- a write seals to
|
|
218
|
+
* the descriptor's epoch public key, reconstructed from the epoch id. This is
|
|
219
|
+
* what lets the recovery re-mint, which holds only the code's unlock KAK
|
|
220
|
+
* public half, re-seal a record it can never open; the issuance wraps go
|
|
221
|
+
* through the same construction and produce the same envelope shape. Decrypt
|
|
222
|
+
* on it refuses with was-client's typed `EncryptOnlyCipherError`.
|
|
223
|
+
*
|
|
224
|
+
* @param options {object}
|
|
225
|
+
* @param options.encryption {CollectionEncryption} the record's descriptor
|
|
226
|
+
* @param [options.collectionId] {string} the cipher context failures are
|
|
227
|
+
* labeled with; defaults to the keyring context
|
|
228
|
+
* @returns {Promise<DocCipher>}
|
|
229
|
+
*/
|
|
230
|
+
export async function recordSealCipher({ encryption, collectionId = KEYRING_COLLECTION.id }) {
|
|
231
|
+
return createEdvEncryptOnlyDocCipher({ collectionId, encryption });
|
|
232
|
+
}
|
|
213
233
|
/**
|
|
214
234
|
* Validates the common `{ version, encryption, wrapped }` frame of a stored
|
|
215
235
|
* record (keyring or recovery -- `label` names the refusals) and returns its
|
|
@@ -339,8 +359,8 @@ export async function verifyRecordProof({ record, allowedKeyMultibases, label =
|
|
|
339
359
|
* @param [options.email] {string} the account email, when known
|
|
340
360
|
* @param [options.pointer] {AccountPointer} the account pointer (absent on
|
|
341
361
|
* no-WAS deployments)
|
|
342
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK
|
|
343
|
-
*
|
|
362
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the unlock KAK (its
|
|
363
|
+
* public half is all the wrap uses: sealing needs no key-agreement secret)
|
|
344
364
|
* @param options.signer {RecordSigner} the unlock identity's signing key
|
|
345
365
|
* (`recordSignerFromAgent` over the unlock agent)
|
|
346
366
|
* @param [options.createdAt] {string} the bind timestamp to stamp, as an ISO
|
|
@@ -348,13 +368,9 @@ export async function verifyRecordProof({ record, allowedKeyMultibases, label =
|
|
|
348
368
|
* so it knows the stamp without unwrapping the record it just wrote.
|
|
349
369
|
* @returns {Promise<SignedRecord>}
|
|
350
370
|
*/
|
|
351
|
-
export async function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey,
|
|
371
|
+
export async function wrapKeyringRecord({ controller, email, pointer, keyAgreementKey, signer, createdAt }) {
|
|
352
372
|
const encryption = await mintRecordEncryption({ keyAgreementKey });
|
|
353
|
-
const cipher = await
|
|
354
|
-
keyAgreementKey,
|
|
355
|
-
keyResolver,
|
|
356
|
-
encryption
|
|
357
|
-
});
|
|
373
|
+
const cipher = await recordSealCipher({ encryption });
|
|
358
374
|
const { envelope } = await cipher.encrypt({
|
|
359
375
|
data: {
|
|
360
376
|
controller,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/keyring/record.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAA;AAOlC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EAGf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAwCvC;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;IAChC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EAQT;IACC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC7D,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC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AAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AACnD,CAAC"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
27
27
|
* anchors before the account document's latest membership change.
|
|
28
28
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
29
|
-
* the enrollment wrap
|
|
29
|
+
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
30
|
+
* it converges onto the account document instead.
|
|
30
31
|
* - `convergeUserKeyRosterToDocument` -- the standing detector for a revocation
|
|
31
32
|
* cascade torn between the document edit and the roster rotation: a roster
|
|
32
33
|
* recipient the document no longer keys is rotated away from.
|
|
@@ -54,7 +55,8 @@ export type { ClientKeyRecord, ClientKeyRecordJson, EnrolledClientKeyRecord } fr
|
|
|
54
55
|
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
55
56
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
56
57
|
export type { CollectionUserKeyRotationOutcome, UserKeyCascadeResult } from './userKeyCascade.js';
|
|
57
|
-
export type { UserKeyRosterReadResult
|
|
58
|
+
export type { UserKeyRosterReadResult } from './userKeyRoster.js';
|
|
59
|
+
export type { KeyAgreementDocument } from '../webvh/keyAgreement.js';
|
|
58
60
|
export { userKeyRosterDescriptorStore } from './rosterStore.js';
|
|
59
61
|
export { EPOCH_CONFIGURATION_STATE_TYPE, isSealableDescriptorStore, logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
60
62
|
export type { SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
package/dist/keys/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAE5E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/keys/index.js
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
27
27
|
* anchors before the account document's latest membership change.
|
|
28
28
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
29
|
-
* the enrollment wrap
|
|
29
|
+
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
30
|
+
* it converges onto the account document instead.
|
|
30
31
|
* - `convergeUserKeyRosterToDocument` -- the standing detector for a revocation
|
|
31
32
|
* cascade torn between the document edit and the roster rotation: a roster
|
|
32
33
|
* recipient the document no longer keys is rotated away from.
|
package/dist/keys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG5D,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAO7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -11,9 +11,22 @@ export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
|
11
11
|
* still anchors before the controller's latest membership change --
|
|
12
12
|
* `'sealed'` -- and writing nothing when the log is already sealed, absent,
|
|
13
13
|
* or has no membership change to seal against -- `'noop'`.
|
|
14
|
+
*
|
|
15
|
+
* `setControllerFloor()` is the post-edit freshness contract: a ceremony that
|
|
16
|
+
* just extended the account log (a revocation about to rotate the roster)
|
|
17
|
+
* hands the store the controller view built from that post-edit log, and the
|
|
18
|
+
* store's subsequent operations never resolve to anything staler. The
|
|
19
|
+
* injected `resolveController` still wins whenever it is at or past the floor
|
|
20
|
+
* (it may be fresher -- a concurrent enrollment), so the floor supersedes
|
|
21
|
+
* only a stale cached view, which would otherwise anchor the rotation before
|
|
22
|
+
* the edit and leave the log unsealed with the seal backstop blind to the
|
|
23
|
+
* removal.
|
|
14
24
|
*/
|
|
15
25
|
export interface SealableEncryptionDescriptorStore extends EncryptionDescriptorStore {
|
|
16
26
|
seal(): Promise<'sealed' | 'noop'>;
|
|
27
|
+
setControllerFloor(options: {
|
|
28
|
+
controller: ResourceLogController;
|
|
29
|
+
}): void;
|
|
17
30
|
}
|
|
18
31
|
/**
|
|
19
32
|
* Whether a descriptor store is log-governed and sealable -- the guard the
|
|
@@ -31,7 +44,11 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
31
44
|
* The controller view is resolved per operation (never held), so a caller
|
|
32
45
|
* that just edited the account document -- a revocation about to rotate the
|
|
33
46
|
* roster -- writes entries anchored at the post-edit head it now verifies,
|
|
34
|
-
* which is exactly what makes its rotation the sealing append.
|
|
47
|
+
* which is exactly what makes its rotation the sealing append. The revocation
|
|
48
|
+
* orchestrator does not leave that freshness to the injected resolver's
|
|
49
|
+
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
50
|
+
* own post-edit log, and a resolver still serving a stale cached view is
|
|
51
|
+
* superseded by it (see the interface doc).
|
|
35
52
|
*
|
|
36
53
|
* @param options {object}
|
|
37
54
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAQL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,EAAE,8BAA8B,EAAE,CAAA;AAEzC
|
|
1
|
+
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAQL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,EAAE,8BAA8B,EAAE,CAAA;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,iCAAkC,SAAQ,yBAAyB;IAClF,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAA;IAClC,kBAAkB,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,qBAAqB,CAAA;KAAE,GAAG,IAAI,CAAA;CACzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,yBAAyB,GAC/B,KAAK,IAAI,iCAAiC,CAK5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACP,EAAE;IACD,GAAG,EAAE,gBAAgB,CAAA;IACrB,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iCAAiC,CAgJpC"}
|
|
@@ -21,7 +21,11 @@ export function isSealableDescriptorStore(store) {
|
|
|
21
21
|
* The controller view is resolved per operation (never held), so a caller
|
|
22
22
|
* that just edited the account document -- a revocation about to rotate the
|
|
23
23
|
* roster -- writes entries anchored at the post-edit head it now verifies,
|
|
24
|
-
* which is exactly what makes its rotation the sealing append.
|
|
24
|
+
* which is exactly what makes its rotation the sealing append. The revocation
|
|
25
|
+
* orchestrator does not leave that freshness to the injected resolver's
|
|
26
|
+
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
27
|
+
* own post-edit log, and a resolver still serving a stale cached view is
|
|
28
|
+
* superseded by it (see the interface doc).
|
|
25
29
|
*
|
|
26
30
|
* @param options {object}
|
|
27
31
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
@@ -39,6 +43,22 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
39
43
|
// a replace builds its entry on that head, pinned to the same read's etag,
|
|
40
44
|
// so a stale head loses the CAS instead of forking.
|
|
41
45
|
let lastVerified = null;
|
|
46
|
+
// The freshness floor a post-edit ceremony set (see the interface doc).
|
|
47
|
+
let controllerFloor = null;
|
|
48
|
+
async function currentController() {
|
|
49
|
+
const resolved = await resolveController();
|
|
50
|
+
if (controllerFloor === null) {
|
|
51
|
+
return resolved;
|
|
52
|
+
}
|
|
53
|
+
const floorHead = controllerFloor.versionIds[controllerFloor.versionIds.length - 1];
|
|
54
|
+
// A resolved view carrying the floor's head version is at or past the
|
|
55
|
+
// floor (the controller-log version list is append-only) and wins; one
|
|
56
|
+
// that does not is a stale cache the floor supersedes.
|
|
57
|
+
if (floorHead !== undefined && !resolved.versionIds.includes(floorHead)) {
|
|
58
|
+
return controllerFloor;
|
|
59
|
+
}
|
|
60
|
+
return resolved;
|
|
61
|
+
}
|
|
42
62
|
function toState(descriptor) {
|
|
43
63
|
const { history: _history, ...rest } = descriptor;
|
|
44
64
|
return { ...rest, type: EPOCH_CONFIGURATION_STATE_TYPE };
|
|
@@ -56,7 +76,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
56
76
|
}
|
|
57
77
|
return {
|
|
58
78
|
async read() {
|
|
59
|
-
const controller = await
|
|
79
|
+
const controller = await currentController();
|
|
60
80
|
const current = await readResourceLog({
|
|
61
81
|
store: log,
|
|
62
82
|
controller,
|
|
@@ -90,7 +110,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
90
110
|
if (lastVerified.terminal) {
|
|
91
111
|
throw new ResourceLogClosedError({ nextLog: lastVerified.terminal });
|
|
92
112
|
}
|
|
93
|
-
const controller = await
|
|
113
|
+
const controller = await currentController();
|
|
94
114
|
const entry = await buildResourceLogEntry({
|
|
95
115
|
head: lastVerified.head,
|
|
96
116
|
state: toState(descriptor),
|
|
@@ -103,7 +123,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
103
123
|
await settle({ entry, controller });
|
|
104
124
|
},
|
|
105
125
|
async create(descriptor) {
|
|
106
|
-
const controller = await
|
|
126
|
+
const controller = await currentController();
|
|
107
127
|
const genesis = await buildResourceLogGenesis({
|
|
108
128
|
state: toState(descriptor),
|
|
109
129
|
method: RESOURCE_LOG_METHOD,
|
|
@@ -116,7 +136,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
116
136
|
await settle({ entry: genesis, controller });
|
|
117
137
|
},
|
|
118
138
|
async seal() {
|
|
119
|
-
const controller = await
|
|
139
|
+
const controller = await currentController();
|
|
120
140
|
// Reuse the log view the most recent read or confirmed append on this
|
|
121
141
|
// store instance verified: a rotation that just appended anchors past
|
|
122
142
|
// the removal, so the sweep resolves noop with no re-fetch, and a stale
|
|
@@ -133,6 +153,9 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, s
|
|
|
133
153
|
lastVerified = verified;
|
|
134
154
|
}
|
|
135
155
|
return sealed ? 'sealed' : 'noop';
|
|
156
|
+
},
|
|
157
|
+
setControllerFloor({ controller }) {
|
|
158
|
+
controllerFloor = controller;
|
|
136
159
|
}
|
|
137
160
|
};
|
|
138
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,aAAa,EACb,mBAAmB,EAEpB,MAAM,yBAAyB,CAAA;AAChC,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,CAAC,UAAU;YACrB,MAAM,UAAU,GAAG,MAAM,iBAAiB,EAAE,CAAA;YAC5C,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC;gBAC5C,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC;gBAC1B,MAAM,EAAE,mBAAmB;gBAC3B,UAAU;gBACV,MAAM;aACP,CAAC,CAAA;YACF,qEAAqE;YACrE,6DAA6D;YAC7D,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YACzB,MAAM,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAA;QAC9C,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,UAAU,GAAG,MAAM,iBAAiB,EAAE,CAAA;YAC5C,sEAAsE;YACtE,sEAAsE;YACtE,wEAAwE;YACxE,wEAAwE;YACxE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,CAAC;gBACjD,KAAK,EAAE,GAAG;gBACV,UAAU;gBACV,cAAc,EAAE,mBAAmB;gBACnC,QAAQ;gBACR,MAAM;gBACN,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;aAC7D,CAAC,CAAA;YACF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,YAAY,GAAG,QAAQ,CAAA;YACzB,CAAC;YACD,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QACnC,CAAC;QAED,kBAAkB,CAAC,EAAE,UAAU,EAAE;YAC/B,eAAe,GAAG,UAAU,CAAA;QAC9B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
* The cascade is rotation-only: every encrypted collection's descriptor
|
|
23
23
|
* carries an epoch roster from provisioning (`ensureWalletSpaceEpochs`), so a
|
|
24
24
|
* descriptor met without epochs can only mean a tampering or pre-provisioning
|
|
25
|
-
* host and is refused fail-closed.
|
|
25
|
+
* host and is refused fail-closed. A descriptor whose `currentEpoch` names no
|
|
26
|
+
* epoch in its own list is refused the same way (the shape
|
|
27
|
+
* `readUserKeyRoster` refuses on the roster itself): collection descriptors
|
|
28
|
+
* arrive host-served with no server-side epoch invariants, so a mismatched
|
|
29
|
+
* pair is a configuration no enrolled client authenticated, never something
|
|
30
|
+
* to evaluate against the last epoch. No construction anywhere installs a
|
|
26
31
|
* user-key secret as a collection epoch secret, which is what keeps a
|
|
27
32
|
* collection-epoch escrow (an App Connect grant, a share) from ever handing a
|
|
28
33
|
* grantee the user key itself.
|
|
@@ -88,9 +93,11 @@ export type CollectionUserKeyRotationOutcome = 'noop' | 'sealed' | 'escrowed' |
|
|
|
88
93
|
* so the store's seal backstop runs here (`sealed` when it appended);
|
|
89
94
|
* rotated and escrowed writes seal by construction, anchored at the
|
|
90
95
|
* caller's current controller head.
|
|
91
|
-
* - **No epochs
|
|
96
|
+
* - **No epochs**, or a `currentEpoch` naming no epoch in the descriptor's
|
|
97
|
+
* own list: refused fail-closed (see the module doc) -- provisioning
|
|
92
98
|
* installs every encrypted collection's epoch[0], so the cascade never
|
|
93
|
-
* mints a first epoch
|
|
99
|
+
* mints a first epoch, and never guesses which epoch an inconsistent
|
|
100
|
+
* descriptor meant.
|
|
94
101
|
*
|
|
95
102
|
* The pull axis is deliberately a no-op here: a user key rotation follows a
|
|
96
103
|
* document edit (client revocation, code retirement) that already killed the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"userKeyCascade.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8B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ACH,wBAAsB,2BAA2B,CAAC,EAChD,aAAa,EACb,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,OAAO,EACR,EAAE;IACD,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,yBAAyB,CAAA;IAC7D,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACxD,gBAAgB,EAAE,oBAAoB,CAAA;IACtC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAwBhC"}
|
|
@@ -65,9 +65,11 @@ export async function unwrapUserKeyGenerations({ descriptor, clientKeyAgreementK
|
|
|
65
65
|
* so the store's seal backstop runs here (`sealed` when it appended);
|
|
66
66
|
* rotated and escrowed writes seal by construction, anchored at the
|
|
67
67
|
* caller's current controller head.
|
|
68
|
-
* - **No epochs
|
|
68
|
+
* - **No epochs**, or a `currentEpoch` naming no epoch in the descriptor's
|
|
69
|
+
* own list: refused fail-closed (see the module doc) -- provisioning
|
|
69
70
|
* installs every encrypted collection's epoch[0], so the cascade never
|
|
70
|
-
* mints a first epoch
|
|
71
|
+
* mints a first epoch, and never guesses which epoch an inconsistent
|
|
72
|
+
* descriptor meant.
|
|
71
73
|
*
|
|
72
74
|
* The pull axis is deliberately a no-op here: a user key rotation follows a
|
|
73
75
|
* document edit (client revocation, code retirement) that already killed the
|
|
@@ -95,8 +97,12 @@ export async function rotateCollectionEpochsToUserKey({ store, userKey, generati
|
|
|
95
97
|
'epoch-less descriptor can only come from a tampering or ' +
|
|
96
98
|
'pre-provisioning host; refusing to rotate it.');
|
|
97
99
|
}
|
|
98
|
-
const currentEpoch = descriptor.epochs.find(epoch => epoch.id === descriptor.currentEpoch)
|
|
99
|
-
|
|
100
|
+
const currentEpoch = descriptor.epochs.find(epoch => epoch.id === descriptor.currentEpoch);
|
|
101
|
+
if (!currentEpoch) {
|
|
102
|
+
throw new Error("The collection descriptor's currentEpoch names no epoch in its own " +
|
|
103
|
+
'epochs list. No enrolled client authenticated such a configuration; ' +
|
|
104
|
+
'refusing to evaluate it against any other epoch.');
|
|
105
|
+
}
|
|
100
106
|
const currentKids = new Set(currentEpoch.recipients.map(entry => entry.header.kid));
|
|
101
107
|
const staleKids = staleGenerations
|
|
102
108
|
.map(generation => epochKeyIdFor(generation.id))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"userKeyCascade.js","sourceRoot":"","sources":["../../src/keys/userKeyCascade.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAgB,MAAM,cAAc,CAAA;AAE7D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,OAAO,EAGR;IACC,OAAO;QACL,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAC7C,UAAU,EACV,qBAAqB,EAItB;IACC,MAAM,WAAW,GAAc,EAAE,CAAA;IACjC,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CACjC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,IAAI,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC,CAAC,CACH,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -51,6 +51,7 @@ import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
|
51
51
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
52
52
|
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv';
|
|
53
53
|
import { type ResourceLogSigner } from '../resourceLog/index.js';
|
|
54
|
+
import type { KeyAgreementDocument } from '../webvh/keyAgreement.js';
|
|
54
55
|
import { type ICapabilityAgent } from '../webvh/zcap.js';
|
|
55
56
|
import type { UserKey } from './userKey.js';
|
|
56
57
|
/**
|
|
@@ -83,21 +84,6 @@ export declare class UserKeyRosterContinuityError extends Error {
|
|
|
83
84
|
export declare class UserKeyRosterUnwrapError extends Error {
|
|
84
85
|
constructor(message: string);
|
|
85
86
|
}
|
|
86
|
-
/**
|
|
87
|
-
* The subset of a resolved DID document the recipient resolver consumes: the
|
|
88
|
-
* `keyAgreement` relation (VM references or embedded VMs) and the
|
|
89
|
-
* `verificationMethod` list references resolve against.
|
|
90
|
-
*/
|
|
91
|
-
export interface RosterRecipientDocument {
|
|
92
|
-
keyAgreement?: Array<string | {
|
|
93
|
-
id?: string;
|
|
94
|
-
publicKeyMultibase?: string;
|
|
95
|
-
}>;
|
|
96
|
-
verificationMethod?: Array<{
|
|
97
|
-
id?: string;
|
|
98
|
-
publicKeyMultibase?: string;
|
|
99
|
-
}>;
|
|
100
|
-
}
|
|
101
87
|
/**
|
|
102
88
|
* The roster's log signer: signs each roster log append with this client's
|
|
103
89
|
* own Ed25519 signing key, named by its public multibase -- exactly the
|
|
@@ -143,13 +129,23 @@ export declare function rosterRecipientKid({ signingKeyMultibase, keyAgreementKe
|
|
|
143
129
|
* resolves `null` -- the was-client skip contract -- so the entry is dropped
|
|
144
130
|
* from the fresh epoch and never receives a wrap.
|
|
145
131
|
*
|
|
132
|
+
* The match is over EVERY key-agreement method the document publishes
|
|
133
|
+
* ({@link resolvedKeyAgreementMethods} filtered by nothing more than "carries a
|
|
134
|
+
* public key multibase"), deliberately including the unmarked ones. That is
|
|
135
|
+
* where this predicate parts company with `markedKeyAgreementMethods`, which
|
|
136
|
+
* hard-requires a client's controller marker: a recovery code's key-agreement
|
|
137
|
+
* method is published unmarked by design, so that client listings and
|
|
138
|
+
* revocations never match it, and it must keep its user key wrap through every
|
|
139
|
+
* rotation. Filtering by the marker here would drop every recovery code from
|
|
140
|
+
* each rotated epoch.
|
|
141
|
+
*
|
|
146
142
|
* @param options {object}
|
|
147
|
-
* @param options.document {
|
|
143
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
148
144
|
* did:webvh document (never a server-supplied roster field)
|
|
149
145
|
* @returns {function} a `resolveRecipientKey` for `removeRecipient`
|
|
150
146
|
*/
|
|
151
147
|
export declare function userKeyRosterRecipientResolver({ document }: {
|
|
152
|
-
document:
|
|
148
|
+
document: KeyAgreementDocument;
|
|
153
149
|
}): (kid: string) => Promise<RecipientPublicKey | null>;
|
|
154
150
|
/**
|
|
155
151
|
* Ensures the roster exists, create-if-absent: an absent roster is initialized
|
|
@@ -218,7 +214,7 @@ export declare function addUserKeyRosterRecipient({ store, recipient, ownerKeyAg
|
|
|
218
214
|
* @param options {object}
|
|
219
215
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
220
216
|
* store
|
|
221
|
-
* @param options.document {
|
|
217
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
222
218
|
* did:webvh document, AFTER the removal edit
|
|
223
219
|
* @param options.retireRecipientId {string} the removed recipient's roster
|
|
224
220
|
* kid
|
|
@@ -226,7 +222,7 @@ export declare function addUserKeyRosterRecipient({ store, recipient, ownerKeyAg
|
|
|
226
222
|
*/
|
|
227
223
|
export declare function rotateUserKeyRoster({ store, document, retireRecipientId }: {
|
|
228
224
|
store: EncryptionDescriptorStore;
|
|
229
|
-
document:
|
|
225
|
+
document: KeyAgreementDocument;
|
|
230
226
|
retireRecipientId: string;
|
|
231
227
|
}): Promise<CollectionEncryption>;
|
|
232
228
|
/**
|
|
@@ -258,7 +254,7 @@ export declare function rotateUserKeyRoster({ store, document, retireRecipientId
|
|
|
258
254
|
* @param options {object}
|
|
259
255
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
260
256
|
* store
|
|
261
|
-
* @param options.document {
|
|
257
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
262
258
|
* did:webvh document -- the recipient source of record
|
|
263
259
|
* @param [options.descriptor] {CollectionEncryption} a descriptor the caller
|
|
264
260
|
* has just read (a login-time roster read), to save a re-read; omitted, the
|
|
@@ -269,7 +265,7 @@ export declare function rotateUserKeyRoster({ store, document, retireRecipientId
|
|
|
269
265
|
*/
|
|
270
266
|
export declare function convergeUserKeyRosterToDocument({ store, document, descriptor }: {
|
|
271
267
|
store: EncryptionDescriptorStore;
|
|
272
|
-
document:
|
|
268
|
+
document: KeyAgreementDocument;
|
|
273
269
|
descriptor?: CollectionEncryption;
|
|
274
270
|
}): Promise<{
|
|
275
271
|
rotated: boolean;
|