@interop/wallet-core 0.62.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -16
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +119 -35
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +227 -160
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -8
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +37 -64
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +85 -38
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +155 -98
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -2
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +16 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +65 -14
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +397 -298
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +23 -7
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +26 -7
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +58 -0
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +249 -41
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +391 -346
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +237 -53
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +533 -198
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +12 -6
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +44 -72
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +123 -0
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
- package/dist/clientAnnex/spaceCapability.js +152 -0
- package/dist/clientAnnex/spaceCapability.js.map +1 -0
- package/dist/clientAnnex/stages.d.ts +63 -0
- package/dist/clientAnnex/stages.d.ts.map +1 -0
- package/dist/clientAnnex/stages.js +64 -0
- package/dist/clientAnnex/stages.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +42 -35
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/policy.d.ts +15 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +12 -6
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -10
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +13 -5
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +10 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +41 -24
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +6 -23
- package/dist/descriptors/acquire.js.map +1 -1
- package/dist/descriptors/cipher.d.ts.map +1 -1
- package/dist/descriptors/cipher.js +5 -0
- package/dist/descriptors/cipher.js.map +1 -1
- package/dist/descriptors/errors.d.ts +43 -0
- package/dist/descriptors/errors.d.ts.map +1 -0
- package/dist/descriptors/errors.js +45 -0
- package/dist/descriptors/errors.js.map +1 -0
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +37 -10
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +52 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +42 -11
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +80 -22
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +3 -1
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +3 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/identity/agents.d.ts +17 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +23 -7
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +3 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/index.d.ts +2 -1
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +2 -1
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +3 -6
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +14 -5
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -36
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +22 -8
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +20 -6
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +15 -12
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +21 -16
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +10 -9
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -3
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/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 +95 -8
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +278 -35
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +117 -16
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +184 -43
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/keys/wasLabelsStore.d.ts +9 -2
- package/dist/keys/wasLabelsStore.d.ts.map +1 -1
- package/dist/keys/wasLabelsStore.js +14 -6
- package/dist/keys/wasLabelsStore.js.map +1 -1
- package/dist/log.d.ts +7 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/recovery/index.d.ts +13 -9
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +12 -8
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +27 -7
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +18 -6
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +23 -0
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +66 -46
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +75 -63
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +127 -116
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/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 +32 -8
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +39 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +1 -6
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +2 -2
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +2 -3
- package/dist/request/parse.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +34 -12
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +79 -86
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +182 -0
- package/dist/resourceLog/document.d.ts.map +1 -0
- package/dist/resourceLog/document.js +159 -0
- package/dist/resourceLog/document.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +47 -8
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +54 -8
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +7 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +7 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts +35 -0
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
- package/dist/resourceLog/ladderRungs.js +352 -0
- package/dist/resourceLog/ladderRungs.js.map +1 -0
- package/dist/resourceLog/license.d.ts +42 -17
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +38 -24
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +15 -15
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +15 -15
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +11 -0
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +13 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/deleteSpace.d.ts +28 -0
- package/dist/space/deleteSpace.d.ts.map +1 -0
- package/dist/space/deleteSpace.js +44 -0
- package/dist/space/deleteSpace.js.map +1 -0
- package/dist/space/errors.d.ts.map +1 -1
- package/dist/space/errors.js +0 -1
- package/dist/space/errors.js.map +1 -1
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +6 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/plaintextCollection.d.ts +43 -0
- package/dist/space/plaintextCollection.d.ts.map +1 -0
- package/dist/space/plaintextCollection.js +17 -0
- package/dist/space/plaintextCollection.js.map +1 -0
- package/dist/stages.d.ts +23 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +23 -0
- package/dist/stages.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.js +4 -4
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.js +2 -2
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +41 -1
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +47 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +5 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +35 -7
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +52 -14
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +5 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +217 -35
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +469 -210
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +146 -0
- package/dist/webvh/accountEntry.d.ts.map +1 -0
- package/dist/webvh/accountEntry.js +239 -0
- package/dist/webvh/accountEntry.js.map +1 -0
- package/dist/webvh/didWeb.d.ts +12 -7
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +2 -2
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +164 -0
- package/dist/webvh/didWebProjection.d.ts.map +1 -0
- package/dist/webvh/didWebProjection.js +230 -0
- package/dist/webvh/didWebProjection.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +275 -136
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +307 -340
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +65 -0
- package/dist/webvh/enrollClient.d.ts.map +1 -0
- package/dist/webvh/enrollClient.js +172 -0
- package/dist/webvh/enrollClient.js.map +1 -0
- package/dist/webvh/index.d.ts +37 -12
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +33 -10
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +1 -35
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -30
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +41 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +99 -48
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +61 -14
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +91 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +59 -5
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +76 -11
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +8 -8
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +39 -14
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +14 -1
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +3 -27
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +2 -2
- package/dist/webvh/keyAgreement.d.ts +0 -97
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -71
- package/dist/webvh/keyAgreement.js.map +0 -1
|
@@ -33,7 +33,15 @@
|
|
|
33
33
|
* ladder-signed entry through the bridge takes the client's whole document
|
|
34
34
|
* inventory out. The app's local wipe runs after this ceremony returns, so
|
|
35
35
|
* a tear anywhere before the entry reads as "not forgotten" and a re-click
|
|
36
|
-
* resumes.
|
|
36
|
+
* resumes. The post-removal `did:web` projection is PUT through
|
|
37
|
+
* `clientLogStore` immediately BEFORE that entry: the entry itself
|
|
38
|
+
* publishes `did.jsonl` alone (the bridge covers nothing else), and this
|
|
39
|
+
* client's authority ends at it, so the projection has to be written while
|
|
40
|
+
* it can still be written. That store is required for exactly this reason
|
|
41
|
+
* -- without it `did.json` would keep naming this client until a later
|
|
42
|
+
* writer ran `ensureDidWebProjection`, and a `did:web` verifier would
|
|
43
|
+
* accept the forgotten key meanwhile (WAS authorization would not: the
|
|
44
|
+
* server resolves the controller from `did.jsonl`).
|
|
37
45
|
*
|
|
38
46
|
* Torn-state map: a run torn after stage 1 leaves the account rotated off a
|
|
39
47
|
* client the document still lists -- writes already land under the fresh key,
|
|
@@ -60,9 +68,10 @@
|
|
|
60
68
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
61
69
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
62
70
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
71
|
+
import type { WebvhIdStore } from '../webvh/didWebvh.js';
|
|
63
72
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
64
73
|
import type { RevokedClientKeys } from '../webvh/revokeClient.js';
|
|
65
|
-
import { type CascadeCollections, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
74
|
+
import { type CascadeCollections, type UserKey, type UserKeyAdoptedHook, type UserKeyCascadeResult } from '../keys/index.js';
|
|
66
75
|
import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
67
76
|
/**
|
|
68
77
|
* What a completed forget reports: whether the roster's wrap for the
|
|
@@ -90,6 +99,10 @@ export interface EnrolledClientForgetResult {
|
|
|
90
99
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
91
100
|
* `did.jsonl` bridge store; also serves the ceremony's public pre-edit
|
|
92
101
|
* read
|
|
102
|
+
* @param options.clientLogStore {object} the account's `id` collection
|
|
103
|
+
* store invoked under THIS (still-standing) enrolled client's root
|
|
104
|
+
* authority. Used for one thing: the post-removal `did:web` projection PUT
|
|
105
|
+
* that precedes the removal entry (see stage 3 in the module doc)
|
|
93
106
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
94
107
|
* pins. Every read the ceremony makes -- the pre-edit read the roster
|
|
95
108
|
* rotation's recipient document comes from, and the removal entry's own
|
|
@@ -127,8 +140,9 @@ export interface EnrolledClientForgetResult {
|
|
|
127
140
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
128
141
|
* @returns {Promise<EnrolledClientForgetResult>}
|
|
129
142
|
*/
|
|
130
|
-
export declare function forgetEnrolledClient({ logStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }: {
|
|
143
|
+
export declare function forgetEnrolledClient({ logStore, clientLogStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }: {
|
|
131
144
|
logStore: UnlockLogStore;
|
|
145
|
+
clientLogStore: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
132
146
|
pinStore?: ResourceLogPinStore;
|
|
133
147
|
logId?: string;
|
|
134
148
|
ladderSeed: Uint8Array;
|
|
@@ -140,11 +154,7 @@ export declare function forgetEnrolledClient({ logStore, pinStore, logId, ladder
|
|
|
140
154
|
credentialKeyAgreementKey: IKeyAgreementKey;
|
|
141
155
|
userKey?: UserKey;
|
|
142
156
|
pinnedEpochId?: string | null;
|
|
143
|
-
onUserKeyAdopted?:
|
|
144
|
-
userKey: UserKey;
|
|
145
|
-
latestEpochId: string;
|
|
146
|
-
descriptor: CollectionEncryption;
|
|
147
|
-
}) => Promise<void>;
|
|
157
|
+
onUserKeyAdopted?: UserKeyAdoptedHook;
|
|
148
158
|
collections: CascadeCollections;
|
|
149
159
|
}): Promise<EnrolledClientForgetResult>;
|
|
150
160
|
//# sourceMappingURL=forget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forget.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"forget.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;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;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,oBAAoB,CAAA;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,iCAAiC,EACjC,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,yBAAyB,EACzB,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,WAAW,EACZ,EAAE;IACD,QAAQ,EAAE,cAAc,CAAA;IACxB,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;IACxE,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,iBAAiB,CAAA;IAClC,iCAAiC,EAAE,MAAM,CAAA;IACzC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,yBAAyB,CAAA;IACtC,yBAAyB,EAAE,gBAAgB,CAAA;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,kBAAkB,CAAA;IACrC,WAAW,EAAE,kBAAkB,CAAA;CAChC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAmEtC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { relationIds } from '../resourceLog/document.js';
|
|
2
|
+
import { readPublishedLogOrThrow } from '../webvh/didWebvh.js';
|
|
3
|
+
import { retireRosterRecipientAndCascade, rosterRecipientKid } from '../keys/index.js';
|
|
3
4
|
import { forgetWebvhClient, LastEnrolledClientForgetError } from './ladderAnchored.js';
|
|
4
5
|
/**
|
|
5
6
|
* Forgets one enrolled client -- this browser's own -- from its
|
|
@@ -11,6 +12,10 @@ import { forgetWebvhClient, LastEnrolledClientForgetError } from './ladderAnchor
|
|
|
11
12
|
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
12
13
|
* `did.jsonl` bridge store; also serves the ceremony's public pre-edit
|
|
13
14
|
* read
|
|
15
|
+
* @param options.clientLogStore {object} the account's `id` collection
|
|
16
|
+
* store invoked under THIS (still-standing) enrolled client's root
|
|
17
|
+
* authority. Used for one thing: the post-removal `did:web` projection PUT
|
|
18
|
+
* that precedes the removal entry (see stage 3 in the module doc)
|
|
14
19
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
15
20
|
* pins. Every read the ceremony makes -- the pre-edit read the roster
|
|
16
21
|
* rotation's recipient document comes from, and the removal entry's own
|
|
@@ -48,22 +53,18 @@ import { forgetWebvhClient, LastEnrolledClientForgetError } from './ladderAnchor
|
|
|
48
53
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
49
54
|
* @returns {Promise<EnrolledClientForgetResult>}
|
|
50
55
|
*/
|
|
51
|
-
export async function forgetEnrolledClient({ logStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }) {
|
|
56
|
+
export async function forgetEnrolledClient({ logStore, clientLogStore, pinStore, logId, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections }) {
|
|
52
57
|
// The pre-edit read, doing double duty: the last-client refusal must fire
|
|
53
58
|
// BEFORE the rotation (or a refused forget would already have retired this
|
|
54
59
|
// client's wrap), and the rotation's recipient resolver needs the pre-edit
|
|
55
60
|
// document (which still keys every other recipient).
|
|
56
|
-
const published = await
|
|
57
|
-
// readPublishedLog only calls getIdResourceRaw, so the narrow seam is
|
|
58
|
-
// safe.
|
|
61
|
+
const published = await readPublishedLogOrThrow({
|
|
59
62
|
idStore: logStore,
|
|
60
63
|
expectedDid,
|
|
61
64
|
...(pinStore ? { pinStore } : {}),
|
|
62
|
-
...(logId !== undefined ? { logId } : {})
|
|
65
|
+
...(logId !== undefined ? { logId } : {}),
|
|
66
|
+
missingMessage: 'did:webvh: did.jsonl is missing; nothing to forget from.'
|
|
63
67
|
});
|
|
64
|
-
if (!published) {
|
|
65
|
-
throw new Error('did:webvh: did.jsonl is missing; nothing to forget from.');
|
|
66
|
-
}
|
|
67
68
|
const signingVmId = `${published.did}#${forgottenClient.signingKeyMultibase}`;
|
|
68
69
|
const invocationIds = relationIds(published.doc.capabilityInvocation);
|
|
69
70
|
if (invocationIds.includes(signingVmId) &&
|
|
@@ -71,61 +72,33 @@ export async function forgetEnrolledClient({ logStore, pinStore, logId, ladderSe
|
|
|
71
72
|
throw new LastEnrolledClientForgetError();
|
|
72
73
|
}
|
|
73
74
|
// Stages 1 and 2: the roster rotation off this client's wrap and the
|
|
74
|
-
// collection fan-out, both under this client's still-standing authority
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
// collection fan-out, both under this client's still-standing authority
|
|
76
|
+
// -- the shared recipient-retiring tail, anchored at the pre-edit head
|
|
77
|
+
// this read verified (the orchestrator sets the roster store's minimum
|
|
78
|
+
// controller version there, so a store wired over a stale cached view
|
|
79
|
+
// still appends under a view that carries every recipient the rotation
|
|
80
|
+
// resolves). The wrap is retired by its roster kid explicitly, since the
|
|
81
|
+
// document still lists this client, and the fresh key comes back through
|
|
82
|
+
// the credential's standing wrap.
|
|
83
|
+
const tail = await retireRosterRecipientAndCascade({
|
|
84
|
+
rosterStore,
|
|
85
|
+
did: published.did,
|
|
86
|
+
doc: published.doc,
|
|
87
|
+
log: published.log,
|
|
88
|
+
retireRecipientId: rosterRecipientKid({
|
|
81
89
|
signingKeyMultibase: forgottenClient.signingKeyMultibase,
|
|
82
90
|
keyAgreementKeyMultibase: forgottenKeyAgreementKeyMultibase
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
document: published.doc,
|
|
91
|
-
retireRecipientId: forgottenKid
|
|
92
|
-
});
|
|
93
|
-
rotated = true;
|
|
94
|
-
}
|
|
95
|
-
// The fresh key comes back through the credential's standing wrap -- this
|
|
96
|
-
// client's own is gone from the current epoch -- with the continuity and
|
|
97
|
-
// possession checks still running on the threaded descriptor.
|
|
98
|
-
const adopted = await readUserKeyRoster({
|
|
99
|
-
store: rosterStore,
|
|
100
|
-
descriptor,
|
|
101
|
-
...(userKey ? { userKey } : {}),
|
|
102
|
-
clientKeyAgreementKey: credentialKeyAgreementKey,
|
|
103
|
-
pinnedEpochId
|
|
104
|
-
});
|
|
105
|
-
if (adopted.rotated) {
|
|
106
|
-
await onUserKeyAdopted?.({
|
|
107
|
-
userKey: adopted.userKey,
|
|
108
|
-
latestEpochId: adopted.latestEpochId,
|
|
109
|
-
descriptor: adopted.descriptor
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
read = { userKey: adopted.userKey, descriptor: adopted.descriptor };
|
|
113
|
-
cascade = await cascadeCollectionsToUserKey({
|
|
114
|
-
collectionIds: typeof collections.collectionIds === 'function'
|
|
115
|
-
? await collections.collectionIds()
|
|
116
|
-
: collections.collectionIds,
|
|
117
|
-
storeFor: collections.storeFor,
|
|
118
|
-
...(collections.isEncrypted
|
|
119
|
-
? { isEncrypted: collections.isEncrypted }
|
|
120
|
-
: {}),
|
|
121
|
-
rosterDescriptor: adopted.descriptor,
|
|
122
|
-
clientKeyAgreementKey: credentialKeyAgreementKey,
|
|
123
|
-
userKey: adopted.userKey
|
|
124
|
-
});
|
|
125
|
-
}
|
|
91
|
+
}),
|
|
92
|
+
...(userKey ? { userKey } : {}),
|
|
93
|
+
readBackKeyAgreementKey: credentialKeyAgreementKey,
|
|
94
|
+
pinnedEpochId,
|
|
95
|
+
...(onUserKeyAdopted ? { onUserKeyAdopted } : {}),
|
|
96
|
+
collections
|
|
97
|
+
});
|
|
126
98
|
// Stage 3: the atomic ladder-signed removal entry, through the bridge.
|
|
127
99
|
const removed = await forgetWebvhClient({
|
|
128
100
|
store: logStore,
|
|
101
|
+
projectionStore: clientLogStore,
|
|
129
102
|
ladderSeed,
|
|
130
103
|
forgottenClient,
|
|
131
104
|
...(knownLatentHashes ? { knownLatentHashes } : {}),
|
|
@@ -134,12 +107,12 @@ export async function forgetEnrolledClient({ logStore, pinStore, logId, ladderSe
|
|
|
134
107
|
...(logId !== undefined ? { logId } : {})
|
|
135
108
|
});
|
|
136
109
|
return {
|
|
137
|
-
rotated,
|
|
138
|
-
collections:
|
|
110
|
+
rotated: tail.rotated,
|
|
111
|
+
collections: tail.collections,
|
|
139
112
|
did: removed.did,
|
|
140
113
|
document: removed.doc,
|
|
141
|
-
...(
|
|
142
|
-
? { userKey:
|
|
114
|
+
...(tail.userKey && tail.rosterDescriptor
|
|
115
|
+
? { userKey: tail.userKey, rosterDescriptor: tail.rosterDescriptor }
|
|
143
116
|
: {})
|
|
144
117
|
};
|
|
145
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAsEA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAI9D,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAKnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,qBAAqB,CAAA;AAoB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,iCAAiC,EACjC,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,yBAAyB,EACzB,OAAO,EACP,aAAa,EACb,gBAAgB,E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C,CAAC,CAAC,EAAE,CAAC;QAC/B,uBAAuB,EAAE,yBAAyB;QAClD,aAAa;QACb,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,WAAW;KACZ,CAAC,CAAA;IAEF,uEAAuE;IACvE,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,cAAc;QAC/B,UAAU;QACV,eAAe;QACf,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,WAAW;QACX,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAC,CAAA;IAEF,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,GAAG;QACrB,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,gBAAgB;YACvC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACpE,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC"}
|
|
@@ -48,22 +48,31 @@
|
|
|
48
48
|
* 2. **The roster rotation**, ladder-signed, anchored at the reinstall entry,
|
|
49
49
|
* HTTP-invoked under the still-standing client: the user key rotates off
|
|
50
50
|
* this client's wrap in ONE append (the license's one-shot shape), read
|
|
51
|
-
* back through the credential's standing wrap.
|
|
51
|
+
* back through the credential's standing wrap. The anchoring is this
|
|
52
|
+
* ceremony's guarantee rather than the app's wiring: the shared
|
|
53
|
+
* recipient-retiring tail (`retireRosterRecipientAndCascade`) sets the
|
|
54
|
+
* roster store's minimum controller version from the post-reinstall log,
|
|
55
|
+
* so a store resolving its controller from a cached pre-transition view
|
|
56
|
+
* still lands the append at the reinstall version. Because the append's
|
|
52
57
|
* signer is the ladder VM -- a key the post-removal document still lists
|
|
53
58
|
* -- the roster log needs no seal repair afterwards, which matters on
|
|
54
59
|
* an account where no enrolled client's login sweep will ever run again.
|
|
55
60
|
* 3. **The collection fan-out**, still under this client's invocation
|
|
56
61
|
* authority: every encrypted collection re-epochs onto the fresh key.
|
|
57
62
|
* 4. **The generation-delegation replacement and revocations**: a fresh
|
|
58
|
-
* ladder-signed generation delegation replaces the embedded one
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
63
|
+
* ladder-signed generation delegation replaces the embedded one when the
|
|
64
|
+
* house staleness policy, read against a projected post-edit document,
|
|
65
|
+
* says it is owed -- this credential's ladder VM and the forgotten client
|
|
66
|
+
* are both named retiring, which is every key this ceremony ends. Then
|
|
67
|
+
* EVERY still-unexpired delegation the annex log's history ever embedded
|
|
68
|
+
* that this credential's ladder VM signed is revoked at the server (a
|
|
69
|
+
* renewal inside the 30-day window can leave two) -- closing the
|
|
70
|
+
* resurrection window a reinstalled derived-key VM would otherwise
|
|
71
|
+
* reopen. The replacement is what keeps the account
|
|
72
|
+
* transient-login-reachable after the transition; replace-before-revoke
|
|
73
|
+
* is what keeps a torn run from stranding the generation delegation-less.
|
|
74
|
+
* A delegation a surviving sibling credential's ladder signed is left
|
|
75
|
+
* standing, since the revocation loop never reaches it either.
|
|
67
76
|
* 5. **The other unlock methods' record re-mint** (`unlockMethods`): every
|
|
68
77
|
* other standing credential's and recovery code's bridge (and
|
|
69
78
|
* `delegatedClients` sibling, where the record carries one) is re-signed
|
|
@@ -98,8 +107,15 @@
|
|
|
98
107
|
* omits the seam is refused before any read.
|
|
99
108
|
* 7. **The removal entry** ({@link forgetLastWebvhClient}): the client's
|
|
100
109
|
* whole document inventory out while the reinstalled ladder VM keeps the
|
|
101
|
-
* account anchored. The
|
|
102
|
-
*
|
|
110
|
+
* account anchored. The post-removal `did:web` projection is PUT through
|
|
111
|
+
* `clientLogStore` immediately BEFORE that entry, since the entry itself
|
|
112
|
+
* is ladder-signed and writes `did.jsonl` alone while the client's root
|
|
113
|
+
* authority ends at it -- without that the account would land client-less
|
|
114
|
+
* with `did.json` still publishing the forgotten client's keys and nothing
|
|
115
|
+
* left able to rewrite it. A run torn between the PUT and the entry leaves
|
|
116
|
+
* `did.json` omitting a client the log still lists, which is fail-closed
|
|
117
|
+
* for a `did:web` verifier and re-PUT by the re-run. The app's local wipe
|
|
118
|
+
* runs after this ceremony returns.
|
|
103
119
|
*
|
|
104
120
|
* Torn-state map: every stage detects completion from durable state, so a
|
|
105
121
|
* run torn anywhere before the removal entry reads as "not forgotten" and a
|
|
@@ -114,9 +130,10 @@
|
|
|
114
130
|
* roster skips the append (no second ladder-signed append is ever
|
|
115
131
|
* attempted), the fan-out is staleness-driven, a re-POSTed revocation's 400
|
|
116
132
|
* already-revoked answer reads as success (decision 0006's resume contract),
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* nothing
|
|
133
|
+
* the generation stage re-asks the same staleness policy (a prior run's own
|
|
134
|
+
* fresh delegation reads as retiring, so a re-run churns one delegation and
|
|
135
|
+
* strands nothing, while a sibling-signed one churns none), and the record
|
|
136
|
+
* re-mint re-checks staleness per entry (a record
|
|
120
137
|
* already ladder-signed reads as current, one whose re-mint failed is still
|
|
121
138
|
* rotted and is re-minted). Torn after the removal entry is the
|
|
122
139
|
* finish-the-wipe state the app's next login maps.
|
|
@@ -125,21 +142,23 @@
|
|
|
125
142
|
* browser already fetched stays forensically recoverable from its storage,
|
|
126
143
|
* and old epochs stay open to keys it already held.
|
|
127
144
|
*/
|
|
128
|
-
import type { DIDLog } from '@interop/did-method-webvh';
|
|
145
|
+
import type { DIDDoc, DIDLog } from '@interop/did-method-webvh';
|
|
129
146
|
import type { IKeyAgreementKey, IZcap } from '@interop/data-integrity-core';
|
|
130
147
|
import type { ZcapClient } from '@interop/ezcap';
|
|
131
148
|
import type { CollectionEncryption, IDelegatedZcap } from '@interop/was-client';
|
|
132
|
-
import type {
|
|
149
|
+
import type { WebvhIdStore } from '../webvh/didWebvh.js';
|
|
133
150
|
import { type RevokedClientKeys } from '../webvh/revokeClient.js';
|
|
134
151
|
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
135
|
-
import { type CascadeCollections, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
152
|
+
import { type CascadeCollections, type SealableEncryptionDescriptorStore, type UserKey, type UserKeyAdoptedHook, type UserKeyCascadeResult } from '../keys/index.js';
|
|
136
153
|
import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
137
154
|
import type { AccountPointer } from '../keyring/record.js';
|
|
138
155
|
import { type RecordRemintOutcome, type RecoveryDelegationEntry } from '../recovery/recoveryDelegation.js';
|
|
139
156
|
import { type ClientAnnexWriteStore } from './log.js';
|
|
140
157
|
/**
|
|
141
158
|
* What the ceremony's generation stage did: the revoked delegation ids, and
|
|
142
|
-
* whether
|
|
159
|
+
* whether it wrote a replacement -- `false` with no `skipped` reason means
|
|
160
|
+
* nothing was owed, the standing delegation being one a surviving sibling
|
|
161
|
+
* credential's ladder signed. A `skipped` reason names the stage
|
|
143
162
|
* that could not run -- `no-pointer` (the account points at no generation:
|
|
144
163
|
* nothing to revoke or replace), `log-unreadable` (the pointed generation's
|
|
145
164
|
* `did.jsonl` is gone; the delegation bytes are unrecoverable, decision
|
|
@@ -242,8 +261,10 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
242
261
|
* strike-and-reinstall pair publishes through it, because the bridge
|
|
243
262
|
* `logStore` is often signed by the ladder VM the strike removes and the
|
|
244
263
|
* reinstall would then be refused under the current-key-set rule. Both
|
|
245
|
-
* entries stay ladder-signed; only the HTTP invocation differs.
|
|
246
|
-
*
|
|
264
|
+
* entries stay ladder-signed; only the HTTP invocation differs. It also
|
|
265
|
+
* carries the removal entry's pre-entry `did:web` projection PUT (stage 7),
|
|
266
|
+
* the one write the bridge store cannot make. Required: a call without it
|
|
267
|
+
* throws a `TypeError` before any read
|
|
247
268
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
248
269
|
* pins, the account log's slot derived from `annex.accountSpaceId`. Every
|
|
249
270
|
* account-log read the ceremony makes -- the opening read, and the strike,
|
|
@@ -263,13 +284,19 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
263
284
|
* excluded from the staged-hash attribution
|
|
264
285
|
* @param options.expectedDid {string} the account DID from the caller's
|
|
265
286
|
* stored account pointer
|
|
266
|
-
* @param options.
|
|
267
|
-
*
|
|
268
|
-
* SIGNED BY THE LADDER VM
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
287
|
+
* @param options.rosterStore {SealableEncryptionDescriptorStore} the
|
|
288
|
+
* log-governed `key-map/user-key.jsonl` roster store whose appends are
|
|
289
|
+
* SIGNED BY THE LADDER VM while its HTTP requests invoke under the
|
|
290
|
+
* still-standing client. Its controller view is the ceremony's to anchor,
|
|
291
|
+
* not the app's: the orchestrator sets the minimum controller version at
|
|
292
|
+
* the pre-transition head for the opening read and at the post-reinstall
|
|
293
|
+
* head for the rotation (the inventory-changing anchor the ceremony-tail
|
|
294
|
+
* license admits), so a store wired over a cached pre-transition view
|
|
295
|
+
* still anchors the one ladder-signed append past the reinstall entry.
|
|
296
|
+
* Required to be anchorable: a store without `setMinimumControllerVersion`
|
|
297
|
+
* is refused with a `TypeError` before any read, since the pair would
|
|
298
|
+
* otherwise publish two entries per attempt ahead of a rotation the
|
|
299
|
+
* license refuses every time
|
|
273
300
|
* @param options.credentialKeyAgreementKey {IKeyAgreementKey} the standing
|
|
274
301
|
* credential's key-agreement key -- the recipient whose wrap survives the
|
|
275
302
|
* rotation, reading the fresh key back and unwrapping the generations for
|
|
@@ -316,7 +343,7 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
316
343
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
317
344
|
* @returns {Promise<LastEnrolledClientForgetResult>}
|
|
318
345
|
*/
|
|
319
|
-
export declare function forgetLastEnrolledClient({ logStore, clientLogStore, pinStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid,
|
|
346
|
+
export declare function forgetLastEnrolledClient({ logStore, clientLogStore, pinStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStore, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now }: {
|
|
320
347
|
logStore: UnlockLogStore;
|
|
321
348
|
clientLogStore: UnlockLogStore;
|
|
322
349
|
pinStore?: ResourceLogPinStore;
|
|
@@ -325,18 +352,11 @@ export declare function forgetLastEnrolledClient({ logStore, clientLogStore, pin
|
|
|
325
352
|
forgottenKeyAgreementKeyMultibase: string;
|
|
326
353
|
knownLatentHashes?: string[];
|
|
327
354
|
expectedDid: string;
|
|
328
|
-
|
|
329
|
-
did: string;
|
|
330
|
-
log: DIDLog;
|
|
331
|
-
}) => EncryptionDescriptorStore;
|
|
355
|
+
rosterStore: SealableEncryptionDescriptorStore;
|
|
332
356
|
credentialKeyAgreementKey: IKeyAgreementKey;
|
|
333
357
|
userKey?: UserKey;
|
|
334
358
|
pinnedEpochId?: string | null;
|
|
335
|
-
onUserKeyAdopted?:
|
|
336
|
-
userKey: UserKey;
|
|
337
|
-
latestEpochId: string;
|
|
338
|
-
descriptor: CollectionEncryption;
|
|
339
|
-
}) => Promise<void>;
|
|
359
|
+
onUserKeyAdopted?: UserKeyAdoptedHook;
|
|
340
360
|
collections: CascadeCollections;
|
|
341
361
|
annex: {
|
|
342
362
|
storeFor: (options: {
|
|
@@ -356,4 +376,31 @@ export declare function forgetLastEnrolledClient({ logStore, clientLogStore, pin
|
|
|
356
376
|
}) => Promise<void>;
|
|
357
377
|
now?: number;
|
|
358
378
|
}): Promise<LastEnrolledClientForgetResult>;
|
|
379
|
+
/**
|
|
380
|
+
* THE LAST-CLIENT REMOVAL ENTRY (stage 7, the transition's own removal): the
|
|
381
|
+
* plain forget's removal shape (`clientForgetEntryOnce`) with this ceremony's
|
|
382
|
+
* removability invariant injected instead of the plain forget's last-client
|
|
383
|
+
* refusal -- the forgotten client IS the last enrolled client, and the
|
|
384
|
+
* account stays invocable because the ladder VM the reinstall entry published
|
|
385
|
+
* remains in the document. Run only from {@link forgetLastEnrolledClient},
|
|
386
|
+
* which sequences the strike-and-reinstall pair, the rotation, and the
|
|
387
|
+
* revocations before it.
|
|
388
|
+
*
|
|
389
|
+
* @param options {object} see `forgetWebvhClient` in `ladderAnchored.ts`
|
|
390
|
+
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>}
|
|
391
|
+
*/
|
|
392
|
+
export declare function forgetLastWebvhClient(options: {
|
|
393
|
+
store: UnlockLogStore;
|
|
394
|
+
projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
395
|
+
ladderSeed: Uint8Array;
|
|
396
|
+
forgottenClient: RevokedClientKeys;
|
|
397
|
+
knownLatentHashes?: string[];
|
|
398
|
+
expectedDid?: string;
|
|
399
|
+
pinStore?: ResourceLogPinStore;
|
|
400
|
+
logId?: string;
|
|
401
|
+
}): Promise<{
|
|
402
|
+
did: string;
|
|
403
|
+
doc: DIDDoc;
|
|
404
|
+
log: DIDLog;
|
|
405
|
+
}>;
|
|
359
406
|
//# sourceMappingURL=forgetLast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex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