@interop/wallet-core 0.49.0 → 0.50.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 +118 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.js +174 -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 +267 -0
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -0
- package/dist/clientAnnex/forgetLast.js +374 -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/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 +40 -34
- 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
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import type { DIDDoc, DIDLog, ServiceEndpoint, Signer } from '@interop/did-method-webvh';
|
|
2
2
|
import type { IZcap } from '@interop/data-integrity-core';
|
|
3
3
|
import type { ZcapClient } from '@interop/ezcap';
|
|
4
|
-
import type { WasClient } from '@interop/was-client';
|
|
4
|
+
import type { IDelegatedZcap, WasClient } from '@interop/was-client';
|
|
5
5
|
import type { ResourceLogPinStore } from '../resourceLog/pin.js';
|
|
6
|
-
import type { ClientWebvhUpdateKeys, WebvhIdStore } from '
|
|
7
|
-
import type {
|
|
6
|
+
import type { ClientWebvhUpdateKeys, WebvhIdStore } from '../webvh/didWebvh.js';
|
|
7
|
+
import type { PublishedKeyDocument } from '../webvh/listClients.js';
|
|
8
|
+
import type { WebvhLogResourceStore } from '../webvh/wasIdStore.js';
|
|
8
9
|
/**
|
|
9
|
-
* The Space Description `type` array of the auxiliary
|
|
10
|
+
* The Space Description `type` array of the auxiliary annex Space, set at
|
|
10
11
|
* creation (the server treats a Space's `type` as immutable afterwards).
|
|
11
12
|
* Wire-level and permanent: the server's inspector clause recognizes the
|
|
12
13
|
* `DelegatedClientsSpace` member, and user-data surfaces exclude auxiliary
|
|
13
14
|
* Spaces by it.
|
|
14
15
|
*/
|
|
15
|
-
export declare const
|
|
16
|
+
export declare const CLIENT_ANNEX_SPACE_TYPE: string[];
|
|
16
17
|
/**
|
|
17
18
|
* The literal prefix of every generation collection's name. Wire-level and
|
|
18
19
|
* permanent: orphan discovery is a plain prefix match over the auxiliary
|
|
19
|
-
* Space's collection listing, and the generation id embeds in every
|
|
20
|
+
* Space's collection listing, and the generation id embeds in every annex
|
|
20
21
|
* DID string ever published.
|
|
21
22
|
*/
|
|
22
23
|
export declare const GENERATION_ID_PREFIX = "gen-";
|
|
@@ -31,31 +32,31 @@ export declare const GENERATION_ID_PREFIX = "gen-";
|
|
|
31
32
|
export declare function mintGenerationId(): string;
|
|
32
33
|
/**
|
|
33
34
|
* Refuses anything that is not a well-formed generation id. Run by every
|
|
34
|
-
*
|
|
35
|
+
* annex builder that takes a generation id, so a malformed one is refused
|
|
35
36
|
* before it can reach a DID string, an HKDF label, or a collection id.
|
|
36
37
|
*
|
|
37
38
|
* @param generationId {string}
|
|
38
39
|
*/
|
|
39
40
|
export declare function assertGenerationId(generationId: string): void;
|
|
40
41
|
/**
|
|
41
|
-
* The pin-slot key for one
|
|
42
|
+
* The pin-slot key for one annex generation's log -- host-free like every
|
|
42
43
|
* pin-slot key, keyed by the auxiliary Space id and the generation id.
|
|
43
44
|
* A transient session keeps this slot in an in-memory pin store (a durable
|
|
44
45
|
* pin is the wrong lifetime for a disposable log, and a transient session
|
|
45
46
|
* must not durably create the pin store on a read); a durable client's store
|
|
46
|
-
* clears
|
|
47
|
+
* clears annex slots when the generation is collected.
|
|
47
48
|
*
|
|
48
49
|
* @param options {object}
|
|
49
|
-
* @param options.spaceId {string} the auxiliary
|
|
50
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
50
51
|
* @param options.generationId {string} the generation collection's name
|
|
51
52
|
* @returns {string}
|
|
52
53
|
*/
|
|
53
|
-
export declare function
|
|
54
|
+
export declare function clientAnnexLogPinId({ spaceId, generationId }: {
|
|
54
55
|
spaceId: string;
|
|
55
56
|
generationId: string;
|
|
56
57
|
}): string;
|
|
57
58
|
/**
|
|
58
|
-
* The WAS-backed store
|
|
59
|
+
* The WAS-backed store an annex generation's ceremonies read and publish
|
|
59
60
|
* through with controller-tier signing (an enrolled client). A transient
|
|
60
61
|
* session writes through the delegated store instead
|
|
61
62
|
* (`delegatedWebvhLogStore`, invoking the credential's sibling delegation);
|
|
@@ -63,27 +64,31 @@ export declare function companionLogPinId({ spaceId, generationId }: {
|
|
|
63
64
|
*
|
|
64
65
|
* @param options {object}
|
|
65
66
|
* @param options.was {WasClient}
|
|
66
|
-
* @param options.spaceId {string} the auxiliary
|
|
67
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
67
68
|
* @param options.generationId {string} the generation collection's name
|
|
69
|
+
* @param [options.capability] {IZcap} an invocation capability every request
|
|
70
|
+
* rides (the sibling delegation, where the caller is not an enrolled
|
|
71
|
+
* invoker); absent, requests invoke the root capability
|
|
68
72
|
* @returns {WebvhLogResourceStore}
|
|
69
73
|
*/
|
|
70
|
-
export declare function
|
|
74
|
+
export declare function clientAnnexLogStore({ was, spaceId, generationId, capability }: {
|
|
71
75
|
was: WasClient;
|
|
72
76
|
spaceId: string;
|
|
73
77
|
generationId: string;
|
|
78
|
+
capability?: IZcap;
|
|
74
79
|
}): WebvhLogResourceStore;
|
|
75
80
|
/**
|
|
76
|
-
* Creates the one-entry
|
|
77
|
-
* the
|
|
81
|
+
* Creates the one-entry annex generation log. The genesis parameters are
|
|
82
|
+
* the annex posture (see the module doc): prerotation on via the rung-0
|
|
78
83
|
* hash commitments, no witnesses, portability off (the library's default,
|
|
79
84
|
* stated explicitly in the emitted entry), and a bare document -- id and the
|
|
80
85
|
* DID core context, nothing else.
|
|
81
86
|
*
|
|
82
87
|
* The caller supplies the update authority: the minting credential's
|
|
83
|
-
*
|
|
88
|
+
* annex rung-0 key as the sole `updateKeys` member, `nextKeyHashes` as
|
|
84
89
|
* every standing credential's rung-0 hash (restated explicitly on every later
|
|
85
90
|
* entry, never inherited), and rung 0's signer. The minting key's own
|
|
86
|
-
* carry-over hash MUST be among the commitments -- every
|
|
91
|
+
* carry-over hash MUST be among the commitments -- every annex entry
|
|
87
92
|
* re-states `updateKeys` containing the revealed rung-0 keys, and the
|
|
88
93
|
* resolver checks the re-statement against the previous entry's commitments
|
|
89
94
|
* -- so a `nextKeyHashes` that omits it is refused here rather than
|
|
@@ -91,16 +96,16 @@ export declare function companionLogStore({ was, spaceId, generationId }: {
|
|
|
91
96
|
*
|
|
92
97
|
* @param options {object}
|
|
93
98
|
* @param options.wasServerUrl {string}
|
|
94
|
-
* @param options.spaceId {string} the auxiliary
|
|
99
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
95
100
|
* @param options.generationId {string} the generation collection's name
|
|
96
101
|
* @param options.updateKeyPublicKeyMultibase {string} the minting
|
|
97
|
-
* credential's
|
|
102
|
+
* credential's annex rung-0 key
|
|
98
103
|
* @param options.nextKeyHashes {string[]} every standing credential's
|
|
99
104
|
* rung-0 hash, the minting credential's included
|
|
100
105
|
* @param options.signer {Signer} the minting credential's rung-0 signer
|
|
101
106
|
* @returns {Promise<{ log: DIDLog; did: string; doc: DIDDoc }>}
|
|
102
107
|
*/
|
|
103
|
-
export declare function
|
|
108
|
+
export declare function createClientAnnexLog({ wasServerUrl, spaceId, generationId, updateKeyPublicKeyMultibase, nextKeyHashes, signer }: {
|
|
104
109
|
wasServerUrl: string;
|
|
105
110
|
spaceId: string;
|
|
106
111
|
generationId: string;
|
|
@@ -113,8 +118,8 @@ export declare function createCompanionLog({ wasServerUrl, spaceId, generationId
|
|
|
113
118
|
doc: DIDDoc;
|
|
114
119
|
}>;
|
|
115
120
|
/**
|
|
116
|
-
* Ensures the auxiliary
|
|
117
|
-
* Description ({@link
|
|
121
|
+
* Ensures the auxiliary annex Space exists: created with the typed
|
|
122
|
+
* Description ({@link CLIENT_ANNEX_SPACE_TYPE}) under the given controller when
|
|
118
123
|
* absent, verified when present. The `type` array must ride the create -- the
|
|
119
124
|
* server accepts it at creation only and treats it as immutable afterwards --
|
|
120
125
|
* which is also why an existing Space at this id that is NOT typed as the
|
|
@@ -130,19 +135,19 @@ export declare function createCompanionLog({ wasServerUrl, spaceId, generationId
|
|
|
130
135
|
*
|
|
131
136
|
* @param options {object}
|
|
132
137
|
* @param options.was {WasClient}
|
|
133
|
-
* @param options.spaceId {string} the auxiliary
|
|
138
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
134
139
|
* @param options.controller {string} the Space controller (the account
|
|
135
|
-
* did:webvh where it exists; a bootstrap did:key on a
|
|
140
|
+
* did:webvh where it exists; a bootstrap did:key on a ladder-anchored signup,
|
|
136
141
|
* promoted the same way the account Space's controller is)
|
|
137
142
|
* @returns {Promise<void>}
|
|
138
143
|
*/
|
|
139
|
-
export declare function
|
|
144
|
+
export declare function ensureClientAnnexSpace({ was, spaceId, controller }: {
|
|
140
145
|
was: WasClient;
|
|
141
146
|
spaceId: string;
|
|
142
147
|
controller: string;
|
|
143
148
|
}): Promise<void>;
|
|
144
149
|
/**
|
|
145
|
-
* Mints a fresh
|
|
150
|
+
* Mints a fresh annex generation with controller-tier signing: ensures
|
|
146
151
|
* the typed auxiliary Space, mints a fresh random generation id, creates the
|
|
147
152
|
* generation collection, and publishes the genesis `did.jsonl` as a
|
|
148
153
|
* create-if-absent -- the same conditional-publish discipline as every log
|
|
@@ -150,7 +155,7 @@ export declare function ensureCompanionSpace({ was, spaceId, controller }: {
|
|
|
150
155
|
* negligible.
|
|
151
156
|
*
|
|
152
157
|
* The account document's `#DelegatedClients` service entry is deliberately
|
|
153
|
-
* NOT written here: the
|
|
158
|
+
* NOT written here: the annex log publishes first, and the caller
|
|
154
159
|
* re-points the account document at the returned DID afterwards. A run torn
|
|
155
160
|
* between the two leaves an unpointed generation -- authorization-inert (no
|
|
156
161
|
* delegation names it), collected by the standing `gen-` prefix orphan
|
|
@@ -163,20 +168,20 @@ export declare function ensureCompanionSpace({ was, spaceId, controller }: {
|
|
|
163
168
|
*
|
|
164
169
|
* @param options {object}
|
|
165
170
|
* @param options.was {WasClient} the storage client, signing as an enrolled
|
|
166
|
-
* client (or the bootstrap controller on a
|
|
171
|
+
* client (or the bootstrap controller on a ladder-anchored signup)
|
|
167
172
|
* @param options.wasServerUrl {string}
|
|
168
|
-
* @param options.spaceId {string} the auxiliary
|
|
173
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
169
174
|
* @param options.controller {string} the auxiliary Space's controller, used
|
|
170
175
|
* only when the Space does not exist yet
|
|
171
176
|
* @param options.updateKeyPublicKeyMultibase {string} the minting
|
|
172
|
-
* credential's
|
|
177
|
+
* credential's annex rung-0 key
|
|
173
178
|
* @param options.nextKeyHashes {string[]} every standing credential's
|
|
174
179
|
* rung-0 hash, the minting credential's included
|
|
175
180
|
* @param options.signer {Signer} the minting credential's rung-0 signer
|
|
176
181
|
* @returns {Promise<{ did: string; generationId: string; log: DIDLog;
|
|
177
182
|
* doc: DIDDoc }>}
|
|
178
183
|
*/
|
|
179
|
-
export declare function
|
|
184
|
+
export declare function mintClientAnnexGeneration({ was, wasServerUrl, spaceId, controller, updateKeyPublicKeyMultibase, nextKeyHashes, signer }: {
|
|
180
185
|
was: WasClient;
|
|
181
186
|
wasServerUrl: string;
|
|
182
187
|
spaceId: string;
|
|
@@ -191,23 +196,23 @@ export declare function mintCompanionGeneration({ was, wasServerUrl, spaceId, co
|
|
|
191
196
|
doc: DIDDoc;
|
|
192
197
|
}>;
|
|
193
198
|
/**
|
|
194
|
-
* Mints a fresh
|
|
195
|
-
*
|
|
199
|
+
* Mints a fresh annex generation signed by a standing CREDENTIAL's
|
|
200
|
+
* annex rung 0 -- the mint a ladder-seed holder runs (a credential-in-hand
|
|
196
201
|
* login, or a test harness standing in for one). The generation id must exist
|
|
197
202
|
* before the update authority can: the rung-0 key derives from the ladder
|
|
198
|
-
* seed AND the generation id (`
|
|
203
|
+
* seed AND the generation id (`clientAnnexRung`), so this helper mints the
|
|
199
204
|
* generation id
|
|
200
205
|
* first, derives the rung, and states its own carry-over hash in
|
|
201
|
-
* `nextKeyHashes` -- {@link
|
|
206
|
+
* `nextKeyHashes` -- {@link mintClientAnnexGeneration}'s caller-supplied-key
|
|
202
207
|
* shape cannot express that ordering. Everything else matches it: the typed
|
|
203
208
|
* Space ensure, the collection create, the create-if-absent genesis publish,
|
|
204
209
|
* and the pointer deliberately left to the caller.
|
|
205
210
|
*
|
|
206
211
|
* @param options {object}
|
|
207
212
|
* @param options.was {WasClient} the storage client, signing as an enrolled
|
|
208
|
-
* client (or the bootstrap controller on a
|
|
213
|
+
* client (or the bootstrap controller on a ladder-anchored signup)
|
|
209
214
|
* @param options.wasServerUrl {string}
|
|
210
|
-
* @param options.spaceId {string} the auxiliary
|
|
215
|
+
* @param options.spaceId {string} the auxiliary annex Space's id
|
|
211
216
|
* @param options.controller {string} the auxiliary Space's controller, used
|
|
212
217
|
* only when the Space does not exist yet
|
|
213
218
|
* @param options.ladderSeed {Uint8Array} the minting credential's ladder
|
|
@@ -216,16 +221,23 @@ export declare function mintCompanionGeneration({ was, wasServerUrl, spaceId, co
|
|
|
216
221
|
* credentials' rung-0 hashes for this generation id, when the account has
|
|
217
222
|
* more
|
|
218
223
|
* than one; the minting credential's own carry-over hash is always included
|
|
224
|
+
* @param [options.capability] {IZcap} an invocation capability the mint
|
|
225
|
+
* rides -- the transient-recovery continuation minting its fresh generation
|
|
226
|
+
* through the credential's sibling delegation (the auxiliary Space's items
|
|
227
|
+
* subtree). The typed-Space ensure is then skipped: the delegation's target
|
|
228
|
+
* covers the collections beneath the Space, never the Space Description,
|
|
229
|
+
* and a standing sibling delegation presupposes the auxiliary Space
|
|
219
230
|
* @returns {Promise<{ did: string; generationId: string; log: DIDLog;
|
|
220
231
|
* doc: DIDDoc }>}
|
|
221
232
|
*/
|
|
222
|
-
export declare function
|
|
233
|
+
export declare function mintCredentialClientAnnexGeneration({ was, wasServerUrl, spaceId, controller, ladderSeed, extraNextKeyHashes, capability }: {
|
|
223
234
|
was: WasClient;
|
|
224
235
|
wasServerUrl: string;
|
|
225
236
|
spaceId: string;
|
|
226
237
|
controller: string;
|
|
227
238
|
ladderSeed: Uint8Array;
|
|
228
239
|
extraNextKeyHashes?: string[];
|
|
240
|
+
capability?: IZcap;
|
|
229
241
|
}): Promise<{
|
|
230
242
|
did: string;
|
|
231
243
|
generationId: string;
|
|
@@ -234,30 +246,30 @@ export declare function mintCredentialCompanionGeneration({ was, wasServerUrl, s
|
|
|
234
246
|
}>;
|
|
235
247
|
/**
|
|
236
248
|
* The type IRI of the account document's delegated-clients service entry --
|
|
237
|
-
* the pointer at the current
|
|
249
|
+
* the pointer at the current annex generation's DID. Wire-level and
|
|
238
250
|
* permanent: readers (this module's {@link delegatedClientsPointer}, the
|
|
239
|
-
* server's
|
|
251
|
+
* server's annex-chain inspector clause) dispatch on this IRI, never on
|
|
240
252
|
* the entry's fragment id, which is non-semantic by convention.
|
|
241
253
|
*/
|
|
242
254
|
export declare const DELEGATED_CLIENTS_SERVICE_TYPE = "https://w3id.org/byoe#DelegatedClients";
|
|
243
255
|
/**
|
|
244
256
|
* Builds a fresh delegated-clients service entry for the account document.
|
|
245
|
-
* The `serviceEndpoint` is the
|
|
257
|
+
* The `serviceEndpoint` is the annex DID STRING, deliberately not a URL:
|
|
246
258
|
* the DID is self-certifying and host-independent, and the account pointer
|
|
247
259
|
* already carries the host.
|
|
248
260
|
*
|
|
249
261
|
* @param options {object}
|
|
250
262
|
* @param options.accountDid {string} the account did:webvh
|
|
251
|
-
* @param options.
|
|
263
|
+
* @param options.clientAnnexDid {string} the current generation's annex
|
|
252
264
|
* DID
|
|
253
265
|
* @returns {ServiceEndpoint}
|
|
254
266
|
*/
|
|
255
|
-
export declare function delegatedClientsServiceEntry({ accountDid,
|
|
267
|
+
export declare function delegatedClientsServiceEntry({ accountDid, clientAnnexDid }: {
|
|
256
268
|
accountDid: string;
|
|
257
|
-
|
|
269
|
+
clientAnnexDid: string;
|
|
258
270
|
}): ServiceEndpoint;
|
|
259
271
|
/**
|
|
260
|
-
* The
|
|
272
|
+
* The annex DID the account document currently points at: the
|
|
261
273
|
* `serviceEndpoint` of the service entry whose `type` names (or includes)
|
|
262
274
|
* {@link DELEGATED_CLIENTS_SERVICE_TYPE}. Only a bare DID-string endpoint
|
|
263
275
|
* counts -- the same predicate the server's inspector clause evaluates, so
|
|
@@ -270,9 +282,32 @@ export declare function delegatedClientsServiceEntry({ accountDid, companionDid
|
|
|
270
282
|
export declare function delegatedClientsPointer({ doc }: {
|
|
271
283
|
doc: DIDDoc;
|
|
272
284
|
}): string | undefined;
|
|
285
|
+
/**
|
|
286
|
+
* The account document's `service` array with the delegated-clients pointer
|
|
287
|
+
* set to `clientAnnexDid`. An existing pointer entry is re-pointed in place,
|
|
288
|
+
* its fragment id preserved verbatim (the id is non-semantic and stable);
|
|
289
|
+
* absent one, a fresh entry is appended. Every other service entry is carried
|
|
290
|
+
* through untouched.
|
|
291
|
+
*
|
|
292
|
+
* Shared by the two writers of the pointer: the standalone
|
|
293
|
+
* {@link setDelegatedClientsPointer} entry, and the transient-recovery
|
|
294
|
+
* continuation, which folds the pointer into its own add-and-retire entry so
|
|
295
|
+
* the pointer can never lag the entry that retires the standing ladder VMs.
|
|
296
|
+
*
|
|
297
|
+
* @param options {object}
|
|
298
|
+
* @param options.doc {DIDDoc} the current account document
|
|
299
|
+
* @param options.accountDid {string} the account did:webvh
|
|
300
|
+
* @param options.clientAnnexDid {string} the generation to point at
|
|
301
|
+
* @returns {ServiceEndpoint[]}
|
|
302
|
+
*/
|
|
303
|
+
export declare function servicesPointedAtClientAnnex({ doc, accountDid, clientAnnexDid }: {
|
|
304
|
+
doc: DIDDoc;
|
|
305
|
+
accountDid: string;
|
|
306
|
+
clientAnnexDid: string;
|
|
307
|
+
}): ServiceEndpoint[];
|
|
273
308
|
/**
|
|
274
309
|
* The unlock-record sibling delegation's `allowedAction` set: GET beside PUT,
|
|
275
|
-
* so an enrolling transient client can read the
|
|
310
|
+
* so an enrolling transient client can read the annex head it appends to.
|
|
276
311
|
* Wire-level and permanent (wallet-core decision 0005): the server's
|
|
277
312
|
* inspector clause admits a delegated-clients delegation with `allowedAction`
|
|
278
313
|
* a subset of exactly this pair.
|
|
@@ -286,13 +321,13 @@ export declare const DELEGATED_CLIENTS_DELEGATION_ACTIONS: string[];
|
|
|
286
321
|
*/
|
|
287
322
|
export declare const DELEGATED_CLIENTS_DELEGATION_TTL_MS: number;
|
|
288
323
|
/**
|
|
289
|
-
* Mints one delegated-clients (
|
|
324
|
+
* Mints one delegated-clients (annex Space) delegation: the pre-minted
|
|
290
325
|
* zcap sealed into a standing credential's unlock record beside the account
|
|
291
|
-
* bridge, which is what lets a transient login reach the
|
|
326
|
+
* bridge, which is what lets a transient login reach the annex log with
|
|
292
327
|
* nothing but the credential. The shape is a permanent wire artifact
|
|
293
328
|
* (wallet-core decision 0005):
|
|
294
329
|
*
|
|
295
|
-
* - `invocationTarget` is the AUXILIARY
|
|
330
|
+
* - `invocationTarget` is the AUXILIARY annex Space's items subtree --
|
|
296
331
|
* the Space URL with a trailing slash, built with was-client's paths
|
|
297
332
|
* helpers so the bytes match the server's target check on a sub-path
|
|
298
333
|
* deployment. Generation coverage comes from generation-id-bounded
|
|
@@ -310,23 +345,49 @@ export declare const DELEGATED_CLIENTS_DELEGATION_TTL_MS: number;
|
|
|
310
345
|
* enrolled client's promoted signer, or the account ladder VM)
|
|
311
346
|
* @param options.wasServerUrl {string} the auxiliary Space's storage
|
|
312
347
|
* server (the account pointer's host)
|
|
313
|
-
* @param options.
|
|
348
|
+
* @param options.clientAnnexSpaceId {string} the auxiliary annex
|
|
314
349
|
* Space's id
|
|
315
350
|
* @param options.controller {string} the credential-derived signing DID
|
|
316
351
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
317
352
|
* @returns {Promise<IZcap>}
|
|
318
353
|
*/
|
|
319
|
-
export declare function mintDelegatedClientsDelegation({ zcapClient, wasServerUrl,
|
|
354
|
+
export declare function mintDelegatedClientsDelegation({ zcapClient, wasServerUrl, clientAnnexSpaceId, controller, now }: {
|
|
320
355
|
zcapClient: ZcapClient;
|
|
321
356
|
wasServerUrl: string;
|
|
322
|
-
|
|
357
|
+
clientAnnexSpaceId: string;
|
|
323
358
|
controller: string;
|
|
324
359
|
now?: number;
|
|
325
360
|
}): Promise<IZcap>;
|
|
326
361
|
/**
|
|
327
|
-
*
|
|
362
|
+
* Builds the annex-side sibling-delegation minter the durable record re-mint
|
|
363
|
+
* orchestrator (`recovery/remintRecoveryDelegations`) takes as an injected
|
|
364
|
+
* closure -- the boundary keeping that base orchestrator free of annex
|
|
365
|
+
* imports. The returned closure reads the auxiliary annex Space id off the
|
|
366
|
+
* verified document's delegated-clients service entry (the annex DID string
|
|
367
|
+
* embeds it) and mints a fresh {@link mintDelegatedClientsDelegation} to the
|
|
368
|
+
* named controller; it resolves `undefined` while the document points at no
|
|
369
|
+
* generation, which the orchestrator reads as "carry the old sealed member
|
|
370
|
+
* verbatim".
|
|
371
|
+
*
|
|
372
|
+
* @param options {object}
|
|
373
|
+
* @param options.doc {object} the locally verified account document
|
|
374
|
+
* @param options.zcapClient {ZcapClient} the acting client's promoted
|
|
375
|
+
* signer, which mints the fresh delegations
|
|
376
|
+
* @param options.wasServerUrl {string} the auxiliary Space's storage
|
|
377
|
+
* server (the account pointer's host)
|
|
378
|
+
* @returns {Function} `({ controller }) => Promise<IZcap | undefined>`
|
|
379
|
+
*/
|
|
380
|
+
export declare function delegatedClientsDelegationMinter({ doc, zcapClient, wasServerUrl }: {
|
|
381
|
+
doc: object;
|
|
382
|
+
zcapClient: ZcapClient;
|
|
383
|
+
wasServerUrl: string;
|
|
384
|
+
}): (options: {
|
|
385
|
+
controller: string;
|
|
386
|
+
}) => Promise<IZcap | undefined>;
|
|
387
|
+
/**
|
|
388
|
+
* The auxiliary annex Space id a delegated-clients delegation targets,
|
|
328
389
|
* read out of its `invocationTarget` (the items-subtree URL,
|
|
329
|
-
* `.../space/<
|
|
390
|
+
* `.../space/<clientAnnexSpaceId>/`). The id has no other home -- a transient
|
|
330
391
|
* login learns the Space from the delegation it unwraps, and a refresh pass
|
|
331
392
|
* that holds the old delegation rebuilds the target from it -- so this parse
|
|
332
393
|
* is the one reader. Returns `undefined` on anything that is not an
|
|
@@ -340,7 +401,7 @@ export declare function delegatedClientsDelegationSpaceId({ delegation }: {
|
|
|
340
401
|
delegation: IZcap;
|
|
341
402
|
}): string | undefined;
|
|
342
403
|
/**
|
|
343
|
-
* The type IRI of the
|
|
404
|
+
* The type IRI of the annex document's generation-delegation service
|
|
344
405
|
* entry -- the generation's standing Space-scoped zcap, embedded where an
|
|
345
406
|
* enrolling transient client can reach it before it holds any other
|
|
346
407
|
* authority. Wire-level and permanent: readers (this module's
|
|
@@ -379,8 +440,8 @@ export declare const GENERATION_DELEGATION_TTL_MS: number;
|
|
|
379
440
|
* bytes match the server's target check on a sub-path deployment. The
|
|
380
441
|
* bare Space URL sits outside the capability bytes (see
|
|
381
442
|
* {@link GENERATION_DELEGATION_ACTIONS} for what that excludes).
|
|
382
|
-
* - `controller` is the bare
|
|
383
|
-
* `<
|
|
443
|
+
* - `controller` is the bare annex DID string. Transient keys invoke as
|
|
444
|
+
* `<clientAnnexDid>#<vm>`, and the server's inspector clause compares this
|
|
384
445
|
* string against the account document's delegated-clients pointer.
|
|
385
446
|
* - The chain is rooted directly in the account Space's root zcap, so an
|
|
386
447
|
* App Connect grant delegated under it forms the depth-3 chain
|
|
@@ -396,15 +457,15 @@ export declare const GENERATION_DELEGATION_TTL_MS: number;
|
|
|
396
457
|
* or a durable client's promoted signer)
|
|
397
458
|
* @param options.wasServerUrl {string} the ACCOUNT Space's storage server
|
|
398
459
|
* @param options.spaceId {string} the ACCOUNT Space's id
|
|
399
|
-
* @param options.
|
|
460
|
+
* @param options.clientAnnexDid {string} the generation's annex DID
|
|
400
461
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
401
462
|
* @returns {Promise<IZcap>}
|
|
402
463
|
*/
|
|
403
|
-
export declare function mintGenerationDelegation({ zcapClient, wasServerUrl, spaceId,
|
|
464
|
+
export declare function mintGenerationDelegation({ zcapClient, wasServerUrl, spaceId, clientAnnexDid, now }: {
|
|
404
465
|
zcapClient: ZcapClient;
|
|
405
466
|
wasServerUrl: string;
|
|
406
467
|
spaceId: string;
|
|
407
|
-
|
|
468
|
+
clientAnnexDid: string;
|
|
408
469
|
now?: number;
|
|
409
470
|
}): Promise<IZcap>;
|
|
410
471
|
/**
|
|
@@ -429,30 +490,30 @@ export declare function clampGrantExpires({ ttlMs, delegation, now }: {
|
|
|
429
490
|
now?: number;
|
|
430
491
|
}): Date;
|
|
431
492
|
/**
|
|
432
|
-
* Builds a fresh generation-delegation service entry for
|
|
493
|
+
* Builds a fresh generation-delegation service entry for an annex
|
|
433
494
|
* document. The `serviceEndpoint` is the full delegated-zcap JSON as a
|
|
434
495
|
* single map, byte-identical to what `zcapClient.delegate` produced -- the
|
|
435
|
-
*
|
|
496
|
+
* annex entry proof (JCS canonicalization) then covers it byte for byte,
|
|
436
497
|
* so host tampering with the stored delegation is client-visible.
|
|
437
498
|
*
|
|
438
499
|
* @param options {object}
|
|
439
|
-
* @param options.
|
|
500
|
+
* @param options.clientAnnexDid {string} the generation's annex DID
|
|
440
501
|
* @param options.delegation {IZcap} the minted generation delegation
|
|
441
502
|
* @returns {ServiceEndpoint}
|
|
442
503
|
*/
|
|
443
|
-
export declare function generationDelegationServiceEntry({
|
|
444
|
-
|
|
504
|
+
export declare function generationDelegationServiceEntry({ clientAnnexDid, delegation }: {
|
|
505
|
+
clientAnnexDid: string;
|
|
445
506
|
delegation: IZcap;
|
|
446
507
|
}): ServiceEndpoint;
|
|
447
508
|
/**
|
|
448
|
-
* The generation delegation
|
|
509
|
+
* The generation delegation an annex document carries: the
|
|
449
510
|
* `serviceEndpoint` map of the service entry whose `type` names (or
|
|
450
511
|
* includes) {@link GENERATION_DELEGATION_SERVICE_TYPE}. Only a map-form
|
|
451
512
|
* endpoint counts (the delegation is embedded as the zcap JSON itself,
|
|
452
513
|
* never as a URL or an encoded string).
|
|
453
514
|
*
|
|
454
515
|
* @param options {object}
|
|
455
|
-
* @param options.doc {DIDDoc} the resolved (and verified)
|
|
516
|
+
* @param options.doc {DIDDoc} the resolved (and verified) annex
|
|
456
517
|
* document
|
|
457
518
|
* @returns {IZcap | undefined}
|
|
458
519
|
*/
|
|
@@ -460,53 +521,89 @@ export declare function embeddedGenerationDelegation({ doc }: {
|
|
|
460
521
|
doc: DIDDoc;
|
|
461
522
|
}): IZcap | undefined;
|
|
462
523
|
/**
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
524
|
+
* Every generation delegation a generation's log has ever embedded, in log
|
|
525
|
+
* order and deduplicated by zcap id -- the annex-log HISTORY WALK the
|
|
526
|
+
* last-durable-client forget revokes from (decision 0004's 2026-08-19
|
|
527
|
+
* amendment): a renewal replaces the head service entry's endpoint in place,
|
|
528
|
+
* so a superseded delegation's bytes survive only in earlier entries'
|
|
529
|
+
* re-stated full state, and a renewal inside the 30-day window can leave TWO
|
|
530
|
+
* still-unexpired ladder-signed delegations. The caller filters (signer,
|
|
531
|
+
* expiry) and revokes; this walk only recovers the bytes.
|
|
532
|
+
*
|
|
533
|
+
* @param options {object}
|
|
534
|
+
* @param options.log {DIDLog} the generation's VERIFIED log
|
|
535
|
+
* @returns {IZcap[]}
|
|
536
|
+
*/
|
|
537
|
+
export declare function generationDelegationHistory({ log }: {
|
|
538
|
+
log: DIDLog;
|
|
539
|
+
}): IZcap[];
|
|
540
|
+
/**
|
|
541
|
+
* Submits the revocation of a generation delegation, reading the server's
|
|
542
|
+
* 400 answer as success: an already-revoked chain (a resumed ceremony's
|
|
543
|
+
* blind re-POST) and an expired delegation (which no longer needs revoking)
|
|
544
|
+
* both land there, and the revocation protocol exposes no read endpoint to
|
|
545
|
+
* distinguish them beforehand. Matched on `err.name` -- error classes do not
|
|
546
|
+
* survive crossing package copies. The `revoke` seam is was-client's
|
|
547
|
+
* `WasClient#revoke`, bound by the caller.
|
|
548
|
+
*
|
|
549
|
+
* @param options {object}
|
|
550
|
+
* @param options.revoke {Function} `(delegation) => Promise<void>` --
|
|
551
|
+
* POSTs the revocation (`was.revoke`)
|
|
552
|
+
* @param options.delegation {IZcap}
|
|
553
|
+
* @returns {Promise<void>}
|
|
554
|
+
*/
|
|
555
|
+
export declare function revokeTreatingAlreadyRevokedAsSuccess({ revoke, delegation }: {
|
|
556
|
+
revoke: (delegation: IDelegatedZcap) => Promise<void>;
|
|
557
|
+
delegation: IZcap;
|
|
558
|
+
}): Promise<void>;
|
|
559
|
+
/**
|
|
560
|
+
* Parses the auxiliary Space id and generation id out of an annex DID
|
|
561
|
+
* string. Both are permanent substrings of every annex DID by
|
|
562
|
+
* construction: the generation id is the final path segment of the annex
|
|
466
563
|
* DID (`did:webvh:<scid>:<host>:...:space:<spaceId>:<generationId>`), and it
|
|
467
|
-
* is the generation-identifying half of the
|
|
564
|
+
* is the generation-identifying half of the annex rung HKDF
|
|
468
565
|
* labels, so this parse is what lets an enrollee derive its writing key from
|
|
469
566
|
* the pointer alone -- no log read, no registry.
|
|
470
567
|
*
|
|
471
568
|
* @param options {object}
|
|
472
|
-
* @param options.did {string}
|
|
569
|
+
* @param options.did {string} an annex did:webvh string
|
|
473
570
|
* @returns {{ spaceId: string, generationId: string }}
|
|
474
571
|
*/
|
|
475
|
-
export declare function
|
|
572
|
+
export declare function clientAnnexDidParts({ did }: {
|
|
476
573
|
did: string;
|
|
477
574
|
}): {
|
|
478
575
|
spaceId: string;
|
|
479
576
|
generationId: string;
|
|
480
577
|
};
|
|
481
578
|
/**
|
|
482
|
-
* Thrown when the published
|
|
579
|
+
* Thrown when the published annex log commits neither the writing
|
|
483
580
|
* credential's rung-0 key nor its hash -- the mid-generation lockout: a
|
|
484
|
-
* credential bound after the generation's genesis cannot write the
|
|
581
|
+
* credential bound after the generation's genesis cannot write the annex
|
|
485
582
|
* until an existing writer commits its rung-0 hash or the next GC swap's
|
|
486
583
|
* genesis does. Typed so callers can map it to the fresh-generation path
|
|
487
584
|
* where one is licensed (the transient-recovery continuation) or to honest
|
|
488
585
|
* copy where none is.
|
|
489
586
|
*/
|
|
490
|
-
export declare class
|
|
587
|
+
export declare class ClientAnnexRungUncommittedError extends Error {
|
|
491
588
|
constructor(message: string);
|
|
492
589
|
}
|
|
493
590
|
/**
|
|
494
|
-
* The narrow store seam
|
|
495
|
-
* log read and the conditional `did.jsonl` PUT, nothing else (
|
|
591
|
+
* The narrow store seam an annex entry is read and published through: the
|
|
592
|
+
* log read and the conditional `did.jsonl` PUT, nothing else (an annex has
|
|
496
593
|
* no `did.json` projection and no key map). Satisfied by
|
|
497
|
-
* {@link
|
|
594
|
+
* {@link clientAnnexLogStore} (controller-tier signing) and by the delegated
|
|
498
595
|
* store a transient session writes through (`delegatedWebvhLogStore`,
|
|
499
596
|
* invoking the credential's sibling delegation).
|
|
500
597
|
*/
|
|
501
|
-
export type
|
|
598
|
+
export type ClientAnnexWriteStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
502
599
|
/**
|
|
503
600
|
* TRANSIENT ENROLLMENT: publishes one per-visit verification method into a
|
|
504
|
-
*
|
|
601
|
+
* annex generation's log -- one atomic entry, signed by the writing
|
|
505
602
|
* credential's static rung 0 (derived from the ladder seed and the generation
|
|
506
603
|
* id;
|
|
507
|
-
* see `
|
|
604
|
+
* see `clientAnnexRung`). The entry:
|
|
508
605
|
*
|
|
509
|
-
* - reveals the writer's rung-0 key into `updateKeys` at its first
|
|
606
|
+
* - reveals the writer's rung-0 key into `updateKeys` at its first annex
|
|
510
607
|
* write (later writes re-state it unchanged);
|
|
511
608
|
* - re-states `nextKeyHashes` verbatim -- every standing credential's rung-0
|
|
512
609
|
* hash, the writer's own carry-over hash included -- explicitly on the
|
|
@@ -515,7 +612,7 @@ export type CompanionWriteStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putId
|
|
|
515
612
|
* relationship arrays stated explicitly (no `authentication`, no
|
|
516
613
|
* `assertionMethod`, no `keyAgreement` twin -- the DIDAuth path signs as
|
|
517
614
|
* the bare did:key, and the controller-marker convention does not arise in
|
|
518
|
-
* the
|
|
615
|
+
* the annex at all).
|
|
519
616
|
*
|
|
520
617
|
* The transient key set carries no update key, and nothing here touches the
|
|
521
618
|
* ACCOUNT log's `updateKeys` or `nextKeyHashes`. There is no two-entry
|
|
@@ -524,12 +621,12 @@ export type CompanionWriteStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putId
|
|
|
524
621
|
* published document's own state -- a VM already present is a no-op.
|
|
525
622
|
*
|
|
526
623
|
* A writer whose rung-0 key is neither revealed nor committed is refused
|
|
527
|
-
* ({@link
|
|
624
|
+
* ({@link ClientAnnexRungUncommittedError}): annex entries verify against
|
|
528
625
|
* the log's own hash-commitment chain, so no admission rule can make an
|
|
529
626
|
* uncommitted key verify mid-log.
|
|
530
627
|
*
|
|
531
628
|
* @param options {object}
|
|
532
|
-
* @param options.store {
|
|
629
|
+
* @param options.store {ClientAnnexWriteStore} the generation's log store
|
|
533
630
|
* (delegated through the credential's sibling delegation, or
|
|
534
631
|
* controller-tier)
|
|
535
632
|
* @param options.ladderSeed {Uint8Array} the credential's ladder seed, from
|
|
@@ -537,35 +634,35 @@ export type CompanionWriteStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putId
|
|
|
537
634
|
* @param options.generationId {string} the generation collection's name
|
|
538
635
|
* @param options.transientKeyMultibase {string} the visit's in-memory
|
|
539
636
|
* Ed25519 signing key, public multibase
|
|
540
|
-
* @param [options.services] {ServiceEndpoint[]} the
|
|
637
|
+
* @param [options.services] {ServiceEndpoint[]} the annex document's
|
|
541
638
|
* full service-entry list, replacing the published one wholesale; omitted,
|
|
542
639
|
* the prior entries are preserved verbatim (or extended by
|
|
543
640
|
* `mintGenerationDelegation` below). Supplying both is refused in favor of
|
|
544
641
|
* the explicit list
|
|
545
642
|
* @param [options.mintGenerationDelegation] {Function}
|
|
546
|
-
* `({
|
|
643
|
+
* `({ clientAnnexDid }) => Promise<IZcap>` -- mints the generation
|
|
547
644
|
* delegation this entry installs when it publishes the generation's FIRST
|
|
548
645
|
* transient verification method (and the document carries no delegation
|
|
549
646
|
* entry yet). Never invoked otherwise: the delegation is installed with
|
|
550
647
|
* the first transient VM or by the GC ceremony's own install stage, never
|
|
551
648
|
* by genesis (a genesis-embedded signed zcap can never verify -- its
|
|
552
649
|
* `controller` embeds the SCID the genesis hash derives from)
|
|
553
|
-
* @param [options.expectedDid] {string} the
|
|
650
|
+
* @param [options.expectedDid] {string} the annex DID the log must
|
|
554
651
|
* resolve to, from the account document's pointer
|
|
555
652
|
* @param [options.pinStore] {ResourceLogPinStore} chain-head pins (a
|
|
556
653
|
* transient session passes an in-memory store)
|
|
557
654
|
* @param [options.logId] {string} the generation's pin-slot key, from
|
|
558
|
-
* {@link
|
|
655
|
+
* {@link clientAnnexLogPinId}; required whenever a `pinStore` is supplied
|
|
559
656
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>}
|
|
560
657
|
*/
|
|
561
|
-
export declare function
|
|
562
|
-
store:
|
|
658
|
+
export declare function enrollClientAnnexTransientClient(options: {
|
|
659
|
+
store: ClientAnnexWriteStore;
|
|
563
660
|
ladderSeed: Uint8Array;
|
|
564
661
|
generationId: string;
|
|
565
662
|
transientKeyMultibase: string;
|
|
566
663
|
services?: ServiceEndpoint[];
|
|
567
664
|
mintGenerationDelegation?: (options: {
|
|
568
|
-
|
|
665
|
+
clientAnnexDid: string;
|
|
569
666
|
}) => Promise<IZcap>;
|
|
570
667
|
expectedDid?: string;
|
|
571
668
|
pinStore?: ResourceLogPinStore;
|
|
@@ -577,10 +674,10 @@ export declare function enrollCompanionTransientClient(options: {
|
|
|
577
674
|
}>;
|
|
578
675
|
/**
|
|
579
676
|
* Points the account document's delegated-clients service entry at a
|
|
580
|
-
*
|
|
677
|
+
* annex DID -- the first install after a generation's genesis, and the GC
|
|
581
678
|
* swap's re-point alike. One ordinary document-update entry, signed by an
|
|
582
|
-
* enrolled durable client's active update key; the
|
|
583
|
-
* publishes FIRST (see {@link
|
|
679
|
+
* enrolled durable client's active update key; the annex log always
|
|
680
|
+
* publishes FIRST (see {@link mintClientAnnexGeneration}), so a tear leaves an
|
|
584
681
|
* unpointed, authorization-inert generation, never a dangling pointer.
|
|
585
682
|
*
|
|
586
683
|
* An existing delegated-clients entry is re-pointed in place, its fragment id
|
|
@@ -591,10 +688,14 @@ export declare function enrollCompanionTransientClient(options: {
|
|
|
591
688
|
* a no-op on the log (it still heals a lagging `did.json`).
|
|
592
689
|
*
|
|
593
690
|
* @param options {object}
|
|
594
|
-
* @param options.idStore {WebvhIdStore} the ACCOUNT log's store
|
|
691
|
+
* @param options.idStore {WebvhIdStore} the ACCOUNT log's store; with
|
|
692
|
+
* `logOnly`, only its log read and `did.jsonl` PUT are used, so the narrow
|
|
693
|
+
* delegated seam satisfies it
|
|
595
694
|
* @param options.updateKeys {ClientWebvhUpdateKeys} this durable client's
|
|
596
|
-
* update-key seeds
|
|
597
|
-
*
|
|
695
|
+
* update-key seeds -- or the ladder-rung idiom on a ladder-anchored
|
|
696
|
+
* account (`{ updateSeed: rung0.seed, stagedSeed: rung1.seed }`), as the
|
|
697
|
+
* credential-anchored genesis and the transient-recovery continuation pass
|
|
698
|
+
* @param options.clientAnnexDid {string} the generation to point at
|
|
598
699
|
* @param [options.expectedDid] {string} the account DID the log must
|
|
599
700
|
* resolve to, from the account pointer
|
|
600
701
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
@@ -602,15 +703,21 @@ export declare function enrollCompanionTransientClient(options: {
|
|
|
602
703
|
* @param [options.logId] {string} the account log's pin-slot key, from
|
|
603
704
|
* `accountLogPinId({ spaceId })`; required whenever a `pinStore` is
|
|
604
705
|
* supplied
|
|
706
|
+
* @param [options.logOnly] {boolean} publish `did.jsonl` only, never the
|
|
707
|
+
* `did.json` projection -- the transient-recovery continuation writing
|
|
708
|
+
* through the record's bridge delegation, whose narrow scope covers nothing
|
|
709
|
+
* but the log. The projection heals at the next authorized write (the log
|
|
710
|
+
* is the source of truth)
|
|
605
711
|
* @returns {Promise<{ did: string, doc: DIDDoc }>}
|
|
606
712
|
*/
|
|
607
713
|
export declare function setDelegatedClientsPointer(options: {
|
|
608
714
|
idStore: WebvhIdStore;
|
|
609
715
|
updateKeys: ClientWebvhUpdateKeys;
|
|
610
|
-
|
|
716
|
+
clientAnnexDid: string;
|
|
611
717
|
expectedDid?: string;
|
|
612
718
|
pinStore?: ResourceLogPinStore;
|
|
613
719
|
logId?: string;
|
|
720
|
+
logOnly?: boolean;
|
|
614
721
|
}): Promise<{
|
|
615
722
|
did: string;
|
|
616
723
|
doc: DIDDoc;
|
|
@@ -638,51 +745,60 @@ export declare function setDelegatedClientsPointer(options: {
|
|
|
638
745
|
* @param options.transientKeyMultibase {string} the visit's in-memory
|
|
639
746
|
* signing key, public multibase
|
|
640
747
|
* @param [options.mintGenerationDelegation] {Function}
|
|
641
|
-
* `({
|
|
748
|
+
* `({ clientAnnexDid }) => Promise<IZcap>` -- forwarded to the enrollment
|
|
642
749
|
* entry, which installs the minted delegation when it publishes the
|
|
643
750
|
* generation's first transient VM (see
|
|
644
|
-
* {@link
|
|
645
|
-
*
|
|
751
|
+
* {@link enrollClientAnnexTransientClient}). The closure receives whichever
|
|
752
|
+
* annex DID the round enrolls into, so a GC-race re-enroll mints for
|
|
646
753
|
* the fresh generation
|
|
647
754
|
* @param [options.pinStore] {ResourceLogPinStore} chain-head pins for the
|
|
648
755
|
* generation logs (a transient session passes an in-memory store); slot
|
|
649
|
-
* keys are derived per generation with {@link
|
|
756
|
+
* keys are derived per generation with {@link clientAnnexLogPinId}
|
|
650
757
|
* @param [options.maxRounds] {number} how many pointer moves to chase
|
|
651
758
|
* before giving up (a GC pass is quarterly, so more than one mid-ceremony
|
|
652
759
|
* move means something else is wrong)
|
|
653
|
-
* @returns {Promise<{
|
|
760
|
+
* @returns {Promise<{ clientAnnexDid: string, doc: DIDDoc, log: DIDLog }>}
|
|
654
761
|
*/
|
|
655
762
|
export declare function enrollTransientClient({ readAccountDocument, storeForGenerationId, ladderSeed, transientKeyMultibase, mintGenerationDelegation: mintDelegation, pinStore, maxRounds }: {
|
|
656
763
|
readAccountDocument: () => Promise<DIDDoc>;
|
|
657
|
-
storeForGenerationId: (generationId: string) =>
|
|
764
|
+
storeForGenerationId: (generationId: string) => ClientAnnexWriteStore;
|
|
658
765
|
ladderSeed: Uint8Array;
|
|
659
766
|
transientKeyMultibase: string;
|
|
660
767
|
mintGenerationDelegation?: (options: {
|
|
661
|
-
|
|
768
|
+
clientAnnexDid: string;
|
|
662
769
|
}) => Promise<IZcap>;
|
|
663
770
|
pinStore?: ResourceLogPinStore;
|
|
664
771
|
maxRounds?: number;
|
|
665
772
|
}): Promise<{
|
|
666
|
-
|
|
773
|
+
clientAnnexDid: string;
|
|
667
774
|
doc: DIDDoc;
|
|
668
775
|
log: DIDLog;
|
|
669
776
|
}>;
|
|
670
777
|
/**
|
|
671
778
|
* RENEW PRECEDES MINT: the blocking pre-mint stage a transient App Connect
|
|
672
|
-
* approval runs before delegating any grant. Reads the
|
|
779
|
+
* approval runs before delegating any grant. Reads the annex document
|
|
673
780
|
* and hands back its embedded generation delegation -- renewing it first
|
|
674
781
|
* when it is expired or inside the 30-day renewal window ({@link
|
|
675
782
|
* zcapExpiring}): a fresh delegation is minted through the caller's closure
|
|
676
783
|
* (ladder-signed -- the renewal must not depend on the very delegation it
|
|
677
784
|
* replaces; published through the store, which in a transient session is
|
|
678
785
|
* the credential's sibling delegation, so even a hard-expired delegation is
|
|
679
|
-
* recoverable), and one
|
|
786
|
+
* recoverable), and one annex entry replaces the service entry's
|
|
680
787
|
* endpoint in place, signed by the writing credential's static rung 0.
|
|
681
788
|
*
|
|
682
|
-
*
|
|
789
|
+
* An annex document carrying no delegation entry at all installs one the
|
|
683
790
|
* same way (the GC ceremony's own install stage and the first-VM install
|
|
684
791
|
* make this rare; a heal, not a policy).
|
|
685
792
|
*
|
|
793
|
+
* Beside the expiry axis, an `accountDoc` adds the SIGNER-DEATH axis: a
|
|
794
|
+
* standing delegation whose proof key is no longer in the supplied verified
|
|
795
|
+
* account document has rotted under the current-key-set rule (the durable
|
|
796
|
+
* client that minted it was revoked, or the ladder VM that signed it left
|
|
797
|
+
* with the first durable self-enrollment) and is replaced the same way. No
|
|
798
|
+
* revocation POST accompanies the replacement: a rotted chain no longer
|
|
799
|
+
* verifies at the revocation endpoint, and the expiry-renewal path never
|
|
800
|
+
* revoked either.
|
|
801
|
+
*
|
|
686
802
|
* Failure is the caller's failure: a renewal that cannot complete throws,
|
|
687
803
|
* and the App Connect approval fails with the standard retryable-ceremony
|
|
688
804
|
* posture -- deliberately no clamp-on-failure fallback, which would deliver
|
|
@@ -692,37 +808,135 @@ export declare function enrollTransientClient({ readAccountDocument, storeForGen
|
|
|
692
808
|
* 30 or more days remaining ({@link clampGrantExpires}).
|
|
693
809
|
*
|
|
694
810
|
* @param options {object}
|
|
695
|
-
* @param options.store {
|
|
811
|
+
* @param options.store {ClientAnnexWriteStore} the generation's log store
|
|
696
812
|
* (delegated through the credential's sibling delegation, or
|
|
697
813
|
* controller-tier)
|
|
698
814
|
* @param options.ladderSeed {Uint8Array} the credential's ladder seed, from
|
|
699
815
|
* its unlock record
|
|
700
816
|
* @param options.generationId {string} the generation collection's name
|
|
701
817
|
* @param options.mintGenerationDelegation {Function}
|
|
702
|
-
* `({
|
|
818
|
+
* `({ clientAnnexDid }) => Promise<IZcap>` -- mints the replacement
|
|
703
819
|
* delegation (ladder-signed in a transient session)
|
|
704
|
-
* @param [options.expectedDid] {string} the
|
|
820
|
+
* @param [options.expectedDid] {string} the annex DID the log must
|
|
705
821
|
* resolve to, from the account document's pointer
|
|
706
822
|
* @param [options.pinStore] {ResourceLogPinStore} chain-head pins (a
|
|
707
823
|
* transient session passes an in-memory store)
|
|
708
824
|
* @param [options.logId] {string} the generation's pin-slot key, from
|
|
709
|
-
* {@link
|
|
825
|
+
* {@link clientAnnexLogPinId}; required whenever a `pinStore` is supplied
|
|
826
|
+
* @param [options.accountDoc] {PublishedKeyDocument} the locally VERIFIED
|
|
827
|
+
* account document; supplied, a standing delegation whose proof key it no
|
|
828
|
+
* longer lists is replaced (the signer-death axis above)
|
|
829
|
+
* @param [options.force] {boolean} replace the embedded delegation
|
|
830
|
+
* unconditionally, however healthy it looks -- the last-durable-client
|
|
831
|
+
* forget's replacement stage, where the standing delegation has just been
|
|
832
|
+
* revoked server-side (a state no client-side predicate can read)
|
|
710
833
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
711
834
|
* @returns {Promise<{ delegation: IZcap, renewed: boolean }>}
|
|
712
835
|
*/
|
|
713
836
|
export declare function ensureGenerationDelegationCurrent(options: {
|
|
714
|
-
store:
|
|
837
|
+
store: ClientAnnexWriteStore;
|
|
715
838
|
ladderSeed: Uint8Array;
|
|
716
839
|
generationId: string;
|
|
717
840
|
mintGenerationDelegation: (options: {
|
|
718
|
-
|
|
841
|
+
clientAnnexDid: string;
|
|
719
842
|
}) => Promise<IZcap>;
|
|
720
843
|
expectedDid?: string;
|
|
721
844
|
pinStore?: ResourceLogPinStore;
|
|
722
845
|
logId?: string;
|
|
846
|
+
accountDoc?: PublishedKeyDocument;
|
|
847
|
+
force?: boolean;
|
|
723
848
|
now?: number;
|
|
724
849
|
}): Promise<{
|
|
725
850
|
delegation: IZcap;
|
|
726
851
|
renewed: boolean;
|
|
727
852
|
}>;
|
|
728
|
-
|
|
853
|
+
/**
|
|
854
|
+
* THE CLIENT-ANNEX RUNG STRIKE: drops a retired credential's annex posture
|
|
855
|
+
* from a generation's log -- its revealed rung-0 key out of `updateKeys` and
|
|
856
|
+
* its standing rung-0 hash out of `nextKeyHashes` -- in one atomic entry
|
|
857
|
+
* signed by ANOTHER credential's committed rung 0 (an annex entry cannot
|
|
858
|
+
* remove its own signing key: the entry verifies against its own re-stated
|
|
859
|
+
* `updateKeys`). The credential-rotation ceremony's annex reach.
|
|
860
|
+
*
|
|
861
|
+
* A log committing neither the retired rung's key nor its hash is already
|
|
862
|
+
* clean and the strike no-ops (`struck: false`) -- the resumable shape, and
|
|
863
|
+
* the common one: a credential that never minted or wrote this generation
|
|
864
|
+
* has no posture in it. An acting rung the log does not commit (after the
|
|
865
|
+
* retired members are excluded -- so the retired credential can never sign
|
|
866
|
+
* its own strike) is refused with {@link ClientAnnexRungUncommittedError},
|
|
867
|
+
* which the caller maps to the generation-swap fallback: a fresh generation
|
|
868
|
+
* minted from a surviving credential's seed retires the rung with the whole
|
|
869
|
+
* generation.
|
|
870
|
+
*
|
|
871
|
+
* @param options {object}
|
|
872
|
+
* @param options.store {ClientAnnexWriteStore} the pointed generation's log
|
|
873
|
+
* store (controller-tier, or delegated through a sibling delegation)
|
|
874
|
+
* @param options.retiredLadderSeed {Uint8Array} the RETIRED credential's
|
|
875
|
+
* ladder seed (its rung is derived per generation, so the seed is the only
|
|
876
|
+
* way to name what to strike)
|
|
877
|
+
* @param options.actingLadderSeed {Uint8Array} a surviving credential's
|
|
878
|
+
* ladder seed, whose committed rung 0 signs the strike entry
|
|
879
|
+
* @param options.generationId {string} the generation collection's name
|
|
880
|
+
* @param [options.expectedDid] {string} the annex DID the log must
|
|
881
|
+
* resolve to, from the account document's pointer
|
|
882
|
+
* @param [options.pinStore] {ResourceLogPinStore}
|
|
883
|
+
* @param [options.logId] {string} the generation's pin-slot key, from
|
|
884
|
+
* {@link clientAnnexLogPinId}; required whenever a `pinStore` is supplied
|
|
885
|
+
* @returns {Promise<{ struck: boolean }>}
|
|
886
|
+
*/
|
|
887
|
+
export declare function retireClientAnnexRung(options: {
|
|
888
|
+
store: ClientAnnexWriteStore;
|
|
889
|
+
retiredLadderSeed: Uint8Array;
|
|
890
|
+
actingLadderSeed: Uint8Array;
|
|
891
|
+
generationId: string;
|
|
892
|
+
expectedDid?: string;
|
|
893
|
+
pinStore?: ResourceLogPinStore;
|
|
894
|
+
logId?: string;
|
|
895
|
+
}): Promise<{
|
|
896
|
+
struck: boolean;
|
|
897
|
+
}>;
|
|
898
|
+
/**
|
|
899
|
+
* THE CLIENT-ANNEX RUNG COMMIT: adds a freshly bound credential's rung-0
|
|
900
|
+
* hash to a generation's `nextKeyHashes` -- one atomic hash-restating entry
|
|
901
|
+
* signed by an already-committed credential's rung 0. The bind ceremonies'
|
|
902
|
+
* annex reach (passkey add, passphrase change): a bind runs from a logged-in
|
|
903
|
+
* session whose own login credential's rung 0 is committed, so committing the
|
|
904
|
+
* new credential's hash here is what keeps it out of the mid-generation
|
|
905
|
+
* lockout ({@link ClientAnnexRungUncommittedError} at its first transient
|
|
906
|
+
* login, otherwise standing until the next GC swap's genesis).
|
|
907
|
+
*
|
|
908
|
+
* A log already committing the bound rung's hash (or carrying its revealed
|
|
909
|
+
* key) is a no-op (`committed: false`) -- the resumable shape. An acting rung
|
|
910
|
+
* the log does not commit is refused with
|
|
911
|
+
* {@link ClientAnnexRungUncommittedError}: the bind ceremony maps that to an
|
|
912
|
+
* honest skip (nothing licenses it to mint a generation), and the lockout
|
|
913
|
+
* consequence stands as documented.
|
|
914
|
+
*
|
|
915
|
+
* @param options {object}
|
|
916
|
+
* @param options.store {ClientAnnexWriteStore} the pointed generation's log
|
|
917
|
+
* store (controller-tier, or delegated through a sibling delegation)
|
|
918
|
+
* @param options.boundLadderSeed {Uint8Array} the freshly bound
|
|
919
|
+
* credential's ladder seed (its rung is derived per generation, so the seed
|
|
920
|
+
* is the only way to name what to commit)
|
|
921
|
+
* @param options.actingLadderSeed {Uint8Array} the logged-in session's
|
|
922
|
+
* login credential's ladder seed, whose committed rung 0 signs the entry
|
|
923
|
+
* @param options.generationId {string} the generation collection's name
|
|
924
|
+
* @param [options.expectedDid] {string} the annex DID the log must
|
|
925
|
+
* resolve to, from the account document's pointer
|
|
926
|
+
* @param [options.pinStore] {ResourceLogPinStore}
|
|
927
|
+
* @param [options.logId] {string} the generation's pin-slot key, from
|
|
928
|
+
* {@link clientAnnexLogPinId}; required whenever a `pinStore` is supplied
|
|
929
|
+
* @returns {Promise<{ committed: boolean }>}
|
|
930
|
+
*/
|
|
931
|
+
export declare function commitClientAnnexRung(options: {
|
|
932
|
+
store: ClientAnnexWriteStore;
|
|
933
|
+
boundLadderSeed: Uint8Array;
|
|
934
|
+
actingLadderSeed: Uint8Array;
|
|
935
|
+
generationId: string;
|
|
936
|
+
expectedDid?: string;
|
|
937
|
+
pinStore?: ResourceLogPinStore;
|
|
938
|
+
logId?: string;
|
|
939
|
+
}): Promise<{
|
|
940
|
+
committed: boolean;
|
|
941
|
+
}>;
|
|
942
|
+
//# sourceMappingURL=log.d.ts.map
|