@interop/wallet-core 0.52.1 → 0.53.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/dist/clientAnnex/forgetLast.d.ts +18 -10
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +29 -9
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +1 -1
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +1 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +110 -3
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +151 -9
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +11 -0
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +45 -5
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +61 -2
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +72 -8
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +10 -7
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +5 -2
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +5 -2
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/keys/clientKeyRecord.d.ts +68 -1
- package/dist/keys/clientKeyRecord.d.ts.map +1 -1
- package/dist/keys/clientKeyRecord.js +155 -20
- package/dist/keys/clientKeyRecord.js.map +1 -1
- package/dist/keys/index.d.ts +2 -2
- 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/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +15 -0
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/log.d.ts +49 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +53 -0
- package/dist/log.js.map +1 -0
- package/dist/recovery/recoveryDelegation.d.ts +6 -2
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +31 -5
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +63 -4
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +109 -14
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/capabilityRequest.d.ts +9 -1
- package/dist/request/capabilityRequest.d.ts.map +1 -1
- package/dist/request/capabilityRequest.js +13 -2
- package/dist/request/capabilityRequest.js.map +1 -1
- package/dist/request/classify.d.ts +37 -1
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +61 -2
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +0 -18
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js +3 -2
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/interactionUrl.d.ts.map +1 -1
- package/dist/request/interactionUrl.js +4 -2
- package/dist/request/interactionUrl.js.map +1 -1
- package/dist/request/parse.d.ts +0 -10
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +15 -1
- package/dist/request/parse.js.map +1 -1
- package/dist/request/processRequest.d.ts.map +1 -1
- package/dist/request/processRequest.js +2 -1
- package/dist/request/processRequest.js.map +1 -1
- package/dist/request/types.d.ts +23 -2
- package/dist/request/types.d.ts.map +1 -1
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +3 -2
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/license.d.ts +17 -3
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +24 -2
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +48 -1
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +52 -4
- package/dist/space/activity.js.map +1 -1
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/pull.d.ts +0 -22
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +30 -2
- package/dist/sync/pull.js.map +1 -1
- package/dist/unlock/index.d.ts +1 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +37 -0
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +53 -0
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +30 -0
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +35 -6
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +1 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +1 -1
- package/dist/webvh/index.js.map +1 -1
- package/package.json +7 -5
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* this client's wrap in ONE append (the license's one-shot shape), read
|
|
23
23
|
* back through the credential's standing wrap. Because the append's
|
|
24
24
|
* signer is the ladder VM -- a key the post-removal document still lists
|
|
25
|
-
* -- the roster log needs no seal
|
|
25
|
+
* -- the roster log needs no seal repair afterwards, which matters on
|
|
26
26
|
* an account where no enrolled client's login sweep will ever run again.
|
|
27
27
|
* 3. **The collection fan-out**, still under this client's invocation
|
|
28
28
|
* authority: every encrypted collection re-epochs onto the fresh key.
|
|
@@ -51,10 +51,11 @@
|
|
|
51
51
|
* management zcaps are granted to the account DID, which only an enrolled
|
|
52
52
|
* client can invoke) -- which is why the stage must run before the
|
|
53
53
|
* removal entry. The pass walks every entry and reports each one's fate,
|
|
54
|
-
* but the ceremony does not carry
|
|
55
|
-
* entry refuses the removal entry
|
|
56
|
-
* naming the records the pass
|
|
57
|
-
* nothing could ever re-sign that
|
|
54
|
+
* but the ceremony does not carry an unsettled entry past this point: a
|
|
55
|
+
* `failed` or `pending-entry` outcome refuses the removal entry
|
|
56
|
+
* ({@link RecordRemintFailedError}, naming the records the pass left
|
|
57
|
+
* unreached), since after the removal nothing could ever re-sign that
|
|
58
|
+
* record's bridge. The client stays
|
|
58
59
|
* enrolled, and a re-run reaches the entry again.
|
|
59
60
|
* 6. **The record re-bind seam** (`onBeforeRemoval`, required): the caller
|
|
60
61
|
* re-signs the LOGIN credential's bridge and `delegatedClients` sibling
|
|
@@ -165,10 +166,16 @@ export interface LastDurableClientForgetResult {
|
|
|
165
166
|
rosterDescriptor?: CollectionEncryption;
|
|
166
167
|
}
|
|
167
168
|
/**
|
|
168
|
-
* The record re-mint stage could not
|
|
169
|
-
* record, so the removal entry was refused: `failed` names the entries
|
|
170
|
-
* re-mint threw (each carrying its cause)
|
|
171
|
-
*
|
|
169
|
+
* The record re-mint stage could not settle every other unlock method's
|
|
170
|
+
* record, so the removal entry was refused: `failed` names the entries the
|
|
171
|
+
* pass left unreached -- those whose re-mint threw (each carrying its cause)
|
|
172
|
+
* and those it skipped as pending-shaped (the entry's identity members name
|
|
173
|
+
* a credential other than the one its record is sealed to) -- and
|
|
174
|
+
* `unlockMethods` is the whole stage report. A pending-shaped entry blocks
|
|
175
|
+
* for the same reason a failed one does: its bridge is left signed by the
|
|
176
|
+
* key the removal entry strikes, and on a client-less account no login will
|
|
177
|
+
* ever heal it. The mender is a durable login, which is exactly what the
|
|
178
|
+
* removal would end. The forgotten client is still enrolled and every stage
|
|
172
179
|
* before this one has landed, so a re-run resumes at the re-mint. Matched
|
|
173
180
|
* on `name` (the errors cross app-injected seams that may resolve to another
|
|
174
181
|
* copy of this package).
|
|
@@ -248,7 +255,8 @@ export declare class RecordRemintFailedError extends Error {
|
|
|
248
255
|
* re-seals through their management zcaps, invoked as the still-standing
|
|
249
256
|
* client. Omitted, the stage is skipped and the result carries no
|
|
250
257
|
* `unlockMethods` report -- the residue decision 0004's amendment stated.
|
|
251
|
-
* Supplied, an entry the pass could not re-mint
|
|
258
|
+
* Supplied, an entry the pass could not re-mint -- or skipped as
|
|
259
|
+
* pending-shaped -- refuses the removal entry
|
|
252
260
|
* (`RecordRemintFailedError`)
|
|
253
261
|
* @param options.onBeforeRemoval {Function}
|
|
254
262
|
* `({ did, doc, log }) => Promise<void>` -- the record re-bind seam: runs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AA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GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,KAAK,yBAAyB,CAAA;IAC/B,yBAAyB,EAAE,gBAAgB,CAAA;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC3B,OAAO,EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE;QACL,QAAQ,EAAE,CAAC,OAAO,EAAE;YAClB,OAAO,EAAE,MAAM,CAAA;YACf,YAAY,EAAE,MAAM,CAAA;SACrB,KAAK,qBAAqB,CAAA;QAC3B,MAAM,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;QACrD,YAAY,EAAE,MAAM,CAAA;QACpB,cAAc,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;KAC/B,CAAA;IACD,aAAa,CAAC,EAAE,wBAAwB,CAAA;IACxC,eAAe,EAAE,CAAC,SAAS,EAAE;QAC3B,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAgMzC"}
|
|
@@ -12,10 +12,28 @@ import { ladderVmAgent, ladderVmZcapClient } from './zcap.js';
|
|
|
12
12
|
import { forgetLastWebvhClient, installLadderVmWebvh } from './ladderAnchored.js';
|
|
13
13
|
import { clientAnnexDidParts, clientAnnexLogPinId, delegatedClientsDelegationMinter, delegatedClientsPointer, ensureGenerationDelegationCurrent, generationDelegationHistory, mintGenerationDelegation, revokeTreatingAlreadyRevokedAsSuccess } from './log.js';
|
|
14
14
|
/**
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
17
|
-
* re-
|
|
18
|
-
*
|
|
15
|
+
* The re-mint outcomes that withhold the removal entry: a record the pass
|
|
16
|
+
* could not reach, and a pending-shaped entry it deliberately did not write
|
|
17
|
+
* (re-minting one would seal a half-retired credential a fresh bridge into
|
|
18
|
+
* the standing credential's record). Both leave a bridge the removal entry
|
|
19
|
+
* would rot for good on an account that will never see a durable login
|
|
20
|
+
* again.
|
|
21
|
+
*/
|
|
22
|
+
const REMINT_BLOCKING_OUTCOMES = [
|
|
23
|
+
'failed',
|
|
24
|
+
'pending-entry'
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* The record re-mint stage could not settle every other unlock method's
|
|
28
|
+
* record, so the removal entry was refused: `failed` names the entries the
|
|
29
|
+
* pass left unreached -- those whose re-mint threw (each carrying its cause)
|
|
30
|
+
* and those it skipped as pending-shaped (the entry's identity members name
|
|
31
|
+
* a credential other than the one its record is sealed to) -- and
|
|
32
|
+
* `unlockMethods` is the whole stage report. A pending-shaped entry blocks
|
|
33
|
+
* for the same reason a failed one does: its bridge is left signed by the
|
|
34
|
+
* key the removal entry strikes, and on a client-less account no login will
|
|
35
|
+
* ever heal it. The mender is a durable login, which is exactly what the
|
|
36
|
+
* removal would end. The forgotten client is still enrolled and every stage
|
|
19
37
|
* before this one has landed, so a re-run resumes at the re-mint. Matched
|
|
20
38
|
* on `name` (the errors cross app-injected seams that may resolve to another
|
|
21
39
|
* copy of this package).
|
|
@@ -24,8 +42,8 @@ export class RecordRemintFailedError extends Error {
|
|
|
24
42
|
failed;
|
|
25
43
|
unlockMethods;
|
|
26
44
|
constructor({ unlockMethods }) {
|
|
27
|
-
const failed = unlockMethods.outcomes.filter(outcome => outcome.outcome
|
|
28
|
-
super('did:webvh: the last-client forget could not
|
|
45
|
+
const failed = unlockMethods.outcomes.filter(outcome => REMINT_BLOCKING_OUTCOMES.includes(outcome.outcome));
|
|
46
|
+
super('did:webvh: the last-client forget could not settle the record of ' +
|
|
29
47
|
`${failed.length} other unlock method(s) (` +
|
|
30
48
|
failed.map(outcome => `"${outcome.label}"`).join(', ') +
|
|
31
49
|
'); the removal entry was not published. The client stays enrolled; ' +
|
|
@@ -103,7 +121,8 @@ export class RecordRemintFailedError extends Error {
|
|
|
103
121
|
* re-seals through their management zcaps, invoked as the still-standing
|
|
104
122
|
* client. Omitted, the stage is skipped and the result carries no
|
|
105
123
|
* `unlockMethods` report -- the residue decision 0004's amendment stated.
|
|
106
|
-
* Supplied, an entry the pass could not re-mint
|
|
124
|
+
* Supplied, an entry the pass could not re-mint -- or skipped as
|
|
125
|
+
* pending-shaped -- refuses the removal entry
|
|
107
126
|
* (`RecordRemintFailedError`)
|
|
108
127
|
* @param options.onBeforeRemoval {Function}
|
|
109
128
|
* `({ did, doc, log }) => Promise<void>` -- the record re-bind seam: runs
|
|
@@ -247,11 +266,12 @@ export async function forgetLastDurableClient({ logStore, pinStore, ladderSeed,
|
|
|
247
266
|
now
|
|
248
267
|
});
|
|
249
268
|
// The one pass that will ever reach these records on a client-less
|
|
250
|
-
// account: a record it could not re-seal
|
|
269
|
+
// account: a record it could not re-seal -- or deliberately did not
|
|
270
|
+
// write, the pending-shaped entry -- would be left with a bridge the
|
|
251
271
|
// removal entry rots for good, so the removal is refused instead. The
|
|
252
272
|
// stages already landed are idempotent and the client still stands, so
|
|
253
273
|
// the re-run resumes here.
|
|
254
|
-
if (remint.outcomes.some(outcome => outcome.outcome
|
|
274
|
+
if (remint.outcomes.some(outcome => REMINT_BLOCKING_OUTCOMES.includes(outcome.outcome))) {
|
|
255
275
|
throw new RecordRemintFailedError({ unlockMethods: remint });
|
|
256
276
|
}
|
|
257
277
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgetLast.js","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forgetLast.js","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAiGA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EACL,mBAAmB,EAEpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAIpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EACL,yBAAyB,EAG1B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,uBAAuB,EACvB,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,qCAAqC,EAEtC,MAAM,UAAU,CAAA;AAmEjB;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAqC;IACjE,QAAQ;IACR,eAAe;CAChB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,MAAM,CAAuB;IAC7B,aAAa,CAErB;IAED,YAAY,EACV,aAAa,EAGd;QACC,MAAM,MAAM,GAAG,aAAa,CAAC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a,CAAC,EAAE,UAAU,EAAE,CAAC;KAC9C,CAAC,CAAA;IACF,OAAO,yBAAyB,CAAC;QAC/B,GAAG;QACH,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,UAAU,EAAE,YAAY;QACxB,YAAY;QACZ,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;QAChD,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,8BAA8B,EAAE,gCAAgC,CAAC;YAC/D,GAAG;YACH,UAAU,EAAE,YAAY;YACxB,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;SACjC,CAAC;QACF,qBAAqB,EAAE,CAAC,2BAA2B,CAAC;QACpD,GAAG;KACJ,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -48,7 +48,7 @@ export type { ClientAnnexWriteStore } from './log.js';
|
|
|
48
48
|
export { clientAnnexGcDue, delegatedClientsPointerEstablishedAt, GENERATION_GC_PERIOD_MS, GENERATION_QUIET_BOUND_MS, GENERATION_QUIET_GRACE_MS, generationQuiet, runClientAnnexGc, swapClientAnnexGeneration } from './gc.js';
|
|
49
49
|
export type { ClientAnnexGcReport, ClientAnnexGcSwapOutcome } from './gc.js';
|
|
50
50
|
export { ladderVmAgent, ladderVmZcapClient } from './zcap.js';
|
|
51
|
-
export { createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetLastWebvhClient, forgetWebvhClient, installLadderVmWebvh, LastDurableClientForgetError, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
51
|
+
export { BuiltOnHeadNotReachedError, createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetLastWebvhClient, forgetWebvhClient, installLadderVmWebvh, LastDurableClientForgetError, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
52
52
|
export { selfEnrollClientCore } from './selfEnroll.js';
|
|
53
53
|
export { forgetDurableClient } from './forget.js';
|
|
54
54
|
export type { DurableClientForgetResult } from './forget.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,UAAU,EACV,eAAe,EACf,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,mCAAmC,EACnC,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,qCAAqC,EACrC,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,OAAO,EACL,gBAAgB,EAChB,oCAAoC,EACpC,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAChB,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,EAC9B,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,sCAAsC,EACtC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAOxE,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,sBAAsB,CAAA"}
|
|
@@ -45,7 +45,7 @@ export { attributeLadderInventory, attributeLadderRung, clientAnnexRung, clientA
|
|
|
45
45
|
export { assertGenerationId, clampGrantExpires, CLIENT_ANNEX_SPACE_TYPE, clientAnnexDidParts, clientAnnexLogPinId, clientAnnexLogStore, ClientAnnexRungUncommittedError, commitClientAnnexRung, createClientAnnexLog, DELEGATED_CLIENTS_DELEGATION_ACTIONS, DELEGATED_CLIENTS_DELEGATION_TTL_MS, DELEGATED_CLIENTS_SERVICE_TYPE, delegatedClientsDelegationMinter, delegatedClientsDelegationSpaceId, delegatedClientsPointer, delegatedClientsServiceEntry, embeddedGenerationDelegation, enrollClientAnnexTransientClient, enrollTransientClient, ensureClientAnnexSpace, ensureGenerationDelegationCurrent, GENERATION_DELEGATION_ACTIONS, GENERATION_DELEGATION_SERVICE_TYPE, GENERATION_DELEGATION_TTL_MS, GENERATION_ID_PREFIX, generationDelegationHistory, generationDelegationServiceEntry, mintClientAnnexGeneration, mintCredentialClientAnnexGeneration, mintDelegatedClientsDelegation, mintGenerationDelegation, mintGenerationId, retireClientAnnexRung, revokeTreatingAlreadyRevokedAsSuccess, servicesPointedAtClientAnnex, setDelegatedClientsPointer } from './log.js';
|
|
46
46
|
export { clientAnnexGcDue, delegatedClientsPointerEstablishedAt, GENERATION_GC_PERIOD_MS, GENERATION_QUIET_BOUND_MS, GENERATION_QUIET_GRACE_MS, generationQuiet, runClientAnnexGc, swapClientAnnexGeneration } from './gc.js';
|
|
47
47
|
export { ladderVmAgent, ladderVmZcapClient } from './zcap.js';
|
|
48
|
-
export { createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetLastWebvhClient, forgetWebvhClient, installLadderVmWebvh, LastDurableClientForgetError, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
48
|
+
export { BuiltOnHeadNotReachedError, createLadderAnchoredAccountLog, ensureLadderAnchoredDidWebvh, forgetLastWebvhClient, forgetWebvhClient, installLadderVmWebvh, LastDurableClientForgetError, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
49
49
|
export { selfEnrollClientCore } from './selfEnroll.js';
|
|
50
50
|
export { forgetDurableClient } from './forget.js';
|
|
51
51
|
export { forgetLastDurableClient, RecordRemintFailedError } from './forgetLast.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clientAnnex/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AAOpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,mCAAmC,EACnC,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,E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qE;AACrE,6EAA6E;AAC7E,4EAA4E;AAC5E,wBAAwB;AACxB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,sBAAsB,CAAA"}
|
|
@@ -106,6 +106,47 @@ export declare function ensureLadderAnchoredDidWebvh(options: {
|
|
|
106
106
|
* @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
|
|
107
107
|
* client's update-key seeds (minted by the self-enrolling flow, which
|
|
108
108
|
* therefore holds them and can sign the add entry)
|
|
109
|
+
* @param options.onCommitted {function}
|
|
110
|
+
* `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
|
|
111
|
+
* the REQUIRED persist-before-publish seam. It runs once per attempt, after
|
|
112
|
+
* the reveal-and-commit entry stands (published here, or standing from a
|
|
113
|
+
* torn earlier run) and BEFORE the add entry -- the ceremony's pivot -- is
|
|
114
|
+
* built. The caller durably writes the pending client-key record there (the
|
|
115
|
+
* `pending` codec group of `keys/clientKeyRecord.ts`: ceremony
|
|
116
|
+
* `'self-enrollment'`, the handed-back `builtOnHead`), so the add entry can
|
|
117
|
+
* never publish a client whose seed nothing can re-derive, per the
|
|
118
|
+
* post-pivot derivability rule (`decisions/0010`). A throw propagates and
|
|
119
|
+
* the add entry is withheld. What a throw leaves behind is inert: the
|
|
120
|
+
* standing reveal entry's committed hashes for the unpersisted client stay
|
|
121
|
+
* in `nextKeyHashes` forever as orphans, but they commit keys of a lost
|
|
122
|
+
* random seed -- nothing can reveal them, so they are no re-seizure
|
|
123
|
+
* credential, and the per-entry staged-hash attribution passes over them.
|
|
124
|
+
* The seam must be idempotent: the conflict retry and a resumed run invoke
|
|
125
|
+
* it again. `builtOnHead` is the head of the log snapshot the add entry is
|
|
126
|
+
* about to be built on -- the SCID from the log's parameters and the latest
|
|
127
|
+
* entry's `versionId` -- which a resume hands back as this call's
|
|
128
|
+
* `builtOnHead` marker. The caveat to hold on to: the idempotent COMPLETED
|
|
129
|
+
* branch (the new client's update key already authorized) returns without
|
|
130
|
+
* ever entering the seam, so a caller resuming across processes must be
|
|
131
|
+
* able to treat an already-complete continuation as success on its own
|
|
132
|
+
* @param [options.builtOnHead] {object} `{ scid, versionId }` -- the resume
|
|
133
|
+
* marker a pending record recorded, from an earlier run's `onCommitted`.
|
|
134
|
+
* Supplied, the attempt's first read is refused with
|
|
135
|
+
* {@link BuiltOnHeadNotReachedError} unless the served log carries that
|
|
136
|
+
* SCID and an entry with that `versionId`. The chain-head pin cannot stand
|
|
137
|
+
* in for it: the pin is written non-atomically after the add entry
|
|
138
|
+
* publishes, and the continuity check accepts a log served at exactly the
|
|
139
|
+
* pinned length -- so only this marker stops a resume rebuilding the add
|
|
140
|
+
* entry over a log that never reached the head the pending record was
|
|
141
|
+
* written against. The marker covers the pre-pivot half of that gap only:
|
|
142
|
+
* a served log CONTAINING the recorded head but truncated behind the torn
|
|
143
|
+
* run's own add entry still passes it and is resumed onto, and the menders
|
|
144
|
+
* for that residual half are the ordinary ones -- this client's own
|
|
145
|
+
* chain-head pin once the add publish wrote it, and any other enrolled
|
|
146
|
+
* client's pinned read of the same log. Both members must be non-empty
|
|
147
|
+
* strings; a malformed marker is refused with a `TypeError` before any
|
|
148
|
+
* read, since a resume with an uncomparable marker is a resume with no
|
|
149
|
+
* fork guard
|
|
109
150
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
110
151
|
* to, from the credential-authenticated pointer
|
|
111
152
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
@@ -116,22 +157,88 @@ export declare function ensureLadderAnchoredDidWebvh(options: {
|
|
|
116
157
|
* @param [options.logId] {string} the account log's pin slot
|
|
117
158
|
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
118
159
|
* supplied
|
|
119
|
-
* @returns {Promise<{ did: string, webDoc?: object }>}
|
|
120
|
-
*
|
|
121
|
-
*
|
|
160
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
161
|
+
* the account DID, the final `did.json` projection when the add entry ran
|
|
162
|
+
* here, and `committed` -- whether THIS call published the pivot entry
|
|
163
|
+
* (`false` exactly on the idempotent completed branch, where a torn earlier
|
|
164
|
+
* run had already published it). It is an observability signal, not a
|
|
165
|
+
* success flag: a returning call means the continuation stands either way,
|
|
166
|
+
* so a caller clears its pending record on the RETURN, whatever `committed`
|
|
167
|
+
* says. Its absence from a return value is a build skew, which is why it is
|
|
168
|
+
* stated rather than inferred
|
|
122
169
|
*/
|
|
123
170
|
export declare function selfEnrollWebvhClient(options: {
|
|
124
171
|
store: UnlockLogStore;
|
|
125
172
|
ladderSeed: Uint8Array;
|
|
126
173
|
newClientKeys: WebvhEnrollmentKeys;
|
|
127
174
|
newClientUpdateSeeds: ClientWebvhUpdateKeys;
|
|
175
|
+
onCommitted: (committed: {
|
|
176
|
+
builtOnHead: {
|
|
177
|
+
scid: string;
|
|
178
|
+
versionId: string;
|
|
179
|
+
};
|
|
180
|
+
}) => Promise<void>;
|
|
181
|
+
builtOnHead?: {
|
|
182
|
+
scid: string;
|
|
183
|
+
versionId: string;
|
|
184
|
+
};
|
|
128
185
|
expectedDid?: string;
|
|
129
186
|
pinStore?: ResourceLogPinStore;
|
|
130
187
|
logId?: string;
|
|
131
188
|
}): Promise<{
|
|
132
189
|
did: string;
|
|
133
190
|
webDoc?: object;
|
|
191
|
+
committed: boolean;
|
|
134
192
|
}>;
|
|
193
|
+
/**
|
|
194
|
+
* Refuses a malformed resume marker before any read. A marker whose members
|
|
195
|
+
* are missing or empty could not be compared against anything, so accepting
|
|
196
|
+
* one would hand a resume the mint-skip WITHOUT the fork guard the marker
|
|
197
|
+
* exists to apply -- fail-open exactly where the guard matters.
|
|
198
|
+
*
|
|
199
|
+
* @param options {object}
|
|
200
|
+
* @param options.builtOnHead {unknown} the supplied marker
|
|
201
|
+
* @returns {void}
|
|
202
|
+
*/
|
|
203
|
+
export declare function assertBuiltOnHeadShape({ builtOnHead }: {
|
|
204
|
+
builtOnHead: unknown;
|
|
205
|
+
}): void;
|
|
206
|
+
/**
|
|
207
|
+
* Thrown when a resumed self-enrollment is served an account log that has not
|
|
208
|
+
* reached the head its pending record was written against -- a different SCID,
|
|
209
|
+
* or no entry carrying the recorded `versionId`. Rebuilding the add entry over
|
|
210
|
+
* such a log would fork the account off a head the ceremony already committed
|
|
211
|
+
* to, which the chain-head pin alone does not catch: the pin is written
|
|
212
|
+
* non-atomically after the add entry publishes, so a run torn between the two
|
|
213
|
+
* leaves a pin one entry behind, and the continuity check accepts a served log
|
|
214
|
+
* at exactly the pinned length.
|
|
215
|
+
*
|
|
216
|
+
* **`name` is a stable contract.** It is always the string
|
|
217
|
+
* `'BuiltOnHeadNotReachedError'`, and a consumer should match on that rather
|
|
218
|
+
* than on `instanceof`: a wallet app that links this package (or holds two
|
|
219
|
+
* copies of it through a dependency tree) gets a different class object for
|
|
220
|
+
* the same error, so `instanceof` silently fails there while the name does
|
|
221
|
+
* not.
|
|
222
|
+
*/
|
|
223
|
+
export declare class BuiltOnHeadNotReachedError extends Error {
|
|
224
|
+
/**
|
|
225
|
+
* The head the pending record recorded, which the served log did not reach.
|
|
226
|
+
*/
|
|
227
|
+
builtOnHead: {
|
|
228
|
+
scid: string;
|
|
229
|
+
versionId: string;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* @param options {object}
|
|
233
|
+
* @param options.builtOnHead {object} the recorded `{ scid, versionId }`
|
|
234
|
+
*/
|
|
235
|
+
constructor({ builtOnHead }: {
|
|
236
|
+
builtOnHead: {
|
|
237
|
+
scid: string;
|
|
238
|
+
versionId: string;
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
}
|
|
135
242
|
/**
|
|
136
243
|
* Thrown when the client being forgotten is the account's LAST enrolled
|
|
137
244
|
* durable client. Removing it through this entry would leave the document
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ladderAnchored.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/ladderAnchored.ts"],"names":[],"mappings":"AAmDA,OAAO,K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A;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAEzE"}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* from durable state alone, on the recovery continuation's pattern.
|
|
50
50
|
*/
|
|
51
51
|
import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
|
|
52
|
-
import { assertCarryOverCommitments, concludeWithPublishedLog, createLadderAnchoredWebvhLog, didWebvhControllerTemplate, genesisNextKeyHashes, ladderVerificationMethod, markedVerificationMethodPair, pinOfLog, publishWebvhLog, putLogResource, readPublishedLog, relationIds, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
52
|
+
import { assertCanonicalClientKeys, assertCarryOverCommitments, concludeWithPublishedLog, createLadderAnchoredWebvhLog, didWebvhControllerTemplate, genesisNextKeyHashes, ladderVerificationMethod, markedVerificationMethodPair, pinOfLog, publishWebvhLog, putLogResource, readPublishedLog, relationIds, servedHead, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
53
53
|
import { accountLogPinId } from '../webvh/verifyLog.js';
|
|
54
54
|
import { ladderVmIds } from '../webvh/listClients.js';
|
|
55
55
|
import { clientRemovalFields, clientRemovalTarget } from '../webvh/revokeClient.js';
|
|
@@ -227,6 +227,47 @@ async function publishLogOnly({ store, log, ifMatch }) {
|
|
|
227
227
|
* @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
|
|
228
228
|
* client's update-key seeds (minted by the self-enrolling flow, which
|
|
229
229
|
* therefore holds them and can sign the add entry)
|
|
230
|
+
* @param options.onCommitted {function}
|
|
231
|
+
* `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
|
|
232
|
+
* the REQUIRED persist-before-publish seam. It runs once per attempt, after
|
|
233
|
+
* the reveal-and-commit entry stands (published here, or standing from a
|
|
234
|
+
* torn earlier run) and BEFORE the add entry -- the ceremony's pivot -- is
|
|
235
|
+
* built. The caller durably writes the pending client-key record there (the
|
|
236
|
+
* `pending` codec group of `keys/clientKeyRecord.ts`: ceremony
|
|
237
|
+
* `'self-enrollment'`, the handed-back `builtOnHead`), so the add entry can
|
|
238
|
+
* never publish a client whose seed nothing can re-derive, per the
|
|
239
|
+
* post-pivot derivability rule (`decisions/0010`). A throw propagates and
|
|
240
|
+
* the add entry is withheld. What a throw leaves behind is inert: the
|
|
241
|
+
* standing reveal entry's committed hashes for the unpersisted client stay
|
|
242
|
+
* in `nextKeyHashes` forever as orphans, but they commit keys of a lost
|
|
243
|
+
* random seed -- nothing can reveal them, so they are no re-seizure
|
|
244
|
+
* credential, and the per-entry staged-hash attribution passes over them.
|
|
245
|
+
* The seam must be idempotent: the conflict retry and a resumed run invoke
|
|
246
|
+
* it again. `builtOnHead` is the head of the log snapshot the add entry is
|
|
247
|
+
* about to be built on -- the SCID from the log's parameters and the latest
|
|
248
|
+
* entry's `versionId` -- which a resume hands back as this call's
|
|
249
|
+
* `builtOnHead` marker. The caveat to hold on to: the idempotent COMPLETED
|
|
250
|
+
* branch (the new client's update key already authorized) returns without
|
|
251
|
+
* ever entering the seam, so a caller resuming across processes must be
|
|
252
|
+
* able to treat an already-complete continuation as success on its own
|
|
253
|
+
* @param [options.builtOnHead] {object} `{ scid, versionId }` -- the resume
|
|
254
|
+
* marker a pending record recorded, from an earlier run's `onCommitted`.
|
|
255
|
+
* Supplied, the attempt's first read is refused with
|
|
256
|
+
* {@link BuiltOnHeadNotReachedError} unless the served log carries that
|
|
257
|
+
* SCID and an entry with that `versionId`. The chain-head pin cannot stand
|
|
258
|
+
* in for it: the pin is written non-atomically after the add entry
|
|
259
|
+
* publishes, and the continuity check accepts a log served at exactly the
|
|
260
|
+
* pinned length -- so only this marker stops a resume rebuilding the add
|
|
261
|
+
* entry over a log that never reached the head the pending record was
|
|
262
|
+
* written against. The marker covers the pre-pivot half of that gap only:
|
|
263
|
+
* a served log CONTAINING the recorded head but truncated behind the torn
|
|
264
|
+
* run's own add entry still passes it and is resumed onto, and the menders
|
|
265
|
+
* for that residual half are the ordinary ones -- this client's own
|
|
266
|
+
* chain-head pin once the add publish wrote it, and any other enrolled
|
|
267
|
+
* client's pinned read of the same log. Both members must be non-empty
|
|
268
|
+
* strings; a malformed marker is refused with a `TypeError` before any
|
|
269
|
+
* read, since a resume with an uncomparable marker is a resume with no
|
|
270
|
+
* fork guard
|
|
230
271
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
231
272
|
* to, from the credential-authenticated pointer
|
|
232
273
|
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
@@ -237,21 +278,103 @@ async function publishLogOnly({ store, log, ifMatch }) {
|
|
|
237
278
|
* @param [options.logId] {string} the account log's pin slot
|
|
238
279
|
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
239
280
|
* supplied
|
|
240
|
-
* @returns {Promise<{ did: string, webDoc?: object }>}
|
|
241
|
-
*
|
|
242
|
-
*
|
|
281
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
282
|
+
* the account DID, the final `did.json` projection when the add entry ran
|
|
283
|
+
* here, and `committed` -- whether THIS call published the pivot entry
|
|
284
|
+
* (`false` exactly on the idempotent completed branch, where a torn earlier
|
|
285
|
+
* run had already published it). It is an observability signal, not a
|
|
286
|
+
* success flag: a returning call means the continuation stands either way,
|
|
287
|
+
* so a caller clears its pending record on the RETURN, whatever `committed`
|
|
288
|
+
* says. Its absence from a return value is a build skew, which is why it is
|
|
289
|
+
* stated rather than inferred
|
|
243
290
|
*/
|
|
244
291
|
export async function selfEnrollWebvhClient(options) {
|
|
292
|
+
// The seam is what makes the new client's seed durable before the pivot
|
|
293
|
+
// entry publishes it; a call omitting it would silently keep the window in
|
|
294
|
+
// which the log names a client nothing can re-derive. Refused before any
|
|
295
|
+
// read, so nothing is published.
|
|
296
|
+
if (typeof options.onCommitted !== 'function') {
|
|
297
|
+
throw new TypeError('selfEnrollWebvhClient requires onCommitted: the pending client-key ' +
|
|
298
|
+
'record must be persisted before the add entry publishes the client.');
|
|
299
|
+
}
|
|
300
|
+
if (options.builtOnHead !== undefined) {
|
|
301
|
+
assertBuiltOnHeadShape({ builtOnHead: options.builtOnHead });
|
|
302
|
+
}
|
|
303
|
+
// A non-canonical pair could only ever throw at the add-entry build, AFTER
|
|
304
|
+
// the reveal entry published and the seam persisted; refused here, it costs
|
|
305
|
+
// nothing durable.
|
|
306
|
+
assertCanonicalClientKeys({
|
|
307
|
+
signingKeyMultibase: options.newClientKeys.signingKeyMultibase,
|
|
308
|
+
keyAgreementKeyMultibase: options.newClientKeys.keyAgreementKeyMultibase
|
|
309
|
+
});
|
|
245
310
|
return withLogConflictRetry(() => selfEnrollWebvhClientOnce(options));
|
|
246
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Refuses a malformed resume marker before any read. A marker whose members
|
|
314
|
+
* are missing or empty could not be compared against anything, so accepting
|
|
315
|
+
* one would hand a resume the mint-skip WITHOUT the fork guard the marker
|
|
316
|
+
* exists to apply -- fail-open exactly where the guard matters.
|
|
317
|
+
*
|
|
318
|
+
* @param options {object}
|
|
319
|
+
* @param options.builtOnHead {unknown} the supplied marker
|
|
320
|
+
* @returns {void}
|
|
321
|
+
*/
|
|
322
|
+
export function assertBuiltOnHeadShape({ builtOnHead }) {
|
|
323
|
+
const { scid, versionId } = (builtOnHead ?? {});
|
|
324
|
+
if (builtOnHead === null ||
|
|
325
|
+
typeof builtOnHead !== 'object' ||
|
|
326
|
+
typeof scid !== 'string' ||
|
|
327
|
+
scid === '' ||
|
|
328
|
+
typeof versionId !== 'string' ||
|
|
329
|
+
versionId === '') {
|
|
330
|
+
throw new TypeError('The self-enrollment resume marker (builtOnHead) must carry a non-empty ' +
|
|
331
|
+
'scid and versionId; a marker that cannot be compared would resume ' +
|
|
332
|
+
'with no fork guard at all.');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Thrown when a resumed self-enrollment is served an account log that has not
|
|
337
|
+
* reached the head its pending record was written against -- a different SCID,
|
|
338
|
+
* or no entry carrying the recorded `versionId`. Rebuilding the add entry over
|
|
339
|
+
* such a log would fork the account off a head the ceremony already committed
|
|
340
|
+
* to, which the chain-head pin alone does not catch: the pin is written
|
|
341
|
+
* non-atomically after the add entry publishes, so a run torn between the two
|
|
342
|
+
* leaves a pin one entry behind, and the continuity check accepts a served log
|
|
343
|
+
* at exactly the pinned length.
|
|
344
|
+
*
|
|
345
|
+
* **`name` is a stable contract.** It is always the string
|
|
346
|
+
* `'BuiltOnHeadNotReachedError'`, and a consumer should match on that rather
|
|
347
|
+
* than on `instanceof`: a wallet app that links this package (or holds two
|
|
348
|
+
* copies of it through a dependency tree) gets a different class object for
|
|
349
|
+
* the same error, so `instanceof` silently fails there while the name does
|
|
350
|
+
* not.
|
|
351
|
+
*/
|
|
352
|
+
export class BuiltOnHeadNotReachedError extends Error {
|
|
353
|
+
/**
|
|
354
|
+
* The head the pending record recorded, which the served log did not reach.
|
|
355
|
+
*/
|
|
356
|
+
builtOnHead;
|
|
357
|
+
/**
|
|
358
|
+
* @param options {object}
|
|
359
|
+
* @param options.builtOnHead {object} the recorded `{ scid, versionId }`
|
|
360
|
+
*/
|
|
361
|
+
constructor({ builtOnHead }) {
|
|
362
|
+
super('did:webvh: the served account log has not reached the head this ' +
|
|
363
|
+
`self-enrollment was built on (scid ${builtOnHead.scid}, version ` +
|
|
364
|
+
`${builtOnHead.versionId}); the resume is refused rather than ` +
|
|
365
|
+
'rebuilt over it.');
|
|
366
|
+
this.name = 'BuiltOnHeadNotReachedError';
|
|
367
|
+
this.builtOnHead = builtOnHead;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
247
370
|
/**
|
|
248
371
|
* One attempt of {@link selfEnrollWebvhClient}, re-invoked by the conflict
|
|
249
372
|
* retry.
|
|
250
373
|
*
|
|
251
374
|
* @param options {object} see {@link selfEnrollWebvhClient}
|
|
252
|
-
* @returns {Promise<{ did: string, webDoc?: object }>}
|
|
375
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
253
376
|
*/
|
|
254
|
-
async function selfEnrollWebvhClientOnce({ store, ladderSeed, newClientKeys, newClientUpdateSeeds, expectedDid, pinStore, logId }) {
|
|
377
|
+
async function selfEnrollWebvhClientOnce({ store, ladderSeed, newClientKeys, newClientUpdateSeeds, onCommitted, builtOnHead, expectedDid, pinStore, logId }) {
|
|
255
378
|
// Each attempt's own read is what the CAS publish is built on, so the
|
|
256
379
|
// continuity check runs here -- and again on the retry-up-the-ladder
|
|
257
380
|
// re-run -- not only on the verify that follows both entries.
|
|
@@ -264,10 +387,22 @@ async function selfEnrollWebvhClientOnce({ store, ladderSeed, newClientKeys, new
|
|
|
264
387
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
265
388
|
...pinned
|
|
266
389
|
});
|
|
390
|
+
// The resume marker, checked before anything else -- the completion check
|
|
391
|
+
// included, so a truncated served log is refused rather than read as "not
|
|
392
|
+
// complete yet" and rebuilt over.
|
|
393
|
+
if (builtOnHead) {
|
|
394
|
+
const genesisScid = published.log[0]?.parameters.scid ?? '';
|
|
395
|
+
const reached = published.log.some(entry => entry.versionId === builtOnHead.versionId);
|
|
396
|
+
if (genesisScid !== builtOnHead.scid || !reached) {
|
|
397
|
+
throw new BuiltOnHeadNotReachedError({ builtOnHead });
|
|
398
|
+
}
|
|
399
|
+
}
|
|
267
400
|
// Already complete (a torn earlier run finished the add entry): the new
|
|
268
|
-
// client's update key is authorized, which only the add entry writes.
|
|
401
|
+
// client's update key is authorized, which only the add entry writes. The
|
|
402
|
+
// seam is deliberately NOT entered here -- nothing is about to be
|
|
403
|
+
// published, so there is no pivot to persist ahead of.
|
|
269
404
|
if (published.updateKeys.includes(newClientKeys.updateKeyMultibase)) {
|
|
270
|
-
return { did: published.did };
|
|
405
|
+
return { did: published.did, committed: false };
|
|
271
406
|
}
|
|
272
407
|
// Which rung is current, recovered from the log itself. Fails closed with
|
|
273
408
|
// `LadderAttributionError` for a revoked (or never-bound) credential and
|
|
@@ -317,6 +452,13 @@ async function selfEnrollWebvhClientOnce({ store, ladderSeed, newClientKeys, new
|
|
|
317
452
|
...pinned
|
|
318
453
|
});
|
|
319
454
|
}
|
|
455
|
+
// The persist-before-publish seam: the pending client-key record becomes
|
|
456
|
+
// durable HERE, on the head the add entry is about to be built on, before
|
|
457
|
+
// that entry -- the ceremony's pivot -- publishes a client whose seed only
|
|
458
|
+
// this caller holds. Reached on both paths into the add entry: the reveal
|
|
459
|
+
// entry just published above, or a torn earlier run's reveal entry standing
|
|
460
|
+
// already.
|
|
461
|
+
await onCommitted({ builtOnHead: servedHead(published.log) });
|
|
320
462
|
// The add entry: the new client's verification methods and update key in;
|
|
321
463
|
// the spent rung's key and hash out. The credential's keyAgreement entry
|
|
322
464
|
// and the next rung's committed hash stand untouched. Signed by the new
|
|
@@ -372,7 +514,7 @@ async function selfEnrollWebvhClientOnce({ store, ladderSeed, newClientKeys, new
|
|
|
372
514
|
if (pinStore && logId !== undefined) {
|
|
373
515
|
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
374
516
|
}
|
|
375
|
-
return { did: updated.did, webDoc: updated.webDoc };
|
|
517
|
+
return { did: updated.did, webDoc: updated.webDoc, committed: true };
|
|
376
518
|
}
|
|
377
519
|
/**
|
|
378
520
|
* Thrown when the client being forgotten is the account's LAST enrolled
|