@interop/wallet-core 0.39.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 +5 -3
- 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 +32 -22
- 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/fetch.d.ts +2 -1
- package/dist/keyring/fetch.d.ts.map +1 -1
- package/dist/keyring/fetch.js +7 -2
- package/dist/keyring/fetch.js.map +1 -1
- package/dist/keyring/index.d.ts +16 -9
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +15 -8
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +3 -1
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +16 -2
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/record.d.ts +236 -50
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +348 -46
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +25 -0
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -2
- package/dist/keyring/unlockSpace.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 +34 -6
- 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 +39 -24
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +28 -77
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +16 -3
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +14 -2
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +7 -0
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +10 -0
- package/dist/recovery/recoveryCode.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 +138 -46
- package/dist/recovery/recoveryRecord.d.ts.map +1 -1
- package/dist/recovery/recoveryRecord.js +231 -30
- 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/request/index.d.ts +1 -1
- package/dist/request/index.js +1 -1
- package/dist/request/matching.d.ts +24 -5
- package/dist/request/matching.d.ts.map +1 -1
- package/dist/request/matching.js +36 -39
- package/dist/request/matching.js.map +1 -1
- package/dist/request/walletInput.d.ts.map +1 -1
- package/dist/request/walletInput.js +3 -6
- package/dist/request/walletInput.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +7 -4
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +17 -35
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/index.d.ts +1 -0
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +1 -0
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/seal.d.ts +9 -1
- package/dist/resourceLog/seal.d.ts.map +1 -1
- package/dist/resourceLog/seal.js +21 -11
- package/dist/resourceLog/seal.js.map +1 -1
- package/dist/resourceLog/verify.d.ts.map +1 -1
- package/dist/resourceLog/verify.js +26 -9
- package/dist/resourceLog/verify.js.map +1 -1
- package/dist/resourceLog/vmFragment.d.ts +33 -0
- package/dist/resourceLog/vmFragment.d.ts.map +1 -0
- package/dist/resourceLog/vmFragment.js +39 -0
- package/dist/resourceLog/vmFragment.js.map +1 -0
- package/dist/space/publicLink.d.ts +2 -0
- package/dist/space/publicLink.d.ts.map +1 -1
- package/dist/space/publicLink.js +13 -1
- package/dist/space/publicLink.js.map +1 -1
- package/dist/space/wasLink.d.ts +5 -0
- package/dist/space/wasLink.d.ts.map +1 -1
- package/dist/space/wasLink.js +7 -2
- package/dist/space/wasLink.js.map +1 -1
- package/dist/webvh/didWeb.d.ts +3 -11
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +5 -1
- package/dist/webvh/didWeb.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 -18
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +141 -36
- 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/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +5 -1
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +4 -4
|
@@ -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;
|
|
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,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,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ACP,aAAa,EAAE,UAAU,CAAC,YAAa;KACxC,CAAA;AACH,CAAC"}
|
package/dist/recovery/index.d.ts
CHANGED
|
@@ -14,18 +14,31 @@
|
|
|
14
14
|
* single did:webvh update key whose hash stands pre-committed.
|
|
15
15
|
* - `wrapRecoveryRecord` / `unwrapRecoveryRecord` -- the keyring-record
|
|
16
16
|
* sibling carrying the account pointer plus the pre-minted
|
|
17
|
-
* PUT-on-`did.jsonl` delegation (never a seed, never a user key wrap)
|
|
17
|
+
* PUT-on-`did.jsonl` delegation (never a seed, never a user key wrap),
|
|
18
|
+
* signed into the same frame under the mixed-signer policy (the code's
|
|
19
|
+
* unlock key at issuance, an enrolled client's account key on a re-mint),
|
|
20
|
+
* with the `{ controller, pointer }` core authenticated by a MAC under a
|
|
21
|
+
* code-derived key (`computeRecoveryBinding` / `recoveryRecordBinding`),
|
|
22
|
+
* so a storage host can never redirect recovery at another account.
|
|
18
23
|
* - `publishRecoveryKey` / `removeRecoveryKey` / `recoverWebvhClient` -- the
|
|
19
24
|
* document half: issuance's split posture, revocation's removal, and the
|
|
20
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).
|
|
21
32
|
*
|
|
22
33
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
23
34
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
|
24
35
|
*/
|
|
25
36
|
export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalizeRecoveryCode, RECOVERY_CODE_BYTES, RECOVERY_KDF, RecoveryCodeInvalidError, recoveryClientFromCode } from './recoveryCode.js';
|
|
26
37
|
export type { RecoveryClient } from './recoveryCode.js';
|
|
27
|
-
export { unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
28
|
-
export type { RecoveryRecordContents } from './recoveryRecord.js';
|
|
38
|
+
export { computeRecoveryBinding, RecoveryBindingError, recoveryRecordBinding, unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
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';
|
|
29
42
|
export { publishRecoveryKey, recoverWebvhClient, RecoveryKeyNotCommittedError, recoveryVmId, removeRecoveryKey } from './recoveryWebvh.js';
|
|
30
43
|
export type { RecoveryLogStore, RecoveryPublicKeys } from './recoveryWebvh.js';
|
|
31
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
|
@@ -14,15 +14,27 @@
|
|
|
14
14
|
* single did:webvh update key whose hash stands pre-committed.
|
|
15
15
|
* - `wrapRecoveryRecord` / `unwrapRecoveryRecord` -- the keyring-record
|
|
16
16
|
* sibling carrying the account pointer plus the pre-minted
|
|
17
|
-
* PUT-on-`did.jsonl` delegation (never a seed, never a user key wrap)
|
|
17
|
+
* PUT-on-`did.jsonl` delegation (never a seed, never a user key wrap),
|
|
18
|
+
* signed into the same frame under the mixed-signer policy (the code's
|
|
19
|
+
* unlock key at issuance, an enrolled client's account key on a re-mint),
|
|
20
|
+
* with the `{ controller, pointer }` core authenticated by a MAC under a
|
|
21
|
+
* code-derived key (`computeRecoveryBinding` / `recoveryRecordBinding`),
|
|
22
|
+
* so a storage host can never redirect recovery at another account.
|
|
18
23
|
* - `publishRecoveryKey` / `removeRecoveryKey` / `recoverWebvhClient` -- the
|
|
19
24
|
* document half: issuance's split posture, revocation's removal, and the
|
|
20
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).
|
|
21
32
|
*
|
|
22
33
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
23
34
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
|
24
35
|
*/
|
|
25
36
|
export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalizeRecoveryCode, RECOVERY_CODE_BYTES, RECOVERY_KDF, RecoveryCodeInvalidError, recoveryClientFromCode } from './recoveryCode.js';
|
|
26
|
-
export { unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
37
|
+
export { computeRecoveryBinding, RecoveryBindingError, recoveryRecordBinding, unwrapRecoveryRecord, wrapRecoveryRecord } from './recoveryRecord.js';
|
|
38
|
+
export { delegateLogWrite, delegationProofKeyId, RECOVERY_DELEGATION_TTL_MS, remintRecoveryDelegations } from './recoveryDelegation.js';
|
|
27
39
|
export { publishRecoveryKey, recoverWebvhClient, RecoveryKeyNotCommittedError, recoveryVmId, removeRecoveryKey } from './recoveryWebvh.js';
|
|
28
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"}
|
|
@@ -77,6 +77,13 @@ export interface RecoveryClient {
|
|
|
77
77
|
codeBytes: Uint8Array;
|
|
78
78
|
clientSeed: Uint8Array;
|
|
79
79
|
updateSeed: Uint8Array;
|
|
80
|
+
/**
|
|
81
|
+
* The symmetric key that MACs the recovery record's account binding
|
|
82
|
+
* (`{ controller, pointer }`): computed at issuance, verified at recovery
|
|
83
|
+
* before the pointer is trusted. Derived from the code bytes, so the
|
|
84
|
+
* storage host never holds it.
|
|
85
|
+
*/
|
|
86
|
+
bindingMacKey: Uint8Array;
|
|
80
87
|
agents: ProfileAgents;
|
|
81
88
|
clientDid: string;
|
|
82
89
|
signingKeyMultibase: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryCode.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryCode.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,SAM1B,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryCode.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryCode.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,SAM1B,CAAA;AAoBD;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,SAAuC;CAI3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAErE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE1E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAazE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,UAAU,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB;;;;;OAKG;IACH,aAAa,EAAE,UAAU,CAAA;IACzB,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC,kBAAkB,EAAE,MAAM,CAAA;IAC1B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,cAAc,CAAC,CA2C1B"}
|
|
@@ -50,6 +50,14 @@ export const RECOVERY_KDF = {
|
|
|
50
50
|
const RECOVERY_CLIENT_SALT = 'freewallet/recovery/client-keys/v1';
|
|
51
51
|
const RECOVERY_CLIENT_SEED_INFO = 'client-seed';
|
|
52
52
|
const RECOVERY_UPDATE_SEED_INFO = 'update-key';
|
|
53
|
+
/**
|
|
54
|
+
* The HKDF info string for the code's account-binding MAC key, expanded
|
|
55
|
+
* under the unlock salt beside the unlock-seed expansion above. The key MACs
|
|
56
|
+
* the recovery record's `{ controller, pointer }` core at issuance, so only
|
|
57
|
+
* a holder of the code bytes -- never the storage host -- can bind a record
|
|
58
|
+
* to an account. Permanent, like every other expansion here.
|
|
59
|
+
*/
|
|
60
|
+
const RECOVERY_BINDING_MAC_INFO = 'freewallet/binding-mac';
|
|
53
61
|
/**
|
|
54
62
|
* Thrown for text that is not a well-formed recovery code (characters outside
|
|
55
63
|
* the base58 alphabet, or the wrong decoded length). Deliberately distinct
|
|
@@ -134,6 +142,7 @@ export async function recoveryClientFromCode({ code }) {
|
|
|
134
142
|
const salt = new TextEncoder().encode(RECOVERY_CLIENT_SALT);
|
|
135
143
|
const clientSeed = hkdf(sha256, codeBytes, salt, new TextEncoder().encode(RECOVERY_CLIENT_SEED_INFO), 32);
|
|
136
144
|
const updateSeed = hkdf(sha256, codeBytes, salt, new TextEncoder().encode(RECOVERY_UPDATE_SEED_INFO), 32);
|
|
145
|
+
const bindingMacKey = hkdf(sha256, codeBytes, new TextEncoder().encode(RECOVERY_KDF.salt), new TextEncoder().encode(RECOVERY_BINDING_MAC_INFO), 32);
|
|
137
146
|
const agents = await agentsFromSeed({ seed: clientSeed });
|
|
138
147
|
const { publicKeyMultibase: keyAgreementKeyMultibase } = agents.keyAgreementKey;
|
|
139
148
|
if (!keyAgreementKeyMultibase) {
|
|
@@ -144,6 +153,7 @@ export async function recoveryClientFromCode({ code }) {
|
|
|
144
153
|
codeBytes,
|
|
145
154
|
clientSeed,
|
|
146
155
|
updateSeed,
|
|
156
|
+
bindingMacKey,
|
|
147
157
|
agents,
|
|
148
158
|
clientDid: agents.keyAgent.id,
|
|
149
159
|
signingKeyMultibase: signingKeyMultibase,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryCode.js","sourceRoot":"","sources":["../../src/recovery/recovery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AG,mBAAmB,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/D,OAAO;QACL,SAAS;QACT,UAAU;QACV,UAAU;QACV,aAAa;QACb,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC7B,mBAAmB,EAAE,mBAAoB;QACzC,wBAAwB;QACxB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAClE,YAAY,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,wBAAwB,EAAE;KAClE,CAAA;AACH,CAAC"}
|
|
@@ -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,gB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AI,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,y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