@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
package/dist/log.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AAeH,MAAM,eAAe,GAAW;IAC9B,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACnB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAClB,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAClB,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACnB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;CAC7E,CAAA;AAED,IAAI,MAAM,GAAW,eAAe,CAAA;AAEpC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAA;IACvB,MAAM,GAAG,IAAI,CAAA;IACb,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAW;IACzB,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;IAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;IAC3C,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;IAC3C,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC;CAC9C,CAAA"}
|
|
@@ -74,14 +74,18 @@ export interface RecoveryDelegationEntry {
|
|
|
74
74
|
* flags a recorded sibling the pass could not rebuild because the document
|
|
75
75
|
* points at no generation, which stays flagged for the health check),
|
|
76
76
|
* `incomplete-entry` (an entry predating the re-mint fields, skipped until
|
|
77
|
-
* the credential is re-bound),
|
|
77
|
+
* the credential is re-bound), `pending-entry` (the entry's recorded
|
|
78
|
+
* unlock-key members do not match the credential the record at its unlock
|
|
79
|
+
* Space is sealed to -- a passphrase change torn before its retirement; the
|
|
80
|
+
* next passphrase login's repair finishes it, and re-minting here would
|
|
81
|
+
* re-arm the retired credential into the new one's record), or `failed` (the record could not be read,
|
|
78
82
|
* re-sealed, or re-PUT -- `error` carries the cause). A skipped or failed
|
|
79
83
|
* entry is named here so no caller can lose it silently.
|
|
80
84
|
*/
|
|
81
85
|
export interface RecordRemintOutcome {
|
|
82
86
|
label: string;
|
|
83
87
|
unlockSpaceId: string;
|
|
84
|
-
outcome: 'current' | 'reminted' | 'incomplete-entry' | 'failed';
|
|
88
|
+
outcome: 'current' | 'reminted' | 'incomplete-entry' | 'pending-entry' | 'failed';
|
|
85
89
|
siblingCarriedVerbatim?: boolean;
|
|
86
90
|
error?: unknown;
|
|
87
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryDelegation.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryDelegation.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAMhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxE,OAAO,EACL,oBAAoB,EAGrB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,QAAuB,CAAA;AAI9D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAqB/E;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,OAAO,EACP,iBAAiB,EAClB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CAAC,KAAK,CAAC,CAOjB;AAID,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAE/B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA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,CAAC,IAAI,CAAC,CAAA;IACzD,8BAA8B,CAAC,EAAE,CAAC,OAAO,EAAE;QACzC,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAA;IAChC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAChC,CAAC,CAuMD"}
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
*/
|
|
46
46
|
import { X25519KeyAgreementKey2020 } from '@interop/x25519-key-agreement-key';
|
|
47
47
|
import { resourcePath, toUrl } from '@interop/was-client/paths';
|
|
48
|
+
import { log } from '../log.js';
|
|
48
49
|
import { DID_LOG_RESOURCE, ID_COLLECTION } from '../space/collections.js';
|
|
49
50
|
import { delegationKeyInDocument } from '../webvh/listClients.js';
|
|
50
51
|
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
51
52
|
import { getUnlockKeyringWithCapability, putUnlockKeyringWithCapability } from '../keyring/unlockSpace.js';
|
|
52
|
-
import { remintUnlockRecordDelegations } from '../unlock/unlockRecord.js';
|
|
53
|
+
import { remintUnlockRecordDelegations, unlockRecordSealedTo } from '../unlock/unlockRecord.js';
|
|
53
54
|
import { delegationProofKeyId, STANDING_ZCAP_TTL_MS, zcapExpiring } from '../webvh/standingZcap.js';
|
|
54
55
|
/**
|
|
55
56
|
* The recovery delegation's lifetime: the house standing-zcap value
|
|
@@ -233,6 +234,29 @@ export async function remintRecoveryDelegations({ doc, entries, pointer, storage
|
|
|
233
234
|
spaceId: entry.unlockSpaceId,
|
|
234
235
|
capability: entry.manageCapability
|
|
235
236
|
});
|
|
237
|
+
// The pending-shaped guard: the entry's `unlockSpaceId` and
|
|
238
|
+
// `manageCapability` name one credential while its identity members
|
|
239
|
+
// name another -- the state a passphrase change torn before its
|
|
240
|
+
// retirement leaves. Re-minting here would seal a fresh
|
|
241
|
+
// current-client-signed bridge for the OLD credential into the NEW
|
|
242
|
+
// credential's record, re-arming the half-retired credential and
|
|
243
|
+
// bricking the new one's entry paths. Nothing is written; the next
|
|
244
|
+
// passphrase login's repair is the mender.
|
|
245
|
+
if (!unlockRecordSealedTo({
|
|
246
|
+
record: standing,
|
|
247
|
+
keyAgreementKeyMultibase: entry.unlockKeyAgreementKeyMultibase
|
|
248
|
+
})) {
|
|
249
|
+
log.warn('The unlock record at the Space recorded for this entry is ' +
|
|
250
|
+
'sealed to another credential (a passphrase change torn before ' +
|
|
251
|
+
'its retirement landed); its delegations are not re-minted', { label: entry.label });
|
|
252
|
+
skipped += 1;
|
|
253
|
+
outcomes.push({
|
|
254
|
+
label: entry.label,
|
|
255
|
+
unlockSpaceId: entry.unlockSpaceId,
|
|
256
|
+
outcome: 'pending-entry'
|
|
257
|
+
});
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
236
260
|
const delegation = await delegateLogWrite({
|
|
237
261
|
zcapClient,
|
|
238
262
|
pointer,
|
|
@@ -253,9 +277,8 @@ export async function remintRecoveryDelegations({ doc, entries, pointer, storage
|
|
|
253
277
|
});
|
|
254
278
|
if (!delegatedClients) {
|
|
255
279
|
siblingCarriedVerbatim = true;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
'verbatim.');
|
|
280
|
+
log.warn('The account document names no client-annex generation; the ' +
|
|
281
|
+
'delegatedClients delegation for this entry is carried verbatim', { label: entry.label });
|
|
259
282
|
}
|
|
260
283
|
}
|
|
261
284
|
// The credential's unlock KAK, public half only -- exactly enough to
|
|
@@ -310,7 +333,10 @@ export async function remintRecoveryDelegations({ doc, entries, pointer, storage
|
|
|
310
333
|
});
|
|
311
334
|
}
|
|
312
335
|
catch (err) {
|
|
313
|
-
|
|
336
|
+
log.warn('Could not re-mint the recovery delegation', {
|
|
337
|
+
label: entry.label,
|
|
338
|
+
err
|
|
339
|
+
});
|
|
314
340
|
skipped += 1;
|
|
315
341
|
outcomes.push({
|
|
316
342
|
label: entry.label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryDelegation.js","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAG7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,2BAA2B,CAAA;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"recoveryDelegation.js","sourceRoot":"","sources":["../../src/recovery/recoveryDelegation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAG7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,6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WebvhEnrollmentKeys, WebvhIdStore } from '../webvh/didWebvh.js';
|
|
3
|
+
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
3
4
|
/**
|
|
4
5
|
* The verification-method id a code's key-agreement key publishes under --
|
|
5
6
|
* the ordinary `<did>#<multibase>` form, indistinguishable by id from any
|
|
@@ -46,11 +47,19 @@ export type RecoveryLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdRes
|
|
|
46
47
|
* @param options.store {RecoveryLogStore}
|
|
47
48
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
48
49
|
* to, where the caller holds one
|
|
50
|
+
* @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
|
|
51
|
+
* pins; a served log that is a rollback, a fork, or an identity switch
|
|
52
|
+
* against the pinned head is refused (`ResourceLogContinuityError`)
|
|
53
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
54
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
55
|
+
* supplied
|
|
49
56
|
* @returns {Promise<PublishedWebvhLog>}
|
|
50
57
|
*/
|
|
51
|
-
export declare function readLogOrThrow({ store, expectedDid }: {
|
|
58
|
+
export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }: {
|
|
52
59
|
store: RecoveryLogStore;
|
|
53
60
|
expectedDid?: string;
|
|
61
|
+
pinStore?: ResourceLogPinStore;
|
|
62
|
+
logId?: string;
|
|
54
63
|
}): Promise<PublishedWebvhLog>;
|
|
55
64
|
/**
|
|
56
65
|
* Publishes `did.jsonl` through the narrow recovery seam -- the log only,
|
|
@@ -87,14 +96,22 @@ export declare function publishLogOnly({ store, log, ifMatch }: {
|
|
|
87
96
|
* @param options.recovery {RecoveryPublicKeys} the code's public halves
|
|
88
97
|
* @param [options.expectedDid] {string} the account DID the log must
|
|
89
98
|
* resolve to, from the caller's stored account pointer
|
|
99
|
+
* @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
|
|
100
|
+
* pins; a served log that is a rollback, a fork, or an identity switch
|
|
101
|
+
* against the pinned head is refused (`ResourceLogContinuityError`)
|
|
102
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
103
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
104
|
+
* supplied
|
|
90
105
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} the account
|
|
91
106
|
* DID and the document and log as this call leaves them
|
|
92
107
|
*/
|
|
93
|
-
export declare function publishRecoveryKey({ idStore, updateKeys, recovery, expectedDid }: {
|
|
108
|
+
export declare function publishRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }: {
|
|
94
109
|
idStore: WebvhIdStore;
|
|
95
110
|
updateKeys: ClientWebvhUpdateKeys;
|
|
96
111
|
recovery: RecoveryPublicKeys;
|
|
97
112
|
expectedDid?: string;
|
|
113
|
+
pinStore?: ResourceLogPinStore;
|
|
114
|
+
logId?: string;
|
|
98
115
|
}): Promise<{
|
|
99
116
|
did: string;
|
|
100
117
|
doc: DIDDoc;
|
|
@@ -112,11 +129,13 @@ export declare function publishRecoveryKey({ idStore, updateKeys, recovery, expe
|
|
|
112
129
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} see
|
|
113
130
|
* {@link publishRecoveryKey}
|
|
114
131
|
*/
|
|
115
|
-
export declare function removeRecoveryKey({ idStore, updateKeys, recovery, expectedDid }: {
|
|
132
|
+
export declare function removeRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }: {
|
|
116
133
|
idStore: WebvhIdStore;
|
|
117
134
|
updateKeys: ClientWebvhUpdateKeys;
|
|
118
135
|
recovery: RecoveryPublicKeys;
|
|
119
136
|
expectedDid?: string;
|
|
137
|
+
pinStore?: ResourceLogPinStore;
|
|
138
|
+
logId?: string;
|
|
120
139
|
}): Promise<{
|
|
121
140
|
did: string;
|
|
122
141
|
doc: DIDDoc;
|
|
@@ -150,11 +169,52 @@ export declare function removeRecoveryKey({ idStore, updateKeys, recovery, expec
|
|
|
150
169
|
* holds them and can sign the add entry)
|
|
151
170
|
* @param options.replacement {RecoveryPublicKeys} the replacement code's
|
|
152
171
|
* public halves, committed and published in the same continuation
|
|
172
|
+
* @param options.onCommitted {function}
|
|
173
|
+
* `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
|
|
174
|
+
* the REQUIRED persist-before-publish seam. It runs once per attempt, after
|
|
175
|
+
* the reveal-and-commit entry stands (published here, or standing from a
|
|
176
|
+
* torn earlier run) and BEFORE the add-and-retire entry -- the ceremony's
|
|
177
|
+
* pivot -- is built. The caller durably persists the successor material
|
|
178
|
+
* there (the `pending` codec group of `keys/clientKeyRecord.ts`: ceremony
|
|
179
|
+
* `'recovery-spend'`, the handed-back `builtOnHead`, the spent code's
|
|
180
|
+
* unwrap key, the replacement code's bytes), so the pivot can never retire
|
|
181
|
+
* the spent code while its successors exist only in tab memory, per the
|
|
182
|
+
* post-pivot derivability rule (`decisions/0010`). Unlike the transient
|
|
183
|
+
* continuation's seam it returns nothing into the entry: the durable spend
|
|
184
|
+
* has no annex pointer to move. A throw propagates and the add-and-retire
|
|
185
|
+
* entry is withheld -- the code stays unspent, and a re-run with the same
|
|
186
|
+
* code converges. The seam must be idempotent: the conflict retry invokes
|
|
187
|
+
* it again. The caveat to hold on to: the idempotent COMPLETED branch (the
|
|
188
|
+
* new client's update key already authorized) returns without ever
|
|
189
|
+
* entering the seam. A re-run after a tear here MUST pass the SAME
|
|
190
|
+
* `replacement` halves back in, re-derived from the persisted replacement
|
|
191
|
+
* code's bytes -- the reveal entry already committed that code's update-key
|
|
192
|
+
* hash, and a re-run minting a fresh replacement would leave the first
|
|
193
|
+
* one's commitment standing forever with no `keyAgreement` method behind
|
|
194
|
+
* it: a code the commitment check accepts but that decrypts nothing. With
|
|
195
|
+
* the halves reused, the only residue of a torn or abandoned run is the
|
|
196
|
+
* never-published CLIENT's committed hashes, inert orphans in
|
|
197
|
+
* `nextKeyHashes` exactly as on the self-enrollment seam (keys of a lost
|
|
198
|
+
* random seed; nothing can reveal them)
|
|
153
199
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
154
200
|
* to, where the recovering flow already knows it
|
|
155
|
-
* @
|
|
156
|
-
*
|
|
157
|
-
*
|
|
201
|
+
* @param [options.pinStore] {ResourceLogPinStore} this caller's chain-head
|
|
202
|
+
* pins; every read both entries are built on is checked against the pinned
|
|
203
|
+
* head (a served prefix is refused before the reveal entry lands, not only
|
|
204
|
+
* by a verify that follows both entries), and the pin advances to each
|
|
205
|
+
* entry as it publishes
|
|
206
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
207
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
208
|
+
* supplied
|
|
209
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
210
|
+
* the account DID, the final `did.json` projection when the add-and-retire
|
|
211
|
+
* entry ran here, and `committed` -- whether THIS call published the pivot
|
|
212
|
+
* entry (`false` exactly on the idempotent completed branch, where a torn
|
|
213
|
+
* earlier run had already published it). It is an observability signal, not
|
|
214
|
+
* a success flag: a returning call means the continuation stands either
|
|
215
|
+
* way, so a caller clears its pending state on the RETURN, whatever
|
|
216
|
+
* `committed` says. Its absence from a return value is a build skew, which
|
|
217
|
+
* is why it is stated rather than inferred
|
|
158
218
|
*/
|
|
159
219
|
export declare function recoverWebvhClient(options: {
|
|
160
220
|
store: RecoveryLogStore;
|
|
@@ -164,9 +224,18 @@ export declare function recoverWebvhClient(options: {
|
|
|
164
224
|
newClientKeys: WebvhEnrollmentKeys;
|
|
165
225
|
newClientUpdateSeeds: ClientWebvhUpdateKeys;
|
|
166
226
|
replacement: RecoveryPublicKeys;
|
|
227
|
+
onCommitted: (committed: {
|
|
228
|
+
builtOnHead: {
|
|
229
|
+
scid: string;
|
|
230
|
+
versionId: string;
|
|
231
|
+
};
|
|
232
|
+
}) => Promise<void>;
|
|
167
233
|
expectedDid?: string;
|
|
234
|
+
pinStore?: ResourceLogPinStore;
|
|
235
|
+
logId?: string;
|
|
168
236
|
}): Promise<{
|
|
169
237
|
did: string;
|
|
170
238
|
webDoc?: object;
|
|
239
|
+
committed: boolean;
|
|
171
240
|
}>;
|
|
172
241
|
//# sourceMappingURL=recoveryWebvh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryWebvh.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAEP,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryWebvh.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAEP,MAAM,2BAA2B,CAAA;AAclC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAGnE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,wBAAwB,EACzB,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,wBAAwB,EAAE,MAAM,CAAA;CACjC,GAAG,MAAM,CAET;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB,EAAE,MAAM,CAAA;IAChC,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;gBAEnD,OAAO,SACuC;CAKjD;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,YAAY,EACZ,kBAAkB,GAAG,eAAe,CACrC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACN,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CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAerD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,KAAK,EAAE,gBAAgB,CAAA;IACvB,QAAQ,EAAE,kBAAkB,GAAG;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAA;IACzD,aAAa,EAAE,mBAAmB,CAAA;IAClC,oBAAoB,EAAE,qBAAqB,CAAA;IAC3C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,WAAW,EAAE,CAAC,SAAS,EAAE;QACvB,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KACjD,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,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,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAmBhE"}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* with the same key material converges without forking the log.
|
|
35
35
|
*/
|
|
36
36
|
import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
|
|
37
|
-
import { assertCarryOverCommitments, markedVerificationMethodPair, MULTIKEY_VM_TYPE, putLogResource, readPublishedLog, relationIds, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
37
|
+
import { assertCanonicalClientKeys, assertCarryOverCommitments, markedVerificationMethodPair, MULTIKEY_VM_TYPE, pinOfLog, putLogResource, readPublishedLog, relationIds, servedHead, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
38
38
|
import { publishUnlockKey, removeUnlockKey } from '../unlock/standingWebvh.js';
|
|
39
39
|
/**
|
|
40
40
|
* The verification-method id a code's key-agreement key publishes under --
|
|
@@ -70,13 +70,21 @@ export class RecoveryKeyNotCommittedError extends Error {
|
|
|
70
70
|
* @param options.store {RecoveryLogStore}
|
|
71
71
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
72
72
|
* to, where the caller holds one
|
|
73
|
+
* @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
|
|
74
|
+
* pins; a served log that is a rollback, a fork, or an identity switch
|
|
75
|
+
* against the pinned head is refused (`ResourceLogContinuityError`)
|
|
76
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
77
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
78
|
+
* supplied
|
|
73
79
|
* @returns {Promise<PublishedWebvhLog>}
|
|
74
80
|
*/
|
|
75
|
-
export async function readLogOrThrow({ store, expectedDid }) {
|
|
81
|
+
export async function readLogOrThrow({ store, expectedDid, pinStore, logId }) {
|
|
76
82
|
// readPublishedLog only calls getIdResourceRaw, so the narrow seam is safe.
|
|
77
83
|
const published = await readPublishedLog({
|
|
78
84
|
idStore: store,
|
|
79
|
-
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
85
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
86
|
+
...(pinStore ? { pinStore } : {}),
|
|
87
|
+
...(logId !== undefined ? { logId } : {})
|
|
80
88
|
});
|
|
81
89
|
if (!published) {
|
|
82
90
|
throw new Error('did:webvh: did.jsonl is missing; nothing to recover.');
|
|
@@ -116,10 +124,16 @@ export async function publishLogOnly({ store, log, ifMatch }) {
|
|
|
116
124
|
* @param options.recovery {RecoveryPublicKeys} the code's public halves
|
|
117
125
|
* @param [options.expectedDid] {string} the account DID the log must
|
|
118
126
|
* resolve to, from the caller's stored account pointer
|
|
127
|
+
* @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
|
|
128
|
+
* pins; a served log that is a rollback, a fork, or an identity switch
|
|
129
|
+
* against the pinned head is refused (`ResourceLogContinuityError`)
|
|
130
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
131
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
132
|
+
* supplied
|
|
119
133
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} the account
|
|
120
134
|
* DID and the document and log as this call leaves them
|
|
121
135
|
*/
|
|
122
|
-
export async function publishRecoveryKey({ idStore, updateKeys, recovery, expectedDid }) {
|
|
136
|
+
export async function publishRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }) {
|
|
123
137
|
return publishUnlockKey({
|
|
124
138
|
idStore,
|
|
125
139
|
updateKeys,
|
|
@@ -130,6 +144,8 @@ export async function publishRecoveryKey({ idStore, updateKeys, recovery, expect
|
|
|
130
144
|
updateKeyMultibase: recovery.updateKeyMultibase
|
|
131
145
|
},
|
|
132
146
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
147
|
+
...(pinStore ? { pinStore } : {}),
|
|
148
|
+
...(logId !== undefined ? { logId } : {}),
|
|
133
149
|
verb: 'issuing a recovery code'
|
|
134
150
|
});
|
|
135
151
|
}
|
|
@@ -145,7 +161,7 @@ export async function publishRecoveryKey({ idStore, updateKeys, recovery, expect
|
|
|
145
161
|
* @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} see
|
|
146
162
|
* {@link publishRecoveryKey}
|
|
147
163
|
*/
|
|
148
|
-
export async function removeRecoveryKey({ idStore, updateKeys, recovery, expectedDid }) {
|
|
164
|
+
export async function removeRecoveryKey({ idStore, updateKeys, recovery, expectedDid, pinStore, logId }) {
|
|
149
165
|
return removeUnlockKey({
|
|
150
166
|
idStore,
|
|
151
167
|
updateKeys,
|
|
@@ -156,6 +172,8 @@ export async function removeRecoveryKey({ idStore, updateKeys, recovery, expecte
|
|
|
156
172
|
updateKeyMultibase: recovery.updateKeyMultibase
|
|
157
173
|
},
|
|
158
174
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
175
|
+
...(pinStore ? { pinStore } : {}),
|
|
176
|
+
...(logId !== undefined ? { logId } : {}),
|
|
159
177
|
verb: 'revoking a recovery code'
|
|
160
178
|
});
|
|
161
179
|
}
|
|
@@ -187,30 +205,96 @@ export async function removeRecoveryKey({ idStore, updateKeys, recovery, expecte
|
|
|
187
205
|
* holds them and can sign the add entry)
|
|
188
206
|
* @param options.replacement {RecoveryPublicKeys} the replacement code's
|
|
189
207
|
* public halves, committed and published in the same continuation
|
|
208
|
+
* @param options.onCommitted {function}
|
|
209
|
+
* `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
|
|
210
|
+
* the REQUIRED persist-before-publish seam. It runs once per attempt, after
|
|
211
|
+
* the reveal-and-commit entry stands (published here, or standing from a
|
|
212
|
+
* torn earlier run) and BEFORE the add-and-retire entry -- the ceremony's
|
|
213
|
+
* pivot -- is built. The caller durably persists the successor material
|
|
214
|
+
* there (the `pending` codec group of `keys/clientKeyRecord.ts`: ceremony
|
|
215
|
+
* `'recovery-spend'`, the handed-back `builtOnHead`, the spent code's
|
|
216
|
+
* unwrap key, the replacement code's bytes), so the pivot can never retire
|
|
217
|
+
* the spent code while its successors exist only in tab memory, per the
|
|
218
|
+
* post-pivot derivability rule (`decisions/0010`). Unlike the transient
|
|
219
|
+
* continuation's seam it returns nothing into the entry: the durable spend
|
|
220
|
+
* has no annex pointer to move. A throw propagates and the add-and-retire
|
|
221
|
+
* entry is withheld -- the code stays unspent, and a re-run with the same
|
|
222
|
+
* code converges. The seam must be idempotent: the conflict retry invokes
|
|
223
|
+
* it again. The caveat to hold on to: the idempotent COMPLETED branch (the
|
|
224
|
+
* new client's update key already authorized) returns without ever
|
|
225
|
+
* entering the seam. A re-run after a tear here MUST pass the SAME
|
|
226
|
+
* `replacement` halves back in, re-derived from the persisted replacement
|
|
227
|
+
* code's bytes -- the reveal entry already committed that code's update-key
|
|
228
|
+
* hash, and a re-run minting a fresh replacement would leave the first
|
|
229
|
+
* one's commitment standing forever with no `keyAgreement` method behind
|
|
230
|
+
* it: a code the commitment check accepts but that decrypts nothing. With
|
|
231
|
+
* the halves reused, the only residue of a torn or abandoned run is the
|
|
232
|
+
* never-published CLIENT's committed hashes, inert orphans in
|
|
233
|
+
* `nextKeyHashes` exactly as on the self-enrollment seam (keys of a lost
|
|
234
|
+
* random seed; nothing can reveal them)
|
|
190
235
|
* @param [options.expectedDid] {string} the account DID the log must resolve
|
|
191
236
|
* to, where the recovering flow already knows it
|
|
192
|
-
* @
|
|
193
|
-
*
|
|
194
|
-
*
|
|
237
|
+
* @param [options.pinStore] {ResourceLogPinStore} this caller's chain-head
|
|
238
|
+
* pins; every read both entries are built on is checked against the pinned
|
|
239
|
+
* head (a served prefix is refused before the reveal entry lands, not only
|
|
240
|
+
* by a verify that follows both entries), and the pin advances to each
|
|
241
|
+
* entry as it publishes
|
|
242
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
243
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
244
|
+
* supplied
|
|
245
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
246
|
+
* the account DID, the final `did.json` projection when the add-and-retire
|
|
247
|
+
* entry ran here, and `committed` -- whether THIS call published the pivot
|
|
248
|
+
* entry (`false` exactly on the idempotent completed branch, where a torn
|
|
249
|
+
* earlier run had already published it). It is an observability signal, not
|
|
250
|
+
* a success flag: a returning call means the continuation stands either
|
|
251
|
+
* way, so a caller clears its pending state on the RETURN, whatever
|
|
252
|
+
* `committed` says. Its absence from a return value is a build skew, which
|
|
253
|
+
* is why it is stated rather than inferred
|
|
195
254
|
*/
|
|
196
255
|
export async function recoverWebvhClient(options) {
|
|
256
|
+
// The seam is what makes the successor material durable before the pivot
|
|
257
|
+
// entry retires the spent code; a call omitting it would silently keep the
|
|
258
|
+
// window in which the document names successors nothing can re-derive.
|
|
259
|
+
// Refused before any read, so nothing is published.
|
|
260
|
+
if (typeof options.onCommitted !== 'function') {
|
|
261
|
+
throw new TypeError('recoverWebvhClient requires onCommitted: the successor material must ' +
|
|
262
|
+
'be persisted before the add-and-retire entry retires the spent code.');
|
|
263
|
+
}
|
|
264
|
+
// A non-canonical pair could only ever throw at the add-and-retire build,
|
|
265
|
+
// AFTER the reveal entry published and the seam persisted; refused here, it
|
|
266
|
+
// costs nothing durable.
|
|
267
|
+
assertCanonicalClientKeys({
|
|
268
|
+
signingKeyMultibase: options.newClientKeys.signingKeyMultibase,
|
|
269
|
+
keyAgreementKeyMultibase: options.newClientKeys.keyAgreementKeyMultibase
|
|
270
|
+
});
|
|
197
271
|
return withLogConflictRetry(() => recoverWebvhClientOnce(options));
|
|
198
272
|
}
|
|
199
273
|
/**
|
|
200
274
|
* One attempt of {@link recoverWebvhClient}, re-invoked by the conflict retry.
|
|
201
275
|
*
|
|
202
276
|
* @param options {object} see {@link recoverWebvhClient}
|
|
203
|
-
* @returns {Promise<{ did: string, webDoc?: object }>}
|
|
277
|
+
* @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
|
|
204
278
|
*/
|
|
205
|
-
async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClientUpdateSeeds, replacement, expectedDid }) {
|
|
279
|
+
async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClientUpdateSeeds, replacement, onCommitted, expectedDid, pinStore, logId }) {
|
|
280
|
+
// Each attempt's own read is what the CAS publish is built on, so the
|
|
281
|
+
// continuity check runs here -- and again on a conflict-retry re-run -- not
|
|
282
|
+
// only on the verify that follows both entries.
|
|
283
|
+
const pinned = {
|
|
284
|
+
...(pinStore ? { pinStore } : {}),
|
|
285
|
+
...(logId !== undefined ? { logId } : {})
|
|
286
|
+
};
|
|
206
287
|
let published = await readLogOrThrow({
|
|
207
288
|
store,
|
|
208
|
-
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
289
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
290
|
+
...pinned
|
|
209
291
|
});
|
|
210
292
|
// Already complete (a torn earlier run finished the add entry): the new
|
|
211
|
-
// client's update key is authorized, which only the add entry writes.
|
|
293
|
+
// client's update key is authorized, which only the add entry writes. The
|
|
294
|
+
// seam is deliberately NOT entered here -- nothing is about to be
|
|
295
|
+
// published, so there is no pivot to persist ahead of.
|
|
212
296
|
if (published.updateKeys.includes(newClientKeys.updateKeyMultibase)) {
|
|
213
|
-
return { did: published.did };
|
|
297
|
+
return { did: published.did, committed: false };
|
|
214
298
|
}
|
|
215
299
|
const recoveryHash = await deriveNextKeyHash(recovery.updateKeyMultibase);
|
|
216
300
|
const newUpdateHash = await deriveNextKeyHash(newClientKeys.updateKeyMultibase);
|
|
@@ -251,9 +335,25 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
|
|
|
251
335
|
log: updated.log,
|
|
252
336
|
ifMatch: published.etag
|
|
253
337
|
});
|
|
254
|
-
//
|
|
255
|
-
|
|
338
|
+
// Advance the pin to what the reveal entry just published, so the re-read
|
|
339
|
+
// below (and any read after a tear here) refuses a host that rolls the
|
|
340
|
+
// log back behind it.
|
|
341
|
+
if (pinStore && logId !== undefined) {
|
|
342
|
+
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
343
|
+
}
|
|
344
|
+
// The same account the reveal entry just extended, under the same pin.
|
|
345
|
+
published = await readLogOrThrow({
|
|
346
|
+
store,
|
|
347
|
+
expectedDid: published.did,
|
|
348
|
+
...pinned
|
|
349
|
+
});
|
|
256
350
|
}
|
|
351
|
+
// The persist-before-publish seam: the successor material becomes durable
|
|
352
|
+
// HERE, on the head the add-and-retire entry is about to be built on,
|
|
353
|
+
// before that entry -- the ceremony's pivot -- retires the spent code.
|
|
354
|
+
// Reached on both paths into the add entry: the reveal entry just published
|
|
355
|
+
// above, or a torn earlier run's reveal entry standing already.
|
|
356
|
+
await onCommitted({ builtOnHead: servedHead(published.log) });
|
|
257
357
|
// The add-and-retire entry: the new client's verification methods and
|
|
258
358
|
// update key in; the spent code's VM, update key, and hash out; the
|
|
259
359
|
// replacement code's VM in. Signed by the new client's update key, whose
|
|
@@ -327,6 +427,11 @@ async function recoverWebvhClientOnce({ store, recovery, newClientKeys, newClien
|
|
|
327
427
|
// Conditional on the read this entry was built on: the re-read above when
|
|
328
428
|
// the commit entry ran here, the first read when it was skipped.
|
|
329
429
|
await publishLogOnly({ store, log: updated.log, ifMatch: published.etag });
|
|
330
|
-
|
|
430
|
+
// Advance the pin to what this entry just published, so a host rolling the
|
|
431
|
+
// log back straight afterwards is refused on the next read.
|
|
432
|
+
if (pinStore && logId !== undefined) {
|
|
433
|
+
await pinStore.write({ logId, pin: pinOfLog(updated.log) });
|
|
434
|
+
}
|
|
435
|
+
return { did: updated.did, webDoc: updated.webDoc, committed: true };
|
|
331
436
|
}
|
|
332
437
|
//# sourceMappingURL=recoveryWebvh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryWebvh.js","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"recoveryWebvh.js","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2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AC,EAAE,KAAK,SAAS,CAAC;gBAC/D,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC;gBAC5C,eAAe;aAChB,CAAC;SACH;QACD,oBAAoB,EAAE,aAAa,CAAC,GAAG,CAAC,oBAAoB,EAAE,WAAW,CAAC;QAC1E,oBAAoB,EAAE,aAAa,CAAC,GAAG,CAAC,oBAAoB,EAAE,WAAW,CAAC;KAC3E,CAAC,CAAA;IACF,0EAA0E;IAC1E,iEAAiE;IACjE,MAAM,cAAc,CAAC,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,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;AACtE,CAAC"}
|
|
@@ -24,10 +24,18 @@ import type { ICapabilityQueryDetail, IVPRDetails } from './types.js';
|
|
|
24
24
|
* @param options.capabilityQueries {ICapabilityQueryDetail[]}
|
|
25
25
|
* @param [options.challenge] {string} a requester-chosen nonce the wallet
|
|
26
26
|
* echoes in its response presentation
|
|
27
|
+
* @param [options.agent] {{ name: string }} the requester's self-declared
|
|
28
|
+
* display name, carried as the VPR's root `agent` member; shown at consent
|
|
29
|
+
* as what the agent calls itself, never as verified identity. Validated by
|
|
30
|
+
* `normalizeAgentName` (trimmed, 1 to 64 characters, no control
|
|
31
|
+
* characters), so a name the wallet would refuse fails here first.
|
|
27
32
|
* @returns {IVPRDetails}
|
|
28
33
|
*/
|
|
29
|
-
export declare function composeCapabilityRequest({ capabilityQueries, challenge }: {
|
|
34
|
+
export declare function composeCapabilityRequest({ capabilityQueries, challenge, agent }: {
|
|
30
35
|
capabilityQueries: ICapabilityQueryDetail[];
|
|
31
36
|
challenge?: string;
|
|
37
|
+
agent?: {
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
32
40
|
}): IVPRDetails;
|
|
33
41
|
//# sourceMappingURL=capabilityRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilityRequest.d.ts","sourceRoot":"","sources":["../../src/request/capabilityRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,WAAW,EAGZ,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"capabilityRequest.d.ts","sourceRoot":"","sources":["../../src/request/capabilityRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,WAAW,EAGZ,MAAM,YAAY,CAAA;AAGnB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,SAAS,EACT,KAAK,EACN,EAAE;IACD,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACzB,GAAG,WAAW,CA2Bd"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeAgentName } from './classify.js';
|
|
1
2
|
/**
|
|
2
3
|
* REQUESTER: builds the zcap-only VPR details for a set of capability
|
|
3
4
|
* requests. Each detail must name its `controller` (the grantee DID) and its
|
|
@@ -9,9 +10,14 @@
|
|
|
9
10
|
* @param options.capabilityQueries {ICapabilityQueryDetail[]}
|
|
10
11
|
* @param [options.challenge] {string} a requester-chosen nonce the wallet
|
|
11
12
|
* echoes in its response presentation
|
|
13
|
+
* @param [options.agent] {{ name: string }} the requester's self-declared
|
|
14
|
+
* display name, carried as the VPR's root `agent` member; shown at consent
|
|
15
|
+
* as what the agent calls itself, never as verified identity. Validated by
|
|
16
|
+
* `normalizeAgentName` (trimmed, 1 to 64 characters, no control
|
|
17
|
+
* characters), so a name the wallet would refuse fails here first.
|
|
12
18
|
* @returns {IVPRDetails}
|
|
13
19
|
*/
|
|
14
|
-
export function composeCapabilityRequest({ capabilityQueries, challenge }) {
|
|
20
|
+
export function composeCapabilityRequest({ capabilityQueries, challenge, agent }) {
|
|
15
21
|
if (capabilityQueries.length === 0) {
|
|
16
22
|
throw new Error('A capability request must ask for at least one zcap.');
|
|
17
23
|
}
|
|
@@ -30,6 +36,11 @@ export function composeCapabilityRequest({ capabilityQueries, challenge }) {
|
|
|
30
36
|
capabilityQuery: capabilityQueries,
|
|
31
37
|
...(challenge !== undefined && { challenge })
|
|
32
38
|
};
|
|
33
|
-
return {
|
|
39
|
+
return {
|
|
40
|
+
query: [query],
|
|
41
|
+
...(agent !== undefined && {
|
|
42
|
+
agent: { name: normalizeAgentName({ name: agent.name }) }
|
|
43
|
+
})
|
|
44
|
+
};
|
|
34
45
|
}
|
|
35
46
|
//# sourceMappingURL=capabilityRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilityRequest.js","sourceRoot":"","sources":["../../src/request/capabilityRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capabilityRequest.js","sourceRoot":"","sources":["../../src/request/capabilityRequest.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,SAAS,EACT,KAAK,EAKN;IACC,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACn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