@interop/wallet-core 0.66.0 → 0.68.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 +12 -8
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +6 -10
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +34 -56
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +46 -29
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +111 -86
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +7 -16
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +13 -24
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +33 -129
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +43 -182
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +26 -12
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +60 -57
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +75 -18
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +79 -147
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +8 -8
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +5 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +51 -4
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +283 -47
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +62 -73
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +103 -117
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +123 -125
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +174 -233
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +0 -4
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +50 -51
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +25 -13
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +80 -303
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -5
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.js +18 -9
- package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +6 -10
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +13 -18
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clientAnnex/zcap.d.ts +19 -0
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +80 -12
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/index.d.ts +3 -2
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +3 -2
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +33 -15
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/policy.d.ts +18 -0
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +22 -8
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -30
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +12 -27
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +6 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +27 -30
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/errors.d.ts +6 -5
- package/dist/descriptors/errors.d.ts.map +1 -1
- package/dist/descriptors/errors.js +6 -5
- package/dist/descriptors/errors.js.map +1 -1
- package/dist/descriptors/index.d.ts +7 -3
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +7 -3
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +28 -6
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +33 -7
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +3 -7
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +11 -16
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +43 -47
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/kmsAuthentication.d.ts +50 -0
- package/dist/genesis/kmsAuthentication.d.ts.map +1 -0
- package/dist/genesis/kmsAuthentication.js +49 -0
- package/dist/genesis/kmsAuthentication.js.map +1 -0
- package/dist/keyring/kdf.d.ts +16 -20
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +2 -2
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +8 -30
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +8 -31
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/clientKeyRecord.d.ts +2 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +28 -11
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +6 -2
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +5 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +14 -5
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +92 -3
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +110 -4
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +30 -3
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +90 -15
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +5 -1
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/recovery/continuation.d.ts +250 -0
- package/dist/recovery/continuation.d.ts.map +1 -0
- package/dist/recovery/continuation.js +467 -0
- package/dist/recovery/continuation.js.map +1 -0
- 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/recoveryDelegation.d.ts +23 -126
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +1 -266
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +52 -107
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +54 -403
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/classify.d.ts +3 -14
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +19 -40
- package/dist/request/classify.js.map +1 -1
- package/dist/request/index.d.ts +1 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +1 -0
- package/dist/request/index.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +19 -27
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts +5 -3
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +7 -6
- package/dist/request/parse.js.map +1 -1
- package/dist/request/processRequest.d.ts.map +1 -1
- package/dist/request/processRequest.js +2 -1
- package/dist/request/processRequest.js.map +1 -1
- package/dist/request/queryPredicates.d.ts +98 -0
- package/dist/request/queryPredicates.d.ts.map +1 -0
- package/dist/request/queryPredicates.js +107 -0
- package/dist/request/queryPredicates.js.map +1 -0
- package/dist/resourceLog/document.d.ts +39 -0
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +41 -0
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/resourceLog/index.d.ts +2 -2
- package/dist/resourceLog/index.js +2 -2
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
- package/dist/resourceLog/ladderRungs.js +3 -2
- package/dist/resourceLog/ladderRungs.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +8 -2
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/sync/engine.d.ts +38 -23
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js +36 -5
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/index.d.ts +9 -12
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +8 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +1 -2
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.d.ts +0 -31
- package/dist/sync/remint.d.ts.map +1 -1
- package/dist/sync/remint.js +32 -1
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +4 -41
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +4 -47
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +1 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +16 -64
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +7 -86
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +27 -61
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +40 -92
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +69 -44
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +68 -19
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +117 -37
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +24 -13
- package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
- package/dist/webvh/delegatedLogStore.js +40 -11
- package/dist/webvh/delegatedLogStore.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +91 -86
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +117 -142
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +2 -8
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +22 -31
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +12 -8
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +10 -7
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +102 -65
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/mergeMethods.d.ts +84 -0
- package/dist/webvh/mergeMethods.d.ts.map +1 -0
- package/dist/webvh/mergeMethods.js +46 -0
- package/dist/webvh/mergeMethods.js.map +1 -0
- package/dist/webvh/revokeClient.d.ts +15 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +130 -57
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +45 -4
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +62 -21
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +16 -3
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +18 -3
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/package.json +11 -11
|
@@ -4,7 +4,7 @@ import { userKeyRosterDescriptorStore } from '../keys/rosterStore.js';
|
|
|
4
4
|
import { memoryResourceLogPinStore } from '@interop/vh-resource-log';
|
|
5
5
|
import { webvhResourceLogController } from '../resourceLog/index.js';
|
|
6
6
|
import { mintClientWebvhUpdateKeys, updateKeyMultibase } from '../webvh/didWebvh.js';
|
|
7
|
-
import {
|
|
7
|
+
import { verifyAccountLog } from '../webvh/verifyLog.js';
|
|
8
8
|
import { clientSigningKeyMultibase, isWebvhDid, webvhZcapClient } from '../webvh/zcap.js';
|
|
9
9
|
import { assertBuiltOnHeadShape, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
10
10
|
/**
|
|
@@ -25,13 +25,11 @@ import { assertBuiltOnHeadShape, selfEnrollWebvhClient } from './ladderAnchored.
|
|
|
25
25
|
* with
|
|
26
26
|
* @param options.logStore {UnlockLogStore} the public log read plus the
|
|
27
27
|
* delegated `did.jsonl` PUT, built by the app around the record's bridge
|
|
28
|
-
* delegation
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* its first contact), which is exactly the pin's trust-on-first-use
|
|
34
|
-
* establishment
|
|
28
|
+
* delegation. It carries this client's chain-head pin for the account log,
|
|
29
|
+
* checked on every read the two log entries are built on and advanced as
|
|
30
|
+
* each publishes, then checked again by the verify that follows. A fresh
|
|
31
|
+
* browser normally holds no pin yet (this is its first contact), which is
|
|
32
|
+
* exactly the pin's trust-on-first-use establishment
|
|
35
33
|
* @param options.onCommitted {function}
|
|
36
34
|
* `(committed: { builtOnHead, clientSeed, webvhUpdateKeys }) =>
|
|
37
35
|
* Promise<void>` -- the REQUIRED persist-before-publish seam. The caller
|
|
@@ -71,7 +69,7 @@ import { assertBuiltOnHeadShape, selfEnrollWebvhClient } from './ladderAnchored.
|
|
|
71
69
|
* cleared. The member exists so a build skew that dropped it surfaces
|
|
72
70
|
* instead of reading as `false`
|
|
73
71
|
*/
|
|
74
|
-
export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore,
|
|
72
|
+
export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, onCommitted, resume }) {
|
|
75
73
|
// Refused before any read, on the ceremony's own rule: without the seam the
|
|
76
74
|
// pivot entry can publish a client whose seed nothing persisted.
|
|
77
75
|
if (typeof onCommitted !== 'function') {
|
|
@@ -106,7 +104,7 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
106
104
|
const signingKeyMultibase = clientSigningKeyMultibase({ keyAgent });
|
|
107
105
|
const webvhUpdateKeys = resume
|
|
108
106
|
? resume.webvhUpdateKeys
|
|
109
|
-
:
|
|
107
|
+
: mintClientWebvhUpdateKeys();
|
|
110
108
|
const newClientKeys = {
|
|
111
109
|
signingKeyMultibase,
|
|
112
110
|
keyAgreementKeyMultibase,
|
|
@@ -133,13 +131,7 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
133
131
|
// rewrite of what already stands.
|
|
134
132
|
onCommitted: async ({ builtOnHead }) => onCommitted({ builtOnHead, clientSeed, webvhUpdateKeys }),
|
|
135
133
|
...(resume ? { builtOnHead: resume.builtOnHead } : {}),
|
|
136
|
-
expectedDid
|
|
137
|
-
...(accountLogPinStore
|
|
138
|
-
? {
|
|
139
|
-
pinStore: accountLogPinStore,
|
|
140
|
-
logId: accountLogPinId({ spaceId: pointer.spaceId })
|
|
141
|
-
}
|
|
142
|
-
: {})
|
|
134
|
+
expectedDid
|
|
143
135
|
});
|
|
144
136
|
// Verify the continuation from the world-readable log -- the same
|
|
145
137
|
// first-contact read an enrollee's completion runs, and the controller the
|
|
@@ -148,7 +140,10 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
148
140
|
did: expectedDid,
|
|
149
141
|
spaceId: pointer.spaceId,
|
|
150
142
|
host: pointer.host,
|
|
151
|
-
|
|
143
|
+
// The same chain-head pin the two entries above published under: the
|
|
144
|
+
// verifier fetches the log by host URL and holds no store, so the store's
|
|
145
|
+
// own pin is handed to it explicitly.
|
|
146
|
+
pinStore: logStore.pin.store
|
|
152
147
|
});
|
|
153
148
|
// The first roster read: signed with the `<did:webvh>#<multibase>` keyId
|
|
154
149
|
// the add entry just published, unwrapping the user key from the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfEnroll.js","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAGrE,OAAO,
|
|
1
|
+
{"version":3,"file":"selfEnroll.js","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,4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EAAE;YACT,EAAE,EAAE,kBAAkB,CAAC;gBACrB,mBAAmB;gBACnB,wBAAwB;aACzB,CAAC;YACF,kBAAkB,EAAE,wBAAwB;SAC7C;QACD,oBAAoB,EAAE,yBAAyB;KAChD,CAAC,CAAA;IAEF,OAAO;QACL,UAAU;QACV,eAAe;QACf,SAAS,EAAE,QAAQ,CAAC,EAAE;QACtB,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,wEAAwE;QACxE,wEAAwE;QACxE,gBAAgB;QAChB,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAA;AACH,CAAC"}
|
|
@@ -52,4 +52,23 @@ export declare function ladderVmZcapClient({ accountDid, ladderSeed }: {
|
|
|
52
52
|
export declare function ladderVmAgent({ ladderSeed }: {
|
|
53
53
|
ladderSeed: Uint8Array;
|
|
54
54
|
}): Promise<ICapabilityAgent>;
|
|
55
|
+
/**
|
|
56
|
+
* The ladder VM's two presentations from ONE key generation: the bare did:key
|
|
57
|
+
* agent a bootstrap identity invokes as, and the ZcapClient that delegates
|
|
58
|
+
* under `<accountDid>#<multibase>`. A caller needing both -- a ceremony that
|
|
59
|
+
* mints delegations while invoking as the ladder -- takes them here instead of
|
|
60
|
+
* paying the Ed25519 generation twice.
|
|
61
|
+
*
|
|
62
|
+
* @param options {object}
|
|
63
|
+
* @param options.accountDid {string} the account did:webvh
|
|
64
|
+
* @param options.ladderSeed {Uint8Array} the credential's ladder seed
|
|
65
|
+
* @returns {Promise<{ agent: ICapabilityAgent, zcapClient: ZcapClient }>}
|
|
66
|
+
*/
|
|
67
|
+
export declare function ladderVmSigners({ accountDid, ladderSeed }: {
|
|
68
|
+
accountDid: string;
|
|
69
|
+
ladderSeed: Uint8Array;
|
|
70
|
+
}): Promise<{
|
|
71
|
+
agent: ICapabilityAgent;
|
|
72
|
+
zcapClient: ZcapClient;
|
|
73
|
+
}>;
|
|
55
74
|
//# sourceMappingURL=zcap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AA+FxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,UAAU,CAAC,CAGtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAI5B;AAoCD;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC,CAO/D"}
|
package/dist/clientAnnex/zcap.js
CHANGED
|
@@ -11,6 +11,33 @@
|
|
|
11
11
|
import { Ed25519VerificationKey } from '@interop/ed25519-verification-key';
|
|
12
12
|
import { zcapClientForSigner } from '../identity/agents.js';
|
|
13
13
|
import { ladderVmSeed } from './ladder.js';
|
|
14
|
+
/**
|
|
15
|
+
* What the ladder VM's key material amounts to for a caller: its public
|
|
16
|
+
* multibase and a bound `sign`, generated once from the seed. Both entry
|
|
17
|
+
* points below present the SAME key under two controllers, so the generation
|
|
18
|
+
* is stated here rather than at each of them.
|
|
19
|
+
*
|
|
20
|
+
* @param options {object}
|
|
21
|
+
* @param options.ladderSeed {Uint8Array} the credential's ladder seed
|
|
22
|
+
* @returns {Promise<object>} `{ publicKeyMultibase, sign }`
|
|
23
|
+
*/
|
|
24
|
+
async function ladderVmKeyMaterial({ ladderSeed }) {
|
|
25
|
+
const keyPair = await Ed25519VerificationKey.generate({
|
|
26
|
+
seed: ladderVmSeed({ ladderSeed })
|
|
27
|
+
});
|
|
28
|
+
const { publicKeyMultibase } = keyPair;
|
|
29
|
+
// The key pair refuses to hand out a signer without an id; set the
|
|
30
|
+
// verification-method id before asking. Which controller it names does not
|
|
31
|
+
// reach the signature -- the caller's own signer object below carries the
|
|
32
|
+
// id the proof states.
|
|
33
|
+
keyPair.id = `did:key:${publicKeyMultibase}#${publicKeyMultibase}`;
|
|
34
|
+
keyPair.controller = `did:key:${publicKeyMultibase}`;
|
|
35
|
+
const keySigner = keyPair.signer();
|
|
36
|
+
return {
|
|
37
|
+
publicKeyMultibase,
|
|
38
|
+
sign: keySigner.sign.bind(keySigner)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
14
41
|
/**
|
|
15
42
|
* The ladder VM's key pair as a signer under the DID it is presented as, the
|
|
16
43
|
* one derivation both entry points below share (`Ed25519VerificationKey`
|
|
@@ -26,24 +53,33 @@ import { ladderVmSeed } from './ladder.js';
|
|
|
26
53
|
* @returns {Promise<object>} `{ publicKeyMultibase, controller, signer }`
|
|
27
54
|
*/
|
|
28
55
|
async function ladderVmSigner({ ladderSeed, accountDid }) {
|
|
29
|
-
const
|
|
30
|
-
|
|
56
|
+
const material = await ladderVmKeyMaterial({ ladderSeed });
|
|
57
|
+
return presentedLadderVmSigner({
|
|
58
|
+
material,
|
|
59
|
+
...(accountDid !== undefined ? { accountDid } : {})
|
|
31
60
|
});
|
|
32
|
-
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* One presentation of the ladder VM's key material: the same key under the
|
|
64
|
+
* controller the caller states, with the verification-method id
|
|
65
|
+
* `<controller>#<multibase>` the proof carries.
|
|
66
|
+
*
|
|
67
|
+
* @param options {object}
|
|
68
|
+
* @param options.material {object} {@link ladderVmKeyMaterial}'s result
|
|
69
|
+
* @param [options.accountDid] {string} the DID the key is presented under;
|
|
70
|
+
* omitted, the key stands under its own bare did:key
|
|
71
|
+
* @returns {object} `{ publicKeyMultibase, controller, signer }`
|
|
72
|
+
*/
|
|
73
|
+
function presentedLadderVmSigner({ material, accountDid }) {
|
|
74
|
+
const { publicKeyMultibase, sign } = material;
|
|
33
75
|
const controller = accountDid ?? `did:key:${publicKeyMultibase}`;
|
|
34
|
-
const id = `${controller}#${publicKeyMultibase}`;
|
|
35
|
-
// The key pair refuses to hand out a signer without an id; set the
|
|
36
|
-
// verification-method id before asking.
|
|
37
|
-
keyPair.id = id;
|
|
38
|
-
keyPair.controller = controller;
|
|
39
|
-
const keySigner = keyPair.signer();
|
|
40
76
|
return {
|
|
41
77
|
publicKeyMultibase,
|
|
42
78
|
controller,
|
|
43
79
|
signer: {
|
|
44
|
-
id
|
|
80
|
+
id: `${controller}#${publicKeyMultibase}`,
|
|
45
81
|
type: 'Ed25519VerificationKey2020',
|
|
46
|
-
sign
|
|
82
|
+
sign
|
|
47
83
|
}
|
|
48
84
|
};
|
|
49
85
|
}
|
|
@@ -97,9 +133,21 @@ export async function ladderVmZcapClient({ accountDid, ladderSeed }) {
|
|
|
97
133
|
* @returns {Promise<ICapabilityAgent>}
|
|
98
134
|
*/
|
|
99
135
|
export async function ladderVmAgent({ ladderSeed }) {
|
|
136
|
+
return ladderVmAgentOf({
|
|
137
|
+
material: await ladderVmKeyMaterial({ ladderSeed })
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* {@link ladderVmAgent} over key material a caller already generated.
|
|
142
|
+
*
|
|
143
|
+
* @param options {object}
|
|
144
|
+
* @param options.material {object} {@link ladderVmKeyMaterial}'s result
|
|
145
|
+
* @returns {ICapabilityAgent}
|
|
146
|
+
*/
|
|
147
|
+
function ladderVmAgentOf({ material }) {
|
|
100
148
|
// No account DID: the key stands under its own bare did:key, the
|
|
101
149
|
// verification-method form the server's did:key resolver expects.
|
|
102
|
-
const { publicKeyMultibase, controller: did, signer } =
|
|
150
|
+
const { publicKeyMultibase, controller: did, signer } = presentedLadderVmSigner({ material });
|
|
103
151
|
return {
|
|
104
152
|
id: did,
|
|
105
153
|
handle: 'ladder-vm',
|
|
@@ -111,4 +159,24 @@ export async function ladderVmAgent({ ladderSeed }) {
|
|
|
111
159
|
})
|
|
112
160
|
};
|
|
113
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* The ladder VM's two presentations from ONE key generation: the bare did:key
|
|
164
|
+
* agent a bootstrap identity invokes as, and the ZcapClient that delegates
|
|
165
|
+
* under `<accountDid>#<multibase>`. A caller needing both -- a ceremony that
|
|
166
|
+
* mints delegations while invoking as the ladder -- takes them here instead of
|
|
167
|
+
* paying the Ed25519 generation twice.
|
|
168
|
+
*
|
|
169
|
+
* @param options {object}
|
|
170
|
+
* @param options.accountDid {string} the account did:webvh
|
|
171
|
+
* @param options.ladderSeed {Uint8Array} the credential's ladder seed
|
|
172
|
+
* @returns {Promise<{ agent: ICapabilityAgent, zcapClient: ZcapClient }>}
|
|
173
|
+
*/
|
|
174
|
+
export async function ladderVmSigners({ accountDid, ladderSeed }) {
|
|
175
|
+
const material = await ladderVmKeyMaterial({ ladderSeed });
|
|
176
|
+
const { signer } = presentedLadderVmSigner({ material, accountDid });
|
|
177
|
+
return {
|
|
178
|
+
agent: ladderVmAgentOf({ material }),
|
|
179
|
+
zcapClient: zcapClientForSigner({ signer })
|
|
180
|
+
};
|
|
181
|
+
}
|
|
114
182
|
//# sourceMappingURL=zcap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcap.js","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"zcap.js","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C;;;;;;;;;GASG;AACH,KAAK,UAAU,mBAAmB,CAAC,EAAE,UAAU,EAA8B;IAC3E,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC;QACpD,IAAI,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;KACnC,CAAC,CAAA;IACF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAA;IACtC,mEAAmE;IACnE,2EAA2E;IAC3E,0EAA0E;IAC1E,uBAAuB;IACvB,OAAO,CAAC,EAAE,GAAG,WAAW,kBAAkB,IAAI,kBAAkB,EAAE,CAAA;IAClE,OAAO,CAAC,UAAU,GAAG,WAAW,kBAAkB,EAAE,CAAA;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;IAClC,OAAO;QACL,kBAAkB;QAClB,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAEV;KAC1B,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;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ACC,iEAAiE;IACjE,kEAAkE;IAClE,MAAM,EACJ,kBAAkB,EAClB,UAAU,EAAE,GAAG,EACf,MAAM,EACP,GAAG,uBAAuB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;IACzC,OAAO;QACL,EAAE,EAAE,GAAG;QACP,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;QACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7B,IAAI,EAAE,4BAA4B;YAClC,UAAU,EAAE,GAAG;YACf,kBAAkB;SACnB,CAAC;KACH,CAAA;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,UAAU,EACV,UAAU,EAIX;IACC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;IAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,uBAAuB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;IACpE,OAAO;QACL,KAAK,EAAE,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;QACpC,UAAU,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5C,CAAA;AACH,CAAC"}
|
package/dist/clients/index.d.ts
CHANGED
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
* fan-out as the resumable success it is.
|
|
20
20
|
* - `revokeAccountClient` -- the revocation cascade in dependency order
|
|
21
21
|
* (document edit, roster rotation with its seal backstop, collection
|
|
22
|
-
* fan-out, optional
|
|
23
|
-
* injected.
|
|
22
|
+
* fan-out, the optional generation-delegation re-mint), with the
|
|
23
|
+
* app-specific stages injected. It writes no unlock record: each is signed
|
|
24
|
+
* by its own credential (`decisions/0019`).
|
|
24
25
|
* - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
|
|
25
26
|
* login-time
|
|
26
27
|
* roster policy: which roster failures refuse a session, and the standing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/clients/index.js
CHANGED
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
* fan-out as the resumable success it is.
|
|
20
20
|
* - `revokeAccountClient` -- the revocation cascade in dependency order
|
|
21
21
|
* (document edit, roster rotation with its seal backstop, collection
|
|
22
|
-
* fan-out, optional
|
|
23
|
-
* injected.
|
|
22
|
+
* fan-out, the optional generation-delegation re-mint), with the
|
|
23
|
+
* app-specific stages injected. It writes no unlock record: each is signed
|
|
24
|
+
* by its own credential (`decisions/0019`).
|
|
24
25
|
* - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
|
|
25
26
|
* login-time
|
|
26
27
|
* roster policy: which roster failures refuse a session, and the standing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAOrB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAQrD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.d.ts","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAGL,gBAAgB,EAChB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAA;AAE7E;;;;;;GAMG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,E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iB,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CASvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,OAAO,EACP,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAiBvB"}
|
package/dist/clients/listing.js
CHANGED
|
@@ -29,6 +29,28 @@
|
|
|
29
29
|
import { ladderVmIds, listEnrolledWebvhClients, verifyAccountLog } from '../webvh/index.js';
|
|
30
30
|
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
31
31
|
import { readClientLabels } from '../keys/index.js';
|
|
32
|
+
/**
|
|
33
|
+
* The verified account log every reader here stands on: the caller's own
|
|
34
|
+
* already-verified log when it supplied one, else a fetch-and-verify under
|
|
35
|
+
* its chain-head pin. Stated once so the three listings share one contract --
|
|
36
|
+
* a supplied log is trusted verbatim, and a fetched one is pinned whenever
|
|
37
|
+
* the caller keeps pins.
|
|
38
|
+
*
|
|
39
|
+
* @param options {object}
|
|
40
|
+
* @param options.pointer {AccountLogPointer} where the account log lives
|
|
41
|
+
* @param [options.verifiedLog] {VerifiedAccountLog} an already-verified log
|
|
42
|
+
* to read instead of fetching and verifying one
|
|
43
|
+
* @param [options.accountLogPinStore] {ResourceLogPinStore} this client's
|
|
44
|
+
* chain-head pin for the account log, checked when the log is fetched here
|
|
45
|
+
* @returns {Promise<VerifiedAccountLog>}
|
|
46
|
+
*/
|
|
47
|
+
async function resolveVerifiedAccountLog({ pointer, verifiedLog, accountLogPinStore }) {
|
|
48
|
+
return (verifiedLog ??
|
|
49
|
+
(await verifyAccountLog({
|
|
50
|
+
...pointer,
|
|
51
|
+
...(accountLogPinStore ? { pinStore: accountLogPinStore } : {})
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
32
54
|
/**
|
|
33
55
|
* Lists the wallet clients enrolled on an account, from the locally verified
|
|
34
56
|
* did:webvh log, with labels merged and the caller's own client marked.
|
|
@@ -48,11 +70,7 @@ import { readClientLabels } from '../keys/index.js';
|
|
|
48
70
|
export async function listAccountClients({ pointer, labelsStore, ownSigningKeyMultibase, verifiedLog, accountLogPinStore }) {
|
|
49
71
|
// The log read and the label read are independent, so they run together.
|
|
50
72
|
const [{ log }, labels] = await Promise.all([
|
|
51
|
-
verifiedLog
|
|
52
|
-
verifyAccountLog({
|
|
53
|
-
...pointer,
|
|
54
|
-
...(accountLogPinStore ? { pinStore: accountLogPinStore } : {})
|
|
55
|
-
}),
|
|
73
|
+
resolveVerifiedAccountLog({ pointer, verifiedLog, accountLogPinStore }),
|
|
56
74
|
labelsStore
|
|
57
75
|
? readClientLabels({ store: labelsStore }).then(read => read.labels)
|
|
58
76
|
: Promise.resolve({})
|
|
@@ -89,11 +107,11 @@ export async function listAccountClients({ pointer, labelsStore, ownSigningKeyMu
|
|
|
89
107
|
* @returns {Promise<Set<string>>}
|
|
90
108
|
*/
|
|
91
109
|
export async function currentAccountSigningKeys({ pointer, verifiedLog, accountLogPinStore }) {
|
|
92
|
-
const { log } =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
const { log } = await resolveVerifiedAccountLog({
|
|
111
|
+
pointer,
|
|
112
|
+
verifiedLog,
|
|
113
|
+
accountLogPinStore
|
|
114
|
+
});
|
|
97
115
|
return new Set(listEnrolledWebvhClients({ log }).map(client => client.signingKeyMultibase));
|
|
98
116
|
}
|
|
99
117
|
/**
|
|
@@ -124,11 +142,11 @@ export async function currentAccountSigningKeys({ pointer, verifiedLog, accountL
|
|
|
124
142
|
* @returns {Promise<Set<string>>} public key multibases
|
|
125
143
|
*/
|
|
126
144
|
export async function currentAccountRecordSigners({ pointer, verifiedLog, accountLogPinStore }) {
|
|
127
|
-
const verified =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
const verified = await resolveVerifiedAccountLog({
|
|
146
|
+
pointer,
|
|
147
|
+
verifiedLog,
|
|
148
|
+
accountLogPinStore
|
|
149
|
+
});
|
|
132
150
|
const keys = await currentAccountSigningKeys({
|
|
133
151
|
pointer,
|
|
134
152
|
verifiedLog: verified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAA;AAmC3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAOnB;IACC,yEAAyE;IACzE,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,
|
|
1
|
+
{"version":3,"file":"listing.js","sourceRoot":"","sources":["../../src/clients/listing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,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,KAAK,sBAAsB;KACjE,CAAC,CAAC,CAAA;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,OAAO,EACP,WAAW,EACX,kBAAkB,EAKnB;IACC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,yBAAyB,CAAC;QAC9C,OAAO;QACP,WAAW;QACX,kBAAkB;KACnB,CAAC,CAAA;IACF,OAAO,IAAI,GAAG,CACZ,wBAAwB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAC5E,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,EAChD,OAAO,EACP,WAAW,EACX,kBAAkB,EAKnB;IACC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC;QAC/C,OAAO;QACP,WAAW;QACX,kBAAkB;KACnB,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC;QAC3C,OAAO;QACP,WAAW,EAAE,QAAQ;KACtB,CAAC,CAAA;IACF,KAAK,MAAM,EAAE,IAAI,WAAW,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC,CAAA;QAClC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/clients/policy.d.ts
CHANGED
|
@@ -67,6 +67,24 @@ export declare function disconnectEligibility({ client, clients, signerKind }: {
|
|
|
67
67
|
allowed: boolean;
|
|
68
68
|
refusal?: DisconnectRefusal;
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Asserts that a client's active update key was attributed from the account
|
|
72
|
+
* log, throwing the one refusal message every disconnect-eligibility surface
|
|
73
|
+
* and the revocation cascade's own up-front check share -- guessing a key
|
|
74
|
+
* here could revoke a different client's authority. Returns the checked key
|
|
75
|
+
* pair on success, so a caller with a wider row (an `AccountClientView`) can
|
|
76
|
+
* narrow through this and a caller already holding just the two keys (the
|
|
77
|
+
* revocation cascade) can re-assert them unchanged.
|
|
78
|
+
*
|
|
79
|
+
* @param options {object}
|
|
80
|
+
* @param options.signingKeyMultibase {string}
|
|
81
|
+
* @param options.updateKeyMultibase {string | undefined}
|
|
82
|
+
* @returns {RevokedClientKeys}
|
|
83
|
+
*/
|
|
84
|
+
export declare function assertUpdateKeyAttributed({ signingKeyMultibase, updateKeyMultibase }: {
|
|
85
|
+
signingKeyMultibase: string;
|
|
86
|
+
updateKeyMultibase?: string;
|
|
87
|
+
}): RevokedClientKeys;
|
|
70
88
|
/**
|
|
71
89
|
* Narrows a listed row to the key set a revocation needs, throwing when the
|
|
72
90
|
* row's active update key could not be attributed. Carries no key-agreement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAC3B,MAAM,GAAG,aAAa,GAAG,yBAAyB,CAAA;AAEpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CA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AAmB,EACnB,kBAAkB,EACnB,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG,iBAAiB,CAQpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iBAAiB,CAEpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EACX,EAAE;IACD,WAAW,EAAE,oBAAoB,CAAA;IACjC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,GAAG,UAAU,GAAG,SAAS,CAIzB"}
|
package/dist/clients/policy.js
CHANGED
|
@@ -26,6 +26,27 @@ export function disconnectEligibility({ client, clients, signerKind = 'client' }
|
|
|
26
26
|
}
|
|
27
27
|
return { allowed: true };
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Asserts that a client's active update key was attributed from the account
|
|
31
|
+
* log, throwing the one refusal message every disconnect-eligibility surface
|
|
32
|
+
* and the revocation cascade's own up-front check share -- guessing a key
|
|
33
|
+
* here could revoke a different client's authority. Returns the checked key
|
|
34
|
+
* pair on success, so a caller with a wider row (an `AccountClientView`) can
|
|
35
|
+
* narrow through this and a caller already holding just the two keys (the
|
|
36
|
+
* revocation cascade) can re-assert them unchanged.
|
|
37
|
+
*
|
|
38
|
+
* @param options {object}
|
|
39
|
+
* @param options.signingKeyMultibase {string}
|
|
40
|
+
* @param options.updateKeyMultibase {string | undefined}
|
|
41
|
+
* @returns {RevokedClientKeys}
|
|
42
|
+
*/
|
|
43
|
+
export function assertUpdateKeyAttributed({ signingKeyMultibase, updateKeyMultibase }) {
|
|
44
|
+
if (!updateKeyMultibase) {
|
|
45
|
+
throw new Error("This wallet's update key could not be attributed from the account " +
|
|
46
|
+
'log, so it cannot be disconnected from here.');
|
|
47
|
+
}
|
|
48
|
+
return { signingKeyMultibase, updateKeyMultibase };
|
|
49
|
+
}
|
|
29
50
|
/**
|
|
30
51
|
* Narrows a listed row to the key set a revocation needs, throwing when the
|
|
31
52
|
* row's active update key could not be attributed. Carries no key-agreement
|
|
@@ -37,14 +58,7 @@ export function disconnectEligibility({ client, clients, signerKind = 'client' }
|
|
|
37
58
|
* @returns {RevokedClientKeys}
|
|
38
59
|
*/
|
|
39
60
|
export function revokedClientKeysFor({ client }) {
|
|
40
|
-
|
|
41
|
-
throw new Error("This wallet's update key could not be attributed from the account " +
|
|
42
|
-
'log, so it cannot be disconnected from here.');
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
signingKeyMultibase: client.signingKeyMultibase,
|
|
46
|
-
updateKeyMultibase: client.updateKeyMultibase
|
|
47
|
-
};
|
|
61
|
+
return assertUpdateKeyAttributed(client);
|
|
48
62
|
}
|
|
49
63
|
/**
|
|
50
64
|
* How a completed cascade should be reported: `complete` when every encrypted
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAkDA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,UAAU,GAAG,QAAQ,EAKtB;IACC,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;QAC5C,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;QACnD,CAAC;IACH,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAA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AAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EAIX;IACC,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,EAAE,OAAO,KAAK,QAAQ;QACtE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAA;AAChB,CAAC"}
|
|
@@ -40,12 +40,8 @@
|
|
|
40
40
|
* the fresh key in parallel, so writes stop landing under epochs the
|
|
41
41
|
* revoked client can still decrypt. Failures are collected per collection
|
|
42
42
|
* and never abort the fan-out.
|
|
43
|
-
* 4. **The
|
|
44
|
-
*
|
|
45
|
-
* codes re-mints them here -- while the registry is still readable under
|
|
46
|
-
* the session's pre-adoption vault keys.
|
|
47
|
-
* 5. **The generation-delegation re-mint** (optional, mirroring stage 4 as a
|
|
48
|
-
* client-annex log entry replacing the service entry): revoking the
|
|
43
|
+
* 4. **The generation-delegation re-mint** (optional, a client-annex log
|
|
44
|
+
* entry replacing the service entry): revoking the
|
|
49
45
|
* enrolled client that minted the current annex generation's delegation
|
|
50
46
|
* kills it under the same current-key-set rule, and without this stage
|
|
51
47
|
* the death is silent mid-generation. The injected closure runs the
|
|
@@ -56,6 +52,12 @@
|
|
|
56
52
|
* old delegation -- stays dead: mid-generation grant death is a stated
|
|
57
53
|
* consequence of ordinary disconnects, healed by the app reconnecting.
|
|
58
54
|
*
|
|
55
|
+
* No unlock record is written anywhere in the cascade. Every record's frame
|
|
56
|
+
* proof is signed by its own credential's unlock identity key, and its bridge
|
|
57
|
+
* and `delegatedClients` sibling delegations by that credential's own ladder
|
|
58
|
+
* VM (`decisions/0019`), so a client's removal rots no record and the
|
|
59
|
+
* cascade owes no re-seal.
|
|
60
|
+
*
|
|
59
61
|
* The revoking session then adopts the fresh key in place (`onRotationAdopted`
|
|
60
62
|
* -- profile vault keys, storage ciphers, engine restarts: whatever "in place"
|
|
61
63
|
* means for the app), so it keeps operating without a re-login.
|
|
@@ -93,7 +95,7 @@ export interface GenerationDelegationRemint {
|
|
|
93
95
|
* this run (a re-run of an already-complete revocation reports `false`), the
|
|
94
96
|
* roster's seal-backstop report (present when the roster store is sealable
|
|
95
97
|
* and the roster stage ran), the per-collection fan-out result, the document
|
|
96
|
-
* as the edit left it
|
|
98
|
+
* as the edit left it.
|
|
97
99
|
*/
|
|
98
100
|
export interface ClientRevocationResult {
|
|
99
101
|
rotated: boolean;
|
|
@@ -102,19 +104,18 @@ export interface ClientRevocationResult {
|
|
|
102
104
|
document: object;
|
|
103
105
|
userKey?: UserKey;
|
|
104
106
|
rosterDescriptor?: CollectionEncryption;
|
|
105
|
-
recovery?: {
|
|
106
|
-
reminted: number;
|
|
107
|
-
skipped: number;
|
|
108
|
-
};
|
|
109
107
|
generation?: GenerationDelegationRemint;
|
|
110
108
|
}
|
|
111
109
|
/**
|
|
112
110
|
* Runs the whole revocation cascade for one enrolled wallet client. See the
|
|
113
111
|
* module doc for the order and the convergence story. Throws before touching
|
|
114
|
-
* anything on a call that must not proceed
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
112
|
+
* anything on a call that must not proceed: a client whose active update key
|
|
113
|
+
* was not attributed is refused here, and a client revoking itself is refused
|
|
114
|
+
* by the document edit's own client-arm check, from the seeds it holds, before
|
|
115
|
+
* its entry publishes -- the one wording every wallet sees, with the `self`
|
|
116
|
+
* eligibility refusal in `policy.ts` naming the rule for the surface. Once
|
|
117
|
+
* the document edit lands, a thrown later stage leaves durable state a naive
|
|
118
|
+
* re-run -- or the login-time sweep -- converges from.
|
|
118
119
|
*
|
|
119
120
|
* The document edit's `StagedCommitmentAmbiguousError` passes through
|
|
120
121
|
* unwrapped, so a surface can re-word it ("disconnect this wallet from the
|
|
@@ -145,9 +146,6 @@ export interface ClientRevocationResult {
|
|
|
145
146
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
146
147
|
* stored account pointer; supplied, the document edit refuses a `did.jsonl`
|
|
147
148
|
* resolving to any other account
|
|
148
|
-
* @param [options.ownSigningKeyMultibase] {string} this client's own signing
|
|
149
|
-
* key; supplied, self-revocation is refused up front by the rule the surface
|
|
150
|
-
* should name, rather than by the update-key check inside the edit
|
|
151
149
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
152
150
|
* `key-map/user-key.jsonl` roster store
|
|
153
151
|
* @param [options.userKey] {UserKey} this client's cached user key
|
|
@@ -159,26 +157,22 @@ export interface ClientRevocationResult {
|
|
|
159
157
|
* with `{ userKey, latestEpochId, descriptor }` after the roster read and BEFORE
|
|
160
158
|
* the fan-out. The key and the epoch pin must persist atomically
|
|
161
159
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
162
|
-
* @param [options.remintRecoveryDelegations] {Function} `({ document }) =>
|
|
163
|
-
* Promise<{ reminted, skipped }>` -- the recovery-delegation re-mint stage,
|
|
164
|
-
* for a wallet that issues recovery codes
|
|
165
160
|
* @param [options.remintGenerationDelegation] {Function} `({ document }) =>
|
|
166
161
|
* Promise<GenerationDelegationRemint>` -- the generation-delegation
|
|
167
|
-
* re-mint stage, run against the post-edit document (stage
|
|
162
|
+
* re-mint stage, run against the post-edit document (stage 4 in the module
|
|
168
163
|
* doc); expected to catch its own failures and report them
|
|
169
164
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) => Promise<void>`
|
|
170
165
|
* -- the live-session adoption of a rotated key, run last so the session
|
|
171
166
|
* keeps operating without a re-login
|
|
172
167
|
* @returns {Promise<ClientRevocationResult>}
|
|
173
168
|
*/
|
|
174
|
-
export declare function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid,
|
|
169
|
+
export declare function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintGenerationDelegation, onRotationAdopted }: {
|
|
175
170
|
idStore: WebvhIdStore;
|
|
176
171
|
signer: AccountLogSigner;
|
|
177
172
|
projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
178
173
|
revokedClient: RevokedClientKeys;
|
|
179
174
|
knownLatentHashes?: string[];
|
|
180
175
|
expectedDid?: string;
|
|
181
|
-
ownSigningKeyMultibase?: string;
|
|
182
176
|
rosterStore: EncryptionDescriptorStore;
|
|
183
177
|
userKey?: UserKey;
|
|
184
178
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
@@ -189,12 +183,6 @@ export declare function revokeAccountClient({ idStore, signer, projectionStore,
|
|
|
189
183
|
descriptor: CollectionEncryption;
|
|
190
184
|
}) => Promise<void>;
|
|
191
185
|
collections: CascadeCollections;
|
|
192
|
-
remintRecoveryDelegations?: (options: {
|
|
193
|
-
document: PublishedKeyDocument;
|
|
194
|
-
}) => Promise<{
|
|
195
|
-
reminted: number;
|
|
196
|
-
skipped: number;
|
|
197
|
-
}>;
|
|
198
186
|
remintGenerationDelegation?: (options: {
|
|
199
187
|
document: PublishedKeyDocument;
|
|
200
188
|
}) => Promise<GenerationDelegationRemint>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;A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