@interop/wallet-core 0.52.1 → 0.54.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/credentialAnchoredGenesis.d.ts +24 -10
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +42 -13
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- 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 +125 -5
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +180 -12
- 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 +75 -6
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +121 -16
- 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/standingWebvh.d.ts +10 -0
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +10 -2
- package/dist/unlock/standingWebvh.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 +53 -2
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +72 -20
- 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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* `recovery/recoveryWebvh.ts`.
|
|
12
12
|
*/
|
|
13
13
|
import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
|
|
14
|
-
import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, relationIds, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
14
|
+
import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, pinOfLog, relationIds, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
15
15
|
import { ladderVmIds } from '../webvh/listClients.js';
|
|
16
16
|
import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWebvh.js';
|
|
17
17
|
import { publishLogOnly, readLogOrThrow, RecoveryKeyNotCommittedError, recoveryVmId } from '../recovery/recoveryWebvh.js';
|
|
@@ -94,11 +94,28 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
|
94
94
|
* REQUIRED: the add entry points the `#DelegatedClients` service entry at
|
|
95
95
|
* it, and a caller that named no generation would republish the stranding
|
|
96
96
|
* this ordering exists to prevent
|
|
97
|
+
* @param [options.pinStore] {ResourceLogPinStore} this caller's chain-head
|
|
98
|
+
* pins; every read both entries are built on is checked against the pinned
|
|
99
|
+
* head (a served prefix is refused before the reveal entry lands, not only
|
|
100
|
+
* by a verify that follows both entries), and the pin advances to each
|
|
101
|
+
* entry as it publishes
|
|
102
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
103
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
104
|
+
* supplied
|
|
97
105
|
* @returns {Promise<object>} the account DID, the post-continuation
|
|
98
106
|
* document and log (the rotation's recipient source and anchor), and, when
|
|
99
107
|
* the add entry ran here, the final `did.json` projection
|
|
100
108
|
*/
|
|
101
109
|
export async function recoverWebvhLadderAnchored(options) {
|
|
110
|
+
// The seam is what makes the fresh credential's and replacement code's
|
|
111
|
+
// material durable before the add entry publishes the ladder VM; a call
|
|
112
|
+
// omitting it would republish the stranding this ordering exists to
|
|
113
|
+
// prevent. Refused before any read, so nothing is published.
|
|
114
|
+
if (typeof options.onCommitted !== 'function') {
|
|
115
|
+
throw new TypeError('recoverWebvhLadderAnchored requires onCommitted: the replacement ' +
|
|
116
|
+
'code and the fresh credential record must be persisted before the ' +
|
|
117
|
+
'add entry publishes the ladder VM.');
|
|
118
|
+
}
|
|
102
119
|
return withLogConflictRetry(() => recoverWebvhLadderAnchoredOnce(options));
|
|
103
120
|
}
|
|
104
121
|
/**
|
|
@@ -108,10 +125,18 @@ export async function recoverWebvhLadderAnchored(options) {
|
|
|
108
125
|
* @param options {object} see {@link recoverWebvhLadderAnchored}
|
|
109
126
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog, webDoc?: object }>}
|
|
110
127
|
*/
|
|
111
|
-
async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, credentialKeyAgreement, replacement, expectedDid, onCommitted }) {
|
|
128
|
+
async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, credentialKeyAgreement, replacement, expectedDid, onCommitted, pinStore, logId }) {
|
|
129
|
+
// Each attempt's own read is what the CAS publish is built on, so the
|
|
130
|
+
// continuity check runs here -- and again on a conflict-retry re-run -- not
|
|
131
|
+
// only on the verify that follows both entries.
|
|
132
|
+
const pinned = {
|
|
133
|
+
...(pinStore ? { pinStore } : {}),
|
|
134
|
+
...(logId !== undefined ? { logId } : {})
|
|
135
|
+
};
|
|
112
136
|
let published = await readLogOrThrow({
|
|
113
137
|
store,
|
|
114
|
-
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
138
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
139
|
+
...pinned
|
|
115
140
|
});
|
|
116
141
|
const rung0 = await ladderRung({ ladderSeed, index: 0 });
|
|
117
142
|
const rung1 = await ladderRung({ ladderSeed, index: 1 });
|
|
@@ -160,8 +185,18 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
160
185
|
log: updated.log,
|
|
161
186
|
ifMatch: published.etag
|
|
162
187
|
});
|
|
163
|
-
//
|
|
164
|
-
|
|
188
|
+
// Advance the pin to what the reveal entry just published, so the re-read
|
|
189
|
+
// below (and any read after a tear here) refuses a host that rolls the
|
|
190
|
+
// log back behind it.
|
|
191
|
+
if (pinStore && logId !== undefined) {
|
|
192
|
+
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
193
|
+
}
|
|
194
|
+
// The same account the reveal entry just extended, under the same pin.
|
|
195
|
+
published = await readLogOrThrow({
|
|
196
|
+
store,
|
|
197
|
+
expectedDid: published.did,
|
|
198
|
+
...pinned
|
|
199
|
+
});
|
|
165
200
|
}
|
|
166
201
|
// The persist-before-publish seam: the replacement code's record and the
|
|
167
202
|
// fresh credential's unlock record (the ladder seed inside) become durable
|
|
@@ -253,6 +288,11 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
|
|
|
253
288
|
// Conditional on the read this entry was built on: the re-read above when
|
|
254
289
|
// the commit entry ran here, the first read when it was skipped.
|
|
255
290
|
await publishLogOnly({ store, log: updated.log, ifMatch: published.etag });
|
|
291
|
+
// Advance the pin to what this entry just published, so a host rolling the
|
|
292
|
+
// log back straight afterwards is refused on the next read.
|
|
293
|
+
if (pinStore && logId !== undefined) {
|
|
294
|
+
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
295
|
+
}
|
|
256
296
|
return {
|
|
257
297
|
did: updated.did,
|
|
258
298
|
doc: updated.doc,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,YAAY,EAGb,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,OAUhD;IACC,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,6DAA6D;IAC7D,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CACjB,mEAAmE;YACjE,oEAAoE;YACpE,oCAAoC,CACvC,CAAA;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,8BAA8B,C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AAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;IAC1E,2EAA2E;IAC3E,4DAA4D;IAC5D,IAAI,QAAQ,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC7D,CAAC;IACD,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAA;AACH,CAAC"}
|
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
* key-agreement key), so later logins on this browser read the roster the
|
|
26
26
|
* ordinary enrolled way.
|
|
27
27
|
*
|
|
28
|
+
* Between the two entries of step 2 sits the required `onCommitted` seam: the
|
|
29
|
+
* caller writes the pending client-key record there, so the add entry -- the
|
|
30
|
+
* ceremony's pivot -- never publishes a client whose seed only a live tab
|
|
31
|
+
* holds (the post-pivot derivability rule, `decisions/0010`). What that record
|
|
32
|
+
* carries is what `resume` replays: the same seeds, and the head the pivot
|
|
33
|
+
* entry was built on.
|
|
34
|
+
*
|
|
28
35
|
* Persisting the key set under the app's own unlock layer is the caller's
|
|
29
36
|
* job, exactly as with the enrollment ceremony's completion: this module
|
|
30
37
|
* hands back the key set, the user key, and the roster epoch to pin, and
|
|
@@ -64,16 +71,67 @@ import type { UnlockLogStore } from '../unlock/standingWebvh.js';
|
|
|
64
71
|
* by the verify that follows. A fresh browser normally has none (this is
|
|
65
72
|
* its first contact), which is exactly the pin's trust-on-first-use
|
|
66
73
|
* establishment
|
|
74
|
+
* @param options.onCommitted {function}
|
|
75
|
+
* `(committed: { builtOnHead, clientSeed, webvhUpdateKeys }) =>
|
|
76
|
+
* Promise<void>` -- the REQUIRED persist-before-publish seam. The caller
|
|
77
|
+
* writes the pending client-key record there -- the `pending` codec group
|
|
78
|
+
* of `keys/clientKeyRecord.ts`, ceremony `'self-enrollment'` -- so the add
|
|
79
|
+
* entry never publishes a client this browser cannot re-derive, per the
|
|
80
|
+
* post-pivot derivability rule (`decisions/0010`). The argument carries
|
|
81
|
+
* everything that record needs beyond what the caller already holds: the
|
|
82
|
+
* key set is minted INSIDE this call, so the seeds are handed over here,
|
|
83
|
+
* while the record's `controller` and pointer DID are the caller's own
|
|
84
|
+
* `pointer`. On a resume the seeds handed back are the resumed record's own,
|
|
85
|
+
* verbatim, so re-persisting is idempotent. The ceremony's own seam
|
|
86
|
+
* ({@link selfEnrollWebvhClient}'s) takes `{ builtOnHead }` alone -- its
|
|
87
|
+
* callers hold the key set already -- and this call passes it a wrapper.
|
|
88
|
+
* The rest of the contract is the ceremony's: it runs after the
|
|
89
|
+
* reveal-and-commit entry stands and before the add entry is built, once
|
|
90
|
+
* per attempt, a throw withholds the pivot, and the idempotent completed
|
|
91
|
+
* branch never enters it. A call omitting the seam is refused with a
|
|
92
|
+
* `TypeError` before any read
|
|
93
|
+
* @param [options.resume] {object} the pending record's contents, replayed:
|
|
94
|
+
* `{ clientSeed, webvhUpdateKeys, builtOnHead }`. Supplied, the local key
|
|
95
|
+
* mint is SKIPPED and the whole enrollment key set is re-derived from the
|
|
96
|
+
* recorded seeds, so the resumed run publishes the same client the torn run
|
|
97
|
+
* was publishing, and `builtOnHead` is passed through as the ceremony's
|
|
98
|
+
* resume marker (refusing a served log that never reached that head with
|
|
99
|
+
* `BuiltOnHeadNotReachedError`). Everything downstream is unchanged: the
|
|
100
|
+
* ceremony's own revealed / committed / completed detection publishes only
|
|
101
|
+
* what is missing
|
|
67
102
|
* @returns {Promise<object>} the new client's key set (for the caller to
|
|
68
103
|
* persist under its unlock layer), its did:key, the account DID, the user
|
|
69
|
-
* key,
|
|
104
|
+
* key, the roster epoch to pin, and `committed` -- whether THIS call
|
|
105
|
+
* published the ceremony's pivot entry, propagated verbatim from
|
|
106
|
+
* {@link selfEnrollWebvhClient}. A resume that met an already-complete
|
|
107
|
+
* continuation returns `committed: false` and is a full success: the clear
|
|
108
|
+
* condition for the pending record is that the call RETURNED, never
|
|
109
|
+
* `committed === true`, or a resumed-onto-completed record would never be
|
|
110
|
+
* cleared. The member exists so a build skew that dropped it surfaces
|
|
111
|
+
* instead of reading as `false`
|
|
70
112
|
*/
|
|
71
|
-
export declare function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, accountLogPinStore }: {
|
|
113
|
+
export declare function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, accountLogPinStore, onCommitted, resume }: {
|
|
72
114
|
pointer: AccountPointer;
|
|
73
115
|
ladderSeed: Uint8Array;
|
|
74
116
|
credentialKeyAgreementKey: IKeyAgreementKey;
|
|
75
117
|
logStore: UnlockLogStore;
|
|
76
118
|
accountLogPinStore?: ResourceLogPinStore;
|
|
119
|
+
onCommitted: (committed: {
|
|
120
|
+
builtOnHead: {
|
|
121
|
+
scid: string;
|
|
122
|
+
versionId: string;
|
|
123
|
+
};
|
|
124
|
+
clientSeed: Uint8Array;
|
|
125
|
+
webvhUpdateKeys: ClientWebvhUpdateKeys;
|
|
126
|
+
}) => Promise<void>;
|
|
127
|
+
resume?: {
|
|
128
|
+
clientSeed: Uint8Array;
|
|
129
|
+
webvhUpdateKeys: ClientWebvhUpdateKeys;
|
|
130
|
+
builtOnHead: {
|
|
131
|
+
scid: string;
|
|
132
|
+
versionId: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
77
135
|
}): Promise<{
|
|
78
136
|
clientSeed: Uint8Array;
|
|
79
137
|
webvhUpdateKeys: ClientWebvhUpdateKeys;
|
|
@@ -81,5 +139,6 @@ export declare function selfEnrollClientCore({ pointer, ladderSeed, credentialKe
|
|
|
81
139
|
did: string;
|
|
82
140
|
userKey: UserKey;
|
|
83
141
|
latestEpochId: string;
|
|
142
|
+
committed: boolean;
|
|
84
143
|
}>;
|
|
85
144
|
//# sourceMappingURL=selfEnroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfEnroll.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"selfEnroll.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AASpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AAMjC,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,sBAAsB,CAAA;AAW7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,MAAM,EACP,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,EAAE,UAAU,CAAA;IACtB,yBAAyB,EAAE,gBAAgB,CAAA;IAC3C,QAAQ,EAAE,cAAc,CAAA;IACxB,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,WAAW,EAAE,CAAC,SAAS,EAAE;QACvB,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;QAChD,UAAU,EAAE,UAAU,CAAA;QACtB,eAAe,EAAE,qBAAqB,CAAA;KACvC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,UAAU,CAAA;QACtB,eAAe,EAAE,qBAAqB,CAAA;QACtC,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KACjD,CAAA;CACF,GAAG,OAAO,CAAC;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,qBAAqB,CAAA;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CA8ID"}
|
|
@@ -6,7 +6,7 @@ import { webvhResourceLogController } from '../resourceLog/index.js';
|
|
|
6
6
|
import { mintClientWebvhUpdateKeys, updateKeyMultibase } from '../webvh/didWebvh.js';
|
|
7
7
|
import { accountLogPinId, verifyAccountLog } from '../webvh/verifyLog.js';
|
|
8
8
|
import { clientSigningKeyMultibase, isWebvhDid, webvhZcapClient } from '../webvh/zcap.js';
|
|
9
|
-
import { selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
9
|
+
import { assertBuiltOnHeadShape, selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
10
10
|
/**
|
|
11
11
|
* Runs the whole self-enrollment described in the module doc. The caller has
|
|
12
12
|
* already unwrapped the credential's unlock record (so it holds the
|
|
@@ -32,19 +32,70 @@ import { selfEnrollWebvhClient } from './ladderAnchored.js';
|
|
|
32
32
|
* by the verify that follows. A fresh browser normally has none (this is
|
|
33
33
|
* its first contact), which is exactly the pin's trust-on-first-use
|
|
34
34
|
* establishment
|
|
35
|
+
* @param options.onCommitted {function}
|
|
36
|
+
* `(committed: { builtOnHead, clientSeed, webvhUpdateKeys }) =>
|
|
37
|
+
* Promise<void>` -- the REQUIRED persist-before-publish seam. The caller
|
|
38
|
+
* writes the pending client-key record there -- the `pending` codec group
|
|
39
|
+
* of `keys/clientKeyRecord.ts`, ceremony `'self-enrollment'` -- so the add
|
|
40
|
+
* entry never publishes a client this browser cannot re-derive, per the
|
|
41
|
+
* post-pivot derivability rule (`decisions/0010`). The argument carries
|
|
42
|
+
* everything that record needs beyond what the caller already holds: the
|
|
43
|
+
* key set is minted INSIDE this call, so the seeds are handed over here,
|
|
44
|
+
* while the record's `controller` and pointer DID are the caller's own
|
|
45
|
+
* `pointer`. On a resume the seeds handed back are the resumed record's own,
|
|
46
|
+
* verbatim, so re-persisting is idempotent. The ceremony's own seam
|
|
47
|
+
* ({@link selfEnrollWebvhClient}'s) takes `{ builtOnHead }` alone -- its
|
|
48
|
+
* callers hold the key set already -- and this call passes it a wrapper.
|
|
49
|
+
* The rest of the contract is the ceremony's: it runs after the
|
|
50
|
+
* reveal-and-commit entry stands and before the add entry is built, once
|
|
51
|
+
* per attempt, a throw withholds the pivot, and the idempotent completed
|
|
52
|
+
* branch never enters it. A call omitting the seam is refused with a
|
|
53
|
+
* `TypeError` before any read
|
|
54
|
+
* @param [options.resume] {object} the pending record's contents, replayed:
|
|
55
|
+
* `{ clientSeed, webvhUpdateKeys, builtOnHead }`. Supplied, the local key
|
|
56
|
+
* mint is SKIPPED and the whole enrollment key set is re-derived from the
|
|
57
|
+
* recorded seeds, so the resumed run publishes the same client the torn run
|
|
58
|
+
* was publishing, and `builtOnHead` is passed through as the ceremony's
|
|
59
|
+
* resume marker (refusing a served log that never reached that head with
|
|
60
|
+
* `BuiltOnHeadNotReachedError`). Everything downstream is unchanged: the
|
|
61
|
+
* ceremony's own revealed / committed / completed detection publishes only
|
|
62
|
+
* what is missing
|
|
35
63
|
* @returns {Promise<object>} the new client's key set (for the caller to
|
|
36
64
|
* persist under its unlock layer), its did:key, the account DID, the user
|
|
37
|
-
* key,
|
|
65
|
+
* key, the roster epoch to pin, and `committed` -- whether THIS call
|
|
66
|
+
* published the ceremony's pivot entry, propagated verbatim from
|
|
67
|
+
* {@link selfEnrollWebvhClient}. A resume that met an already-complete
|
|
68
|
+
* continuation returns `committed: false` and is a full success: the clear
|
|
69
|
+
* condition for the pending record is that the call RETURNED, never
|
|
70
|
+
* `committed === true`, or a resumed-onto-completed record would never be
|
|
71
|
+
* cleared. The member exists so a build skew that dropped it surfaces
|
|
72
|
+
* instead of reading as `false`
|
|
38
73
|
*/
|
|
39
|
-
export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, accountLogPinStore }) {
|
|
74
|
+
export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, accountLogPinStore, onCommitted, resume }) {
|
|
75
|
+
// Refused before any read, on the ceremony's own rule: without the seam the
|
|
76
|
+
// pivot entry can publish a client whose seed nothing persisted.
|
|
77
|
+
if (typeof onCommitted !== 'function') {
|
|
78
|
+
throw new TypeError('selfEnrollClientCore requires onCommitted: the pending client-key ' +
|
|
79
|
+
'record must be persisted before the add entry publishes the client.');
|
|
80
|
+
}
|
|
81
|
+
// A resume skips the mint on the strength of the recorded seeds, so its
|
|
82
|
+
// marker must be usable as the fork guard: refused here, before any read,
|
|
83
|
+
// rather than silently resuming unguarded.
|
|
84
|
+
if (resume) {
|
|
85
|
+
assertBuiltOnHeadShape({ builtOnHead: resume.builtOnHead });
|
|
86
|
+
}
|
|
40
87
|
const expectedDid = pointer.did;
|
|
41
88
|
if (!expectedDid || !isWebvhDid(expectedDid)) {
|
|
42
89
|
throw new Error('The account pointer names no did:webvh; only a promoted account can ' +
|
|
43
90
|
'self-enroll a client.');
|
|
44
91
|
}
|
|
45
92
|
// The new client's whole key set, minted locally; nothing travels but the
|
|
46
|
-
// public halves the log entries publish.
|
|
47
|
-
|
|
93
|
+
// public halves the log entries publish. A resume mints nothing: every
|
|
94
|
+
// member below is a pure derivation of the recorded seeds, so the replayed
|
|
95
|
+
// key set is the torn run's, byte for byte.
|
|
96
|
+
const clientSeed = resume
|
|
97
|
+
? resume.clientSeed
|
|
98
|
+
: crypto.getRandomValues(new Uint8Array(32));
|
|
48
99
|
const { keyAgent, keyAgreementKey } = await agentsFromSeed({
|
|
49
100
|
seed: clientSeed
|
|
50
101
|
});
|
|
@@ -53,7 +104,9 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
53
104
|
throw new Error('The minted key-agreement key has no public multibase.');
|
|
54
105
|
}
|
|
55
106
|
const signingKeyMultibase = clientSigningKeyMultibase({ keyAgent });
|
|
56
|
-
const webvhUpdateKeys =
|
|
107
|
+
const webvhUpdateKeys = resume
|
|
108
|
+
? resume.webvhUpdateKeys
|
|
109
|
+
: await mintClientWebvhUpdateKeys();
|
|
57
110
|
const newClientKeys = {
|
|
58
111
|
signingKeyMultibase,
|
|
59
112
|
keyAgreementKeyMultibase,
|
|
@@ -68,11 +121,18 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
68
121
|
// on a pinned read -- a served prefix of the log is refused before the
|
|
69
122
|
// reveal-and-commit entry lands, rather than being rebased under the new
|
|
70
123
|
// client's entries and only then caught by the verify below.
|
|
71
|
-
await selfEnrollWebvhClient({
|
|
124
|
+
const enrolled = await selfEnrollWebvhClient({
|
|
72
125
|
store: logStore,
|
|
73
126
|
ladderSeed,
|
|
74
127
|
newClientKeys,
|
|
75
128
|
newClientUpdateSeeds: webvhUpdateKeys,
|
|
129
|
+
// The ceremony's seam hands over the head alone; the key set it publishes
|
|
130
|
+
// was minted here, so the wrapper adds it -- everything the caller's
|
|
131
|
+
// pending record needs that the caller does not already hold. On a resume
|
|
132
|
+
// these are the resumed record's own seeds, so the re-persist is a
|
|
133
|
+
// rewrite of what already stands.
|
|
134
|
+
onCommitted: async ({ builtOnHead }) => onCommitted({ builtOnHead, clientSeed, webvhUpdateKeys }),
|
|
135
|
+
...(resume ? { builtOnHead: resume.builtOnHead } : {}),
|
|
76
136
|
expectedDid,
|
|
77
137
|
...(accountLogPinStore
|
|
78
138
|
? {
|
|
@@ -132,7 +192,11 @@ export async function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyA
|
|
|
132
192
|
clientDid: keyAgent.id,
|
|
133
193
|
did: expectedDid,
|
|
134
194
|
userKey: read.userKey,
|
|
135
|
-
latestEpochId: read.latestEpochId
|
|
195
|
+
latestEpochId: read.latestEpochId,
|
|
196
|
+
// Propagated verbatim: whether THIS call published the pivot entry. The
|
|
197
|
+
// pending record is cleared because the call returned, not because this
|
|
198
|
+
// reads `true`.
|
|
199
|
+
committed: enrolled.committed
|
|
136
200
|
};
|
|
137
201
|
}
|
|
138
202
|
//# sourceMappingURL=selfEnroll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfEnroll.js","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selfEnroll.js","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AA2CA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAGrE,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,sBAAsB,EACt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AChD,CAAC,CAAA;IAEF,OAAO;QACL,UAAU;QACV,eAAe;QACf,SAAS,EAAE,QAAQ,CAAC,EAAE;QACtB,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,wEAAwE;QACxE,wEAAwE;QACxE,gBAAgB;QAChB,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAk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AAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CA0GD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { convergeUserKeyRosterToDocument, isSealableDescriptorStore, readUserKeyRoster } from '../keys/index.js';
|
|
2
|
+
import { log } from '../log.js';
|
|
2
3
|
import { verifyAccountLog } from '../webvh/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Whether a thrown error is one of the roster refusals -- a fabricated or
|
|
@@ -86,8 +87,9 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
|
|
|
86
87
|
}
|
|
87
88
|
// An unreachable server (or any transport hiccup) must not lock the user
|
|
88
89
|
// out of an offline start: the cached key stays authoritative.
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
log.warn('The wrap-set roster check failed; continuing with the cached user key', {
|
|
91
|
+
err
|
|
92
|
+
});
|
|
91
93
|
return null;
|
|
92
94
|
}
|
|
93
95
|
if (!read) {
|
|
@@ -168,7 +170,9 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
168
170
|
if (isRosterRefusal(err)) {
|
|
169
171
|
throw err;
|
|
170
172
|
}
|
|
171
|
-
|
|
173
|
+
log.warn('Could not converge the wrap-set roster onto the account document', {
|
|
174
|
+
err
|
|
175
|
+
});
|
|
172
176
|
return unchanged;
|
|
173
177
|
}
|
|
174
178
|
// The seal backstop, on a sealable (log-governed) store: a converged
|
|
@@ -189,15 +193,14 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
189
193
|
if (isRosterRefusal(err)) {
|
|
190
194
|
throw err;
|
|
191
195
|
}
|
|
192
|
-
|
|
196
|
+
log.warn('Could not seal the wrap-set roster log', { err });
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
if (!rotated) {
|
|
196
200
|
return { ...unchanged, sealed };
|
|
197
201
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'longer keys; the rotation has been completed.');
|
|
202
|
+
log.warn('The wrap-set roster still wrapped the current key to recipient(s) ' +
|
|
203
|
+
'the account document no longer keys; the rotation has been completed', { staleRecipientCount: staleRecipientIds.length });
|
|
201
204
|
// Rotated: the fresh key is only readable from the roster, so re-read it
|
|
202
205
|
// and adopt it before the collection fan-out runs against it. A failure
|
|
203
206
|
// here cannot resolve to the unchanged input -- the roster HAS moved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AA4DA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAA;IACrD,IAAI,IAAI,KAAK,4BAA4B,EAAE,CAAC;QAC1C,OAAQ,GAA4B,CAAC,MAAM,KAAK,UAAU,CAAA;IAC5D,CAAC;IACD,OAAO,CACL,IAAI,KAAK,2BAA2B;QACpC,IAAI,KAAK,8BAA8B;QACvC,IAAI,KAAK,6BAA6B;QACtC,IAAI,KAAK,0BAA0B,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EAOb;IACC,IAAI,IAAoC,CAAA;IACxC,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,iBAAiB,CAAC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AClD,CAAA;IAED,yEAAyE;IACzE,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,IAAoC,CAAA;IACxC,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,iBAAiB,CAAC;YAC7B,KAAK;YACL,OAAO;YACP,qBAAqB;YACrB,aAAa;SACd,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAA;QACX,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,mEAAmE;YACnE,kBAAkB,EACpB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
|
|
@@ -28,7 +28,9 @@ export declare const EPOCH_CONFIGURATION_STATE_TYPE = "WasEpochConfiguration";
|
|
|
28
28
|
* (chain, proofs, external authorization, and the chain-head pin, via
|
|
29
29
|
* `readResourceLog`), and refuses a verified head whose state is not a
|
|
30
30
|
* `WasEpochConfiguration` rather than handing it out as a descriptor.
|
|
31
|
-
* Resolves `null` for an absent log (the pre-genesis state)
|
|
31
|
+
* Resolves `null` for an absent log (the pre-genesis state) only while no pin
|
|
32
|
+
* is held for it; under a held pin an absent log is refused as a `rollback`,
|
|
33
|
+
* the library's rule. Both governed
|
|
32
34
|
* descriptor consumers -- the log-governed descriptor source below and the
|
|
33
35
|
* roster's log-governed descriptor store -- read through this helper, so a
|
|
34
36
|
* hardening applied here reaches every trusted descriptor read.
|
|
@@ -58,7 +60,8 @@ export declare function readGovernedEpochConfiguration({ store, resolveControlle
|
|
|
58
60
|
* Builds the {@link EncryptionDescriptorSource} over per-collection resource
|
|
59
61
|
* logs. An absent log resolves `undefined` exactly like an absent
|
|
60
62
|
* Collection Description `encryption` member (a plaintext collection, or one
|
|
61
|
-
* whose provisioning has not landed)
|
|
63
|
+
* whose provisioning has not landed), unless a pin is held for it, in which
|
|
64
|
+
* case the read refuses as a `rollback`; verification failures throw through --
|
|
62
65
|
* {@link acquireDescriptor} rethrows the refusal classes rather than falling
|
|
63
66
|
* back to the cache.
|
|
64
67
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AAErE
|
|
1
|
+
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACN,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAA;IACvB,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,oBAAoB,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,IAAI,CAAC,CAwBR;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACT,EAAE;IACD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAA;IAClD,iBAAiB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACvD,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;CAC3C,GAAG,0BAA0B,CAe7B"}
|
|
@@ -12,7 +12,9 @@ export const EPOCH_CONFIGURATION_STATE_TYPE = 'WasEpochConfiguration';
|
|
|
12
12
|
* (chain, proofs, external authorization, and the chain-head pin, via
|
|
13
13
|
* `readResourceLog`), and refuses a verified head whose state is not a
|
|
14
14
|
* `WasEpochConfiguration` rather than handing it out as a descriptor.
|
|
15
|
-
* Resolves `null` for an absent log (the pre-genesis state)
|
|
15
|
+
* Resolves `null` for an absent log (the pre-genesis state) only while no pin
|
|
16
|
+
* is held for it; under a held pin an absent log is refused as a `rollback`,
|
|
17
|
+
* the library's rule. Both governed
|
|
16
18
|
* descriptor consumers -- the log-governed descriptor source below and the
|
|
17
19
|
* roster's log-governed descriptor store -- read through this helper, so a
|
|
18
20
|
* hardening applied here reaches every trusted descriptor read.
|
|
@@ -55,7 +57,8 @@ export async function readGovernedEpochConfiguration({ store, resolveController,
|
|
|
55
57
|
* Builds the {@link EncryptionDescriptorSource} over per-collection resource
|
|
56
58
|
* logs. An absent log resolves `undefined` exactly like an absent
|
|
57
59
|
* Collection Description `encryption` member (a plaintext collection, or one
|
|
58
|
-
* whose provisioning has not landed)
|
|
60
|
+
* whose provisioning has not landed), unless a pin is held for it, in which
|
|
61
|
+
* case the read refuses as a `rollback`; verification failures throw through --
|
|
59
62
|
* {@link acquireDescriptor} rethrows the refusal classes rather than falling
|
|
60
63
|
* back to the cache.
|
|
61
64
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,eAAe,EACf,yBAAyB,EAK1B,MAAM,0BAA0B,CAAA;AAGjC;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,uBAAuB,CAAA;AAErE
|
|
1
|
+
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,eAAe,EACf,yBAAyB,EAK1B,MAAM,0BAA0B,CAAA;AAGjC;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,uBAAuB,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,EACn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,11 @@
|
|
|
29
29
|
* - `@interop/wallet-core/recovery` -- recovery codes on the roster identity
|
|
30
30
|
* model: a code as a minimal always-enrolled wallet client.
|
|
31
31
|
*
|
|
32
|
+
* The root also exports the logging port: `setLogger` and the `Logger`
|
|
33
|
+
* type (`src/log.ts`), the seam an app wires once at bootstrap so this
|
|
34
|
+
* package's internal `console` fallback is replaced with a real logger
|
|
35
|
+
* (the sibling logging package's `createLogger`, for one).
|
|
36
|
+
*
|
|
32
37
|
* This root re-exports `sync` and `space` for convenience. `identity`,
|
|
33
38
|
* `request`, `webvh`, `keys`, `descriptors`, `keyring`,
|
|
34
39
|
* `enrollment`, and `recovery` are deliberately NOT re-exported here, so
|
|
@@ -37,4 +42,6 @@
|
|
|
37
42
|
*/
|
|
38
43
|
export * from './sync/index.js';
|
|
39
44
|
export * from './space/index.js';
|
|
45
|
+
export { setLogger } from './log.js';
|
|
46
|
+
export type { Logger } from './log.js';
|
|
40
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
* - `@interop/wallet-core/recovery` -- recovery codes on the roster identity
|
|
30
30
|
* model: a code as a minimal always-enrolled wallet client.
|
|
31
31
|
*
|
|
32
|
+
* The root also exports the logging port: `setLogger` and the `Logger`
|
|
33
|
+
* type (`src/log.ts`), the seam an app wires once at bootstrap so this
|
|
34
|
+
* package's internal `console` fallback is replaced with a real logger
|
|
35
|
+
* (the sibling logging package's `createLogger`, for one).
|
|
36
|
+
*
|
|
32
37
|
* This root re-exports `sync` and `space` for convenience. `identity`,
|
|
33
38
|
* `request`, `webvh`, `keys`, `descriptors`, `keyring`,
|
|
34
39
|
* `enrollment`, and `recovery` are deliberately NOT re-exported here, so
|
|
@@ -37,4 +42,5 @@
|
|
|
37
42
|
*/
|
|
38
43
|
export * from './sync/index.js';
|
|
39
44
|
export * from './space/index.js';
|
|
45
|
+
export { setLogger } from './log.js';
|
|
40
46
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA"}
|