@interop/wallet-core 0.62.0 → 0.65.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 +41 -16
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +55 -34
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +102 -56
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +16 -2
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +11 -9
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +62 -18
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +92 -26
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -2
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +7 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +38 -5
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +346 -236
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +21 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +24 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +58 -0
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +222 -33
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +391 -346
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +162 -43
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +423 -192
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +12 -6
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +26 -12
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +123 -0
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
- package/dist/clientAnnex/spaceCapability.js +152 -0
- package/dist/clientAnnex/spaceCapability.js.map +1 -0
- package/dist/clientAnnex/stages.d.ts +63 -0
- package/dist/clientAnnex/stages.d.ts.map +1 -0
- package/dist/clientAnnex/stages.js +64 -0
- package/dist/clientAnnex/stages.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +42 -35
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/policy.d.ts +15 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +12 -6
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -10
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +13 -5
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +10 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +41 -24
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +6 -23
- package/dist/descriptors/acquire.js.map +1 -1
- package/dist/descriptors/cipher.d.ts.map +1 -1
- package/dist/descriptors/cipher.js +5 -0
- package/dist/descriptors/cipher.js.map +1 -1
- package/dist/descriptors/errors.d.ts +43 -0
- package/dist/descriptors/errors.d.ts.map +1 -0
- package/dist/descriptors/errors.js +45 -0
- package/dist/descriptors/errors.js.map +1 -0
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +37 -10
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +52 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +42 -11
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +80 -22
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +3 -1
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +3 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/identity/agents.d.ts +17 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +23 -7
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +3 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/index.d.ts +2 -1
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +2 -1
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +3 -6
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +14 -5
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -36
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +10 -6
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +9 -5
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +12 -11
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +15 -13
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +10 -9
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -3
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +57 -7
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +222 -17
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +7 -6
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +7 -6
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/keys/wasLabelsStore.d.ts +9 -2
- package/dist/keys/wasLabelsStore.d.ts.map +1 -1
- package/dist/keys/wasLabelsStore.js +14 -6
- package/dist/keys/wasLabelsStore.js.map +1 -1
- package/dist/log.d.ts +7 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/recovery/index.d.ts +12 -8
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +11 -7
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +27 -7
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +18 -6
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +21 -34
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +75 -63
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +127 -116
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/classify.d.ts +32 -8
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +39 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +1 -6
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +2 -2
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +2 -3
- package/dist/request/parse.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +34 -12
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +79 -86
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +182 -0
- package/dist/resourceLog/document.d.ts.map +1 -0
- package/dist/resourceLog/document.js +159 -0
- package/dist/resourceLog/document.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +47 -8
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +54 -8
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +7 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +7 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts +35 -0
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
- package/dist/resourceLog/ladderRungs.js +352 -0
- package/dist/resourceLog/ladderRungs.js.map +1 -0
- package/dist/resourceLog/license.d.ts +42 -17
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +38 -24
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +15 -15
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +15 -15
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +11 -0
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +13 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/deleteSpace.d.ts +28 -0
- package/dist/space/deleteSpace.d.ts.map +1 -0
- package/dist/space/deleteSpace.js +44 -0
- package/dist/space/deleteSpace.js.map +1 -0
- package/dist/space/errors.d.ts.map +1 -1
- package/dist/space/errors.js +0 -1
- package/dist/space/errors.js.map +1 -1
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +6 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/plaintextCollection.d.ts +43 -0
- package/dist/space/plaintextCollection.d.ts.map +1 -0
- package/dist/space/plaintextCollection.js +17 -0
- package/dist/space/plaintextCollection.js.map +1 -0
- package/dist/stages.d.ts +23 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +23 -0
- package/dist/stages.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.js +4 -4
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.js +2 -2
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +41 -1
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +47 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +5 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +35 -7
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +52 -14
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +5 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +217 -35
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +469 -210
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +146 -0
- package/dist/webvh/accountEntry.d.ts.map +1 -0
- package/dist/webvh/accountEntry.js +239 -0
- package/dist/webvh/accountEntry.js.map +1 -0
- package/dist/webvh/didWeb.d.ts +12 -7
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +2 -2
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +164 -0
- package/dist/webvh/didWebProjection.d.ts.map +1 -0
- package/dist/webvh/didWebProjection.js +230 -0
- package/dist/webvh/didWebProjection.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +275 -136
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +307 -340
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +65 -0
- package/dist/webvh/enrollClient.d.ts.map +1 -0
- package/dist/webvh/enrollClient.js +172 -0
- package/dist/webvh/enrollClient.js.map +1 -0
- package/dist/webvh/index.d.ts +37 -12
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +33 -10
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +1 -35
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -30
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +41 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +99 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +61 -14
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +91 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +59 -5
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +76 -11
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +8 -8
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +39 -14
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +14 -1
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +3 -27
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +2 -2
- package/dist/webvh/keyAgreement.d.ts +0 -97
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -71
- package/dist/webvh/keyAgreement.js.map +0 -1
package/README.md
CHANGED
|
@@ -75,18 +75,26 @@ The subpaths:
|
|
|
75
75
|
store they write through, and ZCap signing under the did:webvh
|
|
76
76
|
verification-method id.
|
|
77
77
|
|
|
78
|
-
- **`@interop/wallet-core/resourceLog`** -- the
|
|
79
|
-
Profile
|
|
80
|
-
a wallet's clients and the storage server
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
- **`@interop/wallet-core/resourceLog`** -- the wallet-domain half of the
|
|
79
|
+
Resource Log Profile, the hash-linked log format governing key resources
|
|
80
|
+
co-managed between a wallet's clients and the storage server. Three pieces.
|
|
81
|
+
The did:webvh controller adapter, which answers which keys could have signed a
|
|
82
|
+
given entry at a given document version, and supplies the admission hook every
|
|
83
|
+
verifier consults. The ceremony-tail license that hook carries, which bounds
|
|
84
|
+
what a standing credential's ladder key may append -- above all refusing a
|
|
85
|
+
silent rekey against an unchanged document. And `isResourceLogRefusal`, the
|
|
86
|
+
shared reading of the refusal taxonomy: which refusals a reader must not paper
|
|
87
|
+
over with a cached copy, and which one it may (a chain-head rollback,
|
|
88
|
+
reconcilable divergence). The adapter and the license read the account
|
|
89
|
+
document through one import-free leaf beside them: relation resolution,
|
|
90
|
+
ladder-VM recognition, and the credential class. They therefore answer exactly
|
|
91
|
+
as the client listing does. That leaf's public home is the `webvh` subpath.
|
|
92
|
+
The generic half lives in
|
|
93
|
+
[`@interop/vh-resource-log`](https://npm.im/@interop/vh-resource-log) -- chain
|
|
94
|
+
verification against an adversarial host, the chain-head pin, the entry
|
|
95
|
+
builders, the read/append/create path, and the sealing sweep. Transport is in
|
|
96
|
+
[`@interop/was-client`](https://npm.im/@interop/was-client)'s `/log` subpath,
|
|
97
|
+
and the hashing and proof kernel in
|
|
90
98
|
[`@interop/did-method-webvh`](https://npm.im/@interop/did-method-webvh).
|
|
91
99
|
|
|
92
100
|
- **`@interop/wallet-core/keys`** -- the user key and its wrap-set roster,
|
|
@@ -158,6 +166,18 @@ The subpaths:
|
|
|
158
166
|
delegation builder and the revocation cascade's bridge re-mint core; the
|
|
159
167
|
record codec is the `unlock` subpath's, re-exported here).
|
|
160
168
|
|
|
169
|
+
- **`@interop/wallet-core/clientAnnex`** -- the client annex, the sibling
|
|
170
|
+
did:webvh log holding per-visit transient client keys in garbage-collected
|
|
171
|
+
generations, published in the account's auxiliary annex Space. This is the
|
|
172
|
+
authoring and maintenance surface of everything anchored on an unlock
|
|
173
|
+
credential's update-key ladder: the ladder itself (rung and VM derivation, the
|
|
174
|
+
shared attribution walks), the annex log and its GC, ZCap signing under a
|
|
175
|
+
ladder VM, the ladder-anchored account-log ceremonies (genesis,
|
|
176
|
+
self-enrollment, forget, and the last-client transition to a client-less
|
|
177
|
+
account), the credential-anchored account genesis with its mend and its
|
|
178
|
+
per-visit readiness ensure, and the transient-recovery continuation. It sits
|
|
179
|
+
on top of the other subpaths and none of them import from it.
|
|
180
|
+
|
|
161
181
|
## Install
|
|
162
182
|
|
|
163
183
|
- Node.js 24+ is recommended.
|
|
@@ -188,10 +208,15 @@ import {
|
|
|
188
208
|
```
|
|
189
209
|
|
|
190
210
|
The `sync` and `space` subpaths are re-exported from the package root as well.
|
|
191
|
-
Every other subpath (`identity`, `request`, `webvh`, `
|
|
192
|
-
`descriptors`, `keyring`, `enrollment`, `
|
|
193
|
-
|
|
194
|
-
graph.
|
|
211
|
+
Every other subpath (`identity`, `request`, `webvh`, `resourceLog`, `keys`,
|
|
212
|
+
`clients`, `descriptors`, `keyring`, `enrollment`, `genesis`, `unlock`,
|
|
213
|
+
`recovery`, `clientAnnex`) is import-directly-only, so consumers of the root
|
|
214
|
+
never pull the signing / KMS / document-loader dependency graph.
|
|
215
|
+
|
|
216
|
+
Two further exports are leaves of that same isolation, carved out to stay
|
|
217
|
+
dependency-light: `keys/clientKeyRecord` is the client-key record codec alone,
|
|
218
|
+
so a wallet's storage tests load without the crypto graph, and
|
|
219
|
+
`request/matching` is the QueryByExample matchers alone.
|
|
195
220
|
|
|
196
221
|
## Contribute
|
|
197
222
|
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
* resolution of the orphan-Space tear): re-derivable from the unlock
|
|
13
13
|
* record's ladder seed, so a tab death here strands nothing a later
|
|
14
14
|
* login cannot finish or unwind.
|
|
15
|
-
* 2. The optional KMS
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Best-effort: a throw is collected and the genesis proceeds
|
|
20
|
-
* keystore-less
|
|
21
|
-
* key.
|
|
15
|
+
* 2. The optional KMS authentication binding (`provideKmsAuthentication`),
|
|
16
|
+
* started BEFORE stage 1 is awaited and joined before stage 3 -- the
|
|
17
|
+
* keystore and the key mint need no Space, so only the thunk's own
|
|
18
|
+
* `keys.json` write waits on the `spaceReady` promise this ceremony hands
|
|
19
|
+
* it. Best-effort: a throw is collected and the genesis proceeds
|
|
20
|
+
* keystore-less, publishing a document with no `authentication` relation,
|
|
21
|
+
* which no later entry adds the key to.
|
|
22
22
|
* 3. The ladder-anchored did:webvh genesis
|
|
23
23
|
* (`ensureLadderAnchoredDidWebvh`): the entry signed by ladder rung 0,
|
|
24
24
|
* `updateKeys` = [rung 0], `nextKeyHashes` = [hash(rung 0), hash(rung 1)],
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
import { type RecipientPublicKey } from '@interop/was-client/edv';
|
|
56
56
|
import type { WasClient } from '@interop/was-client';
|
|
57
57
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
58
|
-
import type {
|
|
58
|
+
import type { DIDLog } from '@interop/did-method-webvh';
|
|
59
|
+
import type { KmsAuthenticationBinding, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
|
|
59
60
|
import type { UnlockKeyAgreementPublication } from '../unlock/standingWebvh.js';
|
|
60
61
|
import { type UserKey } from '../keys/index.js';
|
|
61
62
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
@@ -97,17 +98,26 @@ export declare function mintCredentialAnchoredAccountKeySet(): Promise<{
|
|
|
97
98
|
* roster and recipient zero of every encrypted collection
|
|
98
99
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
99
100
|
* store, signing as the same bootstrap did:key
|
|
100
|
-
* @param options.rosterStoreFor {Function} `({ did }) =>
|
|
101
|
+
* @param options.rosterStoreFor {Function} `({ did, log }) =>
|
|
101
102
|
* EncryptionDescriptorStore` -- the user-key roster's store once the DID is
|
|
102
|
-
* known, with a LADDER-signed `ResourceLogSigner` (the first-entry shape)
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
103
|
+
* known, with a LADDER-signed `ResourceLogSigner` (the first-entry shape).
|
|
104
|
+
* `log` is the account log the did:webvh stage just adopted or published,
|
|
105
|
+
* so a store resolving its controller view can read it out of this run's
|
|
106
|
+
* own head instead of fetching `did.jsonl` again
|
|
107
|
+
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
108
|
+
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
109
|
+
* binding's acquisition (a wallet that keeps a KMS mints the key under the
|
|
110
|
+
* ladder VM's bare did:key and writes `keys.json` here); absent or
|
|
111
|
+
* resolving `undefined`, the genesis is ladder-and-credential-only and no
|
|
112
|
+
* `keys.json` is ever written. It is STARTED before the Space is awaited
|
|
113
|
+
* and joined before the genesis entry, so its `spaceReady` argument is what
|
|
114
|
+
* its own `keys.json` write waits on. A throw is collected, not fatal: the
|
|
115
|
+
* genesis proceeds keystore-less, and the document it publishes never gains
|
|
116
|
+
* the key. The thunk's own obligation, since this ceremony takes
|
|
117
|
+
* `authentication.vmId` VERBATIM into the world-readable genesis entry: a
|
|
118
|
+
* served `keys.json` may be adopted only after the multibase in its `vmId`
|
|
119
|
+
* is checked against the session's own keystore listing; on a mismatch, or
|
|
120
|
+
* when the keystore cannot be listed, the thunk mints instead of adopting
|
|
111
121
|
* @param [options.expectedDid] {string} the account DID, when the caller
|
|
112
122
|
* holds a pointer that already names one (a heal re-run); a fresh signup
|
|
113
123
|
* and a fresh-terminal heal legitimately hold none
|
|
@@ -119,13 +129,17 @@ export declare function mintCredentialAnchoredAccountKeySet(): Promise<{
|
|
|
119
129
|
* account pointer must durably name the DID first (freewallet's record
|
|
120
130
|
* re-bind) passes `false` and promotes after that write
|
|
121
131
|
* @param [options.onStage] {StageNotifier} observational: called as each
|
|
122
|
-
* stage finishes, with
|
|
123
|
-
* `
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
132
|
+
* stage finishes, with the names in `CREDENTIAL_ANCHORED_GENESIS_STAGES`
|
|
133
|
+
* (`clientAnnex/stages.ts`) and, only when this ceremony promotes,
|
|
134
|
+
* `CONTROLLER_PROMOTION_STAGE`. `kms-authentication` fires at the JOIN
|
|
135
|
+
* rather than inside the thunk: stage 2 overlaps stage 1, so a thunk that
|
|
136
|
+
* finishes first would otherwise mark out of order
|
|
137
|
+
* @returns {Promise<AccountGenesisResult>} with `published` and
|
|
138
|
+
* `logMinted` always set: the account log's verified head the did:webvh
|
|
139
|
+
* stage adopted or minted, and which of the two it was -- the head is only
|
|
140
|
+
* safely reusable downstream when this run minted it
|
|
127
141
|
*/
|
|
128
|
-
export declare function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl, spaceId, ladderSeed, keyAgreement, standingRecipient, userKey, idStore, rosterStoreFor,
|
|
142
|
+
export declare function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl, spaceId, ladderSeed, keyAgreement, standingRecipient, userKey, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, accountLogPinStore, onDidPublished, promoteController, onStage }: {
|
|
129
143
|
was: WasClient;
|
|
130
144
|
wasServerUrl: string;
|
|
131
145
|
spaceId: string;
|
|
@@ -136,8 +150,11 @@ export declare function ensureCredentialAnchoredAccountGenesis({ was, wasServerU
|
|
|
136
150
|
idStore: WebvhIdStore;
|
|
137
151
|
rosterStoreFor: (options: {
|
|
138
152
|
did: string;
|
|
153
|
+
log: DIDLog;
|
|
139
154
|
}) => EncryptionDescriptorStore;
|
|
140
|
-
|
|
155
|
+
provideKmsAuthentication?: (options: {
|
|
156
|
+
spaceReady: Promise<unknown>;
|
|
157
|
+
}) => Promise<KmsAuthenticationBinding | undefined>;
|
|
141
158
|
expectedDid?: string;
|
|
142
159
|
accountLogPinStore?: ResourceLogPinStore;
|
|
143
160
|
onDidPublished?: (published: {
|
|
@@ -145,5 +162,8 @@ export declare function ensureCredentialAnchoredAccountGenesis({ was, wasServerU
|
|
|
145
162
|
}) => Promise<void>;
|
|
146
163
|
promoteController?: boolean;
|
|
147
164
|
onStage?: StageNotifier;
|
|
148
|
-
}): Promise<AccountGenesisResult
|
|
165
|
+
}): Promise<AccountGenesisResult & {
|
|
166
|
+
published: PublishedWebvhLog;
|
|
167
|
+
logMinted: boolean;
|
|
168
|
+
}>;
|
|
149
169
|
//# sourceMappingURL=credentialAnchoredGenesis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentialAnchoredGenesis.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAIxE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"credentialAnchoredGenesis.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAIxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAGL,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM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,CAAC,CAAA;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB,GAAG,OAAO,CACT,oBAAoB,GAAG;IAAE,SAAS,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAC5E,CAwJA"}
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
* resolution of the orphan-Space tear): re-derivable from the unlock
|
|
13
13
|
* record's ladder seed, so a tab death here strands nothing a later
|
|
14
14
|
* login cannot finish or unwind.
|
|
15
|
-
* 2. The optional KMS
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Best-effort: a throw is collected and the genesis proceeds
|
|
20
|
-
* keystore-less
|
|
21
|
-
* key.
|
|
15
|
+
* 2. The optional KMS authentication binding (`provideKmsAuthentication`),
|
|
16
|
+
* started BEFORE stage 1 is awaited and joined before stage 3 -- the
|
|
17
|
+
* keystore and the key mint need no Space, so only the thunk's own
|
|
18
|
+
* `keys.json` write waits on the `spaceReady` promise this ceremony hands
|
|
19
|
+
* it. Best-effort: a throw is collected and the genesis proceeds
|
|
20
|
+
* keystore-less, publishing a document with no `authentication` relation,
|
|
21
|
+
* which no later entry adds the key to.
|
|
22
22
|
* 3. The ladder-anchored did:webvh genesis
|
|
23
23
|
* (`ensureLadderAnchoredDidWebvh`): the entry signed by ladder rung 0,
|
|
24
24
|
* `updateKeys` = [rung 0], `nextKeyHashes` = [hash(rung 0), hash(rung 1)],
|
|
@@ -59,6 +59,7 @@ import { ensureLadderAnchoredDidWebvh } from './ladderAnchored.js';
|
|
|
59
59
|
import { ensureWalletSpaceEpochs, mintUserKey } from '../keys/index.js';
|
|
60
60
|
import { AccountGenesisSpaceError, ensurePromotedSpaceController, mintSpaceId } from '../genesis/accountGenesis.js';
|
|
61
61
|
import { stageNotifier } from '../log.js';
|
|
62
|
+
import { CONTROLLER_PROMOTION_STAGE } from './stages.js';
|
|
62
63
|
/**
|
|
63
64
|
* The key set a credential-anchored signup mints locally before anything
|
|
64
65
|
* touches the network: the data Space id and the account's user key -- nothing else.
|
|
@@ -94,17 +95,26 @@ export async function mintCredentialAnchoredAccountKeySet() {
|
|
|
94
95
|
* roster and recipient zero of every encrypted collection
|
|
95
96
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
96
97
|
* store, signing as the same bootstrap did:key
|
|
97
|
-
* @param options.rosterStoreFor {Function} `({ did }) =>
|
|
98
|
+
* @param options.rosterStoreFor {Function} `({ did, log }) =>
|
|
98
99
|
* EncryptionDescriptorStore` -- the user-key roster's store once the DID is
|
|
99
|
-
* known, with a LADDER-signed `ResourceLogSigner` (the first-entry shape)
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
100
|
+
* known, with a LADDER-signed `ResourceLogSigner` (the first-entry shape).
|
|
101
|
+
* `log` is the account log the did:webvh stage just adopted or published,
|
|
102
|
+
* so a store resolving its controller view can read it out of this run's
|
|
103
|
+
* own head instead of fetching `did.jsonl` again
|
|
104
|
+
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
105
|
+
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
106
|
+
* binding's acquisition (a wallet that keeps a KMS mints the key under the
|
|
107
|
+
* ladder VM's bare did:key and writes `keys.json` here); absent or
|
|
108
|
+
* resolving `undefined`, the genesis is ladder-and-credential-only and no
|
|
109
|
+
* `keys.json` is ever written. It is STARTED before the Space is awaited
|
|
110
|
+
* and joined before the genesis entry, so its `spaceReady` argument is what
|
|
111
|
+
* its own `keys.json` write waits on. A throw is collected, not fatal: the
|
|
112
|
+
* genesis proceeds keystore-less, and the document it publishes never gains
|
|
113
|
+
* the key. The thunk's own obligation, since this ceremony takes
|
|
114
|
+
* `authentication.vmId` VERBATIM into the world-readable genesis entry: a
|
|
115
|
+
* served `keys.json` may be adopted only after the multibase in its `vmId`
|
|
116
|
+
* is checked against the session's own keystore listing; on a mismatch, or
|
|
117
|
+
* when the keystore cannot be listed, the thunk mints instead of adopting
|
|
108
118
|
* @param [options.expectedDid] {string} the account DID, when the caller
|
|
109
119
|
* holds a pointer that already names one (a heal re-run); a fresh signup
|
|
110
120
|
* and a fresh-terminal heal legitimately hold none
|
|
@@ -116,49 +126,89 @@ export async function mintCredentialAnchoredAccountKeySet() {
|
|
|
116
126
|
* account pointer must durably name the DID first (freewallet's record
|
|
117
127
|
* re-bind) passes `false` and promotes after that write
|
|
118
128
|
* @param [options.onStage] {StageNotifier} observational: called as each
|
|
119
|
-
* stage finishes, with
|
|
120
|
-
* `
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
129
|
+
* stage finishes, with the names in `CREDENTIAL_ANCHORED_GENESIS_STAGES`
|
|
130
|
+
* (`clientAnnex/stages.ts`) and, only when this ceremony promotes,
|
|
131
|
+
* `CONTROLLER_PROMOTION_STAGE`. `kms-authentication` fires at the JOIN
|
|
132
|
+
* rather than inside the thunk: stage 2 overlaps stage 1, so a thunk that
|
|
133
|
+
* finishes first would otherwise mark out of order
|
|
134
|
+
* @returns {Promise<AccountGenesisResult>} with `published` and
|
|
135
|
+
* `logMinted` always set: the account log's verified head the did:webvh
|
|
136
|
+
* stage adopted or minted, and which of the two it was -- the head is only
|
|
137
|
+
* safely reusable downstream when this run minted it
|
|
124
138
|
*/
|
|
125
|
-
export async function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl, spaceId, ladderSeed, keyAgreement, standingRecipient, userKey, idStore, rosterStoreFor,
|
|
139
|
+
export async function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl, spaceId, ladderSeed, keyAgreement, standingRecipient, userKey, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, accountLogPinStore, onDidPublished, promoteController = true, onStage }) {
|
|
126
140
|
const failed = [];
|
|
127
141
|
const stage = stageNotifier(onStage);
|
|
128
142
|
const bootstrap = await ladderVmAgent({ ladderSeed });
|
|
129
143
|
// 1. The Space and its collection roster, create-if-absent under the
|
|
130
|
-
// ladder VM's bare did:key.
|
|
131
|
-
//
|
|
144
|
+
// ladder VM's bare did:key. Started here and awaited below, so stage 2 --
|
|
145
|
+
// which needs no Space until its own write -- runs alongside it. The typed
|
|
146
|
+
// refusal, exactly as on the enrolled-client flow: nothing downstream can
|
|
147
|
+
// proceed without a Space.
|
|
148
|
+
const spaceReady = provisionWalletSpace({
|
|
149
|
+
was,
|
|
150
|
+
spaceId,
|
|
151
|
+
controllerDid: bootstrap.id
|
|
152
|
+
});
|
|
153
|
+
// 2. The optional KMS authentication binding, started before the Space is
|
|
154
|
+
// awaited: the keystore and the key mint touch no Space, and the thunk
|
|
155
|
+
// orders its own `keys.json` write behind `spaceReady`. A throw degrades to
|
|
156
|
+
// the ladder-and-credential-only genesis rather than aborting: every later
|
|
157
|
+
// ceremony anchors in the ladder, and the document simply publishes no
|
|
158
|
+
// `authentication` relation.
|
|
159
|
+
// Started inside the same guard the join uses, so a thunk that throws
|
|
160
|
+
// synchronously is collected like one that rejects.
|
|
161
|
+
let kmsRun;
|
|
162
|
+
// The flag rather than the value decides whether the stage is reported, so
|
|
163
|
+
// a thunk rejecting with `undefined` is still a collected failure.
|
|
164
|
+
let kmsFailed = false;
|
|
165
|
+
let kmsFailure;
|
|
132
166
|
try {
|
|
133
|
-
|
|
167
|
+
kmsRun = provideKmsAuthentication?.({ spaceReady });
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
kmsFailed = true;
|
|
171
|
+
kmsFailure = err;
|
|
172
|
+
}
|
|
173
|
+
// A Space that never came up returns below while the thunk is still in
|
|
174
|
+
// flight, so its rejection is claimed here rather than surfacing as an
|
|
175
|
+
// unhandled one.
|
|
176
|
+
kmsRun?.catch(() => { });
|
|
177
|
+
try {
|
|
178
|
+
await spaceReady;
|
|
134
179
|
}
|
|
135
180
|
catch (err) {
|
|
136
181
|
throw new AccountGenesisSpaceError({ spaceId, cause: err });
|
|
137
182
|
}
|
|
138
183
|
stage('space-provisioning');
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// every later ceremony anchors in the ladder, and a later login heals the
|
|
144
|
-
// document with the convenience key.
|
|
145
|
-
let didWebKeys;
|
|
146
|
-
if (provideDidWebKeys) {
|
|
184
|
+
// The join: the genesis entry carries the KMS binding, so it waits on the
|
|
185
|
+
// whole stage even though the Space no longer does.
|
|
186
|
+
let kmsAuthentication;
|
|
187
|
+
if (kmsRun) {
|
|
147
188
|
try {
|
|
148
|
-
|
|
189
|
+
kmsAuthentication = await kmsRun;
|
|
149
190
|
}
|
|
150
191
|
catch (err) {
|
|
151
|
-
|
|
192
|
+
kmsFailed = true;
|
|
193
|
+
kmsFailure = err;
|
|
152
194
|
}
|
|
153
195
|
}
|
|
196
|
+
if (kmsFailed) {
|
|
197
|
+
failed.push({ stage: 'kmsAuthentication', error: kmsFailure });
|
|
198
|
+
}
|
|
199
|
+
stage('kms-authentication');
|
|
200
|
+
const didWebKeys = kmsAuthentication?.keys;
|
|
154
201
|
// 3. The ladder-anchored did:webvh genesis -- probe, adopt
|
|
155
202
|
// (ladder-attributed), or create-and-publish. Fatal on failure, like the
|
|
156
203
|
// enrolled-client stage.
|
|
157
|
-
const { did } = await ensureLadderAnchoredDidWebvh({
|
|
204
|
+
const { did, published, logMinted } = await ensureLadderAnchoredDidWebvh({
|
|
158
205
|
idStore,
|
|
159
206
|
wasServerUrl,
|
|
160
207
|
spaceId,
|
|
161
208
|
...(didWebKeys ? { didWebKeys } : {}),
|
|
209
|
+
...(kmsAuthentication?.etag !== undefined && {
|
|
210
|
+
keysJsonEtag: kmsAuthentication.etag
|
|
211
|
+
}),
|
|
162
212
|
ladderSeed,
|
|
163
213
|
keyAgreement,
|
|
164
214
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
@@ -171,7 +221,7 @@ export async function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl
|
|
|
171
221
|
// genesis append is the ceremony-tail license's first-entry shape.
|
|
172
222
|
let rosterDescriptor;
|
|
173
223
|
try {
|
|
174
|
-
const store = rosterStoreFor({ did });
|
|
224
|
+
const store = rosterStoreFor({ did, log: published.log });
|
|
175
225
|
const current = await store.read();
|
|
176
226
|
rosterDescriptor =
|
|
177
227
|
current !== null
|
|
@@ -224,10 +274,12 @@ export async function ensureCredentialAnchoredAccountGenesis({ was, wasServerUrl
|
|
|
224
274
|
catch (err) {
|
|
225
275
|
failed.push({ stage: 'promotion', error: err });
|
|
226
276
|
}
|
|
227
|
-
stage(
|
|
277
|
+
stage(CONTROLLER_PROMOTION_STAGE);
|
|
228
278
|
}
|
|
229
279
|
return {
|
|
230
280
|
did,
|
|
281
|
+
published,
|
|
282
|
+
logMinted,
|
|
231
283
|
...(rosterDescriptor ? { rosterDescriptor } : {}),
|
|
232
284
|
...(epochs ? { epochs } : {}),
|
|
233
285
|
...(epochsSkipped ? { epochsSkipped } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentialAnchoredGenesis.js","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EACL,cAAc,EAEf,MAAM,yBAAyB,CAAA;AAIhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"credentialAnchoredGenesis.js","sourceRoot":"","sources":["../../src/clientAnnex/credentialAnchoredGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EACL,cAAc,EAEf,MA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,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QACjD,CAAC;QACD,KAAK,CAAC,0BAA0B,CAAC,CAAA;IACnC,CAAC;IAED,OAAO;QACL,GAAG;QACH,SAAS;QACT,SAAS;QACT,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM;KACP,CAAA;AACH,CAAC"}
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
* moments before dying on the promoted Space, a permanent lockout.
|
|
27
27
|
* 2. `ensureCredentialAnchoredAccountGenesis` under the ladder VM's bare
|
|
28
28
|
* did:key as bootstrap controller, promotion deferred
|
|
29
|
-
* (`promoteController: false`): Space + collections, the optional KMS
|
|
30
|
-
*
|
|
29
|
+
* (`promoteController: false`): Space + collections, the optional KMS
|
|
30
|
+
* authentication binding (`provideKmsAuthentication`, an opaque
|
|
31
|
+
* best-effort thunk the caller owns, started alongside the Space),
|
|
31
32
|
* the one-entry ladder-anchored did:webvh genesis with the credential's
|
|
32
33
|
* `keyAgreement` publication folded in, the roster's epoch[0] wrapped to
|
|
33
34
|
* the credential's standing key-agreement key with a ladder-signed entry
|
|
@@ -86,13 +87,14 @@
|
|
|
86
87
|
* bare did:key -- outside the current-key-set rule -- with no mender here;
|
|
87
88
|
* an open gap owned by the did:web-stage collapse.
|
|
88
89
|
*/
|
|
90
|
+
import type { DIDLog } from '@interop/did-method-webvh';
|
|
89
91
|
import type { IKeyAgreementKey, IZcap } from '@interop/data-integrity-core';
|
|
90
92
|
import type { WasClient } from '@interop/was-client';
|
|
91
93
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
92
94
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
93
95
|
import type { ZcapClient } from '@interop/ezcap';
|
|
94
96
|
import { type AccountGenesisResult } from '../genesis/accountGenesis.js';
|
|
95
|
-
import type { ClientWebvhUpdateKeys,
|
|
97
|
+
import type { ClientWebvhUpdateKeys, KmsAuthenticationBinding, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
|
|
96
98
|
import type { ICapabilityAgent } from '../webvh/zcap.js';
|
|
97
99
|
import type { AccountPointer } from '../keyring/record.js';
|
|
98
100
|
import { type UserKey } from '../keys/index.js';
|
|
@@ -122,16 +124,25 @@ export interface CredentialAnchoredStandingFields {
|
|
|
122
124
|
* DID, the record's unlock Space id and management zcap, the standing fields
|
|
123
125
|
* a registry entry records, and the report members -- the genesis's
|
|
124
126
|
* `epochsSkipped` marker and the best-effort stages' collected failures
|
|
125
|
-
* (`
|
|
127
|
+
* (`kmsAuthentication`, `keystorePromotion`).
|
|
126
128
|
*/
|
|
127
129
|
export interface CredentialAnchoredEstablishment {
|
|
128
130
|
did: string;
|
|
131
|
+
/**
|
|
132
|
+
* The account log's verified head this run ends standing on -- the pointer
|
|
133
|
+
* entry's own post-publish head when stage 3 wrote one, otherwise the head
|
|
134
|
+
* stage 3 stood on. The caller enters the account straight after this
|
|
135
|
+
* returns, so it seeds its session's verified-log memo from here rather
|
|
136
|
+
* than fetching `did.jsonl` again (`verifiedAccountLogOf`); reuse is within
|
|
137
|
+
* this one run alone.
|
|
138
|
+
*/
|
|
139
|
+
accountLog: PublishedWebvhLog;
|
|
129
140
|
unlockSpaceId: string;
|
|
130
141
|
manageCapability?: IZcap;
|
|
131
142
|
standingFields: CredentialAnchoredStandingFields;
|
|
132
143
|
epochsSkipped?: AccountGenesisResult['epochsSkipped'];
|
|
133
144
|
failed: Array<{
|
|
134
|
-
stage: '
|
|
145
|
+
stage: 'kmsAuthentication' | 'keystorePromotion';
|
|
135
146
|
error: unknown;
|
|
136
147
|
}>;
|
|
137
148
|
}
|
|
@@ -230,11 +241,19 @@ export type CredentialAnchoredBindRecordHook = (options: {
|
|
|
230
241
|
* establishment's root window omits it
|
|
231
242
|
* @param [options.pinStore] {ResourceLogPinStore} chain-head pins; slot
|
|
232
243
|
* keys are derived here per log
|
|
244
|
+
* @param [options.published] {PublishedWebvhLog} the same account head as
|
|
245
|
+
* `account`, complete with the ETag its read carried, when the caller holds
|
|
246
|
+
* one. The pointer entry's first attempt then builds on it -- one saved
|
|
247
|
+
* read of the log the caller just read or published -- and a lost
|
|
248
|
+
* compare-and-swap falls through to a fresh pinned read
|
|
233
249
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
234
250
|
* @returns {Promise<object>} the pointed (or freshly minted) annex DID,
|
|
235
|
-
* the generation delegation when one was installed here,
|
|
251
|
+
* the generation delegation when one was installed here, what ran, and --
|
|
252
|
+
* on `accountLog` -- the account head this block leaves standing: the
|
|
253
|
+
* post-pointer-entry one when it wrote, the supplied `published` verbatim
|
|
254
|
+
* when the document already pointed at a generation
|
|
236
255
|
*/
|
|
237
|
-
export declare function ensurePointedClientAnnexGeneration({ account, wasServerUrl, accountSpaceId, ladderSeed, was, mintController, mintGenerationDelegation, idStore, updateKeys, delegatedClients, invocation, logOnly, pinStore, now }: {
|
|
256
|
+
export declare function ensurePointedClientAnnexGeneration({ account, wasServerUrl, accountSpaceId, ladderSeed, was, mintController, mintGenerationDelegation, idStore, updateKeys, delegatedClients, invocation, logOnly, pinStore, published, now }: {
|
|
238
257
|
account: Pick<PublishedWebvhLog, 'did' | 'doc' | 'log'>;
|
|
239
258
|
wasServerUrl: string;
|
|
240
259
|
accountSpaceId: string;
|
|
@@ -253,12 +272,14 @@ export declare function ensurePointedClientAnnexGeneration({ account, wasServerU
|
|
|
253
272
|
};
|
|
254
273
|
logOnly?: boolean;
|
|
255
274
|
pinStore?: ResourceLogPinStore;
|
|
275
|
+
published?: PublishedWebvhLog;
|
|
256
276
|
now?: number;
|
|
257
277
|
}): Promise<{
|
|
258
278
|
clientAnnexDid: string;
|
|
259
279
|
generationDelegation?: IZcap;
|
|
260
280
|
generationMinted: boolean;
|
|
261
281
|
spaceMinted: boolean;
|
|
282
|
+
accountLog?: PublishedWebvhLog;
|
|
262
283
|
}>;
|
|
263
284
|
/**
|
|
264
285
|
* Runs the whole credential-anchored establishment for one unlock credential
|
|
@@ -279,10 +300,12 @@ export declare function ensurePointedClientAnnexGeneration({ account, wasServerU
|
|
|
279
300
|
* @param options.bindRecord {CredentialAnchoredBindRecordHook} REQUIRED:
|
|
280
301
|
* the unlock-record codec closure (see its type doc for the hook's
|
|
281
302
|
* standing-layout and freshness-floor obligations)
|
|
282
|
-
* @param options.rosterStoreFor {Function} REQUIRED: `({ did }) =>
|
|
303
|
+
* @param options.rosterStoreFor {Function} REQUIRED: `({ did, log }) =>
|
|
283
304
|
* EncryptionDescriptorStore` -- the user-key roster's store, with a
|
|
284
305
|
* LADDER-signed log signer (the ceremony-tail license's first-entry
|
|
285
|
-
* shape), invoked as the bootstrap did:key
|
|
306
|
+
* shape), invoked as the bootstrap did:key. `log` is the account log this
|
|
307
|
+
* run adopted or published, so a store resolving its controller view reads
|
|
308
|
+
* it out of this run's own head instead of fetching `did.jsonl` again
|
|
286
309
|
* @param options.bootstrapWasFor {Function} REQUIRED:
|
|
287
310
|
* `({ keyAgent }) => WasClient` -- the storage client wiring, signing as
|
|
288
311
|
* the ladder VM's bare did:key (the agent is derived here from the seed)
|
|
@@ -308,10 +331,15 @@ export declare function ensurePointedClientAnnexGeneration({ account, wasServerU
|
|
|
308
331
|
* delegation, when the caller holds one -- threaded into stage 3's Space
|
|
309
332
|
* resolution; under this ceremony's bootstrap-only authority a
|
|
310
333
|
* sibling-named Space it can no longer write falls back to a fresh mint
|
|
311
|
-
* @param [options.
|
|
312
|
-
* Promise<
|
|
313
|
-
* KMS
|
|
314
|
-
*
|
|
334
|
+
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
335
|
+
* Promise<KmsAuthenticationBinding | undefined>` -- the caller's opaque
|
|
336
|
+
* best-effort KMS thunk, started in stage 2 alongside the Space
|
|
337
|
+
* provisioning it reports through `spaceReady` (the caller owns its body
|
|
338
|
+
* and its timeout); a throw is the collected non-fatal `kmsAuthentication`
|
|
339
|
+
* failure. The thunk's obligation, since the genesis takes
|
|
340
|
+
* `authentication.vmId` verbatim into the world-readable entry: it adopts a
|
|
341
|
+
* served `keys.json` only after checking that `vmId`'s multibase against
|
|
342
|
+
* its own keystore listing, and mints otherwise
|
|
315
343
|
* @param [options.promoteKeystore] {Function} `({ did }) => Promise<void>`
|
|
316
344
|
* -- the best-effort keystore-controller promotion, called after the
|
|
317
345
|
* Space's own promotion; the caller's closure no-ops when its KMS stage
|
|
@@ -326,15 +354,16 @@ export declare function ensurePointedClientAnnexGeneration({ account, wasServerU
|
|
|
326
354
|
* client-local one when a remembered caller seeds its own pin)
|
|
327
355
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
328
356
|
* @param [options.onStage] {StageNotifier} observational: called as each
|
|
329
|
-
* stage finishes, so a caller can time them
|
|
330
|
-
* `
|
|
331
|
-
* `
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* `
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
357
|
+
* stage finishes, so a caller can time them, in the order of
|
|
358
|
+
* `CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES` (`clientAnnex/stages.ts`).
|
|
359
|
+
* `interim-bind` is skipped with `priorCreatedAt`; `account-log-read` is
|
|
360
|
+
* kept as the stage-3 preamble's name, its span near-zero whenever the
|
|
361
|
+
* genesis's own head is reused instead of read; and the adopted-roster arm
|
|
362
|
+
* reports `roster-delivered-epochs` in place of `collection-epochs` (see
|
|
363
|
+
* `CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES` beside it). The two
|
|
364
|
+
* stages whose body is the caller's own closure -- `beforePromotion` and
|
|
365
|
+
* `promoteKeystore` -- are left for the caller to mark inside them, since
|
|
366
|
+
* only the caller can name what its closure does
|
|
338
367
|
* @returns {Promise<CredentialAnchoredEstablishment>}
|
|
339
368
|
* @throws {TypeError} synchronously, when a required hook is missing
|
|
340
369
|
* @throws {Error} when the genesis's roster or epoch stage did not land
|
|
@@ -354,6 +383,7 @@ export declare function establishCredentialAnchoredAccount(options: {
|
|
|
354
383
|
bindRecord: CredentialAnchoredBindRecordHook;
|
|
355
384
|
rosterStoreFor: (options: {
|
|
356
385
|
did: string;
|
|
386
|
+
log: DIDLog;
|
|
357
387
|
}) => EncryptionDescriptorStore;
|
|
358
388
|
bootstrapWasFor: (options: {
|
|
359
389
|
keyAgent: ICapabilityAgent;
|
|
@@ -363,7 +393,9 @@ export declare function establishCredentialAnchoredAccount(options: {
|
|
|
363
393
|
lowEntropy: boolean;
|
|
364
394
|
priorCreatedAt?: string;
|
|
365
395
|
delegatedClients?: IZcap;
|
|
366
|
-
|
|
396
|
+
provideKmsAuthentication?: (options: {
|
|
397
|
+
spaceReady: Promise<unknown>;
|
|
398
|
+
}) => Promise<KmsAuthenticationBinding | undefined>;
|
|
367
399
|
promoteKeystore?: (options: {
|
|
368
400
|
did: string;
|
|
369
401
|
}) => Promise<void>;
|
|
@@ -378,17 +410,6 @@ export declare function establishCredentialAnchoredAccount(options: {
|
|
|
378
410
|
now?: number;
|
|
379
411
|
onStage?: StageNotifier;
|
|
380
412
|
}): Promise<CredentialAnchoredEstablishment>;
|
|
381
|
-
/**
|
|
382
|
-
* The current `updateKeys` / `nextKeyHashes` view of a published log, for
|
|
383
|
-
* the bind-time rung attribution.
|
|
384
|
-
*
|
|
385
|
-
* @param published {PublishedWebvhLog}
|
|
386
|
-
* @returns {object}
|
|
387
|
-
*/
|
|
388
|
-
export declare function currentLogParameters(published: Pick<PublishedWebvhLog, 'log'>): {
|
|
389
|
-
updateKeys: string[];
|
|
390
|
-
nextKeyHashes: string[];
|
|
391
|
-
};
|
|
392
413
|
/**
|
|
393
414
|
* A delegation's `expires` caveat, when it carries one.
|
|
394
415
|
*
|