@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
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* The transient-recovery continuation -- the ladder-anchored variant of the
|
|
6
|
-
* recovery subpath's `recoverWebvhClient`, split out beside the rest of the
|
|
7
|
-
* annex-anchored ceremonies: a code spent on a non-remembered browser mints
|
|
8
|
-
* no enrolled client, and the ladder VM the fresh credential's own bind
|
|
9
|
-
* publishes is what anchors the account, so it lands client-less and
|
|
10
|
-
* ladder-anchored. The enrolled-client
|
|
11
|
-
* continuation and the recovery-key inventory edits stay in
|
|
12
|
-
* `recovery/recoveryWebvh.ts`.
|
|
13
|
-
*/
|
|
14
|
-
import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
|
|
15
|
-
import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, publishEntryPinned, readPublishedLogOrThrow, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
16
|
-
import { credentialKeyAgreementMethods, ladderVmIds, relationIds } from '../resourceLog/document.js';
|
|
1
|
+
import { ladderVerificationMethod, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
17
2
|
import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWebvh.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
3
|
+
import { recoveryContinuationOnce } from '../recovery/continuation.js';
|
|
4
|
+
import { ladderRung, ladderVmKeyMultibase } from './ladder.js';
|
|
20
5
|
import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
21
6
|
/**
|
|
22
7
|
* THE TRANSIENT-RECOVERY CONTINUATION (run by the code-derived client through
|
|
@@ -88,6 +73,12 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
|
88
73
|
* completed branch WITHOUT re-entering `onCommitted`, so it must be able to
|
|
89
74
|
* treat an already-complete continuation as success on its own.
|
|
90
75
|
*
|
|
76
|
+
* A fresh credential whose `keyAgreement` id already stands in the document
|
|
77
|
+
* (the same passphrase re-typed) is refused before the reveal entry with
|
|
78
|
+
* `RecoveryCredentialStandingError`: this entry retires every pre-recovery
|
|
79
|
+
* credential, and one it re-bound instead would keep its old rung
|
|
80
|
+
* commitments under a struck ladder VM.
|
|
81
|
+
*
|
|
91
82
|
* @param options {object}
|
|
92
83
|
* @param options.store {RecoveryLogStore} public log read + delegated PUT
|
|
93
84
|
* @param options.recovery {object} the spent code's update seed and public
|
|
@@ -141,285 +132,77 @@ export async function recoverWebvhLadderAnchored(options) {
|
|
|
141
132
|
'code and the fresh credential record must be persisted before the ' +
|
|
142
133
|
'add entry publishes the ladder VM.');
|
|
143
134
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
expectedDid,
|
|
160
|
-
pinStore,
|
|
161
|
-
logId,
|
|
162
|
-
missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
|
|
163
|
-
});
|
|
164
|
-
const rung0 = await ladderRung({ ladderSeed, index: 0 });
|
|
165
|
-
const rung1 = await ladderRung({ ladderSeed, index: 1 });
|
|
166
|
-
const ladderVmKey = await ladderVmKeyMultibase({ ladderSeed });
|
|
167
|
-
// Derived before the completion check, because a resume recomputes the
|
|
168
|
-
// strike with the same protected sets the first run used.
|
|
169
|
-
const recoveryHash = await deriveNextKeyHash(recovery.updateKeyMultibase);
|
|
170
|
-
const rung0Hash = await deriveNextKeyHash(rung0.keyMultibase);
|
|
171
|
-
const rung1Hash = await deriveNextKeyHash(rung1.keyMultibase);
|
|
172
|
-
const replacementHash = await deriveNextKeyHash(replacement.updateKeyMultibase);
|
|
173
|
-
// Already complete (a torn earlier run finished the add entry): the fresh
|
|
174
|
-
// ladder's rung 0 is authorized, which only the add entry writes.
|
|
175
|
-
if (published.updateKeys.includes(rung0.keyMultibase)) {
|
|
176
|
-
// The add entry already struck the pre-recovery credentials, so the
|
|
177
|
-
// document names none of them any more. The report is derived from the
|
|
178
|
-
// log instead (`retiredCredentialVmIdsFromLog`), so a resume tells the
|
|
179
|
-
// caller exactly what the first run told it.
|
|
180
|
-
const retired = retiredCredentialVmIdsFromLog({
|
|
181
|
-
log: published.log,
|
|
182
|
-
did: published.did,
|
|
183
|
-
successorKeyMultibase: rung0.keyMultibase,
|
|
184
|
-
spentVmId: recoveryVmId({
|
|
185
|
-
did: published.did,
|
|
186
|
-
keyAgreementKeyMultibase: recovery.keyAgreementKeyMultibase
|
|
187
|
-
})
|
|
188
|
-
});
|
|
189
|
-
// The strike is recomputed by re-running it over the log as it stood just
|
|
190
|
-
// before the add entry, with the same protected sets, so a resume reports
|
|
191
|
-
// exactly what the first run reported rather than a second definition of
|
|
192
|
-
// the same question.
|
|
193
|
-
const strike = await retiredCredentialRungsBeforeKey({
|
|
194
|
-
log: published.log,
|
|
195
|
-
authorizedKeyMultibase: rung0.keyMultibase,
|
|
196
|
-
credentialVmIds: retired,
|
|
197
|
-
protectedHashes: [rung0Hash, rung1Hash, replacementHash],
|
|
198
|
-
protectedKeys: [rung0.keyMultibase]
|
|
199
|
-
});
|
|
200
|
-
return {
|
|
201
|
-
did: published.did,
|
|
202
|
-
doc: published.doc,
|
|
203
|
-
log: published.log,
|
|
204
|
-
retiredCredentialVmIds: retired,
|
|
205
|
-
struckRungHashes: strike.struckHashes,
|
|
206
|
-
unclaimedCredentialVmIds: strike.unclaimedCredentialVmIds
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
// The reveal-and-commit entry, skipped when a torn earlier run already
|
|
210
|
-
// published it (the revealed key authorized AND every needed hash
|
|
211
|
-
// committed).
|
|
212
|
-
const revealed = published.updateKeys.includes(recovery.updateKeyMultibase);
|
|
213
|
-
const committed = [rung0Hash, rung1Hash, replacementHash].every(hash => published.nextKeyHashes.includes(hash));
|
|
214
|
-
if (!revealed || !committed) {
|
|
215
|
-
if (!revealed && !published.nextKeyHashes.includes(recoveryHash)) {
|
|
216
|
-
throw new RecoveryKeyNotCommittedError();
|
|
217
|
-
}
|
|
218
|
-
await assertCarryOverCommitments({ published });
|
|
219
|
-
const signer = await updateKeySigner({ seed: recovery.updateSeed });
|
|
220
|
-
const updated = await updateDID({
|
|
221
|
-
log: published.log,
|
|
222
|
-
signer,
|
|
223
|
-
alsoKnownAsWeb: true,
|
|
224
|
-
updateKeys: [
|
|
225
|
-
...new Set([...published.updateKeys, recovery.updateKeyMultibase])
|
|
226
|
-
],
|
|
227
|
-
// The spent code's own hash is kept through this entry (so a resumed
|
|
228
|
-
// commit can re-state the revealed key); the add entry drops it.
|
|
229
|
-
nextKeyHashes: [
|
|
230
|
-
...new Set([
|
|
231
|
-
...published.nextKeyHashes,
|
|
232
|
-
recoveryHash,
|
|
233
|
-
rung0Hash,
|
|
234
|
-
rung1Hash,
|
|
235
|
-
replacementHash
|
|
236
|
-
])
|
|
237
|
-
]
|
|
238
|
-
});
|
|
239
|
-
// The publish advances the pin to what the reveal entry just published,
|
|
240
|
-
// so the re-read below (and any read after a tear here) refuses a host
|
|
241
|
-
// that rolls the log back behind it.
|
|
242
|
-
await publishEntryPinned({
|
|
243
|
-
store,
|
|
244
|
-
log: updated.log,
|
|
245
|
-
ifMatch: published.etag,
|
|
246
|
-
pinStore,
|
|
247
|
-
logId
|
|
248
|
-
});
|
|
249
|
-
// The same account the reveal entry just extended, under the same pin.
|
|
250
|
-
published = await readPublishedLogOrThrow({
|
|
251
|
-
idStore: store,
|
|
252
|
-
expectedDid: published.did,
|
|
253
|
-
pinStore,
|
|
254
|
-
logId,
|
|
255
|
-
missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
// The persist-before-publish seam: the replacement code's record and the
|
|
259
|
-
// fresh credential's unlock record (the ladder seed inside) become durable
|
|
260
|
-
// HERE, before the add entry publishes the ladder VM that seed backs.
|
|
261
|
-
const persisted = await onCommitted();
|
|
262
|
-
// Refuses a malformed pointer target before the entry is built.
|
|
263
|
-
clientAnnexDidParts({ did: persisted.clientAnnexDid });
|
|
264
|
-
// The add-and-retire entry: the ladder VM, the fresh credential's
|
|
265
|
-
// keyAgreement inventory, and the replacement code's inventory in; the spent
|
|
266
|
-
// code's VM, update key, and hash out; every pre-recovery standing
|
|
267
|
-
// credential fully retired -- its ladder VM and its keyAgreement member
|
|
268
|
-
// both. Signed by rung 0, whose hash the commit entry just committed.
|
|
269
|
-
const { did, doc } = published;
|
|
270
|
-
const spentVmId = recoveryVmId({
|
|
271
|
-
did,
|
|
272
|
-
keyAgreementKeyMultibase: recovery.keyAgreementKeyMultibase
|
|
273
|
-
});
|
|
274
|
-
const replacementVmId = recoveryVmId({
|
|
275
|
-
did,
|
|
276
|
-
keyAgreementKeyMultibase: replacement.keyAgreementKeyMultibase
|
|
277
|
-
});
|
|
278
|
-
const ladderVms = ladderVmIds({ doc });
|
|
279
|
-
const ladderVm = ladderVerificationMethod({
|
|
280
|
-
controller: did,
|
|
281
|
-
publicKeyMultibase: ladderVmKey
|
|
282
|
-
});
|
|
283
|
-
const ladderVmId = `${did}#${ladderVmKey}`;
|
|
284
|
-
const credentialVm = unlockKeyVerificationMethod({
|
|
285
|
-
did,
|
|
286
|
-
keyAgreement: credentialKeyAgreement
|
|
287
|
-
});
|
|
288
|
-
const credentialVmId = unlockKeyVmId({
|
|
289
|
-
did,
|
|
290
|
-
keyAgreement: credentialKeyAgreement
|
|
291
|
-
});
|
|
292
|
-
// Every pre-recovery credential's keyAgreement member, by the account-DID
|
|
293
|
-
// controller (an enrolled client's carries the client marker instead), less
|
|
294
|
-
// the ids this entry itself adds. The spent code's own id is reported
|
|
295
|
-
// separately: the caller already retires that one by name.
|
|
296
|
-
// The replacement code's ladder VM, published beside its key-agreement
|
|
297
|
-
// member: a code is a standing credential with a ladder, and its own bridge
|
|
298
|
-
// delegation is signed by this VM, so a replacement without it could never
|
|
299
|
-
// spend (`decisions/0019`, `decisions/0020`). Its rung-0 hash is already
|
|
300
|
-
// committed by the reveal-and-commit entry, which this entry carries
|
|
301
|
-
// through.
|
|
302
|
-
const replacementLadderVmId = `${did}#${replacement.ladderVmKeyMultibase}`;
|
|
303
|
-
const addedVmIds = [
|
|
304
|
-
ladderVmId,
|
|
305
|
-
credentialVmId,
|
|
306
|
-
replacementVmId,
|
|
307
|
-
replacementLadderVmId
|
|
308
|
-
];
|
|
309
|
-
const struckCredentialVmIds = credentialKeyAgreementMethods({ doc, did })
|
|
310
|
-
.map(method => method.id)
|
|
311
|
-
.filter((id) => typeof id === 'string')
|
|
312
|
-
.filter(id => !addedVmIds.includes(id));
|
|
313
|
-
const retiredCredentialVmIds = struckCredentialVmIds.filter(id => id !== spentVmId);
|
|
314
|
-
// Each retired credential's committed rungs and any revealed rung of its
|
|
315
|
-
// own go in the SAME entry. Striking the VM alone rots a ladder-signed
|
|
316
|
-
// bridge, but a bridge an enrolled client minted outlives the strike, and
|
|
317
|
-
// that client survives this entry -- so a committed rung left standing is a
|
|
318
|
-
// reveal the retired credential could still perform. The anchoring is
|
|
319
|
-
// log-only (this browser holds no registry), and an unanchorable credential
|
|
320
|
-
// is reported rather than struck.
|
|
321
|
-
const strike = await attributeRetiredCredentialRungs({
|
|
322
|
-
log: published.log,
|
|
323
|
-
credentialVmIds: retiredCredentialVmIds,
|
|
324
|
-
protectedHashes: [rung0Hash, rung1Hash, replacementHash],
|
|
325
|
-
protectedKeys: [rung0.keyMultibase]
|
|
326
|
-
});
|
|
327
|
-
const addedMethods = [
|
|
328
|
-
ladderVm,
|
|
329
|
-
credentialVm,
|
|
330
|
-
{
|
|
331
|
-
id: replacementVmId,
|
|
332
|
-
type: MULTIKEY_VM_TYPE,
|
|
333
|
-
controller: did,
|
|
334
|
-
publicKeyMultibase: replacement.keyAgreementKeyMultibase
|
|
135
|
+
const { ladderSeed, credentialKeyAgreement, onCommitted, expectedDid, pinStore, logId, ...shared } = options;
|
|
136
|
+
// The fresh ladder: rung 0 is the successor key the add entry authorizes
|
|
137
|
+
// and signs with, rung 1 its staged partner (the ladder-anchored genesis
|
|
138
|
+
// configuration), and the VM the stable sibling the entry installs.
|
|
139
|
+
const [rung0, rung1, ladderVmKey] = await Promise.all([
|
|
140
|
+
ladderRung({ ladderSeed, index: 0 }),
|
|
141
|
+
ladderRung({ ladderSeed, index: 1 }),
|
|
142
|
+
ladderVmKeyMultibase({ ladderSeed })
|
|
143
|
+
]);
|
|
144
|
+
const outcome = await withLogConflictRetry(() => recoveryContinuationOnce({
|
|
145
|
+
...shared,
|
|
146
|
+
successor: {
|
|
147
|
+
updateKeyMultibase: rung0.keyMultibase,
|
|
148
|
+
updateSeed: rung0.seed,
|
|
149
|
+
stagedKeyMultibase: rung1.keyMultibase
|
|
335
150
|
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
(
|
|
346
|
-
(!ladderVms.includes(method.id) &&
|
|
347
|
-
!struckCredentialVmIds.includes(method.id)))),
|
|
348
|
-
...addedMethods
|
|
349
|
-
];
|
|
350
|
-
// The retirement filter runs over the EXISTING relation ids only, and the
|
|
351
|
-
// added ids join afterwards: a resumed run's fresh ladder VM already stands
|
|
352
|
-
// in `doc.capabilityDelegation`, so filtering the union would strike the
|
|
353
|
-
// very method this entry is publishing.
|
|
354
|
-
const withoutRemoved = (relation, added) => [
|
|
355
|
-
...new Set([
|
|
356
|
-
...relationIds(relation).filter(referencedId => referencedId !== spentVmId &&
|
|
357
|
-
!ladderVms.includes(referencedId) &&
|
|
358
|
-
!struckCredentialVmIds.includes(referencedId)),
|
|
359
|
-
...(added ?? [])
|
|
360
|
-
])
|
|
361
|
-
];
|
|
362
|
-
const signer = await updateKeySigner({ seed: rung0.seed });
|
|
363
|
-
const updated = await updateDID({
|
|
364
|
-
log: published.log,
|
|
365
|
-
signer,
|
|
366
|
-
alsoKnownAsWeb: true,
|
|
367
|
-
updateKeys: [
|
|
368
|
-
...new Set([
|
|
369
|
-
...published.updateKeys.filter(key => key !== recovery.updateKeyMultibase &&
|
|
370
|
-
!strike.struckKeys.includes(key)),
|
|
371
|
-
rung0.keyMultibase
|
|
372
|
-
])
|
|
151
|
+
// The persist-before-publish seam: the replacement code's record and
|
|
152
|
+
// the fresh credential's unlock record (the ladder seed inside) become
|
|
153
|
+
// durable HERE, before the add entry publishes the ladder VM that seed
|
|
154
|
+
// backs.
|
|
155
|
+
onCommitted,
|
|
156
|
+
// A passphrase the account already stands on is refused before the
|
|
157
|
+
// reveal entry: this continuation retires that credential, and
|
|
158
|
+
// re-binding it would leave its old rungs standing under a new VM.
|
|
159
|
+
credentialVmIds: did => [
|
|
160
|
+
unlockKeyVmId({ did, keyAgreement: credentialKeyAgreement })
|
|
373
161
|
],
|
|
374
|
-
|
|
375
|
-
nextKeyHashes: published.nextKeyHashes.filter(hash => hash !== recoveryHash && !strike.struckHashes.includes(hash)),
|
|
376
|
-
ceremony: 'the transient-recovery add-and-retire entry'
|
|
377
|
-
}),
|
|
378
|
-
verificationMethods,
|
|
379
|
-
// The ladder VM's relation asymmetry: `assertionMethod` and
|
|
162
|
+
// The ladder VM (under the relation asymmetry: `assertionMethod` and
|
|
380
163
|
// `capabilityDelegation` only -- no `authentication`, no
|
|
381
164
|
// `capabilityInvocation` -- which is also what keeps it out of every
|
|
382
|
-
// client listing
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
165
|
+
// client listing) and the fresh credential's keyAgreement inventory in;
|
|
166
|
+
// the core appends the replacement code's after them. Atomic with the
|
|
167
|
+
// retirement: the `#DelegatedClients` pointer and the ladder-VM set
|
|
168
|
+
// change in one entry, so no window exists in which the document
|
|
169
|
+
// points at a generation the surviving record cannot reach.
|
|
170
|
+
added: ({ did, doc, persisted }) => {
|
|
171
|
+
// Refuses a malformed pointer target before the entry is built.
|
|
172
|
+
clientAnnexDidParts({ did: persisted.clientAnnexDid });
|
|
173
|
+
const ladderVmId = `${did}#${ladderVmKey}`;
|
|
174
|
+
const credentialVmId = unlockKeyVmId({
|
|
175
|
+
did,
|
|
176
|
+
keyAgreement: credentialKeyAgreement
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
methods: [
|
|
180
|
+
ladderVerificationMethod({
|
|
181
|
+
controller: did,
|
|
182
|
+
publicKeyMultibase: ladderVmKey
|
|
183
|
+
}),
|
|
184
|
+
unlockKeyVerificationMethod({
|
|
185
|
+
did,
|
|
186
|
+
keyAgreement: credentialKeyAgreement
|
|
187
|
+
})
|
|
188
|
+
],
|
|
189
|
+
assertionMethod: [ladderVmId],
|
|
190
|
+
keyAgreement: [credentialVmId],
|
|
191
|
+
capabilityDelegation: [ladderVmId],
|
|
192
|
+
services: servicesPointedAtClientAnnex({
|
|
193
|
+
doc,
|
|
194
|
+
accountDid: did,
|
|
195
|
+
clientAnnexDid: persisted.clientAnnexDid
|
|
196
|
+
})
|
|
197
|
+
};
|
|
198
|
+
},
|
|
199
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
200
|
+
...(pinStore ? { pinStore } : {}),
|
|
201
|
+
...(logId !== undefined ? { logId } : {})
|
|
202
|
+
}));
|
|
203
|
+
// `committed` is the remembered variant's signal; this one has no
|
|
204
|
+
// cross-process resume for it to serve.
|
|
205
|
+
const { committed: _committed, ...rest } = outcome;
|
|
206
|
+
return rest;
|
|
424
207
|
}
|
|
425
208
|
//# sourceMappingURL=recoveryLadderAnchored.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAMtE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;KAC1C,CAAC,CACH,CAAA;IACD,kEAAkE;IAClE,wCAAwC;IACxC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IAClD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
* roster delivers after the ensure, not the minted candidate**. The ensure
|
|
7
7
|
* adopts a roster another run landed first, and epoch[0] is create-if-absent,
|
|
8
8
|
* so installing under this run's candidate would key a collection to a key
|
|
9
|
-
* nobody holds.
|
|
10
|
-
*
|
|
9
|
+
* nobody holds. The key-versus-roster test itself is `ensureWalletSpaceEpochs`'s
|
|
10
|
+
* mint gate, which this stage hands the settled descriptor; what this stage
|
|
11
|
+
* owns is the ensure-then-re-read order around it and the mint guard. One
|
|
12
|
+
* function, two callers: the credential-anchored establishment's
|
|
13
|
+
* adopted-roster arm, and the mend entry point's roster arm, each supplying
|
|
14
|
+
* the mint preconditions through the required `beforeMint` seam.
|
|
11
15
|
*
|
|
12
16
|
* The stage order: ensure the roster (create-if-absent with the supplied
|
|
13
17
|
* candidate; the entry proof rides the caller's store signer -- the ladder VM
|
|
@@ -93,12 +97,16 @@ export type RosterDeliveredEpochsResult = {
|
|
|
93
97
|
* delegation); absent, requests invoke the root capability
|
|
94
98
|
* @param [options.collectionIds] {string[]} the fan-out's collection set
|
|
95
99
|
* override, threaded through to `ensureWalletSpaceEpochs`
|
|
96
|
-
* @param
|
|
100
|
+
* @param options.beforeMint {Function} `() => Promise<void>` -- the mint
|
|
97
101
|
* guard, awaited exactly when THIS run's own decide-read observed the
|
|
98
102
|
* roster absent and is about to install the candidate as epoch[0]. A
|
|
99
103
|
* throw refuses the mint and propagates unchanged (never folded into the
|
|
100
104
|
* create-race adoption), so a caller's mint preconditions run against the
|
|
101
|
-
* same observation the mint acts on
|
|
105
|
+
* same observation the mint acts on. Required: a served absent roster is
|
|
106
|
+
* the one observation that can turn this stage into a single-recipient
|
|
107
|
+
* roster genesis evicting every other standing credential, so no caller
|
|
108
|
+
* gets the mint without stating what licenses it. A call without the seam
|
|
109
|
+
* is refused with a `TypeError` before any read
|
|
102
110
|
* @returns {Promise<RosterDeliveredEpochsResult>}
|
|
103
111
|
*/
|
|
104
112
|
export declare function ensureRosterDeliveredEpochs({ store, candidateUserKey, clientKeyAgreementKey, was, spaceId, capability, collectionIds, beforeMint }: {
|
|
@@ -109,6 +117,6 @@ export declare function ensureRosterDeliveredEpochs({ store, candidateUserKey, c
|
|
|
109
117
|
spaceId: string;
|
|
110
118
|
capability?: IZcap;
|
|
111
119
|
collectionIds?: string[];
|
|
112
|
-
beforeMint
|
|
120
|
+
beforeMint: () => Promise<void>;
|
|
113
121
|
}): Promise<RosterDeliveredEpochsResult>;
|
|
114
122
|
//# sourceMappingURL=rosterDeliveredEpochs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterDeliveredEpochs.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"rosterDeliveredEpochs.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AAczB;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GACnC;IACE,OAAO,EAAE,WAAW,GAAG,qBAAqB,CAAA;IAC5C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,GACD;IACE,OAAO,EAAE,SAAS,CAAA;IAClB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EACX,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAoFvC"}
|
|
@@ -34,15 +34,23 @@ const CREATE_RACE_ERROR_NAMES = new Set([
|
|
|
34
34
|
* delegation); absent, requests invoke the root capability
|
|
35
35
|
* @param [options.collectionIds] {string[]} the fan-out's collection set
|
|
36
36
|
* override, threaded through to `ensureWalletSpaceEpochs`
|
|
37
|
-
* @param
|
|
37
|
+
* @param options.beforeMint {Function} `() => Promise<void>` -- the mint
|
|
38
38
|
* guard, awaited exactly when THIS run's own decide-read observed the
|
|
39
39
|
* roster absent and is about to install the candidate as epoch[0]. A
|
|
40
40
|
* throw refuses the mint and propagates unchanged (never folded into the
|
|
41
41
|
* create-race adoption), so a caller's mint preconditions run against the
|
|
42
|
-
* same observation the mint acts on
|
|
42
|
+
* same observation the mint acts on. Required: a served absent roster is
|
|
43
|
+
* the one observation that can turn this stage into a single-recipient
|
|
44
|
+
* roster genesis evicting every other standing credential, so no caller
|
|
45
|
+
* gets the mint without stating what licenses it. A call without the seam
|
|
46
|
+
* is refused with a `TypeError` before any read
|
|
43
47
|
* @returns {Promise<RosterDeliveredEpochsResult>}
|
|
44
48
|
*/
|
|
45
49
|
export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, clientKeyAgreementKey, was, spaceId, capability, collectionIds, beforeMint }) {
|
|
50
|
+
if (typeof beforeMint !== 'function') {
|
|
51
|
+
throw new TypeError('ensureRosterDeliveredEpochs requires a beforeMint seam: the mint ' +
|
|
52
|
+
'preconditions that license installing the candidate as epoch[0].');
|
|
53
|
+
}
|
|
46
54
|
// The ensure: create-if-absent with the candidate, the mint guard fired
|
|
47
55
|
// on this run's own absent observation. A read failure is a transport
|
|
48
56
|
// error and rethrows unchanged; only the guarded create's lost race is
|
|
@@ -55,9 +63,7 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
|
|
|
55
63
|
descriptor = current.descriptor;
|
|
56
64
|
}
|
|
57
65
|
else {
|
|
58
|
-
|
|
59
|
-
await beforeMint();
|
|
60
|
-
}
|
|
66
|
+
await beforeMint();
|
|
61
67
|
descriptor = await ensureUserKeyRoster({
|
|
62
68
|
store,
|
|
63
69
|
userKey: candidateUserKey,
|
|
@@ -66,7 +72,7 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
|
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
catch (err) {
|
|
69
|
-
if (!CREATE_RACE_ERROR_NAMES.has(err
|
|
75
|
+
if (!CREATE_RACE_ERROR_NAMES.has(err?.name ?? '')) {
|
|
70
76
|
throw err;
|
|
71
77
|
}
|
|
72
78
|
const reread = await store.read();
|
|
@@ -91,19 +97,22 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
|
|
|
91
97
|
userKey = read.userKey;
|
|
92
98
|
}
|
|
93
99
|
catch (err) {
|
|
94
|
-
if (err
|
|
100
|
+
if (err?.name === 'UserKeyRosterUnwrapError') {
|
|
95
101
|
return { outcome: 'no-wrap', rosterDescriptor: descriptor, error: err };
|
|
96
102
|
}
|
|
97
103
|
throw err;
|
|
98
104
|
}
|
|
99
105
|
// The fan-out, under the DELIVERED key -- create-if-absent per collection,
|
|
100
106
|
// so this call is also the completion test's re-entry on an epoch-less
|
|
101
|
-
// encrypted collection behind a present roster.
|
|
102
|
-
//
|
|
107
|
+
// encrypted collection behind a present roster. The settled descriptor
|
|
108
|
+
// rides along so the fan-out's own mint gate stands between the key and
|
|
109
|
+
// the install. Per-collection failures ride the result's `failed` list to
|
|
110
|
+
// the caller.
|
|
103
111
|
const epochs = await ensureWalletSpaceEpochs({
|
|
104
112
|
was,
|
|
105
113
|
spaceId,
|
|
106
114
|
userKey,
|
|
115
|
+
rosterDescriptor: descriptor,
|
|
107
116
|
...(capability !== undefined ? { capability } : {}),
|
|
108
117
|
...(collectionIds !== undefined ? { collectionIds } : {})
|
|
109
118
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterDeliveredEpochs.js","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rosterDeliveredEpochs.js","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AA8CA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,yBAAyB;IACzB,uBAAuB;CACxB,CAAC,CAAA;AAiCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAA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A;IACpB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC;YACnC,KAAK;YACL,UAAU;YACV,OAAO,EAAE,gBAAgB;YACzB,qBAAqB;SACtB,CAAC,CAAA;QACF,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IACG,GAAgC,EAAE,IAAI,KAAK,0BAA0B,EACtE,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;QACzE,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;IAED,2EAA2E;IAC3E,uEAAuE;IACvE,uEAAuE;IACvE,wEAAwE;IACxE,0EAA0E;IAC1E,cAAc;IACd,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC;QAC3C,GAAG;QACH,OAAO;QACP,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,WAAW;QACjE,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,MAAM;QACN,MAAM;KACP,CAAA;AACH,CAAC"}
|
|
@@ -106,7 +106,7 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
106
106
|
const signingKeyMultibase = clientSigningKeyMultibase({ keyAgent });
|
|
107
107
|
const webvhUpdateKeys = resume
|
|
108
108
|
? resume.webvhUpdateKeys
|
|
109
|
-
:
|
|
109
|
+
: mintClientWebvhUpdateKeys();
|
|
110
110
|
const newClientKeys = {
|
|
111
111
|
signingKeyMultibase,
|
|
112
112
|
keyAgreementKeyMultibase,
|
|
@@ -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,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,OAAO,EACP,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,MAAM,EAiBP;IASC,4EAA4E;IAC5E,iEAAiE;IACjE,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,MAAM,IAAI,SAAS,CACjB,oEAAoE;YAClE,qEAAqE,CACxE,CAAA;IACH,CAAC;IACD,wEAAwE;IACxE,0EAA0E;IAC1E,2CAA2C;IAC3C,IAAI,MAAM,EAAE,CAAC;QAC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I,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,kEAAkE;YAChE,kCAAkC,CACrC,CAAA;IACH,CAAC;IAED,uEAAuE;IACvE,oEAAoE;IACpE,yDAAyD;IACzD,MAAM,yBAAyB,CAAC;QAC9B,KAAK;QACL,SAAS,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"}
|