@interop/wallet-core 0.65.0 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +5 -4
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +32 -50
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +112 -21
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +248 -180
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +2 -6
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +31 -61
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +48 -132
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +88 -221
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +9 -0
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +97 -13
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +108 -174
- 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 +6 -6
- 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 +310 -55
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +37 -3
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +69 -34
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +148 -72
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +211 -137
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +63 -81
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +20 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +77 -294
- 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.js +1 -1
- 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 +8 -10
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +39 -41
- 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 +19 -5
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +17 -3
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +3 -1
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +20 -8
- 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/userKeyCascade.d.ts +8 -5
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +7 -6
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +68 -4
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +146 -33
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +110 -10
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +184 -40
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/recovery/continuation.d.ts +255 -0
- package/dist/recovery/continuation.d.ts.map +1 -0
- package/dist/recovery/continuation.js +471 -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 +40 -120
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +36 -268
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +42 -83
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +44 -380
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/appKey.d.ts +35 -1
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +29 -10
- package/dist/request/appKey.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/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 -56
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +7 -76
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +20 -40
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +35 -76
- 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 +63 -7
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +110 -19
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +18 -12
- package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
- package/dist/webvh/delegatedLogStore.js +32 -11
- package/dist/webvh/delegatedLogStore.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +39 -23
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +63 -45
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +19 -23
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +11 -7
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +9 -6
- 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 +12 -2
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +126 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +21 -0
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +36 -14
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +11 -11
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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AE,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;;;;;;;;;;;;;;;;;;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MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;CACnB;AAmCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;CACzC,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgB/B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,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,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;AAm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ACF,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,CAAC,EACpC,MAAM,EACN,OAAO,EACP,UAAqB,EACtB,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CACjC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAapD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iBAAiB,
|
|
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,CAAC,EACpC,MAAM,EACN,OAAO,EACP,UAAqB,EACtB,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CACjC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAapD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,mBAAmB,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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E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,EACxC,mBAAmB,EACnB,kBAAkB,EAInB;IACC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,CACjD,CAAA;IACH,CAAC;IACD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAA;AACpD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,MAAM,EAGP;IACC,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EAIX;IACC,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,EAAE,OAAO,KAAK,QAAQ;QACtE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAA;AAChB,CAAC"}
|
|
@@ -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;AAC1B,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAA;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,GAAG,QAAQ,CAAA;CACrD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,UAAU,CAAC,EAAE,0BAA0B,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
3
|
+
import { assertUpdateKeyAttributed } from './policy.js';
|
|
3
4
|
/**
|
|
4
5
|
* Runs the whole revocation cascade for one enrolled wallet client. See the
|
|
5
6
|
* module doc for the order and the convergence story. Throws before touching
|
|
6
|
-
* anything on a call that must not proceed
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* anything on a call that must not proceed: a client whose active update key
|
|
8
|
+
* was not attributed is refused here, and a client revoking itself is refused
|
|
9
|
+
* by the document edit's own client-arm check, from the seeds it holds, before
|
|
10
|
+
* its entry publishes -- the one wording every wallet sees, with the `self`
|
|
11
|
+
* eligibility refusal in `policy.ts` naming the rule for the surface. Once
|
|
12
|
+
* the document edit lands, a thrown later stage leaves durable state a naive
|
|
13
|
+
* re-run -- or the login-time sweep -- converges from.
|
|
10
14
|
*
|
|
11
15
|
* The document edit's `StagedCommitmentAmbiguousError` passes through
|
|
12
16
|
* unwrapped, so a surface can re-word it ("disconnect this wallet from the
|
|
@@ -37,9 +41,6 @@ import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
|
37
41
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
38
42
|
* stored account pointer; supplied, the document edit refuses a `did.jsonl`
|
|
39
43
|
* resolving to any other account
|
|
40
|
-
* @param [options.ownSigningKeyMultibase] {string} this client's own signing
|
|
41
|
-
* key; supplied, self-revocation is refused up front by the rule the surface
|
|
42
|
-
* should name, rather than by the update-key check inside the edit
|
|
43
44
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
44
45
|
* `key-map/user-key.jsonl` roster store
|
|
45
46
|
* @param [options.userKey] {UserKey} this client's cached user key
|
|
@@ -51,28 +52,17 @@ import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
|
51
52
|
* with `{ userKey, latestEpochId, descriptor }` after the roster read and BEFORE
|
|
52
53
|
* the fan-out. The key and the epoch pin must persist atomically
|
|
53
54
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
54
|
-
* @param [options.remintRecoveryDelegations] {Function} `({ document }) =>
|
|
55
|
-
* Promise<{ reminted, skipped }>` -- the recovery-delegation re-mint stage,
|
|
56
|
-
* for a wallet that issues recovery codes
|
|
57
55
|
* @param [options.remintGenerationDelegation] {Function} `({ document }) =>
|
|
58
56
|
* Promise<GenerationDelegationRemint>` -- the generation-delegation
|
|
59
|
-
* re-mint stage, run against the post-edit document (stage
|
|
57
|
+
* re-mint stage, run against the post-edit document (stage 4 in the module
|
|
60
58
|
* doc); expected to catch its own failures and report them
|
|
61
59
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) => Promise<void>`
|
|
62
60
|
* -- the live-session adoption of a rotated key, run last so the session
|
|
63
61
|
* keeps operating without a re-login
|
|
64
62
|
* @returns {Promise<ClientRevocationResult>}
|
|
65
63
|
*/
|
|
66
|
-
export async function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid,
|
|
67
|
-
|
|
68
|
-
ownSigningKeyMultibase === revokedClient.signingKeyMultibase) {
|
|
69
|
-
throw new Error('This wallet cannot disconnect itself; use another enrolled wallet ' +
|
|
70
|
-
'client (or a recovery code) instead.');
|
|
71
|
-
}
|
|
72
|
-
if (!revokedClient.updateKeyMultibase) {
|
|
73
|
-
throw new Error("This wallet's update key could not be attributed from the account " +
|
|
74
|
-
'log, so it cannot be disconnected from here.');
|
|
75
|
-
}
|
|
64
|
+
export async function revokeAccountClient({ idStore, signer, projectionStore, revokedClient, knownLatentHashes, expectedDid, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintGenerationDelegation, onRotationAdopted }) {
|
|
65
|
+
assertUpdateKeyAttributed(revokedClient);
|
|
76
66
|
// 1. The document edit -- the pull axis everywhere, first. It resolves the
|
|
77
67
|
// document as it now stands, which is what stage 2 resolves its remaining
|
|
78
68
|
// recipients from.
|
|
@@ -111,11 +101,7 @@ export async function revokeAccountClient({ idStore, signer, projectionStore, re
|
|
|
111
101
|
...(generation ? { generation } : {})
|
|
112
102
|
};
|
|
113
103
|
}
|
|
114
|
-
// 4. The
|
|
115
|
-
// session's pre-adoption vault keys.
|
|
116
|
-
const recovery = await remintRecoveryDelegations?.({ document: doc });
|
|
117
|
-
// 5. The generation-delegation re-mint, against the same post-edit
|
|
118
|
-
// document.
|
|
104
|
+
// 4. The generation-delegation re-mint, against the post-edit document.
|
|
119
105
|
const generation = await remintGenerationDelegation?.({ document: doc });
|
|
120
106
|
if (tail.rotated) {
|
|
121
107
|
await onRotationAdopted?.({ userKey: tail.userKey });
|
|
@@ -127,7 +113,6 @@ export async function revokeAccountClient({ idStore, signer, projectionStore, re
|
|
|
127
113
|
document: doc,
|
|
128
114
|
userKey: tail.userKey,
|
|
129
115
|
rosterDescriptor: tail.rosterDescriptor,
|
|
130
|
-
...(recovery ? { recovery } : {}),
|
|
131
116
|
...(generation ? { generation } : {})
|
|
132
117
|
};
|
|
133
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AA4EA,OAAO,EACL,iBAAiB,EAKlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAmCvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,OAAO,EACP,MAAM,EACN,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC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AAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC,CAAA;IACH,CAAC;IAED,wEAAwE;IACxE,MAAM,UAAU,GAAG,MAAM,0BAA0B,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAExE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAA;AACH,CAAC"}
|
|
@@ -137,6 +137,10 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
|
|
|
137
137
|
* store
|
|
138
138
|
* @param options.userKey {UserKey} the start's current user key
|
|
139
139
|
* @param options.descriptor {CollectionEncryption} the start's roster read
|
|
140
|
+
* @param [options.etag] {string} the validator that read was served under
|
|
141
|
+
* (`UserKeyRosterReadResult.etag`), when it was a read on this same
|
|
142
|
+
* `store` instance; with it, a convergence write is seeded from the
|
|
143
|
+
* start's read rather than acquiring the roster a second time
|
|
140
144
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
141
145
|
* (identity) key-agreement key
|
|
142
146
|
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
@@ -152,11 +156,12 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
|
|
|
152
156
|
* kids found, the kids escrowed by the mirror direction, and the key +
|
|
153
157
|
* descriptor to fan out with
|
|
154
158
|
*/
|
|
155
|
-
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }: {
|
|
159
|
+
export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, etag, clientKeyAgreementKey, pinnedEpochId, accountLogPinStore, onUserKeyAdopted }: {
|
|
156
160
|
pointer: AccountLogPointer;
|
|
157
161
|
store: EncryptionDescriptorStore;
|
|
158
162
|
userKey: UserKey;
|
|
159
163
|
descriptor: CollectionEncryption;
|
|
164
|
+
etag?: string;
|
|
160
165
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
161
166
|
pinnedEpochId?: string | null;
|
|
162
167
|
accountLogPinStore?: ResourceLogPinStore;
|