@interop/wallet-core 0.65.0 → 0.67.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.
Files changed (256) hide show
  1. package/README.md +12 -8
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +5 -4
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +32 -50
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +112 -21
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +248 -180
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +2 -6
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +31 -61
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +48 -132
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +88 -221
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts.map +1 -1
  19. package/dist/clientAnnex/gc.js +9 -0
  20. package/dist/clientAnnex/gc.js.map +1 -1
  21. package/dist/clientAnnex/heal.d.ts +97 -13
  22. package/dist/clientAnnex/heal.d.ts.map +1 -1
  23. package/dist/clientAnnex/heal.js +108 -174
  24. package/dist/clientAnnex/heal.js.map +1 -1
  25. package/dist/clientAnnex/index.d.ts +8 -8
  26. package/dist/clientAnnex/index.d.ts.map +1 -1
  27. package/dist/clientAnnex/index.js +6 -6
  28. package/dist/clientAnnex/index.js.map +1 -1
  29. package/dist/clientAnnex/ladder.d.ts +51 -4
  30. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  31. package/dist/clientAnnex/ladder.js +310 -55
  32. package/dist/clientAnnex/ladder.js.map +1 -1
  33. package/dist/clientAnnex/ladderAnchored.d.ts +37 -3
  34. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  35. package/dist/clientAnnex/ladderAnchored.js +69 -34
  36. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  37. package/dist/clientAnnex/log.d.ts +148 -72
  38. package/dist/clientAnnex/log.d.ts.map +1 -1
  39. package/dist/clientAnnex/log.js +211 -137
  40. package/dist/clientAnnex/log.js.map +1 -1
  41. package/dist/clientAnnex/mend.d.ts.map +1 -1
  42. package/dist/clientAnnex/mend.js +63 -81
  43. package/dist/clientAnnex/mend.js.map +1 -1
  44. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +20 -1
  45. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.js +77 -294
  47. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  48. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -5
  49. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
  50. package/dist/clientAnnex/rosterDeliveredEpochs.js +18 -9
  51. package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
  52. package/dist/clientAnnex/selfEnroll.js +1 -1
  53. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  54. package/dist/clientAnnex/zcap.d.ts +19 -0
  55. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  56. package/dist/clientAnnex/zcap.js +80 -12
  57. package/dist/clientAnnex/zcap.js.map +1 -1
  58. package/dist/clients/index.d.ts +3 -2
  59. package/dist/clients/index.d.ts.map +1 -1
  60. package/dist/clients/index.js +3 -2
  61. package/dist/clients/index.js.map +1 -1
  62. package/dist/clients/listing.d.ts.map +1 -1
  63. package/dist/clients/listing.js +33 -15
  64. package/dist/clients/listing.js.map +1 -1
  65. package/dist/clients/policy.d.ts +18 -0
  66. package/dist/clients/policy.d.ts.map +1 -1
  67. package/dist/clients/policy.js +22 -8
  68. package/dist/clients/policy.js.map +1 -1
  69. package/dist/clients/revocation.d.ts +18 -30
  70. package/dist/clients/revocation.d.ts.map +1 -1
  71. package/dist/clients/revocation.js +12 -27
  72. package/dist/clients/revocation.js.map +1 -1
  73. package/dist/clients/rosterPolicy.d.ts +6 -1
  74. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  75. package/dist/clients/rosterPolicy.js +27 -30
  76. package/dist/clients/rosterPolicy.js.map +1 -1
  77. package/dist/descriptors/errors.d.ts +6 -5
  78. package/dist/descriptors/errors.d.ts.map +1 -1
  79. package/dist/descriptors/errors.js +6 -5
  80. package/dist/descriptors/errors.js.map +1 -1
  81. package/dist/descriptors/index.d.ts +7 -3
  82. package/dist/descriptors/index.d.ts.map +1 -1
  83. package/dist/descriptors/index.js +7 -3
  84. package/dist/descriptors/index.js.map +1 -1
  85. package/dist/descriptors/logSource.d.ts +28 -6
  86. package/dist/descriptors/logSource.d.ts.map +1 -1
  87. package/dist/descriptors/logSource.js +33 -7
  88. package/dist/descriptors/logSource.js.map +1 -1
  89. package/dist/enrollment/enrollment.d.ts.map +1 -1
  90. package/dist/enrollment/enrollment.js +3 -7
  91. package/dist/enrollment/enrollment.js.map +1 -1
  92. package/dist/genesis/accountGenesis.d.ts +8 -10
  93. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  94. package/dist/genesis/accountGenesis.js +39 -41
  95. package/dist/genesis/accountGenesis.js.map +1 -1
  96. package/dist/genesis/kmsAuthentication.d.ts +50 -0
  97. package/dist/genesis/kmsAuthentication.d.ts.map +1 -0
  98. package/dist/genesis/kmsAuthentication.js +49 -0
  99. package/dist/genesis/kmsAuthentication.js.map +1 -0
  100. package/dist/keyring/kdf.d.ts +16 -20
  101. package/dist/keyring/kdf.d.ts.map +1 -1
  102. package/dist/keyring/kdf.js +2 -2
  103. package/dist/keyring/kdf.js.map +1 -1
  104. package/dist/keyring/unlockSpace.d.ts +8 -30
  105. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  106. package/dist/keyring/unlockSpace.js +8 -31
  107. package/dist/keyring/unlockSpace.js.map +1 -1
  108. package/dist/keys/clientKeyRecord.d.ts +2 -1
  109. package/dist/keys/clientKeyRecord.d.ts.map +1 -1
  110. package/dist/keys/clientKeyRecord.js +28 -11
  111. package/dist/keys/clientKeyRecord.js.map +1 -1
  112. package/dist/keys/index.d.ts +19 -5
  113. package/dist/keys/index.d.ts.map +1 -1
  114. package/dist/keys/index.js +17 -3
  115. package/dist/keys/index.js.map +1 -1
  116. package/dist/keys/rosterLogStore.d.ts +3 -1
  117. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  118. package/dist/keys/rosterLogStore.js +20 -8
  119. package/dist/keys/rosterLogStore.js.map +1 -1
  120. package/dist/keys/spaceEpochs.d.ts +92 -3
  121. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  122. package/dist/keys/spaceEpochs.js +110 -4
  123. package/dist/keys/spaceEpochs.js.map +1 -1
  124. package/dist/keys/userKeyCascade.d.ts +8 -5
  125. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  126. package/dist/keys/userKeyCascade.js +7 -6
  127. package/dist/keys/userKeyCascade.js.map +1 -1
  128. package/dist/keys/userKeyRoster.d.ts +68 -4
  129. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  130. package/dist/keys/userKeyRoster.js +146 -33
  131. package/dist/keys/userKeyRoster.js.map +1 -1
  132. package/dist/keys/userKeyRosterCascade.d.ts +110 -10
  133. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  134. package/dist/keys/userKeyRosterCascade.js +184 -40
  135. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  136. package/dist/recovery/continuation.d.ts +255 -0
  137. package/dist/recovery/continuation.d.ts.map +1 -0
  138. package/dist/recovery/continuation.js +471 -0
  139. package/dist/recovery/continuation.js.map +1 -0
  140. package/dist/recovery/index.d.ts +12 -8
  141. package/dist/recovery/index.d.ts.map +1 -1
  142. package/dist/recovery/index.js +11 -7
  143. package/dist/recovery/index.js.map +1 -1
  144. package/dist/recovery/recoveryDelegation.d.ts +40 -120
  145. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  146. package/dist/recovery/recoveryDelegation.js +36 -268
  147. package/dist/recovery/recoveryDelegation.js.map +1 -1
  148. package/dist/recovery/recoveryWebvh.d.ts +42 -83
  149. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  150. package/dist/recovery/recoveryWebvh.js +44 -380
  151. package/dist/recovery/recoveryWebvh.js.map +1 -1
  152. package/dist/request/appKey.d.ts +35 -1
  153. package/dist/request/appKey.d.ts.map +1 -1
  154. package/dist/request/appKey.js +29 -10
  155. package/dist/request/appKey.js.map +1 -1
  156. package/dist/request/classify.d.ts +3 -14
  157. package/dist/request/classify.d.ts.map +1 -1
  158. package/dist/request/classify.js +19 -40
  159. package/dist/request/classify.js.map +1 -1
  160. package/dist/request/index.d.ts +1 -0
  161. package/dist/request/index.d.ts.map +1 -1
  162. package/dist/request/index.js +1 -0
  163. package/dist/request/index.js.map +1 -1
  164. package/dist/request/onboarding.d.ts.map +1 -1
  165. package/dist/request/onboarding.js +19 -27
  166. package/dist/request/onboarding.js.map +1 -1
  167. package/dist/request/parse.d.ts +5 -3
  168. package/dist/request/parse.d.ts.map +1 -1
  169. package/dist/request/parse.js +7 -6
  170. package/dist/request/parse.js.map +1 -1
  171. package/dist/request/processRequest.d.ts.map +1 -1
  172. package/dist/request/processRequest.js +2 -1
  173. package/dist/request/processRequest.js.map +1 -1
  174. package/dist/request/queryPredicates.d.ts +98 -0
  175. package/dist/request/queryPredicates.d.ts.map +1 -0
  176. package/dist/request/queryPredicates.js +107 -0
  177. package/dist/request/queryPredicates.js.map +1 -0
  178. package/dist/resourceLog/document.d.ts +39 -0
  179. package/dist/resourceLog/document.d.ts.map +1 -1
  180. package/dist/resourceLog/document.js +41 -0
  181. package/dist/resourceLog/document.js.map +1 -1
  182. package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
  183. package/dist/resourceLog/ladderRungs.js +3 -2
  184. package/dist/resourceLog/ladderRungs.js.map +1 -1
  185. package/dist/sync/contactsConflict.d.ts.map +1 -1
  186. package/dist/sync/contactsConflict.js +8 -2
  187. package/dist/sync/contactsConflict.js.map +1 -1
  188. package/dist/sync/engine.d.ts +38 -23
  189. package/dist/sync/engine.d.ts.map +1 -1
  190. package/dist/sync/engine.js +36 -5
  191. package/dist/sync/engine.js.map +1 -1
  192. package/dist/sync/index.d.ts +9 -12
  193. package/dist/sync/index.d.ts.map +1 -1
  194. package/dist/sync/index.js +8 -11
  195. package/dist/sync/index.js.map +1 -1
  196. package/dist/sync/push.d.ts.map +1 -1
  197. package/dist/sync/push.js +1 -2
  198. package/dist/sync/push.js.map +1 -1
  199. package/dist/sync/remint.d.ts +0 -31
  200. package/dist/sync/remint.d.ts.map +1 -1
  201. package/dist/sync/remint.js +32 -1
  202. package/dist/sync/remint.js.map +1 -1
  203. package/dist/sync/types.d.ts +4 -41
  204. package/dist/sync/types.d.ts.map +1 -1
  205. package/dist/sync/types.js +4 -47
  206. package/dist/sync/types.js.map +1 -1
  207. package/dist/unlock/index.d.ts +1 -1
  208. package/dist/unlock/index.d.ts.map +1 -1
  209. package/dist/unlock/index.js +1 -1
  210. package/dist/unlock/index.js.map +1 -1
  211. package/dist/unlock/retire.d.ts +16 -56
  212. package/dist/unlock/retire.d.ts.map +1 -1
  213. package/dist/unlock/retire.js +7 -76
  214. package/dist/unlock/retire.js.map +1 -1
  215. package/dist/unlock/standingWebvh.d.ts +20 -40
  216. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  217. package/dist/unlock/standingWebvh.js +35 -76
  218. package/dist/unlock/standingWebvh.js.map +1 -1
  219. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  220. package/dist/unlock/unlockRecord.js +69 -44
  221. package/dist/unlock/unlockRecord.js.map +1 -1
  222. package/dist/webvh/accountEntry.d.ts +63 -7
  223. package/dist/webvh/accountEntry.d.ts.map +1 -1
  224. package/dist/webvh/accountEntry.js +110 -19
  225. package/dist/webvh/accountEntry.js.map +1 -1
  226. package/dist/webvh/delegatedLogStore.d.ts +18 -12
  227. package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
  228. package/dist/webvh/delegatedLogStore.js +32 -11
  229. package/dist/webvh/delegatedLogStore.js.map +1 -1
  230. package/dist/webvh/didWebvh.d.ts +39 -23
  231. package/dist/webvh/didWebvh.d.ts.map +1 -1
  232. package/dist/webvh/didWebvh.js +63 -45
  233. package/dist/webvh/didWebvh.js.map +1 -1
  234. package/dist/webvh/enrollClient.d.ts.map +1 -1
  235. package/dist/webvh/enrollClient.js +19 -23
  236. package/dist/webvh/enrollClient.js.map +1 -1
  237. package/dist/webvh/index.d.ts +11 -7
  238. package/dist/webvh/index.d.ts.map +1 -1
  239. package/dist/webvh/index.js +9 -6
  240. package/dist/webvh/index.js.map +1 -1
  241. package/dist/webvh/listClients.d.ts.map +1 -1
  242. package/dist/webvh/listClients.js +102 -65
  243. package/dist/webvh/listClients.js.map +1 -1
  244. package/dist/webvh/mergeMethods.d.ts +84 -0
  245. package/dist/webvh/mergeMethods.d.ts.map +1 -0
  246. package/dist/webvh/mergeMethods.js +46 -0
  247. package/dist/webvh/mergeMethods.js.map +1 -0
  248. package/dist/webvh/revokeClient.d.ts +12 -2
  249. package/dist/webvh/revokeClient.d.ts.map +1 -1
  250. package/dist/webvh/revokeClient.js +126 -48
  251. package/dist/webvh/revokeClient.js.map +1 -1
  252. package/dist/webvh/verifyLog.d.ts +21 -0
  253. package/dist/webvh/verifyLog.d.ts.map +1 -1
  254. package/dist/webvh/verifyLog.js +36 -14
  255. package/dist/webvh/verifyLog.js.map +1 -1
  256. package/package.json +11 -11
@@ -1,7 +1,28 @@
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. The delegation is a wire artifact both apps must mint
7
+ * byte-identically (issuance and every re-bind produce the record another
8
+ * replica later recovers with), so its builder lives here: PUT on the one
9
+ * `did.jsonl` resource, one-year TTL, delegated to the code-derived signing
10
+ * DID. Its narrow scope is what keeps recovery loud -- a stolen code must
11
+ * extend the world-readable log before it can read anything.
12
+ *
13
+ * No ceremony re-mints another credential's bridge. A record's bridge and
14
+ * `delegatedClients` sibling are signed by that record's own credential's
15
+ * ladder VM, and its frame proof by that credential's own unlock identity
16
+ * key (`decisions/0019`), so the only thing that can rot a bridge is
17
+ * retiring the credential it belongs to -- which deletes the record with it.
18
+ * A bridge that ages out, or one a pre-rule bind left signed by a foreign
19
+ * key, is refreshed by that credential's own login on the house staleness
20
+ * axes ({@link zcapExpiring}, `recordedZcapStale`), and the registry fields
21
+ * a refresh records are built here ({@link recordedDelegationFields}).
22
+ */
1
23
  import type { IZcap } from '@interop/data-integrity-core';
2
24
  import type { ZcapClient } from '@interop/ezcap';
3
- import type { PublishedKeyDocument } from '../webvh/listClients.js';
4
- import type { AccountPointer, RecordSigner } from '../keyring/record.js';
25
+ import type { AccountPointer } from '../keyring/record.js';
5
26
  import { delegationProofKeyId } from '../webvh/standingZcap.js';
6
27
  /**
7
28
  * The recovery delegation's lifetime: the house standing-zcap value
@@ -42,127 +63,26 @@ export declare function delegateLogWrite({ zcapClient, pointer, recoveryClientDi
42
63
  }): Promise<IZcap>;
43
64
  export { delegationProofKeyId };
44
65
  /**
45
- * The members of a recovery-code registry entry the re-mint reads: where the
46
- * code's unlock Space and record are (`unlockSpaceId`, `manageCapability`),
47
- * which key signed the recorded delegation and when it expires
48
- * (`delegationKeyId` / `delegationExpires` -- either absent on an entry
49
- * predating its field, which the staleness checks conservatively flag), and
50
- * the re-mint fields: the code-derived signing DID the fresh delegation names
51
- * and the unlock KAK public half the record is re-wrapped to. A standing
52
- * credential's entry additionally tracks its annex Space sibling
53
- * delegation as a second scalar pair (`delegatedClientsKeyId` /
54
- * `delegatedClientsExpires` -- absent for recovery codes, mirroring the
55
- * record member's optionality); the sibling rots on exactly the bridge's
56
- * axis, so one pass reseals both. Structural on
57
- * purpose -- an app's richer registry entry satisfies it, and the re-mint
58
- * hands the SAME entry back (with the fresh key ids and expiries) through the
59
- * record seam, extra members untouched.
66
+ * The registry fields a record's delegations stand for -- which key signed
67
+ * the bridge and the `delegatedClients` sibling, and when each expires --
68
+ * built once here for the re-mint and for the credential-anchored
69
+ * establishment's standing fields. A member is present iff its source is:
70
+ * an absent delegation, a proof with no key id, or a caveat-less zcap
71
+ * contributes nothing.
72
+ *
73
+ * @param options {object}
74
+ * @param [options.delegation] {IZcap} the record's bridge delegation
75
+ * @param [options.delegatedClients] {IZcap} the record's sibling
76
+ * @returns {{ delegationKeyId?: string, delegationExpires?: string,
77
+ * delegatedClientsKeyId?: string, delegatedClientsExpires?: string }}
60
78
  */
61
- export interface RecoveryDelegationEntry {
62
- label: string;
63
- unlockSpaceId: string;
64
- manageCapability?: IZcap;
79
+ export declare function recordedDelegationFields({ delegation, delegatedClients }: {
80
+ delegation?: IZcap;
81
+ delegatedClients?: IZcap;
82
+ }): {
65
83
  delegationKeyId?: string;
66
84
  delegationExpires?: string;
67
85
  delegatedClientsKeyId?: string;
68
86
  delegatedClientsExpires?: string;
69
- recoveryClientDid?: string;
70
- unlockKeyAgreementKeyId?: string;
71
- unlockKeyAgreementKeyMultibase?: string;
72
- }
73
- /**
74
- * One registry entry's fate in a re-mint pass: `current` (both members stand
75
- * and are outside the renewal window -- nothing written), `reminted` (the
76
- * record re-sealed and the entry handed back fresh; `siblingCarriedVerbatim`
77
- * flags a recorded sibling the pass could not rebuild because the document
78
- * points at no generation, which stays flagged for the health check),
79
- * `incomplete-entry` (an entry predating the re-mint fields, skipped until
80
- * the credential is re-bound), `pending-entry` (the entry's recorded
81
- * unlock-key members do not match the credential the record at its unlock
82
- * Space is sealed to -- a passphrase change torn before its retirement; the
83
- * next passphrase login's repair finishes it, and re-minting here would
84
- * re-arm the retired credential into the new one's record), or `failed` (the record could not be read,
85
- * re-sealed, or re-PUT -- `error` carries the cause). A skipped or failed
86
- * entry is named here so no caller can lose it silently.
87
- */
88
- export interface RecordRemintOutcome {
89
- label: string;
90
- unlockSpaceId: string;
91
- outcome: 'current' | 'reminted' | 'incomplete-entry' | 'pending-entry' | 'failed';
92
- siblingCarriedVerbatim?: boolean;
93
- error?: unknown;
94
- }
95
- /**
96
- * Re-mints the recovery delegations the current document no longer backs --
97
- * the recovery-code delta riding the revocation cascade (see the module doc
98
- * for the mechanism and the skip policy).
99
- *
100
- * The record's credential-authenticated core is preserved verbatim: the
101
- * re-mint reads the standing record through the entry's management zcap and
102
- * replaces only its delegation members
103
- * ({@link remintUnlockRecordDelegations}) -- the bridge always, and the
104
- * annex Space sibling where the entry records one (the two rot on one
105
- * axis, so both reseal in the same atomic pass and one registry-entry
106
- * rewrite records both fresh pairs). The
107
- * shell, the ladder member (where one rides), and the binding tag all travel
108
- * untouched, since the re-mint can decrypt none of them and does not need to.
109
- * A re-mint therefore can never change the pointer or controller the
110
- * credential was bound against -- and after a host migration the tag no
111
- * longer matches the moved pointer, so credentials must be rebound (codes
112
- * re-issued) when the account moves hosts.
113
- *
114
- * The re-mint holds the code's KAK public half but not its signing key, so
115
- * every record it re-PUTs is signed with the acting client's own account key
116
- * (`recordSigner`) -- the mixed-signer case a reader settles against the
117
- * verified did:webvh document.
118
- *
119
- * Best-effort per entry: a skipped entry stays flagged by the login-time
120
- * health check, whose regenerate nudge remains the backstop.
121
- *
122
- * @param options {object}
123
- * @param options.doc {PublishedKeyDocument} the locally verified did:webvh
124
- * document, AFTER the revocation edit
125
- * @param options.entries {RecoveryDelegationEntry[]} the registry's
126
- * recovery-code entries, as the app's registry read returned them
127
- * @param options.pointer {AccountPointer}
128
- * @param options.storageServerUrl {string} the unlock Spaces' storage server
129
- * @param options.zcapClient {ZcapClient} the acting client's promoted
130
- * signer, which mints the fresh delegations
131
- * @param options.recordSigner {RecordSigner} the acting client's account
132
- * key, which signs the re-wrapped records
133
- * @param options.managementZcapClient {Function} `({ capability }) =>
134
- * ZcapClient` -- the client an entry's management zcap is invoked with
135
- * @param options.recordEntry {Function} `({ entry }) => Promise<void>` --
136
- * persists one updated registry entry (matching on the app's entry key)
137
- * @param [options.mintDelegatedClientsDelegation] {Function} `({ controller })
138
- * => Promise<IZcap | undefined>` -- the annex-side mint of a fresh
139
- * `delegatedClients` sibling delegation, injected by the caller (the
140
- * annex subpath's `delegatedClientsDelegationMinter` builds one over the
141
- * verified document); `undefined` when the document points at no
142
- * generation, in which case the old sealed member travels verbatim
143
- * @returns {Promise<{ reminted: number; skipped: number }>}
144
- */
145
- export declare function remintRecoveryDelegations<Entry extends RecoveryDelegationEntry>({ doc, entries, pointer, storageServerUrl, zcapClient, recordSigner, managementZcapClient, recordEntry, mintDelegatedClientsDelegation, retiringKeyMultibases, now }: {
146
- doc: PublishedKeyDocument;
147
- entries: Entry[];
148
- pointer: AccountPointer;
149
- storageServerUrl: string;
150
- zcapClient: ZcapClient;
151
- recordSigner: RecordSigner;
152
- managementZcapClient: (options: {
153
- capability: IZcap;
154
- }) => ZcapClient;
155
- recordEntry: (options: {
156
- entry: Entry;
157
- }) => Promise<void>;
158
- mintDelegatedClientsDelegation?: (options: {
159
- controller: string;
160
- }) => Promise<IZcap | undefined>;
161
- retiringKeyMultibases?: string[];
162
- now?: number;
163
- }): Promise<{
164
- reminted: number;
165
- skipped: number;
166
- outcomes: RecordRemintOutcome[];
167
- }>;
87
+ };
168
88
  //# sourceMappingURL=recoveryDelegation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryDelegation.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE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K,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EACL,oBAAoB,EAErB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,QAAuB,CAAA;AAI9D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAqB/E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,GAAgB,EACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,KAAK,CAAC,CAOjB;AAID,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAE/B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,gBAAgB,EACjB,EAAE;IACD,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,gBAAgB,CAAC,EAAE,KAAK,CAAA;CACzB,GAAG;IACF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,uBAAuB,CAAC,EAAE,MAAM,CAAA;CACjC,CAiBA"}
@@ -1,55 +1,6 @@
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, one-year TTL,
10
- * delegated to the code-derived signing DID. Its narrow scope is what keeps
11
- * recovery loud -- a stolen code must extend the world-readable log before it
12
- * can read 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 -- and a delegation left standing eventually reaches its own
18
- * expiry. For each registry entry whose recorded delegation no longer
19
- * chains (its signing verification method left `capabilityDelegation` in the
20
- * document) or is expired or inside the renewal window, the acting client
21
- * signs a fresh delegation to the code's signing DID, re-wraps the
22
- * record to the code's unlock KAK (the public half the registry records --
23
- * the record carries no secrets, so re-encryption needs none), re-PUTs it
24
- * through the entry's management zcap, and updates the registry's
25
- * `delegationKeyId` and `delegationExpires`. A standing credential's
26
- * client-annex Space sibling delegation rides the same pass (its scalar pair is
27
- * `delegatedClientsKeyId` / `delegatedClientsExpires`): either member going
28
- * stale reseals both, and the one registry rewrite records both fresh pairs
29
- * -- a re-mint handling only the bridge is incomplete. The skip policy is
30
- * cross-replica correctness and is
31
- * decided here once: an entry that predates the re-mint fields, or whose
32
- * standing record cannot be read or carries no binding, is skipped and stays
33
- * flagged by the login-time health check. Every entry's fate is reported
34
- * (`RecordRemintOutcome`), so a record the pass could not reach is named
35
- * rather than silently left with a rotted bridge. What stays app-side is the
36
- * seams: the management-zcap client factory, the storage server URL, and the
37
- * registry read/record halves.
38
- *
39
- * The same pass serves the last-client forget ceremony, whose acting signer
40
- * is the ladder VM rather than an enrolled client: there the rot check runs
41
- * against the post-install document, in which the client about to be removed
42
- * still stands, so the ceremony names it as retiring
43
- * (`retiringKeyMultibases`) and every delegation it signed counts as rotted
44
- * ahead of the removal entry.
45
- */
46
- import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
47
1
  import { resourcePath, toUrl } from '@interop/was-client/paths';
48
- import { log } from '../log.js';
49
2
  import { DID_LOG_RESOURCE, ID_COLLECTION } from '../space/collections.js';
50
- import { getUnlockKeyringWithCapability, putUnlockKeyringWithCapability } from '../keyring/unlockSpace.js';
51
- import { remintUnlockRecordDelegations, unlockRecordSealedTo } from '../unlock/unlockRecord.js';
52
- import { delegationProofKeyId, recordedZcapStale, STANDING_ZCAP_TTL_MS } from '../webvh/standingZcap.js';
3
+ import { delegationProofKeyId, STANDING_ZCAP_TTL_MS } from '../webvh/standingZcap.js';
53
4
  /**
54
5
  * The recovery delegation's lifetime: the house standing-zcap value
55
6
  * ({@link STANDING_ZCAP_TTL_MS} -- one year, per NIST SP 800-57's
@@ -113,227 +64,44 @@ export async function delegateLogWrite({ zcapClient, pointer, recoveryClientDid,
113
64
  // module's public surface is unchanged.
114
65
  export { delegationProofKeyId };
115
66
  /**
116
- * Re-mints the recovery delegations the current document no longer backs --
117
- * the recovery-code delta riding the revocation cascade (see the module doc
118
- * for the mechanism and the skip policy).
119
- *
120
- * The record's credential-authenticated core is preserved verbatim: the
121
- * re-mint reads the standing record through the entry's management zcap and
122
- * replaces only its delegation members
123
- * ({@link remintUnlockRecordDelegations}) -- the bridge always, and the
124
- * annex Space sibling where the entry records one (the two rot on one
125
- * axis, so both reseal in the same atomic pass and one registry-entry
126
- * rewrite records both fresh pairs). The
127
- * shell, the ladder member (where one rides), and the binding tag all travel
128
- * untouched, since the re-mint can decrypt none of them and does not need to.
129
- * A re-mint therefore can never change the pointer or controller the
130
- * credential was bound against -- and after a host migration the tag no
131
- * longer matches the moved pointer, so credentials must be rebound (codes
132
- * re-issued) when the account moves hosts.
133
- *
134
- * The re-mint holds the code's KAK public half but not its signing key, so
135
- * every record it re-PUTs is signed with the acting client's own account key
136
- * (`recordSigner`) -- the mixed-signer case a reader settles against the
137
- * verified did:webvh document.
138
- *
139
- * Best-effort per entry: a skipped entry stays flagged by the login-time
140
- * health check, whose regenerate nudge remains the backstop.
67
+ * The registry fields a record's delegations stand for -- which key signed
68
+ * the bridge and the `delegatedClients` sibling, and when each expires --
69
+ * built once here for the re-mint and for the credential-anchored
70
+ * establishment's standing fields. A member is present iff its source is:
71
+ * an absent delegation, a proof with no key id, or a caveat-less zcap
72
+ * contributes nothing.
141
73
  *
142
74
  * @param options {object}
143
- * @param options.doc {PublishedKeyDocument} the locally verified did:webvh
144
- * document, AFTER the revocation edit
145
- * @param options.entries {RecoveryDelegationEntry[]} the registry's
146
- * recovery-code entries, as the app's registry read returned them
147
- * @param options.pointer {AccountPointer}
148
- * @param options.storageServerUrl {string} the unlock Spaces' storage server
149
- * @param options.zcapClient {ZcapClient} the acting client's promoted
150
- * signer, which mints the fresh delegations
151
- * @param options.recordSigner {RecordSigner} the acting client's account
152
- * key, which signs the re-wrapped records
153
- * @param options.managementZcapClient {Function} `({ capability }) =>
154
- * ZcapClient` -- the client an entry's management zcap is invoked with
155
- * @param options.recordEntry {Function} `({ entry }) => Promise<void>` --
156
- * persists one updated registry entry (matching on the app's entry key)
157
- * @param [options.mintDelegatedClientsDelegation] {Function} `({ controller })
158
- * => Promise<IZcap | undefined>` -- the annex-side mint of a fresh
159
- * `delegatedClients` sibling delegation, injected by the caller (the
160
- * annex subpath's `delegatedClientsDelegationMinter` builds one over the
161
- * verified document); `undefined` when the document points at no
162
- * generation, in which case the old sealed member travels verbatim
163
- * @returns {Promise<{ reminted: number; skipped: number }>}
75
+ * @param [options.delegation] {IZcap} the record's bridge delegation
76
+ * @param [options.delegatedClients] {IZcap} the record's sibling
77
+ * @returns {{ delegationKeyId?: string, delegationExpires?: string,
78
+ * delegatedClientsKeyId?: string, delegatedClientsExpires?: string }}
164
79
  */
165
- export async function remintRecoveryDelegations({ doc, entries, pointer, storageServerUrl, zcapClient, recordSigner, managementZcapClient, recordEntry, mintDelegatedClientsDelegation, retiringKeyMultibases = [], now = Date.now() }) {
166
- let reminted = 0;
167
- let skipped = 0;
168
- const outcomes = [];
169
- // The house staleness policy, decided once in `webvh` and asked here over
170
- // the scalars a registry entry records: expiry, the current-key-set rule
171
- // (a recorded signing key the document no longer lists under
172
- // `capabilityDelegation` -- or no recorded key at all -- has rotted), and
173
- // the caller's retiring set, which the document still lists only until the
174
- // entry that removes those keys lands.
175
- const recordedStale = (delegationKeyId, expires) => recordedZcapStale({
176
- doc,
80
+ export function recordedDelegationFields({ delegation, delegatedClients }) {
81
+ const delegationKeyId = delegation
82
+ ? delegationProofKeyId(delegation)
83
+ : undefined;
84
+ const delegationExpires = delegation ? zcapExpires(delegation) : undefined;
85
+ const delegatedClientsKeyId = delegatedClients
86
+ ? delegationProofKeyId(delegatedClients)
87
+ : undefined;
88
+ const delegatedClientsExpires = delegatedClients
89
+ ? zcapExpires(delegatedClients)
90
+ : undefined;
91
+ return {
177
92
  ...(delegationKeyId ? { delegationKeyId } : {}),
178
- ...(expires ? { expires } : {}),
179
- retiringKeyMultibases,
180
- now
181
- });
182
- for (const entry of entries) {
183
- const stale = recordedStale(entry.delegationKeyId, entry.delegationExpires);
184
- // The annex Space sibling, where the entry records one, is checked on the
185
- // same axes; either member going stale re-mints BOTH in one atomic pass
186
- // (both resealed, one registry-entry rewrite).
187
- const siblingRecorded = entry.delegatedClientsKeyId !== undefined ||
188
- entry.delegatedClientsExpires !== undefined;
189
- const siblingStale = siblingRecorded &&
190
- recordedStale(entry.delegatedClientsKeyId, entry.delegatedClientsExpires);
191
- if (!stale && !siblingStale) {
192
- outcomes.push({
193
- label: entry.label,
194
- unlockSpaceId: entry.unlockSpaceId,
195
- outcome: 'current'
196
- });
197
- continue;
198
- }
199
- if (!entry.recoveryClientDid ||
200
- !entry.unlockKeyAgreementKeyId ||
201
- !entry.unlockKeyAgreementKeyMultibase ||
202
- !entry.manageCapability) {
203
- // An entry issued before the re-mint fields existed: the health check
204
- // keeps flagging it until the code is regenerated.
205
- skipped += 1;
206
- outcomes.push({
207
- label: entry.label,
208
- unlockSpaceId: entry.unlockSpaceId,
209
- outcome: 'incomplete-entry'
210
- });
211
- continue;
212
- }
213
- try {
214
- // The standing record, whose credential-authenticated core travels
215
- // verbatim (a record with no binding predates the standing layout and
216
- // cannot be re-minted -- `remintUnlockRecordDelegations` refuses, and the
217
- // entry is skipped into the health check's regenerate nudge).
218
- const standing = await getUnlockKeyringWithCapability({
219
- storageServerUrl,
220
- zcapClient: managementZcapClient({
221
- capability: entry.manageCapability
222
- }),
223
- spaceId: entry.unlockSpaceId,
224
- capability: entry.manageCapability
225
- });
226
- // The pending-shaped guard: the entry's `unlockSpaceId` and
227
- // `manageCapability` name one credential while its identity members
228
- // name another -- the state a passphrase change torn before its
229
- // retirement leaves. Re-minting here would seal a fresh
230
- // current-client-signed bridge for the OLD credential into the NEW
231
- // credential's record, re-arming the half-retired credential and
232
- // bricking the new one's entry paths. Nothing is written; the next
233
- // passphrase login's repair is the mender.
234
- if (!unlockRecordSealedTo({
235
- record: standing,
236
- keyAgreementKeyMultibase: entry.unlockKeyAgreementKeyMultibase
237
- })) {
238
- log.warn('The unlock record at the Space recorded for this entry is ' +
239
- 'sealed to another credential (a passphrase change torn before ' +
240
- 'its retirement landed); its delegations are not re-minted', { label: entry.label });
241
- skipped += 1;
242
- outcomes.push({
243
- label: entry.label,
244
- unlockSpaceId: entry.unlockSpaceId,
245
- outcome: 'pending-entry'
246
- });
247
- continue;
248
- }
249
- const delegation = await delegateLogWrite({
250
- zcapClient,
251
- pointer,
252
- recoveryClientDid: entry.recoveryClientDid
253
- });
254
- // The fresh annex Space sibling, for an entry that records one --
255
- // minted through the injected annex-side closure, so this orchestrator
256
- // never imports the annex module. A document not (yet) pointing at a
257
- // generation (or a caller wiring no minter) leaves nothing to rebuild
258
- // the target from, so the old sealed member travels verbatim and the
259
- // pair stays stale-flagged for the login-time health check.
260
- let delegatedClients;
261
- let siblingCarriedVerbatim = false;
262
- if (siblingRecorded) {
263
- delegatedClients = await mintDelegatedClientsDelegation?.({
264
- controller: entry.recoveryClientDid
265
- });
266
- if (!delegatedClients) {
267
- siblingCarriedVerbatim = true;
268
- log.warn('The account document names no client-annex generation; the ' +
269
- 'delegatedClients delegation for this entry is carried verbatim', { label: entry.label });
270
- }
271
- }
272
- // The credential's unlock KAK, public half only -- exactly enough to
273
- // seal the fresh bridge to the same recipient the credential derives
274
- // (sealing goes through the encrypt-only cipher, so no secret is
275
- // needed).
276
- const unlockKak = (await X25519KeyAgreementKey2020.from({
277
- id: entry.unlockKeyAgreementKeyId,
278
- controller: entry.unlockKeyAgreementKeyId.split('#')[0],
279
- type: 'X25519KeyAgreementKey2020',
280
- publicKeyMultibase: entry.unlockKeyAgreementKeyMultibase
281
- }));
282
- const wrapped = await remintUnlockRecordDelegations({
283
- record: standing,
284
- delegation,
285
- ...(delegatedClients ? { delegatedClients } : {}),
286
- keyAgreementKey: unlockKak,
287
- signer: recordSigner
288
- });
289
- await putUnlockKeyringWithCapability({
290
- storageServerUrl,
291
- zcapClient: managementZcapClient({
292
- capability: entry.manageCapability
293
- }),
294
- spaceId: entry.unlockSpaceId,
295
- record: wrapped,
296
- capability: entry.manageCapability
297
- });
298
- const delegationKeyId = delegationProofKeyId(delegation);
299
- const delegationExpires = delegation.expires;
300
- const delegatedClientsKeyId = delegatedClients
301
- ? delegationProofKeyId(delegatedClients)
302
- : undefined;
303
- const delegatedClientsExpires = delegatedClients
304
- ? delegatedClients.expires
305
- : undefined;
306
- await recordEntry({
307
- entry: {
308
- ...entry,
309
- ...(delegationKeyId ? { delegationKeyId } : {}),
310
- ...(delegationExpires ? { delegationExpires } : {}),
311
- ...(delegatedClientsKeyId ? { delegatedClientsKeyId } : {}),
312
- ...(delegatedClientsExpires ? { delegatedClientsExpires } : {})
313
- }
314
- });
315
- reminted += 1;
316
- outcomes.push({
317
- label: entry.label,
318
- unlockSpaceId: entry.unlockSpaceId,
319
- outcome: 'reminted',
320
- ...(siblingCarriedVerbatim ? { siblingCarriedVerbatim } : {})
321
- });
322
- }
323
- catch (err) {
324
- log.warn('Could not re-mint the recovery delegation', {
325
- label: entry.label,
326
- err
327
- });
328
- skipped += 1;
329
- outcomes.push({
330
- label: entry.label,
331
- unlockSpaceId: entry.unlockSpaceId,
332
- outcome: 'failed',
333
- error: err
334
- });
335
- }
336
- }
337
- return { reminted, skipped, outcomes };
93
+ ...(delegationExpires ? { delegationExpires } : {}),
94
+ ...(delegatedClientsKeyId ? { delegatedClientsKeyId } : {}),
95
+ ...(delegatedClientsExpires ? { delegatedClientsExpires } : {})
96
+ };
97
+ }
98
+ /**
99
+ * A delegation's `expires` caveat, when it carries one.
100
+ *
101
+ * @param zcap {IZcap}
102
+ * @returns {string | undefined}
103
+ */
104
+ function zcapExpires(zcap) {
105
+ return zcap.expires;
338
106
  }
339
107
  //# sourceMappingURL=recoveryDelegation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryDelegation.js","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAG7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAA;AAE9D,wEAAwE;AACxE,2DAA2D;AAC3D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAAC,EAAE,OAAO,EAA+B;IACzD,OAAO,KAAK,CAAC;QACX,SAAS,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