@interop/wallet-core 0.61.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 +126 -35
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +208 -60
- 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 +101 -33
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +559 -212
- 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 +304 -18
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +942 -64
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +261 -28
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +521 -295
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +193 -38
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +445 -190
- 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 +38 -11
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +177 -55
- 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 +24 -8
- 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 +89 -9
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +262 -19
- 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 +4 -1
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +25 -36
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +117 -65
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +279 -126
- 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 +6 -2
- 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 +95 -14
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +102 -10
- 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 +341 -49
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +608 -164
- 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 +278 -138
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +314 -345
- 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 -33
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -28
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +89 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +182 -47
- 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 +5 -5
- package/dist/webvh/keyAgreement.d.ts +0 -72
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -47
- package/dist/webvh/keyAgreement.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { decodeMultikey, MultikeyCodec } from '@interop/data-integrity-core/multihash';
|
|
2
2
|
import { base64urlnopad } from '@scure/base';
|
|
3
3
|
import { agentsFromSeed } from '../identity/agents.js';
|
|
4
|
-
import {
|
|
4
|
+
import { keyAgreementTwinMultibase, mintClientWebvhUpdateKeys, updateKeyMultibase } from '../webvh/didWebvh.js';
|
|
5
|
+
import { enrollWebvhClient } from '../webvh/enrollClient.js';
|
|
5
6
|
import { clientSigningKeyMultibase, isWebvhDid, webvhZcapClient } from '../webvh/zcap.js';
|
|
6
7
|
import { AccountLogMissingError, verifyAccountLog } from '../webvh/verifyLog.js';
|
|
7
8
|
import { addUserKeyRosterRecipient } from '../keys/userKeyRoster.js';
|
|
8
9
|
import { readUserKeyRoster, rosterRecipientKid, userKeyRosterLogSigner } from '../keys/userKeyRoster.js';
|
|
9
10
|
import { userKeyRosterDescriptorStore } from '../keys/rosterStore.js';
|
|
11
|
+
import { isSealableDescriptorStore } from '../keys/rosterLogStore.js';
|
|
10
12
|
import { memoryResourceLogPinStore } from '@interop/vh-resource-log';
|
|
11
13
|
import { webvhResourceLogController } from '../resourceLog/index.js';
|
|
12
14
|
import { CONNECT_CODE_PREFIX } from './connectCode.js';
|
|
@@ -231,21 +233,47 @@ export async function mintEnrollmentRequest() {
|
|
|
231
233
|
};
|
|
232
234
|
}
|
|
233
235
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* client's own update key signs both entries. Idempotent at every stage, so
|
|
236
|
+
* THE APPROVING SIDE: the whole approval -- the user key wrapped into the
|
|
237
|
+
* roster (escrow: every epoch, so the new client reads pre-enrollment
|
|
238
|
+
* history) and the two log entries. Idempotent at every stage, so
|
|
238
239
|
* re-approving the same code after any tear converges. A request whose
|
|
239
240
|
* key-agreement key is not its signing key's canonical twin is refused before
|
|
240
241
|
* anything is written ({@link assertCanonicalEnrollmentKeys}).
|
|
241
242
|
*
|
|
243
|
+
* The escrow is placed by signer kind (`decisions/0018`). A CLIENT signer
|
|
244
|
+
* keeps the push order, the escrow first: an enrolled client's roster append
|
|
245
|
+
* needs no license, so it may precede the entries, and no enrolled client is
|
|
246
|
+
* ever authorized but blind. Quorum-of-one there: any single enrolled
|
|
247
|
+
* client's own update key signs both entries.
|
|
248
|
+
*
|
|
249
|
+
* A LADDER signer runs commit, add, then escrow, because a ladder-signed
|
|
250
|
+
* append is licensed only at an inventory-changing version its own ladder
|
|
251
|
+
* signed, which the add entry is what mints. The one-request window between
|
|
252
|
+
* the add entry and the append is the ladder branch's stated cost: a client
|
|
253
|
+
* the add entry published holds `assertionMethod` and its own update key
|
|
254
|
+
* while holding no wrap. It is bounded three ways -- one request wide on the
|
|
255
|
+
* happy path, mended by a re-run with the same connect code and by the
|
|
256
|
+
* escrow-direction convergence of any later ladder-branch ceremony (the
|
|
257
|
+
* document carries the client's key verbatim), and visible as a row in the
|
|
258
|
+
* connected-wallets listing, where a disconnect removes it.
|
|
259
|
+
*
|
|
260
|
+
* On that branch the escrow must ANCHOR at the add entry's version, and the
|
|
261
|
+
* ceremony does not leave that to the roster store's own controller wiring:
|
|
262
|
+
* a store resolving its controller view through a document cached before
|
|
263
|
+
* the entries (an app's session-verified log) would anchor the append at the
|
|
264
|
+
* pre-add head, and the license would refuse it after the ceremony's pivot.
|
|
265
|
+
* So, on a sealable roster store, the view built from the add entry's own
|
|
266
|
+
* post-add log is set as the store's minimum controller version before the
|
|
267
|
+
* escrow runs -- the same guarantee `revokeAccountClient` gives its rotation
|
|
268
|
+
* from its post-edit log. A fresher resolved view still wins.
|
|
269
|
+
*
|
|
242
270
|
* @param options {object}
|
|
243
271
|
* @param options.request {EnrollmentRequest} the parsed connect code
|
|
244
|
-
* @param options.
|
|
245
|
-
* client's own did:webvh update-key seeds
|
|
272
|
+
* @param options.signer {AccountLogSigner} who signs the two entries: the
|
|
273
|
+
* approving client's own did:webvh update-key seeds, or the acting
|
|
274
|
+
* credential's ladder seed
|
|
246
275
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} the approving
|
|
247
|
-
*
|
|
248
|
-
* re-wrapping
|
|
276
|
+
* party's own key-agreement key, unwrapping each epoch for re-wrapping
|
|
249
277
|
* @param options.userKeyRosterStore {EncryptionDescriptorStore} the account's
|
|
250
278
|
* `key-map/user-key.jsonl` descriptor store
|
|
251
279
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
@@ -254,14 +282,12 @@ export async function mintEnrollmentRequest() {
|
|
|
254
282
|
* multibase (the key a label or a listing row is filed under), so the caller
|
|
255
283
|
* needs no second parse of the connect code
|
|
256
284
|
*/
|
|
257
|
-
export async function approveEnrollment({ request,
|
|
285
|
+
export async function approveEnrollment({ request, signer, clientKeyAgreementKey, userKeyRosterStore, idStore }) {
|
|
258
286
|
// Re-checked here rather than trusted from the parse: this is the one seam
|
|
259
287
|
// every approval path runs through, and it is what publishes the key under
|
|
260
288
|
// the controller marker.
|
|
261
289
|
assertCanonicalEnrollmentKeys({ request });
|
|
262
|
-
|
|
263
|
-
// enrolled client is ever authorized but blind.
|
|
264
|
-
await addUserKeyRosterRecipient({
|
|
290
|
+
const escrow = async () => addUserKeyRosterRecipient({
|
|
265
291
|
store: userKeyRosterStore,
|
|
266
292
|
recipient: {
|
|
267
293
|
id: enrollmentRecipientKid({ request }),
|
|
@@ -269,11 +295,22 @@ export async function approveEnrollment({ request, clientWebvhKeys, clientKeyAgr
|
|
|
269
295
|
},
|
|
270
296
|
ownerKeyAgreementKey: clientKeyAgreementKey
|
|
271
297
|
});
|
|
272
|
-
|
|
298
|
+
if (signer.kind === 'client') {
|
|
299
|
+
await escrow();
|
|
300
|
+
}
|
|
301
|
+
const { did, log } = await enrollWebvhClient({
|
|
273
302
|
idStore,
|
|
274
|
-
|
|
303
|
+
signer,
|
|
275
304
|
newClient: request
|
|
276
305
|
});
|
|
306
|
+
if (signer.kind === 'ladder') {
|
|
307
|
+
if (isSealableDescriptorStore(userKeyRosterStore)) {
|
|
308
|
+
userKeyRosterStore.setMinimumControllerVersion({
|
|
309
|
+
controller: webvhResourceLogController({ did, log })
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
await escrow();
|
|
313
|
+
}
|
|
277
314
|
return {
|
|
278
315
|
did,
|
|
279
316
|
clientDid: enrollmentClientDid({ request }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":[],"mappings":"AA+BA,OAAO,EACL,cAAc,EACd,aAAa,EACd,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":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AA;IACF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC;QACnC,KAAK;QACL,qBAAqB,EAAE,eAAe;KACvC,CAAC,CAAA;IACF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,yEAAyE;YACvE,2BAA2B,CAC9B,CAAA;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAA;AACrE,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { CollectionEncryption, WasClient } from '@interop/was-client';
|
|
2
2
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
3
3
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
4
|
-
import { type ClientWebvhUpdateKeys, type
|
|
4
|
+
import { type ClientWebvhUpdateKeys, type ICapabilityAgent, type KmsAuthenticationBinding, type PublishedWebvhLog, type WebvhIdStore } from '../webvh/index.js';
|
|
5
5
|
import { type UserKey, type WalletSpaceEpochsResult } from '../keys/index.js';
|
|
6
6
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
7
|
+
import { type StageNotifier } from '../log.js';
|
|
7
8
|
/**
|
|
8
9
|
* The complete key set a brand-new account mints locally before anything
|
|
9
10
|
* touches the network: the data Space id, this founding client's identity
|
|
@@ -102,7 +103,7 @@ export declare class AccountGenesisSpaceError extends Error {
|
|
|
102
103
|
* The stages whose failures the ceremony collects instead of throwing (see
|
|
103
104
|
* the module doc for the split).
|
|
104
105
|
*/
|
|
105
|
-
export type AccountGenesisStage = '
|
|
106
|
+
export type AccountGenesisStage = 'kmsAuthentication' | 'roster' | 'epochs' | 'promotion';
|
|
106
107
|
/**
|
|
107
108
|
* What a completed ceremony reports: the account DID, each collected stage's
|
|
108
109
|
* outcome where it ran (the roster descriptor, the per-collection epoch
|
|
@@ -113,6 +114,23 @@ export type AccountGenesisStage = 'didWebKeys' | 'roster' | 'epochs' | 'promotio
|
|
|
113
114
|
*/
|
|
114
115
|
export interface AccountGenesisResult {
|
|
115
116
|
did: string;
|
|
117
|
+
/**
|
|
118
|
+
* The account log's verified head as the did:webvh stage left it -- the
|
|
119
|
+
* served head it adopted, or the one it minted paired with its create PUT's
|
|
120
|
+
* ETag -- for the stage after the ceremony to build on rather than re-read.
|
|
121
|
+
* Set by the credential-anchored ceremony alone; the plain genesis's
|
|
122
|
+
* did:webvh stage hands no head back.
|
|
123
|
+
*/
|
|
124
|
+
published?: PublishedWebvhLog;
|
|
125
|
+
/**
|
|
126
|
+
* Whether the did:webvh stage MINTED that head (a fresh signup) rather than
|
|
127
|
+
* adopting a served one (a heal re-run). A later stage may reuse a minted
|
|
128
|
+
* head freely -- the account did not exist a moment ago, so no other writer
|
|
129
|
+
* holds it -- but an adopted head is only a snapshot: its document's
|
|
130
|
+
* completion tests are unprotected by any ETag and another client may have
|
|
131
|
+
* moved past them by the time a later stage reads them.
|
|
132
|
+
*/
|
|
133
|
+
logMinted?: boolean;
|
|
116
134
|
rosterDescriptor?: CollectionEncryption;
|
|
117
135
|
epochs?: WalletSpaceEpochsResult;
|
|
118
136
|
/**
|
|
@@ -170,13 +188,19 @@ export interface AccountGenesisResult {
|
|
|
170
188
|
* EncryptionDescriptorStore` -- builds the user-key roster's descriptor
|
|
171
189
|
* store once the account DID is known (the log-governed store's controller
|
|
172
190
|
* view and chain-head pin are the app's wiring)
|
|
173
|
-
* @param [options.
|
|
174
|
-
* Promise<
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
191
|
+
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
192
|
+
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
193
|
+
* binding's acquisition; absent or resolving `undefined`, the genesis is
|
|
194
|
+
* client-keys-only and no `keys.json` is ever written. It is started before
|
|
195
|
+
* the Space is awaited and joined before the genesis entry, so its
|
|
196
|
+
* `spaceReady` argument is what its own `keys.json` write waits on. A throw
|
|
197
|
+
* is collected, not fatal: the genesis proceeds client-keys-only, and the
|
|
198
|
+
* document it publishes never gains the key. The thunk's own obligation,
|
|
199
|
+
* since this ceremony takes `authentication.vmId` VERBATIM into the
|
|
200
|
+
* world-readable genesis entry: a served `keys.json` may be adopted only
|
|
201
|
+
* after the multibase in its `vmId` is checked against the session's own
|
|
202
|
+
* keystore listing; on a mismatch, or when the keystore cannot be listed,
|
|
203
|
+
* the thunk mints instead of adopting
|
|
180
204
|
* @param [options.expectedDid] {string} the account's did:webvh from the
|
|
181
205
|
* caller's stored account pointer, when it already names one; the genesis
|
|
182
206
|
* read then refuses a published log resolving to any other account
|
|
@@ -192,9 +216,13 @@ export interface AccountGenesisResult {
|
|
|
192
216
|
* pointer write lives outside this call (freewallet's keyring re-bind) --
|
|
193
217
|
* passes `false` and runs {@link ensurePromotedSpaceController} itself
|
|
194
218
|
* after that write
|
|
219
|
+
* @param [options.onStage] {StageNotifier} observational: called at the
|
|
220
|
+
* KMS-authentication join, with {@link KMS_AUTHENTICATION_STAGE} -- the one
|
|
221
|
+
* boundary this ceremony names, and the same token the credential-anchored
|
|
222
|
+
* genesis emits at the same point
|
|
195
223
|
* @returns {Promise<AccountGenesisResult>}
|
|
196
224
|
*/
|
|
197
|
-
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor,
|
|
225
|
+
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, accountLogPinStore, onDidPublished, promoteController, onStage }: {
|
|
198
226
|
was: WasClient;
|
|
199
227
|
wasAsClient?: WasClient;
|
|
200
228
|
wasServerUrl: string;
|
|
@@ -207,12 +235,15 @@ export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, s
|
|
|
207
235
|
rosterStoreFor: (options: {
|
|
208
236
|
did: string;
|
|
209
237
|
}) => EncryptionDescriptorStore;
|
|
210
|
-
|
|
238
|
+
provideKmsAuthentication?: (options: {
|
|
239
|
+
spaceReady: Promise<unknown>;
|
|
240
|
+
}) => Promise<KmsAuthenticationBinding | undefined>;
|
|
211
241
|
expectedDid?: string;
|
|
212
242
|
accountLogPinStore?: ResourceLogPinStore;
|
|
213
243
|
onDidPublished?: (published: {
|
|
214
244
|
did: string;
|
|
215
245
|
}) => Promise<void>;
|
|
216
246
|
promoteController?: boolean;
|
|
247
|
+
onStage?: StageNotifier;
|
|
217
248
|
}): Promise<AccountGenesisResult>;
|
|
218
249
|
//# sourceMappingURL=accountGenesis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountGenesis.d.ts","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAGpE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,
|
|
1
|
+
{"version":3,"file":"accountGenesis.d.ts","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAGpE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,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,CAAA;KAC7B,KAAK,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAA;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAuIhC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* collection, and Space-controller promotion.
|
|
11
11
|
*
|
|
12
12
|
* Two callers, one ceremony. A wallet that keeps a KMS (freewallet) supplies
|
|
13
|
-
* `
|
|
13
|
+
* `provideKmsAuthentication` and gets the KMS-backed did:webvh genesis; a wallet
|
|
14
14
|
* with no KMS anywhere in the path (dcw) supplies nothing and gets the
|
|
15
15
|
* client-keys-only genesis. The keyring bind is deliberately NOT a stage:
|
|
16
16
|
* where an app binds an unlock method (and whether it binds one at all)
|
|
@@ -37,6 +37,8 @@ import { base64urlnopad } from '@scure/base';
|
|
|
37
37
|
import { provisionWalletSpace, WALLET_SPACE_NAME } from '../space/index.js';
|
|
38
38
|
import { clientSigningKeyMultibase, ensureDidWebvh, mintClientWebvhUpdateKeys } from '../webvh/index.js';
|
|
39
39
|
import { ensureUserKeyRoster, ensureWalletSpaceEpochs, mintUserKey } from '../keys/index.js';
|
|
40
|
+
import { stageNotifier } from '../log.js';
|
|
41
|
+
import { KMS_AUTHENTICATION_STAGE } from '../stages.js';
|
|
40
42
|
/**
|
|
41
43
|
* The byte length of a freshly minted data-Space id.
|
|
42
44
|
*/
|
|
@@ -106,7 +108,13 @@ export async function ensurePromotedSpaceController({ was, wasAsClient, spaceId,
|
|
|
106
108
|
if (description.controller === did) {
|
|
107
109
|
return 'confirmed';
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
// The read a statement above is the current Description, so it rides as
|
|
112
|
+
// `current` and was-client skips its own pre-merge describe.
|
|
113
|
+
await space.configure({
|
|
114
|
+
current: description,
|
|
115
|
+
name: WALLET_SPACE_NAME,
|
|
116
|
+
controller: did
|
|
117
|
+
});
|
|
110
118
|
return 'promoted';
|
|
111
119
|
}
|
|
112
120
|
if (!wasAsClient) {
|
|
@@ -114,6 +122,9 @@ export async function ensurePromotedSpaceController({ was, wasAsClient, spaceId,
|
|
|
114
122
|
'identity and no did:key-signed client was supplied to heal a torn ' +
|
|
115
123
|
'controller promotion.');
|
|
116
124
|
}
|
|
125
|
+
// No `current` here: the null above came from a read under `was`, a
|
|
126
|
+
// different signing identity than this heal PUT rides, so it is no answer
|
|
127
|
+
// for what `wasAsClient` can see. was-client reads for itself.
|
|
117
128
|
await wasAsClient
|
|
118
129
|
.space(spaceId)
|
|
119
130
|
.configure({ name: WALLET_SPACE_NAME, controller: did });
|
|
@@ -172,13 +183,19 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
172
183
|
* EncryptionDescriptorStore` -- builds the user-key roster's descriptor
|
|
173
184
|
* store once the account DID is known (the log-governed store's controller
|
|
174
185
|
* view and chain-head pin are the app's wiring)
|
|
175
|
-
* @param [options.
|
|
176
|
-
* Promise<
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
186
|
+
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
187
|
+
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
188
|
+
* binding's acquisition; absent or resolving `undefined`, the genesis is
|
|
189
|
+
* client-keys-only and no `keys.json` is ever written. It is started before
|
|
190
|
+
* the Space is awaited and joined before the genesis entry, so its
|
|
191
|
+
* `spaceReady` argument is what its own `keys.json` write waits on. A throw
|
|
192
|
+
* is collected, not fatal: the genesis proceeds client-keys-only, and the
|
|
193
|
+
* document it publishes never gains the key. The thunk's own obligation,
|
|
194
|
+
* since this ceremony takes `authentication.vmId` VERBATIM into the
|
|
195
|
+
* world-readable genesis entry: a served `keys.json` may be adopted only
|
|
196
|
+
* after the multibase in its `vmId` is checked against the session's own
|
|
197
|
+
* keystore listing; on a mismatch, or when the keystore cannot be listed,
|
|
198
|
+
* the thunk mints instead of adopting
|
|
182
199
|
* @param [options.expectedDid] {string} the account's did:webvh from the
|
|
183
200
|
* caller's stored account pointer, when it already names one; the genesis
|
|
184
201
|
* read then refuses a published log resolving to any other account
|
|
@@ -194,34 +211,72 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
194
211
|
* pointer write lives outside this call (freewallet's keyring re-bind) --
|
|
195
212
|
* passes `false` and runs {@link ensurePromotedSpaceController} itself
|
|
196
213
|
* after that write
|
|
214
|
+
* @param [options.onStage] {StageNotifier} observational: called at the
|
|
215
|
+
* KMS-authentication join, with {@link KMS_AUTHENTICATION_STAGE} -- the one
|
|
216
|
+
* boundary this ceremony names, and the same token the credential-anchored
|
|
217
|
+
* genesis emits at the same point
|
|
197
218
|
* @returns {Promise<AccountGenesisResult>}
|
|
198
219
|
*/
|
|
199
|
-
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor,
|
|
220
|
+
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, accountLogPinStore, onDidPublished, promoteController = true, onStage }) {
|
|
200
221
|
const failed = [];
|
|
222
|
+
const stage = stageNotifier(onStage);
|
|
201
223
|
// 1. The Space and its collection roster, create-if-absent under this
|
|
202
224
|
// founding client's did:key controller (adopted untouched when it exists).
|
|
203
|
-
//
|
|
204
|
-
//
|
|
225
|
+
// Started here and awaited below, so stage 2 runs alongside it. Raised as
|
|
226
|
+
// the typed refusal so a caller that treats the later stages as non-fatal
|
|
227
|
+
// can still propagate a Space that never came up.
|
|
228
|
+
const spaceReady = provisionWalletSpace({
|
|
229
|
+
was,
|
|
230
|
+
spaceId,
|
|
231
|
+
controllerDid: keyAgent.id
|
|
232
|
+
});
|
|
233
|
+
// 2. The optional KMS authentication binding, started before the Space is
|
|
234
|
+
// awaited: the keystore and the key mint touch no Space, and the thunk
|
|
235
|
+
// orders its own `keys.json` write behind `spaceReady`. A throw degrades to
|
|
236
|
+
// the client-keys-only genesis rather than aborting: every later ceremony
|
|
237
|
+
// anchors in client keys, and the document simply publishes no
|
|
238
|
+
// `authentication` relation.
|
|
239
|
+
// Started inside the same guard the join uses, so a thunk that throws
|
|
240
|
+
// synchronously is collected like one that rejects.
|
|
241
|
+
let kmsRun;
|
|
242
|
+
// The flag rather than the value decides whether the stage is reported, so
|
|
243
|
+
// a thunk rejecting with `undefined` is still a collected failure.
|
|
244
|
+
let kmsFailed = false;
|
|
245
|
+
let kmsFailure;
|
|
246
|
+
try {
|
|
247
|
+
kmsRun = provideKmsAuthentication?.({ spaceReady });
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
kmsFailed = true;
|
|
251
|
+
kmsFailure = err;
|
|
252
|
+
}
|
|
253
|
+
// A Space that never came up returns below while the thunk is still in
|
|
254
|
+
// flight, so its rejection is claimed here rather than surfacing as an
|
|
255
|
+
// unhandled one.
|
|
256
|
+
kmsRun?.catch(() => { });
|
|
205
257
|
try {
|
|
206
|
-
await
|
|
258
|
+
await spaceReady;
|
|
207
259
|
}
|
|
208
260
|
catch (err) {
|
|
209
261
|
throw new AccountGenesisSpaceError({ spaceId, cause: err });
|
|
210
262
|
}
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// heals the document with the convenience key.
|
|
216
|
-
let didWebKeys;
|
|
217
|
-
if (provideDidWebKeys) {
|
|
263
|
+
// The join: the genesis entry carries the KMS binding, so it waits on the
|
|
264
|
+
// whole stage even though the Space no longer does.
|
|
265
|
+
let kmsAuthentication;
|
|
266
|
+
if (kmsRun) {
|
|
218
267
|
try {
|
|
219
|
-
|
|
268
|
+
kmsAuthentication = await kmsRun;
|
|
220
269
|
}
|
|
221
270
|
catch (err) {
|
|
222
|
-
|
|
271
|
+
kmsFailed = true;
|
|
272
|
+
kmsFailure = err;
|
|
223
273
|
}
|
|
224
274
|
}
|
|
275
|
+
if (kmsFailed) {
|
|
276
|
+
failed.push({ stage: 'kmsAuthentication', error: kmsFailure });
|
|
277
|
+
}
|
|
278
|
+
stage(KMS_AUTHENTICATION_STAGE);
|
|
279
|
+
const didWebKeys = kmsAuthentication?.keys;
|
|
225
280
|
// 3. The did:webvh genesis -- probe, adopt, or create-and-publish. Fatal on
|
|
226
281
|
// failure: the account DID is what every remaining stage anchors in.
|
|
227
282
|
const { publicKeyMultibase: keyAgreementKeyMultibase } = clientKeyAgreementKey;
|
|
@@ -233,6 +288,9 @@ export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spa
|
|
|
233
288
|
wasServerUrl,
|
|
234
289
|
spaceId,
|
|
235
290
|
...(didWebKeys ? { didWebKeys } : {}),
|
|
291
|
+
...(kmsAuthentication?.etag !== undefined && {
|
|
292
|
+
keysJsonEtag: kmsAuthentication.etag
|
|
293
|
+
}),
|
|
236
294
|
clientKeys: {
|
|
237
295
|
signingKeyMultibase: clientSigningKeyMultibase({ keyAgent }),
|
|
238
296
|
keyAgreementKeyMultibase
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountGenesis.js","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,yBAAyB,
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;QACL,GAAG;QACH,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,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM;KACP,CAAA;AACH,CAAC"}
|
package/dist/genesis/index.d.ts
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* complete key set (Space id, client identity seed, user key, did:webvh
|
|
11
11
|
* update keys), before anything touches the network.
|
|
12
12
|
* - `ensureAccountGenesis` -- the ceremony itself: Space provisioning, the
|
|
13
|
-
* optional KMS
|
|
13
|
+
* optional KMS authentication binding (acquired alongside it), did:webvh
|
|
14
|
+
* genesis, user-key roster
|
|
14
15
|
* genesis, epoch[0] on every encrypted roster collection, and
|
|
15
16
|
* Space-controller promotion; idempotent end to end, so a torn run heals
|
|
16
17
|
* by re-running.
|
|
@@ -23,5 +24,6 @@
|
|
|
23
24
|
* ceremonies.
|
|
24
25
|
*/
|
|
25
26
|
export { AccountGenesisSpaceError, ensureAccountGenesis, ensurePromotedSpaceController, mintAccountKeySet, mintSpaceId } from './accountGenesis.js';
|
|
27
|
+
export { KMS_AUTHENTICATION_STAGE } from '../stages.js';
|
|
26
28
|
export type { AccountGenesisResult, AccountGenesisStage, AccountKeySet, SpaceControllerPromotion } from './accountGenesis.js';
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AACvD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACzB,MAAM,qBAAqB,CAAA"}
|
package/dist/genesis/index.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* complete key set (Space id, client identity seed, user key, did:webvh
|
|
11
11
|
* update keys), before anything touches the network.
|
|
12
12
|
* - `ensureAccountGenesis` -- the ceremony itself: Space provisioning, the
|
|
13
|
-
* optional KMS
|
|
13
|
+
* optional KMS authentication binding (acquired alongside it), did:webvh
|
|
14
|
+
* genesis, user-key roster
|
|
14
15
|
* genesis, epoch[0] on every encrypted roster collection, and
|
|
15
16
|
* Space-controller promotion; idempotent end to end, so a torn run heals
|
|
16
17
|
* by re-running.
|
|
@@ -23,4 +24,5 @@
|
|
|
23
24
|
* ceremonies.
|
|
24
25
|
*/
|
|
25
26
|
export { AccountGenesisSpaceError, ensureAccountGenesis, ensurePromotedSpaceController, mintAccountKeySet, mintSpaceId } from './accountGenesis.js';
|
|
27
|
+
export { KMS_AUTHENTICATION_STAGE } from '../stages.js';
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { CapabilityAgent } from '@interop/webkms-client';
|
|
21
21
|
import { ZcapClient } from '@interop/ezcap';
|
|
22
|
-
import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
|
|
22
|
+
import type { IKeyAgreementKey, IKeyResolver, ISigner } from '@interop/data-integrity-core';
|
|
23
23
|
/**
|
|
24
24
|
* The load-bearing `CapabilityAgent` derivation names (see the module doc:
|
|
25
25
|
* the typo in the key name can never be fixed without stranding wallets).
|
|
@@ -38,6 +38,22 @@ export interface ProfileAgents {
|
|
|
38
38
|
keyAgreementKey: IKeyAgreementKey;
|
|
39
39
|
keyResolver: IKeyResolver;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* A `ZcapClient` signing invocations and delegations alike with one signer,
|
|
43
|
+
* under `eddsa-jcs-2022` -- the suite every zcap this library mints is signed
|
|
44
|
+
* with. This is that construction's one site: the suite is hard-coded rather
|
|
45
|
+
* than threaded as a caller option, and a wrong setting would surface only as
|
|
46
|
+
* an interop failure at the server, so a second copy is a setting someone has
|
|
47
|
+
* to remember. Callers that sign under a different key id (the did:webvh
|
|
48
|
+
* verification method, the ladder VM) build the signer and hand it here.
|
|
49
|
+
*
|
|
50
|
+
* @param options {object}
|
|
51
|
+
* @param options.signer {ISigner} signs invocations and delegations alike
|
|
52
|
+
* @returns {ZcapClient}
|
|
53
|
+
*/
|
|
54
|
+
export declare function zcapClientForSigner({ signer }: {
|
|
55
|
+
signer: ISigner;
|
|
56
|
+
}): ZcapClient;
|
|
41
57
|
/**
|
|
42
58
|
* Derives the WAS agents from an already-derived 32-byte seed, skipping the
|
|
43
59
|
* salted-hash step (`CapabilityAgent.fromSeed` semantics: a stored seed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACR,MAAM,8BAA8B,CAAA;AAGrC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,eAAe,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,gBAAgB,CAAA;IACjC,WAAW,EAAE,YAAY,CAAA;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,OAAO,CAAA;CAChB,GAAG,UAAU,CAMb;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACL,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;CACjB,GAAG,OAAO,CAAC,aAAa,CAAC,CAOzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,aAAa,CAAC,CAOzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,eAAe,CAAA;CAC1B,GAAG,aAAa,CAqBhB"}
|
package/dist/identity/agents.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* returning user, on any device, decrypts the same envelopes.
|
|
19
19
|
*/
|
|
20
20
|
import { CapabilityAgent } from '@interop/webkms-client';
|
|
21
|
-
import {
|
|
21
|
+
import { EddsaJcs2022 } from '@interop/ed25519-signature/eddsa-jcs-2022';
|
|
22
22
|
import { ZcapClient } from '@interop/ezcap';
|
|
23
23
|
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
24
24
|
import { singleKeyResolver } from './keyResolver.js';
|
|
@@ -28,6 +28,26 @@ import { singleKeyResolver } from './keyResolver.js';
|
|
|
28
28
|
*/
|
|
29
29
|
export const BOOTSTRAP_HANDLE = 'bootstrap';
|
|
30
30
|
export const BOOTSTRAP_KEY_NAME = 'boostrap-key';
|
|
31
|
+
/**
|
|
32
|
+
* A `ZcapClient` signing invocations and delegations alike with one signer,
|
|
33
|
+
* under `eddsa-jcs-2022` -- the suite every zcap this library mints is signed
|
|
34
|
+
* with. This is that construction's one site: the suite is hard-coded rather
|
|
35
|
+
* than threaded as a caller option, and a wrong setting would surface only as
|
|
36
|
+
* an interop failure at the server, so a second copy is a setting someone has
|
|
37
|
+
* to remember. Callers that sign under a different key id (the did:webvh
|
|
38
|
+
* verification method, the ladder VM) build the signer and hand it here.
|
|
39
|
+
*
|
|
40
|
+
* @param options {object}
|
|
41
|
+
* @param options.signer {ISigner} signs invocations and delegations alike
|
|
42
|
+
* @returns {ZcapClient}
|
|
43
|
+
*/
|
|
44
|
+
export function zcapClientForSigner({ signer }) {
|
|
45
|
+
return new ZcapClient({
|
|
46
|
+
SuiteClass: EddsaJcs2022,
|
|
47
|
+
invocationSigner: signer,
|
|
48
|
+
delegationSigner: signer
|
|
49
|
+
});
|
|
50
|
+
}
|
|
31
51
|
/**
|
|
32
52
|
* Derives the WAS agents from an already-derived 32-byte seed, skipping the
|
|
33
53
|
* salted-hash step (`CapabilityAgent.fromSeed` semantics: a stored seed
|
|
@@ -80,13 +100,9 @@ export async function agentsFromSecret({ secret }) {
|
|
|
80
100
|
*/
|
|
81
101
|
export function agentsFromKeyAgent({ keyAgent }) {
|
|
82
102
|
const signer = keyAgent.getSigner();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// The root key also signs delegations (sharing grants, app capability
|
|
87
|
-
// grants).
|
|
88
|
-
delegationSigner: signer
|
|
89
|
-
});
|
|
103
|
+
// The root key also signs delegations (sharing grants, app capability
|
|
104
|
+
// grants).
|
|
105
|
+
const zcapClient = zcapClientForSigner({ signer });
|
|
90
106
|
const keyAgreementKey = X25519KeyAgreementKey2020.fromEd25519VerificationKey2020({
|
|
91
107
|
keyPair: keyAgent.getVerificationKeyPair()
|
|
92
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/identity/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAM7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA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