@interop/wallet-core 0.49.0 → 0.51.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 +5 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +127 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.js +195 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -0
- package/dist/clientAnnex/forget.d.ts +138 -0
- package/dist/clientAnnex/forget.d.ts.map +1 -0
- package/dist/clientAnnex/forget.js +133 -0
- package/dist/clientAnnex/forget.js.map +1 -0
- package/dist/clientAnnex/forgetLast.d.ts +291 -0
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -0
- package/dist/clientAnnex/forgetLast.js +408 -0
- package/dist/clientAnnex/forgetLast.js.map +1 -0
- package/dist/{webvh/companionGc.d.ts → clientAnnex/gc.d.ts} +50 -16
- package/dist/clientAnnex/gc.d.ts.map +1 -0
- package/dist/{webvh/companionGc.js → clientAnnex/gc.js} +103 -71
- package/dist/clientAnnex/gc.js.map +1 -0
- package/dist/clientAnnex/index.d.ts +60 -0
- package/dist/clientAnnex/index.d.ts.map +1 -0
- package/dist/clientAnnex/index.js +60 -0
- package/dist/clientAnnex/index.js.map +1 -0
- package/dist/{unlock → clientAnnex}/ladder.d.ts +89 -15
- package/dist/clientAnnex/ladder.d.ts.map +1 -0
- package/dist/clientAnnex/ladder.js +474 -0
- package/dist/clientAnnex/ladder.js.map +1 -0
- package/dist/clientAnnex/ladderAnchored.d.ts +276 -0
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -0
- package/dist/clientAnnex/ladderAnchored.js +631 -0
- package/dist/clientAnnex/ladderAnchored.js.map +1 -0
- package/dist/{webvh/companion.d.ts → clientAnnex/log.d.ts} +333 -119
- package/dist/clientAnnex/log.d.ts.map +1 -0
- package/dist/{webvh/companion.js → clientAnnex/log.js} +583 -199
- package/dist/clientAnnex/log.js.map +1 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +103 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -0
- package/dist/clientAnnex/recoveryLadderAnchored.js +263 -0
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -0
- package/dist/{unlock → clientAnnex}/selfEnroll.d.ts +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -0
- package/dist/{unlock → clientAnnex}/selfEnroll.js +1 -1
- package/dist/clientAnnex/selfEnroll.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +49 -0
- package/dist/clientAnnex/zcap.d.ts.map +1 -0
- package/dist/clientAnnex/zcap.js +101 -0
- package/dist/clientAnnex/zcap.js.map +1 -0
- package/dist/clients/index.d.ts +9 -6
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +8 -5
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/listing.d.ts +32 -0
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +47 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +33 -1
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +16 -4
- package/dist/clients/revocation.js.map +1 -1
- package/dist/enrollment/index.d.ts +6 -4
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +6 -4
- package/dist/enrollment/index.js.map +1 -1
- package/dist/enrollment/onboardingInvite.d.ts +5 -88
- package/dist/enrollment/onboardingInvite.d.ts.map +1 -1
- package/dist/enrollment/onboardingInvite.js +5 -168
- package/dist/enrollment/onboardingInvite.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +12 -0
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +5 -0
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +5 -0
- package/dist/genesis/index.js.map +1 -1
- package/dist/keys/index.d.ts +1 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +7 -2
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +8 -2
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +39 -0
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +43 -1
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +5 -3
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +4 -2
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +35 -12
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +84 -86
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +32 -1
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +2 -2
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/capabilityRequest.d.ts +33 -0
- package/dist/request/capabilityRequest.d.ts.map +1 -0
- package/dist/request/capabilityRequest.js +35 -0
- package/dist/request/capabilityRequest.js.map +1 -0
- package/dist/request/ephemeralExchange.d.ts +118 -0
- package/dist/request/ephemeralExchange.d.ts.map +1 -0
- package/dist/request/ephemeralExchange.js +224 -0
- package/dist/request/ephemeralExchange.js.map +1 -0
- package/dist/request/index.d.ts +6 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +6 -0
- package/dist/request/index.js.map +1 -1
- package/dist/space/activity.d.ts +2 -2
- package/dist/space/activity.js +3 -3
- package/dist/space/activity.js.map +1 -1
- package/dist/unlock/index.d.ts +11 -23
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +10 -21
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +47 -3
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +21 -5
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +37 -82
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +64 -247
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +13 -6
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +14 -8
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +5 -5
- package/dist/webvh/delegatedLogStore.js +1 -1
- package/dist/webvh/didWebvh.d.ts +19 -9
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +16 -16
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +9 -25
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +9 -23
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +77 -5
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +154 -61
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +11 -1
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +13 -14
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +13 -7
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +8 -4
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +0 -24
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +0 -42
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +41 -35
- package/dist/unlock/ladder.d.ts.map +0 -1
- package/dist/unlock/ladder.js +0 -258
- package/dist/unlock/ladder.js.map +0 -1
- package/dist/unlock/selfEnroll.d.ts.map +0 -1
- package/dist/unlock/selfEnroll.js.map +0 -1
- package/dist/webvh/companion.d.ts.map +0 -1
- package/dist/webvh/companion.js.map +0 -1
- package/dist/webvh/companionGc.d.ts.map +0 -1
- package/dist/webvh/companionGc.js.map +0 -1
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The LAST durable client's forget: the two-entry transition ceremony that
|
|
6
|
+
* takes an account from one enrolled durable client to the client-less,
|
|
7
|
+
* ladder-anchored state -- the same state a credential-anchored signup and a
|
|
8
|
+
* transient recovery produce. Decision 0004's 2026-08-19 amendment fixes the
|
|
9
|
+
* entry order, and it is forced twice over: the server's revocation endpoint
|
|
10
|
+
* verifies a to-be-revoked capability's chain against the CURRENTLY resolved
|
|
11
|
+
* document (so a ladder-signed chain revokes only while the ladder VM is
|
|
12
|
+
* published), and the ladder VM carries no `capabilityInvocation` (so once
|
|
13
|
+
* the client's verification method is gone, nothing can sign the revocation
|
|
14
|
+
* POST at all). So:
|
|
15
|
+
*
|
|
16
|
+
* 1. **The install entry** ({@link installLadderVmWebvh}): the ladder VM
|
|
17
|
+
* joins the document while the client's whole footprint stays -- the
|
|
18
|
+
* both-present transitional state. This is the ceremony's
|
|
19
|
+
* posture-changing document version under the ceremony-tail license.
|
|
20
|
+
* 2. **The roster rotation**, ladder-signed, anchored at the install entry,
|
|
21
|
+
* HTTP-invoked under the still-standing client: the user key rotates off
|
|
22
|
+
* this client's wrap in ONE append (the license's one-shot shape), read
|
|
23
|
+
* back through the credential's standing wrap. Because the append's
|
|
24
|
+
* signer is the ladder VM -- a key the post-removal document still lists
|
|
25
|
+
* -- the roster log needs no seal completer afterwards, which matters on
|
|
26
|
+
* an account where no enrolled client's login sweep will ever run again.
|
|
27
|
+
* 3. **The collection fan-out**, still under this client's invocation
|
|
28
|
+
* authority: every encrypted collection re-epochs onto the fresh key.
|
|
29
|
+
* 4. **The generation-delegation replacement and revocations**: a fresh
|
|
30
|
+
* ladder-signed generation delegation replaces the embedded one
|
|
31
|
+
* unconditionally (the forced renewal), and then EVERY still-unexpired
|
|
32
|
+
* delegation the annex log's history ever embedded that this
|
|
33
|
+
* credential's ladder VM signed is revoked at the server (a renewal
|
|
34
|
+
* inside the 30-day window can leave two) -- closing the resurrection
|
|
35
|
+
* window a reinstalled derived-key VM would otherwise reopen. The
|
|
36
|
+
* replacement is what keeps the account transient-login-reachable after
|
|
37
|
+
* the transition; replace-before-revoke is what keeps a torn run from
|
|
38
|
+
* stranding the generation delegation-less.
|
|
39
|
+
* 5. **The other unlock methods' record re-mint** (`unlockMethods`): every
|
|
40
|
+
* other standing credential's and recovery code's bridge (and
|
|
41
|
+
* `delegatedClients` sibling, where the record carries one) is re-signed
|
|
42
|
+
* by the ladder VM and its record re-sealed through the entry's
|
|
43
|
+
* management zcap -- the revocation cascade's re-mint pass
|
|
44
|
+
* (`remintRecoveryDelegations`), run with the ladder VM as the delegating
|
|
45
|
+
* and record-signing key and the forgotten client named as retiring, so
|
|
46
|
+
* every delegation it signed counts as rotted ahead of the removal entry.
|
|
47
|
+
* Delegations the removed client had signed rot at that entry, and on a
|
|
48
|
+
* client-less account no durable login's refresh block will ever run
|
|
49
|
+
* again to heal them, so this is the one pass that reaches them. The
|
|
50
|
+
* HTTP side still invokes under the still-standing client (the
|
|
51
|
+
* management zcaps are granted to the account DID, which only an enrolled
|
|
52
|
+
* client can invoke) -- which is why the stage must run before the
|
|
53
|
+
* removal entry. The pass walks every entry and reports each one's fate,
|
|
54
|
+
* but the ceremony does not carry a failure past this point: a `failed`
|
|
55
|
+
* entry refuses the removal entry ({@link RecordRemintFailedError},
|
|
56
|
+
* naming the records the pass could not reach), since after the removal
|
|
57
|
+
* nothing could ever re-sign that record's bridge. The client stays
|
|
58
|
+
* enrolled, and a re-run reaches the entry again.
|
|
59
|
+
* 6. **The record re-bind seam** (`onBeforeRemoval`): the caller re-signs
|
|
60
|
+
* the LOGIN credential's bridge and `delegatedClients` sibling with the
|
|
61
|
+
* ladder VM and re-seals its unlock record with the credential in hand
|
|
62
|
+
* (a full re-wrap, proof verified rather than settled) -- the one record
|
|
63
|
+
* stage 5 need not reach.
|
|
64
|
+
* 7. **The removal entry** ({@link forgetLastWebvhClient}): the client's
|
|
65
|
+
* whole document footprint out while the installed ladder VM keeps the
|
|
66
|
+
* account anchored. The app's local wipe runs after this ceremony
|
|
67
|
+
* returns.
|
|
68
|
+
*
|
|
69
|
+
* Torn-state map: every stage detects completion from durable state, so a
|
|
70
|
+
* run torn anywhere before the removal entry reads as "not forgotten" and a
|
|
71
|
+
* re-run converges -- the install entry is idempotent, an already-rotated
|
|
72
|
+
* roster skips the append (no second ladder-signed append is ever
|
|
73
|
+
* attempted), the fan-out is staleness-driven, a re-POSTed revocation's 400
|
|
74
|
+
* already-revoked answer reads as success (decision 0006's resume contract),
|
|
75
|
+
* and the forced replacement re-mints (the prior run's fresh delegation is
|
|
76
|
+
* then revoked as history, so a re-run churns one delegation and strands
|
|
77
|
+
* nothing), and the record re-mint re-checks staleness per entry (a record
|
|
78
|
+
* already ladder-signed reads as current, one whose re-mint failed is still
|
|
79
|
+
* rotted and is re-minted). Torn after the removal entry is the
|
|
80
|
+
* finish-the-wipe state the app's next login maps.
|
|
81
|
+
*
|
|
82
|
+
* The honest limitation is the cascade's, as everywhere: ciphertext this
|
|
83
|
+
* browser already fetched stays forensically recoverable from its storage,
|
|
84
|
+
* and old epochs stay open to keys it already held.
|
|
85
|
+
*/
|
|
86
|
+
import type { DIDLog } from '@interop/did-method-webvh';
|
|
87
|
+
import type { IKeyAgreementKey, IZcap } from '@interop/data-integrity-core';
|
|
88
|
+
import type { ZcapClient } from '@interop/ezcap';
|
|
89
|
+
import type { CollectionEncryption, IDelegatedZcap } from '@interop/was-client';
|
|
90
|
+
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
91
|
+
import { type RevokedClientKeys } from '../webvh/revokeClient.js';
|
|
92
|
+
import type { ResourceLogPinStore } from '../resourceLog/index.js';
|
|
93
|
+
import { type CascadeCollections, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
94
|
+
import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
95
|
+
import type { AccountPointer } from '../keyring/record.js';
|
|
96
|
+
import { type RecordRemintOutcome, type RecoveryDelegationEntry } from '../recovery/recoveryDelegation.js';
|
|
97
|
+
import { type ClientAnnexWriteStore } from './log.js';
|
|
98
|
+
/**
|
|
99
|
+
* What the ceremony's generation stage did: the revoked delegation ids, and
|
|
100
|
+
* whether the forced replacement landed. A `skipped` reason names the stage
|
|
101
|
+
* that could not run -- `no-pointer` (the account points at no generation:
|
|
102
|
+
* nothing to revoke or replace), `log-unreadable` (the pointed generation's
|
|
103
|
+
* `did.jsonl` is gone; the delegation bytes are unrecoverable, decision
|
|
104
|
+
* 0006's honest limit), `rung-uncommitted` (this credential cannot write the
|
|
105
|
+
* generation's log; the account lands delegation-less until a
|
|
106
|
+
* fresh-generation heal), `already-removed` (the whole ceremony completed on
|
|
107
|
+
* an earlier run; nothing here can still invoke) -- and a skip never fails
|
|
108
|
+
* the ceremony.
|
|
109
|
+
*/
|
|
110
|
+
export interface GenerationDelegationRetirement {
|
|
111
|
+
revoked: string[];
|
|
112
|
+
replaced: boolean;
|
|
113
|
+
skipped?: 'no-pointer' | 'log-unreadable' | 'rung-uncommitted' | 'already-removed';
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The other unlock methods' reach for the record re-mint stage: the registry
|
|
117
|
+
* entries to walk (the OTHER methods' -- the login credential's own record is
|
|
118
|
+
* the `onBeforeRemoval` seam's, re-wrapped with the credential in hand; an
|
|
119
|
+
* entry for it here is harmless but redundant), the unlock Spaces' storage
|
|
120
|
+
* server, the management-zcap client factory (invoking as the still-standing
|
|
121
|
+
* client), and the registry record-back seam. The shape is the revocation
|
|
122
|
+
* cascade's re-mint seams verbatim, so an app binds both from one place.
|
|
123
|
+
*/
|
|
124
|
+
export interface UnlockMethodsRemintReach<Entry extends RecoveryDelegationEntry = RecoveryDelegationEntry> {
|
|
125
|
+
entries: Entry[];
|
|
126
|
+
pointer: AccountPointer;
|
|
127
|
+
storageServerUrl: string;
|
|
128
|
+
managementZcapClient: (options: {
|
|
129
|
+
capability: IZcap;
|
|
130
|
+
}) => ZcapClient;
|
|
131
|
+
recordEntry: (options: {
|
|
132
|
+
entry: Entry;
|
|
133
|
+
}) => Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* What a completed last-client forget reports: whether the install entry ran
|
|
137
|
+
* on this call (`false` on a resumed run), whether the roster's wrap for the
|
|
138
|
+
* forgotten client was retired on this run, the per-collection fan-out
|
|
139
|
+
* result, the generation stage's report, the other unlock methods' record
|
|
140
|
+
* re-mint report (present when the caller supplied the reach: the counts and
|
|
141
|
+
* every entry's fate; a completed ceremony never carries a `failed` outcome,
|
|
142
|
+
* since that refuses the removal entry instead), the document as the removal
|
|
143
|
+
* entry left it, and -- when the account has a roster -- the rotated key with
|
|
144
|
+
* the roster descriptor it was read from.
|
|
145
|
+
*/
|
|
146
|
+
export interface LastDurableClientForgetResult {
|
|
147
|
+
installed: boolean;
|
|
148
|
+
rotated: boolean;
|
|
149
|
+
collections: UserKeyCascadeResult;
|
|
150
|
+
generation: GenerationDelegationRetirement;
|
|
151
|
+
unlockMethods?: {
|
|
152
|
+
reminted: number;
|
|
153
|
+
skipped: number;
|
|
154
|
+
outcomes: RecordRemintOutcome[];
|
|
155
|
+
};
|
|
156
|
+
did: string;
|
|
157
|
+
document: object;
|
|
158
|
+
userKey?: UserKey;
|
|
159
|
+
rosterDescriptor?: CollectionEncryption;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The record re-mint stage could not reach every other unlock method's
|
|
163
|
+
* record, so the removal entry was refused: `failed` names the entries whose
|
|
164
|
+
* re-mint threw (each carrying its cause), and `unlockMethods` is the whole
|
|
165
|
+
* stage report. The forgotten client is still enrolled and every stage
|
|
166
|
+
* before this one has landed, so a re-run resumes at the re-mint. Matched
|
|
167
|
+
* on `name` (the errors cross app-injected seams that may resolve to another
|
|
168
|
+
* copy of this package).
|
|
169
|
+
*/
|
|
170
|
+
export declare class RecordRemintFailedError extends Error {
|
|
171
|
+
readonly failed: RecordRemintOutcome[];
|
|
172
|
+
readonly unlockMethods: NonNullable<LastDurableClientForgetResult['unlockMethods']>;
|
|
173
|
+
constructor({ unlockMethods }: {
|
|
174
|
+
unlockMethods: NonNullable<LastDurableClientForgetResult['unlockMethods']>;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Forgets the account's LAST enrolled durable client -- this browser's own
|
|
179
|
+
* -- transitioning the account to the client-less, ladder-anchored state.
|
|
180
|
+
* See the module doc for the stage order and the torn-state map. The caller
|
|
181
|
+
* runs the local wipe only after this resolves. An account with another
|
|
182
|
+
* enrolled durable client refuses: that forget is the ordinary ceremony
|
|
183
|
+
* (`forgetDurableClient`), reached first, whose `LastDurableClientForgetError`
|
|
184
|
+
* is what routes callers here.
|
|
185
|
+
*
|
|
186
|
+
* @param options {object}
|
|
187
|
+
* @param options.logStore {UnlockLogStore} the credential's delegated
|
|
188
|
+
* `did.jsonl` bridge store; also serves the ceremony's public reads. The
|
|
189
|
+
* caller is expected to have verified the account log under its own
|
|
190
|
+
* chain-head pins in the same session (the ceremony re-reads through the
|
|
191
|
+
* seam and checks `expectedDid`, but carries no account-log pin store
|
|
192
|
+
* itself)
|
|
193
|
+
* @param options.ladderSeed {Uint8Array} the login credential's ladder seed
|
|
194
|
+
* @param options.forgottenClient {RevokedClientKeys} this client's public
|
|
195
|
+
* halves; an `updateKeyMultibase` the log does not authorize (stale, or the
|
|
196
|
+
* staged key) is re-derived from the log
|
|
197
|
+
* @param options.forgottenKeyAgreementKeyMultibase {string} this client's
|
|
198
|
+
* identity key-agreement key (the X25519 twin), naming its roster wrap
|
|
199
|
+
* @param [options.knownLatentHashes] {string[]} standing latent commitments
|
|
200
|
+
* the caller vouches for (the recovery registry's update-key hashes),
|
|
201
|
+
* excluded from the staged-hash attribution
|
|
202
|
+
* @param options.expectedDid {string} the account DID from the caller's
|
|
203
|
+
* stored account pointer
|
|
204
|
+
* @param options.rosterStoreFor {Function} `({ did, log }) => store` --
|
|
205
|
+
* builds the `key-map/user-key.jsonl` roster store whose appends are
|
|
206
|
+
* SIGNED BY THE LADDER VM and whose controller view resolves from the
|
|
207
|
+
* supplied post-install log (the posture-changing anchor the ceremony-tail
|
|
208
|
+
* license admits), while its HTTP requests invoke under the still-standing
|
|
209
|
+
* client
|
|
210
|
+
* @param options.credentialKeyAgreementKey {IKeyAgreementKey} the standing
|
|
211
|
+
* credential's key-agreement key -- the recipient whose wrap survives the
|
|
212
|
+
* rotation, reading the fresh key back and unwrapping the generations for
|
|
213
|
+
* the fan-out
|
|
214
|
+
* @param [options.userKey] {UserKey} this client's cached user key
|
|
215
|
+
* @param [options.pinnedEpochId] {string} the locally pinned latest-seen
|
|
216
|
+
* roster epoch
|
|
217
|
+
* @param [options.onUserKeyAdopted] {Function} persists a rotated key:
|
|
218
|
+
* called with `{ userKey, latestEpochId, descriptor }` after the roster
|
|
219
|
+
* read and BEFORE the fan-out
|
|
220
|
+
* @param options.collections {CascadeCollections} the fan-out's work
|
|
221
|
+
* @param options.annex {object} the generation stage's reach:
|
|
222
|
+
* @param options.annex.storeFor {Function}
|
|
223
|
+
* `({ spaceId, generationId }) => ClientAnnexWriteStore` -- the pointed
|
|
224
|
+
* generation's log store, reading and writing under the still-standing
|
|
225
|
+
* client's authority
|
|
226
|
+
* @param options.annex.revoke {Function} `(delegation) => Promise<void>`
|
|
227
|
+
* -- POSTs a revocation (was-client's `WasClient#revoke`, bound by the
|
|
228
|
+
* caller; the invocation signs as the still-standing client)
|
|
229
|
+
* @param options.annex.wasServerUrl {string} the ACCOUNT Space's storage
|
|
230
|
+
* server (the fresh generation delegation's target host)
|
|
231
|
+
* @param options.annex.accountSpaceId {string} the ACCOUNT Space's id (the
|
|
232
|
+
* fresh delegation's target subtree)
|
|
233
|
+
* @param [options.annex.pinStore] {ResourceLogPinStore} chain-head pins
|
|
234
|
+
* for the pointed generation's read
|
|
235
|
+
* @param [options.unlockMethods] {UnlockMethodsRemintReach} the other
|
|
236
|
+
* unlock methods' record re-mint reach (stage 5): the registry entries
|
|
237
|
+
* whose bridge (and sibling) the ladder VM re-signs and whose records it
|
|
238
|
+
* re-seals through their management zcaps, invoked as the still-standing
|
|
239
|
+
* client. Omitted, the stage is skipped and the result carries no
|
|
240
|
+
* `unlockMethods` report -- the residue decision 0004's amendment stated.
|
|
241
|
+
* Supplied, an entry the pass could not re-mint refuses the removal entry
|
|
242
|
+
* (`RecordRemintFailedError`)
|
|
243
|
+
* @param [options.onBeforeRemoval] {Function}
|
|
244
|
+
* `({ did, doc, log }) => Promise<void>` -- the record re-bind seam: runs
|
|
245
|
+
* after the record re-mint stage, immediately before the removal entry,
|
|
246
|
+
* with the post-install published state. The caller re-signs the login
|
|
247
|
+
* credential's bridge and `delegatedClients` sibling with the ladder VM
|
|
248
|
+
* and re-seals its unlock record here. Must be idempotent (a resumed run
|
|
249
|
+
* invokes it again)
|
|
250
|
+
* @param [options.now] {number} epoch milliseconds, for tests
|
|
251
|
+
* @returns {Promise<LastDurableClientForgetResult>}
|
|
252
|
+
*/
|
|
253
|
+
export declare function forgetLastDurableClient({ logStore, ladderSeed, forgottenClient, forgottenKeyAgreementKeyMultibase, knownLatentHashes, expectedDid, rosterStoreFor, credentialKeyAgreementKey, userKey, pinnedEpochId, onUserKeyAdopted, collections, annex, unlockMethods, onBeforeRemoval, now }: {
|
|
254
|
+
logStore: UnlockLogStore;
|
|
255
|
+
ladderSeed: Uint8Array;
|
|
256
|
+
forgottenClient: RevokedClientKeys;
|
|
257
|
+
forgottenKeyAgreementKeyMultibase: string;
|
|
258
|
+
knownLatentHashes?: string[];
|
|
259
|
+
expectedDid: string;
|
|
260
|
+
rosterStoreFor: (options: {
|
|
261
|
+
did: string;
|
|
262
|
+
log: DIDLog;
|
|
263
|
+
}) => EncryptionDescriptorStore;
|
|
264
|
+
credentialKeyAgreementKey: IKeyAgreementKey;
|
|
265
|
+
userKey?: UserKey;
|
|
266
|
+
pinnedEpochId?: string | null;
|
|
267
|
+
onUserKeyAdopted?: (adopted: {
|
|
268
|
+
userKey: UserKey;
|
|
269
|
+
latestEpochId: string;
|
|
270
|
+
descriptor: CollectionEncryption;
|
|
271
|
+
}) => Promise<void>;
|
|
272
|
+
collections: CascadeCollections;
|
|
273
|
+
annex: {
|
|
274
|
+
storeFor: (options: {
|
|
275
|
+
spaceId: string;
|
|
276
|
+
generationId: string;
|
|
277
|
+
}) => ClientAnnexWriteStore;
|
|
278
|
+
revoke: (delegation: IDelegatedZcap) => Promise<void>;
|
|
279
|
+
wasServerUrl: string;
|
|
280
|
+
accountSpaceId: string;
|
|
281
|
+
pinStore?: ResourceLogPinStore;
|
|
282
|
+
};
|
|
283
|
+
unlockMethods?: UnlockMethodsRemintReach;
|
|
284
|
+
onBeforeRemoval?: (published: {
|
|
285
|
+
did: string;
|
|
286
|
+
doc: object;
|
|
287
|
+
log: DIDLog;
|
|
288
|
+
}) => Promise<void>;
|
|
289
|
+
now?: number;
|
|
290
|
+
}): Promise<LastDurableClientForgetResult>;
|
|
291
|
+
//# sourceMappingURL=forgetLast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC/D,O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