@interop/wallet-core 0.40.0 → 0.42.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 (153) hide show
  1. package/README.md +17 -3
  2. package/dist/clients/listing.d.ts +4 -3
  3. package/dist/clients/listing.d.ts.map +1 -1
  4. package/dist/clients/listing.js.map +1 -1
  5. package/dist/clients/policy.d.ts +3 -2
  6. package/dist/clients/policy.d.ts.map +1 -1
  7. package/dist/clients/policy.js +3 -3
  8. package/dist/clients/policy.js.map +1 -1
  9. package/dist/clients/revocation.d.ts +14 -4
  10. package/dist/clients/revocation.d.ts.map +1 -1
  11. package/dist/clients/revocation.js +29 -14
  12. package/dist/clients/revocation.js.map +1 -1
  13. package/dist/clients/rosterPolicy.d.ts +22 -15
  14. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  15. package/dist/clients/rosterPolicy.js +32 -15
  16. package/dist/clients/rosterPolicy.js.map +1 -1
  17. package/dist/descriptors/index.d.ts +1 -1
  18. package/dist/descriptors/index.d.ts.map +1 -1
  19. package/dist/descriptors/index.js +1 -1
  20. package/dist/descriptors/index.js.map +1 -1
  21. package/dist/descriptors/logSource.d.ts +58 -6
  22. package/dist/descriptors/logSource.d.ts.map +1 -1
  23. package/dist/descriptors/logSource.js +57 -15
  24. package/dist/descriptors/logSource.js.map +1 -1
  25. package/dist/enrollment/enrollment.d.ts +30 -2
  26. package/dist/enrollment/enrollment.d.ts.map +1 -1
  27. package/dist/enrollment/enrollment.js +58 -30
  28. package/dist/enrollment/enrollment.js.map +1 -1
  29. package/dist/enrollment/index.d.ts +4 -1
  30. package/dist/enrollment/index.d.ts.map +1 -1
  31. package/dist/enrollment/index.js +4 -1
  32. package/dist/enrollment/index.js.map +1 -1
  33. package/dist/keyring/fetch.d.ts +12 -0
  34. package/dist/keyring/fetch.d.ts.map +1 -1
  35. package/dist/keyring/fetch.js +0 -2
  36. package/dist/keyring/fetch.js.map +1 -1
  37. package/dist/keyring/index.d.ts +7 -6
  38. package/dist/keyring/index.d.ts.map +1 -1
  39. package/dist/keyring/index.js +7 -6
  40. package/dist/keyring/index.js.map +1 -1
  41. package/dist/keyring/kdf.d.ts +22 -6
  42. package/dist/keyring/kdf.d.ts.map +1 -1
  43. package/dist/keyring/kdf.js +9 -14
  44. package/dist/keyring/kdf.js.map +1 -1
  45. package/dist/keyring/record.d.ts +30 -10
  46. package/dist/keyring/record.d.ts.map +1 -1
  47. package/dist/keyring/record.js +31 -15
  48. package/dist/keyring/record.js.map +1 -1
  49. package/dist/keys/index.d.ts +5 -3
  50. package/dist/keys/index.d.ts.map +1 -1
  51. package/dist/keys/index.js +3 -2
  52. package/dist/keys/index.js.map +1 -1
  53. package/dist/keys/rosterLogStore.d.ts +22 -2
  54. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  55. package/dist/keys/rosterLogStore.js +40 -20
  56. package/dist/keys/rosterLogStore.js.map +1 -1
  57. package/dist/keys/rosterStore.d.ts +13 -1
  58. package/dist/keys/rosterStore.d.ts.map +1 -1
  59. package/dist/keys/rosterStore.js +18 -0
  60. package/dist/keys/rosterStore.js.map +1 -1
  61. package/dist/keys/userKeyCascade.d.ts +10 -3
  62. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  63. package/dist/keys/userKeyCascade.js +10 -4
  64. package/dist/keys/userKeyCascade.js.map +1 -1
  65. package/dist/keys/userKeyRoster.d.ts +29 -21
  66. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  67. package/dist/keys/userKeyRoster.js +47 -23
  68. package/dist/keys/userKeyRoster.js.map +1 -1
  69. package/dist/recovery/index.d.ts +21 -11
  70. package/dist/recovery/index.d.ts.map +1 -1
  71. package/dist/recovery/index.js +19 -10
  72. package/dist/recovery/index.js.map +1 -1
  73. package/dist/recovery/recoveryCode.d.ts +5 -17
  74. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  75. package/dist/recovery/recoveryCode.js +4 -14
  76. package/dist/recovery/recoveryCode.js.map +1 -1
  77. package/dist/recovery/recoveryDelegation.d.ts +151 -0
  78. package/dist/recovery/recoveryDelegation.d.ts.map +1 -0
  79. package/dist/recovery/recoveryDelegation.js +261 -0
  80. package/dist/recovery/recoveryDelegation.js.map +1 -0
  81. package/dist/recovery/recoveryWebvh.d.ts +13 -22
  82. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  83. package/dist/recovery/recoveryWebvh.js +53 -139
  84. package/dist/recovery/recoveryWebvh.js.map +1 -1
  85. package/dist/resourceLog/append.d.ts +12 -3
  86. package/dist/resourceLog/append.d.ts.map +1 -1
  87. package/dist/resourceLog/append.js +17 -10
  88. package/dist/resourceLog/append.js.map +1 -1
  89. package/dist/resourceLog/index.d.ts +1 -1
  90. package/dist/resourceLog/index.d.ts.map +1 -1
  91. package/dist/resourceLog/index.js +1 -1
  92. package/dist/resourceLog/index.js.map +1 -1
  93. package/dist/resourceLog/pin.d.ts +46 -8
  94. package/dist/resourceLog/pin.d.ts.map +1 -1
  95. package/dist/resourceLog/pin.js +32 -7
  96. package/dist/resourceLog/pin.js.map +1 -1
  97. package/dist/resourceLog/seal.d.ts +4 -1
  98. package/dist/resourceLog/seal.d.ts.map +1 -1
  99. package/dist/resourceLog/seal.js +6 -2
  100. package/dist/resourceLog/seal.js.map +1 -1
  101. package/dist/unlock/index.d.ts +40 -0
  102. package/dist/unlock/index.d.ts.map +1 -0
  103. package/dist/unlock/index.js +36 -0
  104. package/dist/unlock/index.js.map +1 -0
  105. package/dist/unlock/ladder.d.ts +100 -0
  106. package/dist/unlock/ladder.d.ts.map +1 -0
  107. package/dist/unlock/ladder.js +144 -0
  108. package/dist/unlock/ladder.js.map +1 -0
  109. package/dist/unlock/selfEnroll.d.ts +83 -0
  110. package/dist/unlock/selfEnroll.d.ts.map +1 -0
  111. package/dist/unlock/selfEnroll.js +126 -0
  112. package/dist/unlock/selfEnroll.js.map +1 -0
  113. package/dist/unlock/standingClient.d.ts +68 -0
  114. package/dist/unlock/standingClient.d.ts.map +1 -0
  115. package/dist/unlock/standingClient.js +81 -0
  116. package/dist/unlock/standingClient.js.map +1 -0
  117. package/dist/unlock/standingWebvh.d.ts +153 -0
  118. package/dist/unlock/standingWebvh.d.ts.map +1 -0
  119. package/dist/unlock/standingWebvh.js +370 -0
  120. package/dist/unlock/standingWebvh.js.map +1 -0
  121. package/dist/unlock/unlockRecord.d.ts +207 -0
  122. package/dist/unlock/unlockRecord.d.ts.map +1 -0
  123. package/dist/unlock/unlockRecord.js +435 -0
  124. package/dist/unlock/unlockRecord.js.map +1 -0
  125. package/dist/webvh/didWebvh.d.ts +166 -7
  126. package/dist/webvh/didWebvh.d.ts.map +1 -1
  127. package/dist/webvh/didWebvh.js +286 -31
  128. package/dist/webvh/didWebvh.js.map +1 -1
  129. package/dist/webvh/index.d.ts +15 -3
  130. package/dist/webvh/index.d.ts.map +1 -1
  131. package/dist/webvh/index.js +14 -3
  132. package/dist/webvh/index.js.map +1 -1
  133. package/dist/webvh/keyAgreement.d.ts +72 -0
  134. package/dist/webvh/keyAgreement.d.ts.map +1 -0
  135. package/dist/webvh/keyAgreement.js +47 -0
  136. package/dist/webvh/keyAgreement.js.map +1 -0
  137. package/dist/webvh/listClients.d.ts +69 -20
  138. package/dist/webvh/listClients.d.ts.map +1 -1
  139. package/dist/webvh/listClients.js +102 -14
  140. package/dist/webvh/listClients.js.map +1 -1
  141. package/dist/webvh/revokeClient.d.ts +21 -11
  142. package/dist/webvh/revokeClient.d.ts.map +1 -1
  143. package/dist/webvh/revokeClient.js +31 -14
  144. package/dist/webvh/revokeClient.js.map +1 -1
  145. package/dist/webvh/verifyLog.d.ts +15 -2
  146. package/dist/webvh/verifyLog.d.ts.map +1 -1
  147. package/dist/webvh/verifyLog.js +22 -3
  148. package/dist/webvh/verifyLog.js.map +1 -1
  149. package/package.json +11 -5
  150. package/dist/recovery/recoveryRecord.d.ts +0 -171
  151. package/dist/recovery/recoveryRecord.d.ts.map +0 -1
  152. package/dist/recovery/recoveryRecord.js +0 -290
  153. package/dist/recovery/recoveryRecord.js.map +0 -1
package/README.md CHANGED
@@ -140,10 +140,24 @@ The subpaths:
140
140
  heals by re-running. The keyring bind is deliberately not a stage, so a wallet
141
141
  with no unlock method bound at creation drives the same ceremony.
142
142
 
143
+ - **`@interop/wallet-core/unlock`** -- standing unlock credentials: every unlock
144
+ method (passphrase, passkey PRF, recovery code) as a standing credential in
145
+ the recovery-code posture, with self-enrolling login. The credential-derived
146
+ client identity and binding MAC key, the update-key ladder
147
+ (latent-and-consumed did:webvh update authority from a random seed carried in
148
+ the unlock record, the current rung recovered from the log itself), the unlock
149
+ record codec (shell / bridge delegation / ladder members under a
150
+ credential-authenticated binding, with the bridge-only re-mint), the merged
151
+ document-posture edit (a verbatim `keyAgreement` entry or a
152
+ `publicKeyCommitment` entry for a low-entropy-derived key), and the
153
+ self-enrolling continuation with its composed completion.
154
+
143
155
  - **`@interop/wallet-core/recovery`** -- recovery codes on the roster identity
144
- model: a code as a minimal always-enrolled wallet client (format and
145
- derivation, the recovery record, the document half of issuance / revocation /
146
- recovery).
156
+ model, over the `unlock` machinery: a code as a minimal always-enrolled wallet
157
+ client (format and derivation, the document half of issuance / revocation /
158
+ recovery with its spend-on-use continuation, the pre-minted `did.jsonl`
159
+ delegation builder and the revocation cascade's bridge re-mint core; the
160
+ record codec is the `unlock` subpath's, re-exported here).
147
161
 
148
162
  ## Install
149
163
 
@@ -49,9 +49,10 @@ export interface AccountLogPointer {
49
49
  export type VerifiedAccountLog = Awaited<ReturnType<typeof verifyAccountLog>>;
50
50
  /**
51
51
  * One row of the listing: the log-stated client plus its display state.
52
- * `updateKeyMultibase` is absent when the log attribution could not isolate
53
- * the client's active update key, which is exactly when it cannot be
54
- * disconnected.
52
+ * `keyAgreementKeyMultibases` is an empty array when the document carries no
53
+ * marked key-agreement method for the client. `updateKeyMultibase` is absent
54
+ * when the log attribution could not isolate the client's active update key,
55
+ * which is exactly when it cannot be disconnected.
55
56
  */
56
57
  export interface AccountClientView extends EnrolledWebvhClient {
57
58
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAEL,gBAAgB,EAChB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAA;AAE7E;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAoB/B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,OAAO,EACP,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB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AAE,CAAC;SAChE,CAAC,CAAC,CAAA;IACL,OAAO,IAAI,GAAG,CACZ,wBAAwB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAC5E,CAAA;AACH,CAAC"}
@@ -55,8 +55,9 @@ export declare function disconnectEligibility({ client, clients }: {
55
55
  };
56
56
  /**
57
57
  * Narrows a listed row to the key set a revocation needs, throwing when the
58
- * row's active update key could not be attributed. A row with all three key
59
- * members present is exactly a `RevokedClientKeys`.
58
+ * row's active update key could not be attributed. Carries no key-agreement
59
+ * member: the revocation removes every key-agreement method the client's
60
+ * controller marker claims, read off the document itself.
60
61
  *
61
62
  * @param options {object}
62
63
  * @param options.client {AccountClientView}
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAC3B,MAAM,GAAG,aAAa,GAAG,yBAAyB,CAAA;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACR,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAWpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oB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CAAA;IACjC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,GAAG,UAAU,GAAG,SAAS,CAIzB"}
@@ -22,8 +22,9 @@ export function disconnectEligibility({ client, clients }) {
22
22
  }
23
23
  /**
24
24
  * Narrows a listed row to the key set a revocation needs, throwing when the
25
- * row's active update key could not be attributed. A row with all three key
26
- * members present is exactly a `RevokedClientKeys`.
25
+ * row's active update key could not be attributed. Carries no key-agreement
26
+ * member: the revocation removes every key-agreement method the client's
27
+ * controller marker claims, read off the document itself.
27
28
  *
28
29
  * @param options {object}
29
30
  * @param options.client {AccountClientView}
@@ -36,7 +37,6 @@ export function revokedClientKeysFor({ client }) {
36
37
  }
37
38
  return {
38
39
  signingKeyMultibase: client.signingKeyMultibase,
39
- keyAgreementKeyMultibase: client.keyAgreementKeyMultibase,
40
40
  updateKeyMultibase: client.updateKeyMultibase
41
41
  };
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EAIR;IACC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;IACnD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAA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,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,CACjD,CAAA;IACH,CAAC;IACD,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EAIX;IACC,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,EAAE,OAAO,KAAK,QAAQ;QACtE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAA;AAChB,CAAC"}
@@ -18,8 +18,18 @@
18
18
  * ordinary connect flow.
19
19
  * 2. **The user key rotation** in the wrap-set roster, recipients resolved
20
20
  * from the document the edit itself just resolved to (no re-fetch of the
21
- * log this call just extended). The roster delivers, never sources, so the
22
- * revoked client's entry is dropped even before the retire filter. An
21
+ * log this call just extended). On a log-governed roster store the
22
+ * orchestrator itself guarantees post-edit anchoring: the controller view
23
+ * built from the edit's own post-edit log is set as the store's freshness
24
+ * floor (`setControllerFloor`) before anything roster-side runs, so the
25
+ * rotation and the seal backstop anchor at or past the edit even where the
26
+ * app's injected controller resolution still serves a cached pre-edit
27
+ * view. The roster delivers, never sources, so the
28
+ * stage names no client at all: it converges the roster onto that document
29
+ * (the login sweep's own path), retiring every current-epoch recipient the
30
+ * document no longer keys in one rotation. Nothing here has to pair a
31
+ * client with its key-agreement key, so a client that published several
32
+ * of them, or none the caller knows, is retired just the same. An
23
33
  * account with no roster yet stops here: the client IS disconnected, with
24
34
  * nothing to rotate. On a sealable (log-governed) roster store, the seal
25
35
  * backstop follows: a rotation that no-op'd appended nothing, so the
@@ -51,7 +61,7 @@
51
61
  import type { IKeyAgreementKey } from '@interop/data-integrity-core';
52
62
  import type { CollectionEncryption } from '@interop/was-client';
53
63
  import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
54
- import { type ClientWebvhUpdateKeys, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
64
+ import { type ClientWebvhUpdateKeys, type PublishedKeyDocument, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
55
65
  import { type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
56
66
  /**
57
67
  * What the roster's seal backstop reported: `sealed` (the roster log's head
@@ -166,7 +176,7 @@ export declare function revokeAccountClient({ idStore, updateKeys, revokedClient
166
176
  }) => Promise<void>;
167
177
  collections: CascadeCollections;
168
178
  remintRecoveryDelegations?: (options: {
169
- document: object;
179
+ document: PublishedKeyDocument;
170
180
  }) => Promise<{
171
181
  reminted: number;
172
182
  skipped: number;
@@ -1 +1 @@
1
- {"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,EAAE,GAAG,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AqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC3B,OAAO,EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE;QACpC,QAAQ,EAAE,oBAAoB,CAAA;KAC/B,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpD,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA+HlC"}
@@ -1,5 +1,6 @@
1
+ import { webvhResourceLogController } from '../resourceLog/index.js';
1
2
  import { revokeWebvhClient } from '../webvh/index.js';
2
- import { cascadeCollectionsToUserKey, isSealableDescriptorStore, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from '../keys/index.js';
3
+ import { cascadeCollectionsToUserKey, convergeUserKeyRosterToDocument, isSealableDescriptorStore, readUserKeyRoster } from '../keys/index.js';
3
4
  /**
4
5
  * Resolves the collection ids the fan-out covers, whether they are a fixed set
5
6
  * or a listing the app performs.
@@ -79,38 +80,52 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
79
80
  // 1. The document edit -- the pull axis everywhere, first. It resolves the
80
81
  // document as it now stands, which is what stage 2 resolves its remaining
81
82
  // recipients from.
82
- const { doc } = await revokeWebvhClient({
83
+ const { did, doc, log } = await revokeWebvhClient({
83
84
  idStore,
84
85
  updateKeys,
85
86
  revokedClient,
86
87
  ...(knownLatentHashes ? { knownLatentHashes } : {}),
87
88
  ...(expectedDid !== undefined ? { expectedDid } : {})
88
89
  });
90
+ // The post-edit anchoring guarantee: stage 2's roster appends -- and the
91
+ // seal backstop's removal detection -- must run under a controller view
92
+ // that includes the edit this call just published, or the rotation anchors
93
+ // pre-edit and the log stays unsealed with the seal blind to the removal.
94
+ // Rather than leaving that to the injected store's own controller wiring,
95
+ // the view built from the edit's post-edit log is set as the store's floor;
96
+ // a fresher resolved view still wins.
97
+ if (isSealableDescriptorStore(rosterStore)) {
98
+ rosterStore.setControllerFloor({
99
+ controller: webvhResourceLogController({ did, log })
100
+ });
101
+ }
89
102
  // 2. The roster rotation, recipients resolved from that same document.
90
- // Whether there IS a roster is settled BEFORE the rotation: an account with
91
- // no `key-map/user-key.jsonl` (its collections are not encrypted yet) has nothing
92
- // to rotate, and the rotation itself refuses an absent descriptor rather
93
- // than no-op'ing. The document edit has already landed, so the client IS
103
+ // Whether there IS a roster is settled BY the convergence call itself: a
104
+ // `null` descriptor back means the account has no `key-map/user-key.jsonl`
105
+ // yet (its collections are not encrypted yet), so there is nothing to
106
+ // rotate. The document edit has already landed, so the client IS
94
107
  // disconnected -- a completed cascade with nothing rotated, not a failure.
95
- const roster = await rosterStore.read();
96
- if (roster === null) {
108
+ // Pairing-free: rather than naming the revoked client's kid, the rotation
109
+ // retires every current-epoch recipient the post-edit document no longer
110
+ // keys -- which is exactly the revoked client's entry, plus anything an
111
+ // earlier torn cascade left behind, in one rotation.
112
+ const converged = await convergeUserKeyRosterToDocument({
113
+ store: rosterStore,
114
+ document: doc
115
+ });
116
+ if (converged.descriptor === null) {
97
117
  return {
98
118
  rotated: false,
99
119
  collections: { outcomes: {}, failed: [] },
100
120
  document: doc
101
121
  };
102
122
  }
103
- const rotatedDescriptor = await rotateUserKeyRoster({
104
- store: rosterStore,
105
- document: doc,
106
- retireRecipientId: rosterRecipientKid(revokedClient)
107
- });
108
123
  // The rotation's own verified result is threaded into the adopting read, so
109
124
  // one cascade run acquires the roster once for both halves of stage 2 (the
110
125
  // continuity and possession checks still run on the threaded descriptor).
111
126
  const read = await readUserKeyRoster({
112
127
  store: rosterStore,
113
- descriptor: rotatedDescriptor,
128
+ descriptor: converged.descriptor,
114
129
  ...(userKey ? { userKey } : {}),
115
130
  clientKeyAgreementKey,
116
131
  pinnedEpochId
@@ -1 +1 @@
1
- {"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAqDA,OAAO,EACL,iBAAiB,EAIlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,kBAAkB,CAAA;AA6CzB;;;;;;;GAOG;AACH,KAAK,UAAU,eAAe,CAAC,EAC7B,WAAW,EAGZ;IACC,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,CAAA;IACrC,OAAO,OAAO,aAAa,KAAK,UAAU;QACxC,CAAC,CAAC,MAAM,aAAa,EAAE;QACvB,CAAC,CAAC,aAAa,CAAA;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,iBAAiB,EAsBlB;IACC,IACE,sBAAsB;QACtB,sBAAsB,KAAK,aAAa,CAAC,mBAAmB,EAC5D,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,sCAAsC,CACzC,CAAA;IACH,CAAC;IACD,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,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;QAC9B,GAAG,CAAC,WAAW,CAAC,WAAW;YACzB,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;YAC1C,CAAC,CAAC,EAAE,CAAC;QACP,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,qBAAqB;QACrB,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAA;IAEF,2EAA2E;IAC3E,qCAAqC;IACrC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAErE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAA;AACH,CAAC"}
@@ -15,13 +15,16 @@
15
15
  * roster is authenticated and checked against the locally pinned latest-seen
16
16
  * epoch either way.
17
17
  *
18
- * **Failure semantics.** The three roster refusals -- a rolled-back or
19
- * replayed roster, an epoch configuration that fails authentication, and a
20
- * current epoch this client cannot unwrap -- rethrow and refuse the session:
21
- * they are the same continuity class as a substituted account pointer, and
22
- * proceeding would mean acting under a key nobody vouched for. Anything else
23
- * (an unreachable server, a transport hiccup) is warned about and resolves
24
- * `null`, so an offline start keeps working from the cached key.
18
+ * **Failure semantics.** The roster refusals -- a fabricated or
19
+ * discontinuous roster log, a rolled-back or replayed epoch configuration,
20
+ * one that fails authentication, and a current epoch this client cannot
21
+ * unwrap -- rethrow and refuse the session: they are the same continuity
22
+ * class as a substituted account pointer, and proceeding would mean acting
23
+ * under a key nobody vouched for. The one carve-out is the chain-head pin's
24
+ * continuity reason `rollback` (see {@link isRosterRefusal}), which lands in
25
+ * the transport class instead. Anything in that class (an unreachable
26
+ * server, a transport hiccup, the rollback) is warned about and resolves
27
+ * `null`, so the start keeps working from the cached key.
25
28
  *
26
29
  * - {@link convergeUserKeyRosterToAccount} -- the roster stage of the
27
30
  * cascade-completion sweep, which the collection fan-out then runs behind. A
@@ -70,10 +73,12 @@ export interface AdoptedUserKey {
70
73
  * Every read traces to the account document through the log-governed store
71
74
  * itself: the roster resolves only from the roster log's verified head, whose
72
75
  * entry proofs are checked against the locally verified account log. A log
73
- * that cannot be fetched lands in the transport-failure class -- the session
74
- * carries on under the cached key, WITHOUT adopting an unverifiable rotation
75
- * -- while a roster no enrolled client signed onto the log, and a log that
76
- * conflicts with the chain-head pin, are refusals like the other three.
76
+ * that cannot be fetched, and a served log the chain-head pin reports as a
77
+ * rollback, land in the transport-failure class -- the session carries on
78
+ * under the cached key, WITHOUT adopting an unverifiable (or rolled-back)
79
+ * rotation -- while a roster no enrolled client signed onto the log, and a
80
+ * log the pin reports as a fork or an SCID/method switch, are refusals like
81
+ * the other three.
77
82
  *
78
83
  * @param options {object}
79
84
  * @param options.store {EncryptionDescriptorStore} the roster's descriptor
@@ -111,8 +116,9 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
111
116
  * to a fresh key, that key is readable only from the roster, so a failed
112
117
  * adoption throws rather than reporting `rotated: false` with the retired key
113
118
  * and descriptor (which would skip `onUserKeyAdopted` and fan the collections
114
- * out onto the pre-rotation epoch). The three roster refusals rethrow
115
- * throughout, exactly as {@link checkUserKeyRosterAtLogin} rethrows them.
119
+ * out onto the pre-rotation epoch). The roster refusals rethrow throughout,
120
+ * exactly as {@link checkUserKeyRosterAtLogin} rethrows them, under the same
121
+ * rollback carve-out.
116
122
  *
117
123
  * @param options {object}
118
124
  * @param options.pointer {AccountLogPointer} where the account log lives
@@ -125,8 +131,9 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
125
131
  * @param [options.pinnedEpochId] {string} the locally pinned latest-seen
126
132
  * roster epoch
127
133
  * @param [options.accountLogPinStore] {ResourceLogPinStore} this client's
128
- * chain-head pin for the account log; a served log that conflicts with it
129
- * is a refusal like the other five, not a transport failure
134
+ * chain-head pin for the account log; a served log the pin reports as a
135
+ * fork or an SCID/method switch is a refusal like the others, while a
136
+ * rollback resolves to the unchanged input under the carve-out
130
137
  * @param [options.onUserKeyAdopted] {Function} called with the
131
138
  * {@link AdoptedUserKey} of a rotation, before the fan-out runs
132
139
  * @returns {Promise<object>} whether the roster rotated on this call,
@@ -1 +1 @@
1
- {"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,oBAAoB,CAAA;CACjC;AA8BD;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EACjB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CAwGD"}
@@ -2,11 +2,22 @@ import { convergeUserKeyRosterToDocument, isSealableDescriptorStore, readUserKey
2
2
  import { verifyAccountLog } from '../webvh/index.js';
3
3
  /**
4
4
  * Whether a thrown error is one of the roster refusals -- a fabricated or
5
- * discontinuous roster log, a rolled-back or replayed roster, an epoch
6
- * configuration that fails authentication, and a current epoch this client
7
- * cannot unwrap. They are the continuity class that refuses a session rather
8
- * than degrading it, so both entry points rethrow them instead of warning and
9
- * carrying on.
5
+ * discontinuous roster log, a rolled-back or replayed epoch configuration, an
6
+ * epoch configuration that fails authentication, and a current epoch this
7
+ * client cannot unwrap. They are the continuity class that refuses a session
8
+ * rather than degrading it, so both entry points rethrow them instead of
9
+ * warning and carrying on.
10
+ *
11
+ * The one carve-out is the chain-head pin's continuity reason `rollback` --
12
+ * reconcilable divergence (possibly replication lag, retryable per the
13
+ * profile's log-pin rules), the same carve-out `descriptors/acquire.ts` makes
14
+ * on the collection-descriptor path and the account-log pin makes for the
15
+ * account document: nothing rolled back is adopted and the pin never
16
+ * regresses, so a lagging replica degrades the start to the cached user key
17
+ * instead of hard-refusing a healthy account's login. The epoch pin's own
18
+ * `UserKeyRosterContinuityError` stays a refusal: with no chain to compare it
19
+ * cannot tell a rollback from a fork, and it is the guard that remains when
20
+ * the chain-head pin was lost with a reinstall.
10
21
  *
11
22
  * Matched on `err.name` rather than `instanceof`: the errors are raised inside
12
23
  * the app-injected descriptor store, which can resolve to a different copy of
@@ -19,8 +30,10 @@ import { verifyAccountLog } from '../webvh/index.js';
19
30
  */
20
31
  function isRosterRefusal(err) {
21
32
  const name = err?.name;
22
- return (name === 'ResourceLogContinuityError' ||
23
- name === 'ResourceLogIntegrityError' ||
33
+ if (name === 'ResourceLogContinuityError') {
34
+ return err.reason !== 'rollback';
35
+ }
36
+ return (name === 'ResourceLogIntegrityError' ||
24
37
  name === 'UserKeyRosterContinuityError' ||
25
38
  name === 'UserKeyRosterIntegrityError' ||
26
39
  name === 'UserKeyRosterUnwrapError');
@@ -31,10 +44,12 @@ function isRosterRefusal(err) {
31
44
  * Every read traces to the account document through the log-governed store
32
45
  * itself: the roster resolves only from the roster log's verified head, whose
33
46
  * entry proofs are checked against the locally verified account log. A log
34
- * that cannot be fetched lands in the transport-failure class -- the session
35
- * carries on under the cached key, WITHOUT adopting an unverifiable rotation
36
- * -- while a roster no enrolled client signed onto the log, and a log that
37
- * conflicts with the chain-head pin, are refusals like the other three.
47
+ * that cannot be fetched, and a served log the chain-head pin reports as a
48
+ * rollback, land in the transport-failure class -- the session carries on
49
+ * under the cached key, WITHOUT adopting an unverifiable (or rolled-back)
50
+ * rotation -- while a roster no enrolled client signed onto the log, and a
51
+ * log the pin reports as a fork or an SCID/method switch, are refusals like
52
+ * the other three.
38
53
  *
39
54
  * @param options {object}
40
55
  * @param options.store {EncryptionDescriptorStore} the roster's descriptor
@@ -94,8 +109,9 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
94
109
  * to a fresh key, that key is readable only from the roster, so a failed
95
110
  * adoption throws rather than reporting `rotated: false` with the retired key
96
111
  * and descriptor (which would skip `onUserKeyAdopted` and fan the collections
97
- * out onto the pre-rotation epoch). The three roster refusals rethrow
98
- * throughout, exactly as {@link checkUserKeyRosterAtLogin} rethrows them.
112
+ * out onto the pre-rotation epoch). The roster refusals rethrow throughout,
113
+ * exactly as {@link checkUserKeyRosterAtLogin} rethrows them, under the same
114
+ * rollback carve-out.
99
115
  *
100
116
  * @param options {object}
101
117
  * @param options.pointer {AccountLogPointer} where the account log lives
@@ -108,8 +124,9 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
108
124
  * @param [options.pinnedEpochId] {string} the locally pinned latest-seen
109
125
  * roster epoch
110
126
  * @param [options.accountLogPinStore] {ResourceLogPinStore} this client's
111
- * chain-head pin for the account log; a served log that conflicts with it
112
- * is a refusal like the other five, not a transport failure
127
+ * chain-head pin for the account log; a served log the pin reports as a
128
+ * fork or an SCID/method switch is a refusal like the others, while a
129
+ * rollback resolves to the unchanged input under the carve-out
113
130
  * @param [options.onUserKeyAdopted] {Function} called with the
114
131
  * {@link AdoptedUserKey} of a rotation, before the fan-out runs
115
132
  * @returns {Promise<object>} whether the roster rotated on this call,
@@ -1 +1 @@
1
- {"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAsDA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAA;IACrD,OAAO,CACL,IAAI,KAAK,4BAA4B;QACrC,IAAI,KAAK,2BAA2B;QACpC,IAAI,KAAK,8BAA8B;QACvC,IAAI,KAAK,6BAA6B;QACtC,IAAI,KAAK,0BAA0B,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;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,CAAA;IACjC,CAAC;IACD,OAAO,CAAC,IAAI,CACV,uDAAuD;QACrD,GAAG,iBAAiB,CAAC,MAAM,wCAAwC;QACnE,+CAA+C,CAClD,CAAA;IAED,yEAAyE;IACzE,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,IAAoC,CAAA;IACxC,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,iBAAiB,CAAC;YAC7B,KAAK;YACL,OAAO;YACP,qBAAqB;YACrB,aAAa;SACd,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAA;QACX,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,mEAAmE;YACnE,kBAAkB,EACpB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAyDA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;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OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
@@ -38,7 +38,7 @@
38
38
  */
39
39
  export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
40
40
  export type { EncryptionDescriptorCache, EncryptionDescriptorSource } from './acquire.js';
41
- export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource } from './logSource.js';
41
+ export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
42
42
  export { DescriptorRefreshPolicy } from './refresh.js';
43
43
  export { createRefreshingEdvDocCipher } from './cipher.js';
44
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
@@ -37,7 +37,7 @@
37
37
  * instance.
38
38
  */
39
39
  export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
40
- export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource } from './logSource.js';
40
+ export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
41
41
  export { DescriptorRefreshPolicy } from './refresh.js';
42
42
  export { createRefreshingEdvDocCipher } from './cipher.js';
43
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAMrB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAMrB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
@@ -1,11 +1,60 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The log-governed {@link EncryptionDescriptorSource}: descriptor acquisition
6
+ * for a collection whose encryption descriptor is governed by a resource log
7
+ * (the Resource Log Profile) rather than by its Collection Description. Every
8
+ * read -- including the unknown-epoch refresh's re-read -- resolves to the
9
+ * log's VERIFIED head state: chain, proofs, external authorization against
10
+ * the independently verified controller document, and the chain-head pin all
11
+ * checked before any descriptor is handed out, so a refresh re-verifies the
12
+ * log rather than adopting whatever the host serves. A verified head whose
13
+ * state is not an epoch configuration is refused fail-closed rather than
14
+ * handed out as a descriptor.
15
+ */
16
+ import type { CollectionEncryption } from '@interop/was-client';
1
17
  import { type ResourceLogStore } from '@interop/was-client/log';
2
- import { type ResourceLogController, type ResourceLogPinStore } from '../resourceLog/index.js';
18
+ import { type ResourceLogController, type ResourceLogPinStore, type VerifiedResourceLog } from '../resourceLog/index.js';
3
19
  import type { EncryptionDescriptorSource } from './acquire.js';
4
20
  /**
5
21
  * The state-document schema identifier an encryption descriptor carries in a
6
22
  * governed log entry, per WAS-EC.
7
23
  */
8
24
  export declare const EPOCH_CONFIGURATION_STATE_TYPE = "WasEpochConfiguration";
25
+ /**
26
+ * The one governed epoch-configuration read: the fail-closed boundary that
27
+ * decides whether a served log state may be treated as an encryption
28
+ * descriptor. Resolves the controller view, reads and fully verifies the log
29
+ * (chain, proofs, external authorization, and the chain-head pin, via
30
+ * `readResourceLog`), and refuses a verified head whose state is not a
31
+ * `WasEpochConfiguration` rather than handing it out as a descriptor.
32
+ * Resolves `null` for an absent log (the pre-genesis state). Both governed
33
+ * descriptor consumers -- the log-governed descriptor source below and the
34
+ * roster's log-governed descriptor store -- read through this helper, so a
35
+ * hardening applied here reaches every trusted descriptor read.
36
+ *
37
+ * @param options {object}
38
+ * @param options.store {ResourceLogStore} the log's transport seam
39
+ * @param options.resolveController {function}
40
+ * `() => Promise<ResourceLogController>` -- the caller's currently verified
41
+ * controller view, resolved per operation
42
+ * @param options.pinStore {ResourceLogPinStore} this client's chain-head
43
+ * pin for this log
44
+ * @param options.logId {string} the pin-slot key for this log, from
45
+ * `resourceLogPinId`
46
+ * @returns {Promise<{ verified: VerifiedResourceLog; descriptor: CollectionEncryption; etag?: string } | null>}
47
+ */
48
+ export declare function readGovernedEpochConfiguration({ store, resolveController, pinStore, logId }: {
49
+ store: ResourceLogStore;
50
+ resolveController: () => Promise<ResourceLogController>;
51
+ pinStore: ResourceLogPinStore;
52
+ logId: string;
53
+ }): Promise<{
54
+ verified: VerifiedResourceLog;
55
+ descriptor: CollectionEncryption;
56
+ etag?: string;
57
+ } | null>;
9
58
  /**
10
59
  * Builds the {@link EncryptionDescriptorSource} over per-collection resource
11
60
  * logs. An absent log resolves `undefined` exactly like an absent
@@ -20,14 +69,17 @@ export declare const EPOCH_CONFIGURATION_STATE_TYPE = "WasEpochConfiguration";
20
69
  * @param options.resolveController {function}
21
70
  * `() => Promise<ResourceLogController>` -- the caller's currently verified
22
71
  * controller view, resolved per operation
23
- * @param options.pinStoreFor {function} `(collectionId) =>
24
- * ResourceLogPinStore` -- this client's chain-head pin for the collection's
25
- * log
72
+ * @param options.pinStore {ResourceLogPinStore} this client's chain-head
73
+ * pins, keyed per log
74
+ * @param options.logIdFor {function} `(collectionId) => string` -- the
75
+ * collection's descriptor log's pin-slot key, typically built with
76
+ * `resourceLogPinId`
26
77
  * @returns {EncryptionDescriptorSource}
27
78
  */
28
- export declare function logGovernedDescriptorSource({ logFor, resolveController, pinStoreFor }: {
79
+ export declare function logGovernedDescriptorSource({ logFor, resolveController, pinStore, logIdFor }: {
29
80
  logFor: (collectionId: string) => ResourceLogStore;
30
81
  resolveController: () => Promise<ResourceLogController>;
31
- pinStoreFor: (collectionId: string) => ResourceLogPinStore;
82
+ pinStore: ResourceLogPinStore;
83
+ logIdFor: (collectionId: string) => string;
32
84
  }): EncryptionDescriptorSource;
33
85
  //# sourceMappingURL=logSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,EAAE;IACD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAA;IAClD,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,mBAAmB,CAAA;CAC3D,GAAG,0BAA0B,CAuB7B"}
1
+ {"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,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