@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyRoster.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAML,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"userKeyRoster.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAML,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,aAAa,EAAE,MAAM,CAAA;gBACT,EAAE,aAAa,EAAE,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE;C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AgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addRecipient, initRecipients, ownerRecipient, removeRecipient, unwrapEpochSecret } from '@interop/was-client/edv';
|
|
2
2
|
import { vmFragmentOf } from '../resourceLog/index.js';
|
|
3
|
+
import { resolvedKeyAgreementMethods } from '../webvh/keyAgreement.js';
|
|
3
4
|
import { clientSigningKeyMultibase } from '../webvh/zcap.js';
|
|
4
5
|
/**
|
|
5
6
|
* Thrown when a served roster fails its client-side consistency checks: a
|
|
@@ -94,27 +95,25 @@ export function rosterRecipientKid({ signingKeyMultibase, keyAgreementKeyMultiba
|
|
|
94
95
|
* resolves `null` -- the was-client skip contract -- so the entry is dropped
|
|
95
96
|
* from the fresh epoch and never receives a wrap.
|
|
96
97
|
*
|
|
98
|
+
* The match is over EVERY key-agreement method the document publishes
|
|
99
|
+
* ({@link resolvedKeyAgreementMethods} filtered by nothing more than "carries a
|
|
100
|
+
* public key multibase"), deliberately including the unmarked ones. That is
|
|
101
|
+
* where this predicate parts company with `markedKeyAgreementMethods`, which
|
|
102
|
+
* hard-requires a client's controller marker: a recovery code's key-agreement
|
|
103
|
+
* method is published unmarked by design, so that client listings and
|
|
104
|
+
* revocations never match it, and it must keep its user key wrap through every
|
|
105
|
+
* rotation. Filtering by the marker here would drop every recovery code from
|
|
106
|
+
* each rotated epoch.
|
|
107
|
+
*
|
|
97
108
|
* @param options {object}
|
|
98
|
-
* @param options.document {
|
|
109
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
99
110
|
* did:webvh document (never a server-supplied roster field)
|
|
100
111
|
* @returns {function} a `resolveRecipientKey` for `removeRecipient`
|
|
101
112
|
*/
|
|
102
113
|
export function userKeyRosterRecipientResolver({ document }) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
for (const method of document.verificationMethod ?? []) {
|
|
107
|
-
if (typeof method?.id === 'string') {
|
|
108
|
-
byId.set(method.id, method);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const keyAgreementMethods = [];
|
|
112
|
-
for (const entry of document.keyAgreement ?? []) {
|
|
113
|
-
const method = typeof entry === 'string' ? byId.get(entry) : entry;
|
|
114
|
-
if (method && typeof method.publicKeyMultibase === 'string') {
|
|
115
|
-
keyAgreementMethods.push(method);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
114
|
+
const keyAgreementMethods = resolvedKeyAgreementMethods({
|
|
115
|
+
doc: document
|
|
116
|
+
}).filter(method => typeof method.publicKeyMultibase === 'string');
|
|
118
117
|
return async function resolveRecipientKey(kid) {
|
|
119
118
|
const fragment = vmFragmentOf(kid);
|
|
120
119
|
if (!fragment) {
|
|
@@ -218,7 +217,7 @@ export async function addUserKeyRosterRecipient({ store, recipient, ownerKeyAgre
|
|
|
218
217
|
* @param options {object}
|
|
219
218
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
220
219
|
* store
|
|
221
|
-
* @param options.document {
|
|
220
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
222
221
|
* did:webvh document, AFTER the removal edit
|
|
223
222
|
* @param options.retireRecipientId {string} the removed recipient's roster
|
|
224
223
|
* kid
|
|
@@ -261,7 +260,7 @@ export async function rotateUserKeyRoster({ store, document, retireRecipientId }
|
|
|
261
260
|
* @param options {object}
|
|
262
261
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
263
262
|
* store
|
|
264
|
-
* @param options.document {
|
|
263
|
+
* @param options.document {KeyAgreementDocument} the locally verified
|
|
265
264
|
* did:webvh document -- the recipient source of record
|
|
266
265
|
* @param [options.descriptor] {CollectionEncryption} a descriptor the caller
|
|
267
266
|
* has just read (a login-time roster read), to save a re-read; omitted, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyRoster.js","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAmDA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EAGlB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EACL,yBAAyB,EAE1B,MAAM,kBAAkB,CAAA;AAGzB;;;;;GAKG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAA;IAC3C,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD,aAAa,CAAQ;IACrB,YAAY,EAAE,aAAa,EAA6B;QACtD,KAAK,CACH,4EAA4E;YAC1E,mCAAmC,CACtC,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAA;QAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;IACxC,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"userKeyRoster.js","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAmDA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EAGlB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAEtE,OAAO,EACL,yBAAyB,EAE1B,MAAM,kBAAkB,CAAA;AAGzB;;;;;GAKG;AACH,MAAM,OAAO,2BAA4B,S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AChC,uDAAuD,CACxD,CAAA;QACH,CAAC;QACD,cAAc,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,YAAa,EAAE,MAAM,EAAE,CAAA;QACzD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC;IAED,OAAO;QACL,UAAU;QACV,OAAO,EAAE,cAAc;QACvB,OAAO;QACP,aAAa,EAAE,UAAU,CAAC,YAAa;KACxC,CAAA;AACH,CAAC"}
|
package/dist/recovery/index.d.ts
CHANGED
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
* - `publishRecoveryKey` / `removeRecoveryKey` / `recoverWebvhClient` -- the
|
|
24
24
|
* document half: issuance's split posture, revocation's removal, and the
|
|
25
25
|
* self-enrolling recovery continuation.
|
|
26
|
+
* - `delegateLogWrite` / `delegationProofKeyId` /
|
|
27
|
+
* `remintRecoveryDelegations` -- the authorization bridge: the pre-minted
|
|
28
|
+
* PUT-on-`did.jsonl` delegation builder and the revocation cascade's
|
|
29
|
+
* re-mint of the delegations a document edit rotted, behind injected
|
|
30
|
+
* app seams (management-zcap client factory, storage URL, registry
|
|
31
|
+
* read/record).
|
|
26
32
|
*
|
|
27
33
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
28
34
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
|
@@ -31,6 +37,8 @@ export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalize
|
|
|
31
37
|
export type { RecoveryClient } from './recoveryCode.js';
|
|
32
38
|
export { computeRecoveryBinding, RecoveryBindingError, recoveryRecordBinding, unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
33
39
|
export type { RecoveryRecordContents, RecoveryRecordProofState, SignedRecoveryRecord } from './recoveryRecord.js';
|
|
40
|
+
export { delegateLogWrite, delegationProofKeyId, RECOVERY_DELEGATION_TTL_MS, remintRecoveryDelegations } from './recoveryDelegation.js';
|
|
41
|
+
export type { RecoveryDelegationEntry } from './recoveryDelegation.js';
|
|
34
42
|
export { publishRecoveryKey, recoverWebvhClient, RecoveryKeyNotCommittedError, recoveryVmId, removeRecoveryKey } from './recoveryWebvh.js';
|
|
35
43
|
export type { RecoveryLogStore, RecoveryPublicKeys } from './recoveryWebvh.js';
|
|
36
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEtE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,iBAAiB,EAClB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/recovery/index.js
CHANGED
|
@@ -23,11 +23,18 @@
|
|
|
23
23
|
* - `publishRecoveryKey` / `removeRecoveryKey` / `recoverWebvhClient` -- the
|
|
24
24
|
* document half: issuance's split posture, revocation's removal, and the
|
|
25
25
|
* self-enrolling recovery continuation.
|
|
26
|
+
* - `delegateLogWrite` / `delegationProofKeyId` /
|
|
27
|
+
* `remintRecoveryDelegations` -- the authorization bridge: the pre-minted
|
|
28
|
+
* PUT-on-`did.jsonl` delegation builder and the revocation cascade's
|
|
29
|
+
* re-mint of the delegations a document edit rotted, behind injected
|
|
30
|
+
* app seams (management-zcap client factory, storage URL, registry
|
|
31
|
+
* read/record).
|
|
26
32
|
*
|
|
27
33
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
28
34
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
|
29
35
|
*/
|
|
30
36
|
export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalizeRecoveryCode, RECOVERY_CODE_BYTES, RECOVERY_KDF, RecoveryCodeInvalidError, recoveryClientFromCode } from './recoveryCode.js';
|
|
31
37
|
export { computeRecoveryBinding, RecoveryBindingError, recoveryRecordBinding, unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
38
|
+
export { delegateLogWrite, delegationProofKeyId, RECOVERY_DELEGATION_TTL_MS, remintRecoveryDelegations } from './recoveryDelegation.js';
|
|
32
39
|
export { publishRecoveryKey, recoverWebvhClient, RecoveryKeyNotCommittedError, recoveryVmId, removeRecoveryKey } from './recoveryWebvh.js';
|
|
33
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,iBAAiB,EAClB,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { IZcap } from '@interop/data-integrity-core';
|
|
2
|
+
import type { ZcapClient } from '@interop/ezcap';
|
|
3
|
+
import type { PublishedKeyDocument } from '../webvh/listClients.js';
|
|
4
|
+
import type { AccountPointer, RecordSigner } from '../keyring/record.js';
|
|
5
|
+
/**
|
|
6
|
+
* The recovery delegation's lifetime: ten years. Deliberately long-lived: a
|
|
7
|
+
* recovery code must work years after issuance, and the delegation's scope is
|
|
8
|
+
* one resource (the world-readable DID log), whose worst-case abuse is a log
|
|
9
|
+
* write that still has to verify against the published hash chain and
|
|
10
|
+
* prerotation commitments to resolve. The login-time recovery health check
|
|
11
|
+
* watches for delegation rot (the signing client's verification method
|
|
12
|
+
* leaving the document) rather than expiry.
|
|
13
|
+
*/
|
|
14
|
+
export declare const RECOVERY_DELEGATION_TTL_MS: number;
|
|
15
|
+
/**
|
|
16
|
+
* Delegates the narrow log-write bridge to a code-derived client: PUT on the
|
|
17
|
+
* one `did.jsonl` resource, {@link RECOVERY_DELEGATION_TTL_MS} lifetime. The
|
|
18
|
+
* delegation is what lets a latent-authority code write its self-enrolling
|
|
19
|
+
* continuation without any standing invocation presence.
|
|
20
|
+
*
|
|
21
|
+
* @param options {object}
|
|
22
|
+
* @param options.zcapClient {ZcapClient} the delegating client (an enrolled
|
|
23
|
+
* client's promoted signer)
|
|
24
|
+
* @param options.pointer {AccountPointer}
|
|
25
|
+
* @param options.recoveryClientDid {string}
|
|
26
|
+
* @returns {Promise<IZcap>}
|
|
27
|
+
*/
|
|
28
|
+
export declare function delegateLogWrite({ zcapClient, pointer, recoveryClientDid }: {
|
|
29
|
+
zcapClient: ZcapClient;
|
|
30
|
+
pointer: AccountPointer;
|
|
31
|
+
recoveryClientDid: string;
|
|
32
|
+
}): Promise<IZcap>;
|
|
33
|
+
/**
|
|
34
|
+
* The verification method that signed a delegation's proof -- recorded in the
|
|
35
|
+
* registry entry so the health check and the re-mint's rot check can test it
|
|
36
|
+
* against the current document without holding the code.
|
|
37
|
+
*
|
|
38
|
+
* @param delegation {IZcap}
|
|
39
|
+
* @returns {string | undefined}
|
|
40
|
+
*/
|
|
41
|
+
export declare function delegationProofKeyId(delegation: IZcap): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The members of a recovery-code registry entry the re-mint reads: where the
|
|
44
|
+
* code's unlock Space and record are (`unlockSpaceId`, `manageCapability`),
|
|
45
|
+
* which key signed the recorded delegation (`delegationKeyId` -- absent on an
|
|
46
|
+
* entry predating the field, which the rot check conservatively flags), and
|
|
47
|
+
* the re-mint fields: the code-derived signing DID the fresh delegation names
|
|
48
|
+
* and the unlock KAK public half the record is re-wrapped to. Structural on
|
|
49
|
+
* purpose -- an app's richer registry entry satisfies it, and the re-mint
|
|
50
|
+
* hands the SAME entry back (with the fresh `delegationKeyId`) through the
|
|
51
|
+
* record seam, extra members untouched.
|
|
52
|
+
*/
|
|
53
|
+
export interface RecoveryDelegationEntry {
|
|
54
|
+
label: string;
|
|
55
|
+
unlockSpaceId: string;
|
|
56
|
+
manageCapability?: IZcap;
|
|
57
|
+
delegationKeyId?: string;
|
|
58
|
+
recoveryClientDid?: string;
|
|
59
|
+
unlockKeyAgreementKeyId?: string;
|
|
60
|
+
unlockKeyAgreementKeyMultibase?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Re-mints the recovery delegations the current document no longer backs --
|
|
64
|
+
* the recovery-code delta riding the revocation cascade (see the module doc
|
|
65
|
+
* for the mechanism and the skip policy).
|
|
66
|
+
*
|
|
67
|
+
* The record's code-authenticated account binding is preserved verbatim: the
|
|
68
|
+
* re-mint reads the standing record through the entry's management zcap and
|
|
69
|
+
* carries its `binding` frame member forward (the tag rides in the clear; it
|
|
70
|
+
* cannot be recomputed without the code, and does not need to be). A re-mint
|
|
71
|
+
* therefore can never change the pointer or controller the code was issued
|
|
72
|
+
* against -- and after a host migration the tag no longer matches the moved
|
|
73
|
+
* pointer, so codes must be re-issued when the account moves hosts.
|
|
74
|
+
*
|
|
75
|
+
* The re-mint holds the code's KAK public half but not its signing key, so
|
|
76
|
+
* every record it re-PUTs is signed with the acting client's own account key
|
|
77
|
+
* (`recordSigner`) -- the mixed-signer case a reader settles against the
|
|
78
|
+
* verified did:webvh document.
|
|
79
|
+
*
|
|
80
|
+
* Best-effort per entry: a skipped entry stays flagged by the login-time
|
|
81
|
+
* health check, whose regenerate nudge remains the backstop.
|
|
82
|
+
*
|
|
83
|
+
* @param options {object}
|
|
84
|
+
* @param options.doc {PublishedKeyDocument} the locally verified did:webvh
|
|
85
|
+
* document, AFTER the revocation edit
|
|
86
|
+
* @param options.entries {RecoveryDelegationEntry[]} the registry's
|
|
87
|
+
* recovery-code entries, as the app's registry read returned them
|
|
88
|
+
* @param options.pointer {AccountPointer}
|
|
89
|
+
* @param options.controller {string} the account controller to stamp into
|
|
90
|
+
* re-wrapped records (an identity label, as at issuance)
|
|
91
|
+
* @param options.storageServerUrl {string} the unlock Spaces' storage server
|
|
92
|
+
* @param options.zcapClient {ZcapClient} the acting client's promoted
|
|
93
|
+
* signer, which mints the fresh delegations
|
|
94
|
+
* @param options.recordSigner {RecordSigner} the acting client's account
|
|
95
|
+
* key, which signs the re-wrapped records
|
|
96
|
+
* @param options.managementZcapClient {Function} `({ capability }) =>
|
|
97
|
+
* ZcapClient` -- the client an entry's management zcap is invoked with
|
|
98
|
+
* @param options.recordEntry {Function} `({ entry }) => Promise<void>` --
|
|
99
|
+
* persists one updated registry entry (matching on the app's entry key)
|
|
100
|
+
* @returns {Promise<{ reminted: number; skipped: number }>}
|
|
101
|
+
*/
|
|
102
|
+
export declare function remintRecoveryDelegations<Entry extends RecoveryDelegationEntry>({ doc, entries, pointer, controller, storageServerUrl, zcapClient, recordSigner, managementZcapClient, recordEntry }: {
|
|
103
|
+
doc: PublishedKeyDocument;
|
|
104
|
+
entries: Entry[];
|
|
105
|
+
pointer: AccountPointer;
|
|
106
|
+
controller: string;
|
|
107
|
+
storageServerUrl: string;
|
|
108
|
+
zcapClient: ZcapClient;
|
|
109
|
+
recordSigner: RecordSigner;
|
|
110
|
+
managementZcapClient: (options: {
|
|
111
|
+
capability: IZcap;
|
|
112
|
+
}) => ZcapClient;
|
|
113
|
+
recordEntry: (options: {
|
|
114
|
+
entry: Entry;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
reminted: number;
|
|
118
|
+
skipped: number;
|
|
119
|
+
}>;
|
|
120
|
+
//# sourceMappingURL=recoveryDelegation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recoveryDelegation.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,QAAiC,CAAA;AAiBxE;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBA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I,CAAC,CAAA;CAC1D,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAyFjD"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The recovery code's authorization bridge: the pre-minted PUT-on-`did.jsonl`
|
|
6
|
+
* delegation and the revocation cascade's re-mint of it. The delegation is a
|
|
7
|
+
* wire artifact both apps must mint byte-identically (issuance and every
|
|
8
|
+
* re-mint produce the record another replica later recovers with), so its
|
|
9
|
+
* builder lives here: PUT on the one `did.jsonl` resource, long TTL, delegated
|
|
10
|
+
* to the code-derived signing DID. Its narrow scope is what keeps recovery
|
|
11
|
+
* loud -- a stolen code must extend the world-readable log before it can read
|
|
12
|
+
* anything.
|
|
13
|
+
*
|
|
14
|
+
* Beside the builder lives the re-mint core (`remintRecoveryDelegations`):
|
|
15
|
+
* revoking a client kills, by the current-key-set rule, every `did.jsonl`
|
|
16
|
+
* delegation that client signed, which would brick recovery exactly when it
|
|
17
|
+
* is needed. For each registry entry whose recorded delegation no longer
|
|
18
|
+
* chains (its signing verification method left the document), the acting
|
|
19
|
+
* client signs a fresh delegation to the code's signing DID, re-wraps the
|
|
20
|
+
* record to the code's unlock KAK (the public half the registry records --
|
|
21
|
+
* the record carries no secrets, so re-encryption needs none), re-PUTs it
|
|
22
|
+
* through the entry's management zcap, and updates the registry's
|
|
23
|
+
* `delegationKeyId`. The skip policy is cross-replica correctness and is
|
|
24
|
+
* decided here once: an entry that predates the re-mint fields, or whose
|
|
25
|
+
* standing record cannot be read or carries no binding, is skipped and stays
|
|
26
|
+
* flagged by the login-time health check. What stays app-side is the seams:
|
|
27
|
+
* the management-zcap client factory, the storage server URL, and the
|
|
28
|
+
* registry read/record halves.
|
|
29
|
+
*/
|
|
30
|
+
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
31
|
+
import { DID_LOG_RESOURCE, ID_COLLECTION } from '../space/collections.js';
|
|
32
|
+
import { delegationKeyInDocument } from '../webvh/listClients.js';
|
|
33
|
+
import { getUnlockKeyringWithCapability, putUnlockKeyringWithCapability } from '../keyring/unlockSpace.js';
|
|
34
|
+
import { recoveryRecordBinding, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
35
|
+
/**
|
|
36
|
+
* The recovery delegation's lifetime: ten years. Deliberately long-lived: a
|
|
37
|
+
* recovery code must work years after issuance, and the delegation's scope is
|
|
38
|
+
* one resource (the world-readable DID log), whose worst-case abuse is a log
|
|
39
|
+
* write that still has to verify against the published hash chain and
|
|
40
|
+
* prerotation commitments to resolve. The login-time recovery health check
|
|
41
|
+
* watches for delegation rot (the signing client's verification method
|
|
42
|
+
* leaving the document) rather than expiry.
|
|
43
|
+
*/
|
|
44
|
+
export const RECOVERY_DELEGATION_TTL_MS = 10 * 365 * 24 * 60 * 60 * 1000;
|
|
45
|
+
/**
|
|
46
|
+
* The absolute URL of the account's `did.jsonl` log resource -- the
|
|
47
|
+
* invocation target of the pre-minted recovery delegation.
|
|
48
|
+
*
|
|
49
|
+
* @param options {object}
|
|
50
|
+
* @param options.pointer {AccountPointer}
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
function didLogUrl({ pointer }) {
|
|
54
|
+
return new URL(`/space/${pointer.spaceId}/${ID_COLLECTION.id}/${DID_LOG_RESOURCE}`, pointer.host).toString();
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Delegates the narrow log-write bridge to a code-derived client: PUT on the
|
|
58
|
+
* one `did.jsonl` resource, {@link RECOVERY_DELEGATION_TTL_MS} lifetime. The
|
|
59
|
+
* delegation is what lets a latent-authority code write its self-enrolling
|
|
60
|
+
* continuation without any standing invocation presence.
|
|
61
|
+
*
|
|
62
|
+
* @param options {object}
|
|
63
|
+
* @param options.zcapClient {ZcapClient} the delegating client (an enrolled
|
|
64
|
+
* client's promoted signer)
|
|
65
|
+
* @param options.pointer {AccountPointer}
|
|
66
|
+
* @param options.recoveryClientDid {string}
|
|
67
|
+
* @returns {Promise<IZcap>}
|
|
68
|
+
*/
|
|
69
|
+
export async function delegateLogWrite({ zcapClient, pointer, recoveryClientDid }) {
|
|
70
|
+
return zcapClient.delegate({
|
|
71
|
+
invocationTarget: didLogUrl({ pointer }),
|
|
72
|
+
controller: recoveryClientDid,
|
|
73
|
+
allowedActions: ['PUT'],
|
|
74
|
+
expires: new Date(Date.now() + RECOVERY_DELEGATION_TTL_MS)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The verification method that signed a delegation's proof -- recorded in the
|
|
79
|
+
* registry entry so the health check and the re-mint's rot check can test it
|
|
80
|
+
* against the current document without holding the code.
|
|
81
|
+
*
|
|
82
|
+
* @param delegation {IZcap}
|
|
83
|
+
* @returns {string | undefined}
|
|
84
|
+
*/
|
|
85
|
+
export function delegationProofKeyId(delegation) {
|
|
86
|
+
const { proof } = delegation;
|
|
87
|
+
const single = Array.isArray(proof) ? proof[0] : proof;
|
|
88
|
+
return single?.verificationMethod;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Re-mints the recovery delegations the current document no longer backs --
|
|
92
|
+
* the recovery-code delta riding the revocation cascade (see the module doc
|
|
93
|
+
* for the mechanism and the skip policy).
|
|
94
|
+
*
|
|
95
|
+
* The record's code-authenticated account binding is preserved verbatim: the
|
|
96
|
+
* re-mint reads the standing record through the entry's management zcap and
|
|
97
|
+
* carries its `binding` frame member forward (the tag rides in the clear; it
|
|
98
|
+
* cannot be recomputed without the code, and does not need to be). A re-mint
|
|
99
|
+
* therefore can never change the pointer or controller the code was issued
|
|
100
|
+
* against -- and after a host migration the tag no longer matches the moved
|
|
101
|
+
* pointer, so codes must be re-issued when the account moves hosts.
|
|
102
|
+
*
|
|
103
|
+
* The re-mint holds the code's KAK public half but not its signing key, so
|
|
104
|
+
* every record it re-PUTs is signed with the acting client's own account key
|
|
105
|
+
* (`recordSigner`) -- the mixed-signer case a reader settles against the
|
|
106
|
+
* verified did:webvh document.
|
|
107
|
+
*
|
|
108
|
+
* Best-effort per entry: a skipped entry stays flagged by the login-time
|
|
109
|
+
* health check, whose regenerate nudge remains the backstop.
|
|
110
|
+
*
|
|
111
|
+
* @param options {object}
|
|
112
|
+
* @param options.doc {PublishedKeyDocument} the locally verified did:webvh
|
|
113
|
+
* document, AFTER the revocation edit
|
|
114
|
+
* @param options.entries {RecoveryDelegationEntry[]} the registry's
|
|
115
|
+
* recovery-code entries, as the app's registry read returned them
|
|
116
|
+
* @param options.pointer {AccountPointer}
|
|
117
|
+
* @param options.controller {string} the account controller to stamp into
|
|
118
|
+
* re-wrapped records (an identity label, as at issuance)
|
|
119
|
+
* @param options.storageServerUrl {string} the unlock Spaces' storage server
|
|
120
|
+
* @param options.zcapClient {ZcapClient} the acting client's promoted
|
|
121
|
+
* signer, which mints the fresh delegations
|
|
122
|
+
* @param options.recordSigner {RecordSigner} the acting client's account
|
|
123
|
+
* key, which signs the re-wrapped records
|
|
124
|
+
* @param options.managementZcapClient {Function} `({ capability }) =>
|
|
125
|
+
* ZcapClient` -- the client an entry's management zcap is invoked with
|
|
126
|
+
* @param options.recordEntry {Function} `({ entry }) => Promise<void>` --
|
|
127
|
+
* persists one updated registry entry (matching on the app's entry key)
|
|
128
|
+
* @returns {Promise<{ reminted: number; skipped: number }>}
|
|
129
|
+
*/
|
|
130
|
+
export async function remintRecoveryDelegations({ doc, entries, pointer, controller, storageServerUrl, zcapClient, recordSigner, managementZcapClient, recordEntry }) {
|
|
131
|
+
let reminted = 0;
|
|
132
|
+
let skipped = 0;
|
|
133
|
+
for (const entry of entries) {
|
|
134
|
+
// The current-key-set rule, decided once in `webvh`: an entry whose
|
|
135
|
+
// recorded signing key the document no longer publishes -- or that
|
|
136
|
+
// records no signing key at all -- is rotted.
|
|
137
|
+
const stands = delegationKeyInDocument({
|
|
138
|
+
doc,
|
|
139
|
+
...(entry.delegationKeyId
|
|
140
|
+
? { delegationKeyId: entry.delegationKeyId }
|
|
141
|
+
: {})
|
|
142
|
+
});
|
|
143
|
+
if (stands) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (!entry.recoveryClientDid ||
|
|
147
|
+
!entry.unlockKeyAgreementKeyId ||
|
|
148
|
+
!entry.unlockKeyAgreementKeyMultibase ||
|
|
149
|
+
!entry.manageCapability) {
|
|
150
|
+
// An entry issued before the re-mint fields existed: the health check
|
|
151
|
+
// keeps flagging it until the code is regenerated.
|
|
152
|
+
skipped += 1;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
// The standing record's code-authenticated binding, carried forward
|
|
157
|
+
// verbatim (a record with none predates the binding and cannot be
|
|
158
|
+
// re-minted -- `recoveryRecordBinding` refuses, and the entry is
|
|
159
|
+
// skipped into the health check's regenerate nudge).
|
|
160
|
+
const standing = await getUnlockKeyringWithCapability({
|
|
161
|
+
storageServerUrl,
|
|
162
|
+
zcapClient: managementZcapClient({
|
|
163
|
+
capability: entry.manageCapability
|
|
164
|
+
}),
|
|
165
|
+
spaceId: entry.unlockSpaceId,
|
|
166
|
+
capability: entry.manageCapability
|
|
167
|
+
});
|
|
168
|
+
const binding = recoveryRecordBinding({ record: standing });
|
|
169
|
+
const delegation = await delegateLogWrite({
|
|
170
|
+
zcapClient,
|
|
171
|
+
pointer,
|
|
172
|
+
recoveryClientDid: entry.recoveryClientDid
|
|
173
|
+
});
|
|
174
|
+
// The code's unlock KAK, public half only -- exactly enough to
|
|
175
|
+
// re-encrypt the record to the same recipient the code derives (the
|
|
176
|
+
// wrap seals through the encrypt-only cipher, so no secret is needed).
|
|
177
|
+
const unlockKak = (await X25519KeyAgreementKey2020.from({
|
|
178
|
+
id: entry.unlockKeyAgreementKeyId,
|
|
179
|
+
controller: entry.unlockKeyAgreementKeyId.split('#')[0],
|
|
180
|
+
type: 'X25519KeyAgreementKey2020',
|
|
181
|
+
publicKeyMultibase: entry.unlockKeyAgreementKeyMultibase
|
|
182
|
+
}));
|
|
183
|
+
const wrapped = await wrapRecoveryRecord({
|
|
184
|
+
controller,
|
|
185
|
+
pointer,
|
|
186
|
+
delegation,
|
|
187
|
+
keyAgreementKey: unlockKak,
|
|
188
|
+
signer: recordSigner,
|
|
189
|
+
binding
|
|
190
|
+
});
|
|
191
|
+
await putUnlockKeyringWithCapability({
|
|
192
|
+
storageServerUrl,
|
|
193
|
+
zcapClient: managementZcapClient({
|
|
194
|
+
capability: entry.manageCapability
|
|
195
|
+
}),
|
|
196
|
+
spaceId: entry.unlockSpaceId,
|
|
197
|
+
record: wrapped,
|
|
198
|
+
capability: entry.manageCapability
|
|
199
|
+
});
|
|
200
|
+
const delegationKeyId = delegationProofKeyId(delegation);
|
|
201
|
+
await recordEntry({
|
|
202
|
+
entry: {
|
|
203
|
+
...entry,
|
|
204
|
+
...(delegationKeyId ? { delegationKeyId } : {})
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
reminted += 1;
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
console.warn(`Could not re-mint the recovery delegation for "${entry.label}":`, err);
|
|
211
|
+
skipped += 1;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return { reminted, skipped };
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=recoveryDelegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recoveryDelegation.js","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAG7E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yB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IAAI,CAAC,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;AAC9B,CAAC"}
|
|
@@ -97,8 +97,10 @@ export declare function recoveryRecordBinding({ record }: {
|
|
|
97
97
|
* @param options.pointer {AccountPointer} the account pointer
|
|
98
98
|
* @param options.delegation {IZcap} the PUT-on-`did.jsonl` delegation to the
|
|
99
99
|
* code-derived signing DID
|
|
100
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK
|
|
101
|
-
*
|
|
100
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK --
|
|
101
|
+
* its public half is all the wrap uses (sealing needs no key-agreement
|
|
102
|
+
* secret), which is exactly what lets the re-mint path re-seal a record it
|
|
103
|
+
* can never open
|
|
102
104
|
* @param options.signer {RecordSigner} the signing key: the code's unlock
|
|
103
105
|
* key at issuance, an enrolled client's account key on a re-mint
|
|
104
106
|
* @param [options.bindingMacKey] {Uint8Array} the code-derived binding MAC
|
|
@@ -109,12 +111,11 @@ export declare function recoveryRecordBinding({ record }: {
|
|
|
109
111
|
* string; defaults to now. Supplied by a caller that pins record freshness.
|
|
110
112
|
* @returns {Promise<SignedRecoveryRecord>}
|
|
111
113
|
*/
|
|
112
|
-
export declare function wrapRecoveryRecord({ controller, pointer, delegation, keyAgreementKey,
|
|
114
|
+
export declare function wrapRecoveryRecord({ controller, pointer, delegation, keyAgreementKey, signer, bindingMacKey, binding, createdAt }: {
|
|
113
115
|
controller: string;
|
|
114
116
|
pointer: AccountPointer;
|
|
115
117
|
delegation: IZcap;
|
|
116
118
|
keyAgreementKey: IKeyAgreementKey;
|
|
117
|
-
keyResolver: IKeyResolver;
|
|
118
119
|
signer: RecordSigner;
|
|
119
120
|
bindingMacKey?: Uint8Array;
|
|
120
121
|
binding?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryRecord.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryRecord.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACN,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryRecord.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryRecord.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACN,MAAM,8BAA8B,CAAA;AAcrC,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,sBAAsB,CAAA;AAQ7B;;;;;;;;GAQG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,EAAE,KAAK,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAClC,UAAU,GAAG;IAAE,OAAO,EAAE;QAAE,kBAAkB,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAA;AAyBhF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,UAAU,EACV,OAAO,EACR,EAAE;IACD,aAAa,EAAE,UAAU,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,cAAc,CAAA;CACxB,GAAG,MAAM,CAIT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAS7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,MAAM,EACN,aAAa,EACb,OAAO,EACP,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,EAAE,KAAK,CAAA;IACjB,eAAe,EAAE,gBAAgB,CAAA;IACjC,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,aAAa,EACd,EAAE;IACD,MAAM,EAAE,OAAO,CAAA;IACf,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;IACzB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,UAAU,CAAA;CAC1B,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,sBAAsB,CAAA;IAChC,UAAU,EAAE,wBAAwB,CAAA;CACrC,CAAC,CAqFD"}
|
|
@@ -45,7 +45,7 @@ import { base64urlnopad } from '@scure/base';
|
|
|
45
45
|
import { equalBytes } from '@noble/ciphers/utils.js';
|
|
46
46
|
import { hmac } from '@noble/hashes/hmac.js';
|
|
47
47
|
import { sha256 } from '@noble/hashes/sha2.js';
|
|
48
|
-
import { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, recordProofKeyMultibase, signRecordFrame, verifyRecordProof } from '../keyring/record.js';
|
|
48
|
+
import { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, recordProofKeyMultibase, recordSealCipher, signRecordFrame, verifyRecordProof } from '../keyring/record.js';
|
|
49
49
|
/**
|
|
50
50
|
* The context label mixed into the binding MAC input, versioning the tag
|
|
51
51
|
* construction. Permanent -- changing it orphans every issued code.
|
|
@@ -131,8 +131,10 @@ export function recoveryRecordBinding({ record }) {
|
|
|
131
131
|
* @param options.pointer {AccountPointer} the account pointer
|
|
132
132
|
* @param options.delegation {IZcap} the PUT-on-`did.jsonl` delegation to the
|
|
133
133
|
* code-derived signing DID
|
|
134
|
-
* @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK
|
|
135
|
-
*
|
|
134
|
+
* @param options.keyAgreementKey {IKeyAgreementKey} the code's unlock KAK --
|
|
135
|
+
* its public half is all the wrap uses (sealing needs no key-agreement
|
|
136
|
+
* secret), which is exactly what lets the re-mint path re-seal a record it
|
|
137
|
+
* can never open
|
|
136
138
|
* @param options.signer {RecordSigner} the signing key: the code's unlock
|
|
137
139
|
* key at issuance, an enrolled client's account key on a re-mint
|
|
138
140
|
* @param [options.bindingMacKey] {Uint8Array} the code-derived binding MAC
|
|
@@ -143,7 +145,7 @@ export function recoveryRecordBinding({ record }) {
|
|
|
143
145
|
* string; defaults to now. Supplied by a caller that pins record freshness.
|
|
144
146
|
* @returns {Promise<SignedRecoveryRecord>}
|
|
145
147
|
*/
|
|
146
|
-
export async function wrapRecoveryRecord({ controller, pointer, delegation, keyAgreementKey,
|
|
148
|
+
export async function wrapRecoveryRecord({ controller, pointer, delegation, keyAgreementKey, signer, bindingMacKey, binding, createdAt }) {
|
|
147
149
|
if ((bindingMacKey === undefined) === (binding === undefined)) {
|
|
148
150
|
throw new Error('Exactly one of bindingMacKey (issuance) or binding (re-mint) is ' +
|
|
149
151
|
'required.');
|
|
@@ -152,11 +154,7 @@ export async function wrapRecoveryRecord({ controller, pointer, delegation, keyA
|
|
|
152
154
|
? computeRecoveryBinding({ bindingMacKey, controller, pointer })
|
|
153
155
|
: binding;
|
|
154
156
|
const encryption = await mintRecordEncryption({ keyAgreementKey });
|
|
155
|
-
const cipher = await
|
|
156
|
-
keyAgreementKey,
|
|
157
|
-
keyResolver,
|
|
158
|
-
encryption
|
|
159
|
-
});
|
|
157
|
+
const cipher = await recordSealCipher({ encryption });
|
|
160
158
|
const data = {
|
|
161
159
|
controller,
|
|
162
160
|
pointer: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryRecord.js","sourceRoot":"","sources":["../../src/recovery/recoveryRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAM9C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAO7B;;;GAGG;AACH,MAAM,wBAAwB,GAAG,gCAAgC,CAAA;AAEjE;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AAsCD;;;;GAIG;AACH,SAAS,eAAe,CAAC,EACvB,UAAU,EACV,OAAO,EAIR;IACC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAC7B,IAAI,CAAC,SAAS,CAAC;QACb,w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