@interop/wallet-core 0.50.0 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -11
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +17 -8
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +33 -12
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +18 -6
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +19 -6
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +65 -28
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +78 -18
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -3
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +2 -2
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +6 -6
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +5 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +19 -11
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +77 -14
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +36 -7
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +80 -18
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +6 -6
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +8 -8
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +7 -7
- package/dist/clientAnnex/recoveryLadderAnchored.js +9 -9
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +6 -4
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +19 -7
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clients/listing.d.ts +1 -1
- package/dist/clients/listing.d.ts.map +1 -1
- package/dist/clients/listing.js +1 -1
- package/dist/clients/listing.js.map +1 -1
- package/dist/clients/revocation.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +1 -1
- package/dist/descriptors/logSource.d.ts +1 -2
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +2 -2
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +1 -1
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +2 -1
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +13 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +1 -1
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +6 -20
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +8 -5
- package/dist/keyring/kdf.js.map +1 -1
- package/dist/keyring/unlockSpace.js +1 -1
- package/dist/keys/rosterLogStore.d.ts +16 -14
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +149 -32
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +8 -7
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +6 -6
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +1 -1
- package/dist/keys/spaceEpochs.js +1 -1
- package/dist/keys/userKeyRoster.d.ts +3 -3
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +3 -3
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/recovery/index.d.ts +2 -2
- package/dist/recovery/index.js +2 -2
- package/dist/recovery/recoveryDelegation.js +1 -1
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +4 -4
- package/dist/recovery/recoveryWebvh.js +5 -5
- package/dist/request/appKey.d.ts +9 -3
- package/dist/request/appKey.d.ts.map +1 -1
- package/dist/request/appKey.js +13 -8
- package/dist/request/appKey.js.map +1 -1
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +13 -1
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +6 -1
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js +6 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/exchangeClient.d.ts +0 -23
- package/dist/request/exchangeClient.d.ts.map +1 -1
- package/dist/request/exchangeClient.js +30 -1
- package/dist/request/exchangeClient.js.map +1 -1
- package/dist/request/index.d.ts +4 -1
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +4 -1
- package/dist/request/index.js.map +1 -1
- package/dist/request/interactionRequest.d.ts +23 -0
- package/dist/request/interactionRequest.d.ts.map +1 -0
- package/dist/request/interactionRequest.js +46 -0
- package/dist/request/interactionRequest.js.map +1 -0
- package/dist/request/interactionUrl.d.ts +3 -14
- package/dist/request/interactionUrl.d.ts.map +1 -1
- package/dist/request/interactionUrl.js +20 -1
- package/dist/request/interactionUrl.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +48 -49
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +40 -20
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/errors.d.ts +12 -78
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +12 -79
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +17 -22
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +16 -21
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/license.d.ts +27 -26
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +31 -30
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/unlock/index.d.ts +6 -6
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -5
- package/dist/unlock/retire.d.ts +29 -28
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +25 -16
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts +1 -1
- package/dist/unlock/standingClient.js +3 -3
- package/dist/unlock/standingWebvh.d.ts +28 -10
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +75 -37
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.js +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +2 -2
- package/dist/webvh/delegatedLogStore.js +2 -2
- package/dist/webvh/didWeb.js +1 -1
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +3 -3
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +5 -5
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/listClients.js +1 -1
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +1 -1
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +1 -2
- package/dist/webvh/verifyLog.js.map +1 -1
- package/package.json +6 -10
- package/dist/display/alignment.d.ts +0 -55
- package/dist/display/alignment.d.ts.map +0 -1
- package/dist/display/alignment.js +0 -117
- package/dist/display/alignment.js.map +0 -1
- package/dist/display/credentialName.d.ts +0 -42
- package/dist/display/credentialName.d.ts.map +0 -1
- package/dist/display/credentialName.js +0 -106
- package/dist/display/credentialName.js.map +0 -1
- package/dist/display/displayFields.d.ts +0 -59
- package/dist/display/displayFields.d.ts.map +0 -1
- package/dist/display/displayFields.js +0 -136
- package/dist/display/displayFields.js.map +0 -1
- package/dist/display/evidence.d.ts +0 -50
- package/dist/display/evidence.d.ts.map +0 -1
- package/dist/display/evidence.js +0 -67
- package/dist/display/evidence.js.map +0 -1
- package/dist/display/image.d.ts +0 -18
- package/dist/display/image.d.ts.map +0 -1
- package/dist/display/image.js +0 -23
- package/dist/display/image.js.map +0 -1
- package/dist/display/index.d.ts +0 -38
- package/dist/display/index.d.ts.map +0 -1
- package/dist/display/index.js +0 -32
- package/dist/display/index.js.map +0 -1
- package/dist/display/issuer.d.ts +0 -105
- package/dist/display/issuer.d.ts.map +0 -1
- package/dist/display/issuer.js +0 -126
- package/dist/display/issuer.js.map +0 -1
- package/dist/display/obv3.d.ts +0 -82
- package/dist/display/obv3.d.ts.map +0 -1
- package/dist/display/obv3.js +0 -117
- package/dist/display/obv3.js.map +0 -1
- package/dist/display/parse.d.ts +0 -66
- package/dist/display/parse.d.ts.map +0 -1
- package/dist/display/parse.js +0 -104
- package/dist/display/parse.js.map +0 -1
- package/dist/display/subject.d.ts +0 -79
- package/dist/display/subject.d.ts.map +0 -1
- package/dist/display/subject.js +0 -124
- package/dist/display/subject.js.map +0 -1
- package/dist/display/text.d.ts +0 -53
- package/dist/display/text.d.ts.map +0 -1
- package/dist/display/text.js +0 -78
- package/dist/display/text.js.map +0 -1
- package/dist/display/types.d.ts +0 -55
- package/dist/display/types.d.ts.map +0 -1
- package/dist/display/types.js +0 -41
- package/dist/display/types.js.map +0 -1
- package/dist/display/validity.d.ts +0 -51
- package/dist/display/validity.d.ts.map +0 -1
- package/dist/display/validity.js +0 -51
- package/dist/display/validity.js.map +0 -1
- package/dist/display/verificationView.d.ts +0 -115
- package/dist/display/verificationView.d.ts.map +0 -1
- package/dist/display/verificationView.js +0 -199
- package/dist/display/verificationView.js.map +0 -1
- package/dist/resourceLog/append.d.ts +0 -112
- package/dist/resourceLog/append.d.ts.map +0 -1
- package/dist/resourceLog/append.js +0 -197
- package/dist/resourceLog/append.js.map +0 -1
- package/dist/resourceLog/entry.d.ts +0 -68
- package/dist/resourceLog/entry.d.ts.map +0 -1
- package/dist/resourceLog/entry.js +0 -167
- package/dist/resourceLog/entry.js.map +0 -1
- package/dist/resourceLog/pin.d.ts +0 -82
- package/dist/resourceLog/pin.d.ts.map +0 -1
- package/dist/resourceLog/pin.js +0 -57
- package/dist/resourceLog/pin.js.map +0 -1
- package/dist/resourceLog/seal.d.ts +0 -97
- package/dist/resourceLog/seal.d.ts.map +0 -1
- package/dist/resourceLog/seal.js +0 -113
- package/dist/resourceLog/seal.js.map +0 -1
- package/dist/resourceLog/verify.d.ts +0 -96
- package/dist/resourceLog/verify.d.ts.map +0 -1
- package/dist/resourceLog/verify.js +0 -474
- package/dist/resourceLog/verify.js.map +0 -1
- package/dist/resourceLog/vmFragment.d.ts +0 -33
- package/dist/resourceLog/vmFragment.d.ts.map +0 -1
- package/dist/resourceLog/vmFragment.js +0 -39
- package/dist/resourceLog/vmFragment.js.map +0 -1
|
@@ -2,28 +2,23 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The `@interop/wallet-core/resourceLog` entry: the
|
|
6
|
-
* Resource Log Profile
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
5
|
+
* The `@interop/wallet-core/resourceLog` entry: the wallet-domain residue of
|
|
6
|
+
* the Resource Log Profile's client side after the generic half moved to
|
|
7
|
+
* `@interop/vh-resource-log` -- the did:webvh controller adapter (the
|
|
8
|
+
* library's controller port extended with the per-version
|
|
9
|
+
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
|
+
* hook), and the ceremony-tail license the hook carries
|
|
11
|
+
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`).
|
|
12
|
+
* Everything generic -- the JSON Lines codec, the store port and
|
|
13
|
+
* `confirmAppend`, chain verification, the chain-head pin
|
|
14
|
+
* (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
|
|
15
|
+
* stay on their owning subpaths: `accountLogPinId` in `webvh`,
|
|
16
|
+
* `userKeyRosterPinId` in `keys`, `clientAnnexLogPinId` in `clientAnnex`),
|
|
17
|
+
* the append path, and the sealing sweep -- lives in the library, and this
|
|
18
|
+
* subpath re-exports none of it: one owner per name. Kept out of the root
|
|
19
|
+
* export: this subpath pulls the did:webvh and ed25519 dependency graph.
|
|
19
20
|
*/
|
|
20
21
|
export { webvhResourceLogController } from './controller.js';
|
|
21
|
-
export {
|
|
22
|
+
export { ResourceLogLicenseError } from './errors.js';
|
|
22
23
|
export { assertLadderAppendLicensed } from './license.js';
|
|
23
|
-
export { buildResourceLogEntry, buildResourceLogGenesis } from './entry.js';
|
|
24
|
-
export { memoryResourceLogPinStore, resourceLogPinId } from './pin.js';
|
|
25
|
-
export { isTerminalResourceLogEntry, verifyResourceLog, verifyResourceLogHandover } from './verify.js';
|
|
26
|
-
export { appendResourceLog, createResourceLog, readResourceLog } from './append.js';
|
|
27
|
-
export { latestAssertionRemovalIndex, sealResourceLog } from './seal.js';
|
|
28
|
-
export { vmFragmentOf } from './vmFragment.js';
|
|
29
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -6,39 +6,40 @@
|
|
|
6
6
|
* of the ladder VM's authority clauses). A ladder-signed append is accepted
|
|
7
7
|
* in exactly two shapes: the log's first entry (creation, never extension --
|
|
8
8
|
* callers admit that shape by not calling this check on a genesis entry),
|
|
9
|
-
* or a rotation
|
|
10
|
-
* one-shot -- refused when the verified log head already carries
|
|
11
|
-
*
|
|
9
|
+
* or a rotation that carries an inventory-changing controller document
|
|
10
|
+
* version, one-shot -- refused when the verified log head already carries
|
|
11
|
+
* an entry at that version or later. Everything else, above all a rotation
|
|
12
12
|
* against an unchanged document (the silent-rekey shape), is refused with
|
|
13
|
-
* {@link ResourceLogLicenseError}.
|
|
14
|
-
* controller's verified version history, the structural twin of the
|
|
15
|
-
* sweep's `
|
|
13
|
+
* {@link ResourceLogLicenseError}. Controller versions compare by position
|
|
14
|
+
* in the controller's verified version history, the structural twin of the
|
|
15
|
+
* sealing sweep's `headControllerVersionIndex >= removalIndex` check.
|
|
16
16
|
*/
|
|
17
|
-
import type {
|
|
17
|
+
import type { WebvhResourceLogController } from './controller.js';
|
|
18
18
|
/**
|
|
19
19
|
* Evaluates the ceremony-tail license's second shape for one ladder-signed
|
|
20
|
-
* append: the append must
|
|
21
|
-
* S(V) differs from S(V-1) in either direction, with S(-1) empty for
|
|
22
|
-
* genesis
|
|
23
|
-
*
|
|
24
|
-
* so a torn ceremony's late-arriving tail still passes
|
|
25
|
-
* rotation against the same
|
|
26
|
-
* unversioned controller, where no
|
|
27
|
-
* refused fail-closed.
|
|
20
|
+
* append: the append must carry an inventory-changing document version V --
|
|
21
|
+
* S(V) differs from S(V-1) in either direction, with S(-1) empty for the
|
|
22
|
+
* genesis version -- and no verified entry may already carry V or later
|
|
23
|
+
* (`headControllerVersionIndex >= controllerVersionIndex` refuses; the
|
|
24
|
+
* license is one-shot, so a torn ceremony's late-arriving tail still passes
|
|
25
|
+
* while a second rotation against the same version does not). A `null`
|
|
26
|
+
* controller version index (an unversioned controller, where no version
|
|
27
|
+
* exists to license against) is refused fail-closed.
|
|
28
28
|
*
|
|
29
29
|
* @param options {object}
|
|
30
|
-
* @param options.controller {
|
|
31
|
-
*
|
|
32
|
-
* @param options.
|
|
33
|
-
* index into `controller.versionIds` (`null`:
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
30
|
+
* @param options.controller {object} the verified controller view's
|
|
31
|
+
* version list and inventory accessor
|
|
32
|
+
* @param options.controllerVersionIndex {number | null} the append's
|
|
33
|
+
* controller version as an index into `controller.versionIds` (`null`:
|
|
34
|
+
* no controller version)
|
|
35
|
+
* @param options.headControllerVersionIndex {number | null} the verified
|
|
36
|
+
* log head's effective controller version index before this append
|
|
37
|
+
* (`null`: the log has no versioned entries yet)
|
|
37
38
|
* @returns {Promise<void>}
|
|
38
39
|
*/
|
|
39
|
-
export declare function assertLadderAppendLicensed({ controller,
|
|
40
|
-
controller:
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
export declare function assertLadderAppendLicensed({ controller, controllerVersionIndex, headControllerVersionIndex }: {
|
|
41
|
+
controller: Pick<WebvhResourceLogController, 'versionIds' | 'inventoryAt'>;
|
|
42
|
+
controllerVersionIndex: number | null;
|
|
43
|
+
headControllerVersionIndex: number | null;
|
|
43
44
|
}): Promise<void>;
|
|
44
45
|
//# sourceMappingURL=license.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAsBjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,UAAU,EACV,sBAAsB,EACtB,0BAA0B,EAC3B,EAAE;IACD,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,aAAa,CAAC,CAAA;IAC1E,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1C,GAAG,OAAO,CAAC,IAAI,CAAC,CAsChB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResourceLogLicenseError } from './errors.js';
|
|
2
2
|
/**
|
|
3
|
-
* Set equality over
|
|
3
|
+
* Set equality over inventory members.
|
|
4
4
|
*
|
|
5
5
|
* @param left {Set<string>}
|
|
6
6
|
* @param right {Set<string>}
|
|
@@ -19,45 +19,46 @@ function setsEqual(left, right) {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Evaluates the ceremony-tail license's second shape for one ladder-signed
|
|
22
|
-
* append: the append must
|
|
23
|
-
* S(V) differs from S(V-1) in either direction, with S(-1) empty for
|
|
24
|
-
* genesis
|
|
25
|
-
*
|
|
26
|
-
* so a torn ceremony's late-arriving tail still passes
|
|
27
|
-
* rotation against the same
|
|
28
|
-
* unversioned controller, where no
|
|
29
|
-
* refused fail-closed.
|
|
22
|
+
* append: the append must carry an inventory-changing document version V --
|
|
23
|
+
* S(V) differs from S(V-1) in either direction, with S(-1) empty for the
|
|
24
|
+
* genesis version -- and no verified entry may already carry V or later
|
|
25
|
+
* (`headControllerVersionIndex >= controllerVersionIndex` refuses; the
|
|
26
|
+
* license is one-shot, so a torn ceremony's late-arriving tail still passes
|
|
27
|
+
* while a second rotation against the same version does not). A `null`
|
|
28
|
+
* controller version index (an unversioned controller, where no version
|
|
29
|
+
* exists to license against) is refused fail-closed.
|
|
30
30
|
*
|
|
31
31
|
* @param options {object}
|
|
32
|
-
* @param options.controller {
|
|
33
|
-
*
|
|
34
|
-
* @param options.
|
|
35
|
-
* index into `controller.versionIds` (`null`:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
32
|
+
* @param options.controller {object} the verified controller view's
|
|
33
|
+
* version list and inventory accessor
|
|
34
|
+
* @param options.controllerVersionIndex {number | null} the append's
|
|
35
|
+
* controller version as an index into `controller.versionIds` (`null`:
|
|
36
|
+
* no controller version)
|
|
37
|
+
* @param options.headControllerVersionIndex {number | null} the verified
|
|
38
|
+
* log head's effective controller version index before this append
|
|
39
|
+
* (`null`: the log has no versioned entries yet)
|
|
39
40
|
* @returns {Promise<void>}
|
|
40
41
|
*/
|
|
41
|
-
export async function assertLadderAppendLicensed({ controller,
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
export async function assertLadderAppendLicensed({ controller, controllerVersionIndex, headControllerVersionIndex }) {
|
|
43
|
+
if (controllerVersionIndex === null ||
|
|
44
|
+
controllerVersionIndex < 0 ||
|
|
45
|
+
controllerVersionIndex >= controller.versionIds.length) {
|
|
45
46
|
throw new ResourceLogLicenseError('A ladder-signed append past the genesis entry cannot be licensed ' +
|
|
46
|
-
'without
|
|
47
|
+
'without a controller document version to license against.');
|
|
47
48
|
}
|
|
48
|
-
const current = (await controller.
|
|
49
|
-
const previous =
|
|
49
|
+
const current = (await controller.inventoryAt(controller.versionIds[controllerVersionIndex])).inventoryKeys;
|
|
50
|
+
const previous = controllerVersionIndex === 0
|
|
50
51
|
? new Set()
|
|
51
|
-
: (await controller.
|
|
52
|
-
.postureKeys;
|
|
52
|
+
: (await controller.inventoryAt(controller.versionIds[controllerVersionIndex - 1])).inventoryKeys;
|
|
53
53
|
if (setsEqual(current, previous)) {
|
|
54
|
-
throw new ResourceLogLicenseError('The ladder-signed append
|
|
55
|
-
'that did not change the credential
|
|
54
|
+
throw new ResourceLogLicenseError('The ladder-signed append carries a controller document version ' +
|
|
55
|
+
'that did not change the credential inventory (a rotation against an ' +
|
|
56
56
|
'unchanged document is never licensed).');
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
if (headControllerVersionIndex !== null &&
|
|
59
|
+
headControllerVersionIndex >= controllerVersionIndex) {
|
|
60
|
+
throw new ResourceLogLicenseError('The verified log head already carries an entry at or past this ' +
|
|
61
|
+
'inventory-changing document version (the license is one-shot).');
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
//# sourceMappingURL=license.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,IAAiB,EAAE,KAAkB;IACtD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/resourceLog/license.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;GAMG;AACH,SAAS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D,MAAM,IAAI,uBAAuB,CAC/B,iEAAiE;YAC/D,gEAAgE,CACnE,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/dist/unlock/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The `@interop/wallet-core/unlock` subpath: standing unlock credentials --
|
|
6
6
|
* every unlock method (passphrase, passkey PRF, recovery code) as a standing
|
|
7
|
-
* credential in the recovery-code
|
|
7
|
+
* credential in the recovery-code configuration, with self-enrolling login. The
|
|
8
8
|
* recovery subpath's spend-on-use flows sit on top of the machinery here.
|
|
9
9
|
*
|
|
10
10
|
* - `standingClientFromUnlockSeed` / `unlockClientIdentityFromSeed` -- the
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
* client-annex Space `delegatedClients` delegations re-mintable; the ladder
|
|
17
17
|
* seed sealed and carried verbatim, its `LADDER_SEED_BYTES` size owned by
|
|
18
18
|
* the record format).
|
|
19
|
-
* - `publishUnlockKey` / `removeUnlockKey` -- the merged document
|
|
19
|
+
* - `publishUnlockKey` / `removeUnlockKey` -- the merged document inventory
|
|
20
20
|
* edit, parameterized by credential class: a verbatim `keyAgreement` entry,
|
|
21
21
|
* or a `MultikeyCommitment` entry for a low-entropy-derived key.
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
|
-
* passphrase" and "remove this passkey": the
|
|
23
|
+
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
25
|
*
|
|
26
26
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
27
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
28
|
-
* `@interop/wallet-core/clientAnnex` -- what stays here is the
|
|
29
|
-
* record machinery every wallet needs regardless of
|
|
28
|
+
* `@interop/wallet-core/clientAnnex` -- what stays here is the inventory and
|
|
29
|
+
* record machinery every wallet needs regardless of account configuration.
|
|
30
30
|
*
|
|
31
31
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
32
32
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
|
@@ -38,5 +38,5 @@ export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, Unlo
|
|
|
38
38
|
export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
39
39
|
export type { StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
|
|
40
40
|
export { retireUnlockCredential } from './retire.js';
|
|
41
|
-
export type {
|
|
41
|
+
export type { ClientAnnexInventoryRetirement, UnlockCredentialRetirementResult } from './retire.js';
|
|
42
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
|
package/dist/unlock/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The `@interop/wallet-core/unlock` subpath: standing unlock credentials --
|
|
6
6
|
* every unlock method (passphrase, passkey PRF, recovery code) as a standing
|
|
7
|
-
* credential in the recovery-code
|
|
7
|
+
* credential in the recovery-code configuration, with self-enrolling login. The
|
|
8
8
|
* recovery subpath's spend-on-use flows sit on top of the machinery here.
|
|
9
9
|
*
|
|
10
10
|
* - `standingClientFromUnlockSeed` / `unlockClientIdentityFromSeed` -- the
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
* client-annex Space `delegatedClients` delegations re-mintable; the ladder
|
|
17
17
|
* seed sealed and carried verbatim, its `LADDER_SEED_BYTES` size owned by
|
|
18
18
|
* the record format).
|
|
19
|
-
* - `publishUnlockKey` / `removeUnlockKey` -- the merged document
|
|
19
|
+
* - `publishUnlockKey` / `removeUnlockKey` -- the merged document inventory
|
|
20
20
|
* edit, parameterized by credential class: a verbatim `keyAgreement` entry,
|
|
21
21
|
* or a `MultikeyCommitment` entry for a low-entropy-derived key.
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
|
-
* passphrase" and "remove this passkey": the
|
|
23
|
+
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
25
|
*
|
|
26
26
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
27
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
28
|
-
* `@interop/wallet-core/clientAnnex` -- what stays here is the
|
|
29
|
-
* record machinery every wallet needs regardless of
|
|
28
|
+
* `@interop/wallet-core/clientAnnex` -- what stays here is the inventory and
|
|
29
|
+
* record machinery every wallet needs regardless of account configuration.
|
|
30
30
|
*
|
|
31
31
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
32
32
|
* was-client dependency graph (the same isolation pattern as `./keyring`).
|
package/dist/unlock/retire.d.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* passphrase" and "remove this passkey", run synchronously in an enrolled
|
|
7
7
|
* client, in dependency order. A standing credential is not a stored string to
|
|
8
8
|
* overwrite -- it holds a wrap in the user key roster and a `keyAgreement`
|
|
9
|
-
*
|
|
9
|
+
* inventory in the account's did:webvh document -- so retiring one is a real
|
|
10
10
|
* rotation, on the same stages the client-revocation cascade runs.
|
|
11
11
|
*
|
|
12
|
-
* 1. **The document
|
|
12
|
+
* 1. **The document inventory edit** (`removeUnlockKey`): the credential's
|
|
13
13
|
* `keyAgreement` entry (verbatim key or commitment) and its committed
|
|
14
14
|
* update-key hash leave the document in one log entry. That kills the
|
|
15
15
|
* credential's latent self-enrollment authority -- with its rung
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* first means a run torn anywhere after it leaves the roster keying a
|
|
27
27
|
* recipient the document no longer backs -- exactly the state the login-time
|
|
28
28
|
* sweep detects and finishes. Torn the other way around, a rotation with the
|
|
29
|
-
*
|
|
29
|
+
* inventory still standing would simply re-escrow the credential and look
|
|
30
30
|
* healthy.
|
|
31
31
|
*
|
|
32
32
|
* There is deliberately no recovery-delegation re-mint stage here (the
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* credential's bridge chains through it.
|
|
37
37
|
*
|
|
38
38
|
* The client annex reach is its own stage (1b, the injected
|
|
39
|
-
* `
|
|
39
|
+
* `retireClientAnnexInventory` closure), between the document edit and the
|
|
40
40
|
* roster tail: a standing credential's annex rung-0 key and hash live in
|
|
41
41
|
* the pointed generation's log, kept nowhere the account document edit can
|
|
42
42
|
* reach, so without it a retired credential keeps annex-write authority
|
|
@@ -49,12 +49,13 @@
|
|
|
49
49
|
* `delegatedClients` sibling: no server revocation is possible or needed --
|
|
50
50
|
* the sibling delegation's record dies with the unlock Space the caller
|
|
51
51
|
* deletes, and a swap (or the ordinary GC cadence) retires the generation it
|
|
52
|
-
* targeted. Best-effort by contract
|
|
53
|
-
*
|
|
54
|
-
* remedy -- always
|
|
52
|
+
* targeted. Best-effort by contract, enforced by the ceremony itself: a
|
|
53
|
+
* throw escaping the closure is caught here and reported as the `failed`
|
|
54
|
+
* skip, so the roster rotation -- the ceremony's essential remedy -- always
|
|
55
|
+
* runs.
|
|
55
56
|
*
|
|
56
57
|
* Convergence is the design: every stage detects its own completion from
|
|
57
|
-
* durable state alone -- the
|
|
58
|
+
* durable state alone -- the inventory edit no-ops when the document is already
|
|
58
59
|
* settled, the rotation no-ops once every current-epoch recipient is
|
|
59
60
|
* document-backed, and a collection is stale exactly when its current epoch
|
|
60
61
|
* names a non-current user key generation -- so a naive full re-run finishes
|
|
@@ -76,7 +77,7 @@ import { type StandingUnlockKeys } from './standingWebvh.js';
|
|
|
76
77
|
* this run (a re-run of an already-complete retirement reports `false`), the
|
|
77
78
|
* roster's seal-backstop report (present when the roster store is sealable and
|
|
78
79
|
* the roster stage ran), the per-collection fan-out result, the document as
|
|
79
|
-
* the
|
|
80
|
+
* the inventory edit left it, and the rotated key with the roster descriptor it
|
|
80
81
|
* was read from.
|
|
81
82
|
*/
|
|
82
83
|
export interface UnlockCredentialRetirementResult {
|
|
@@ -86,40 +87,40 @@ export interface UnlockCredentialRetirementResult {
|
|
|
86
87
|
document: object;
|
|
87
88
|
userKey?: UserKey;
|
|
88
89
|
rosterDescriptor?: CollectionEncryption;
|
|
89
|
-
clientAnnex?:
|
|
90
|
+
clientAnnex?: ClientAnnexInventoryRetirement;
|
|
90
91
|
}
|
|
91
92
|
/**
|
|
92
|
-
* What the annex-
|
|
93
|
+
* What the annex-inventory stage reports: `struck` (a strike entry dropped
|
|
93
94
|
* the retired rung's key and hash), `swapped` (a fresh generation replaced
|
|
94
|
-
* the old one wholesale), `clean` (the pointed generation held no
|
|
95
|
+
* the old one wholesale), `clean` (the pointed generation held no inventory
|
|
95
96
|
* for the retired credential), or `skipped` with the reason (`no-pointer`:
|
|
96
|
-
* the account has no annex
|
|
97
|
-
* no seed that could strike or swap; `failed`: the closure
|
|
98
|
-
*
|
|
97
|
+
* the account has no annex inventory; `no-ladder-seed`: the ceremony holds
|
|
98
|
+
* no seed that could strike or swap; `failed`: the closure reported a
|
|
99
|
+
* failure, or threw and the ceremony caught it).
|
|
99
100
|
*/
|
|
100
|
-
export interface
|
|
101
|
+
export interface ClientAnnexInventoryRetirement {
|
|
101
102
|
action: 'struck' | 'swapped' | 'clean' | 'skipped';
|
|
102
103
|
reason?: 'no-pointer' | 'no-ladder-seed' | 'failed';
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
105
106
|
* Retires one standing unlock credential from an account. See the module doc
|
|
106
|
-
* for the order and the convergence story. Once the
|
|
107
|
+
* for the order and the convergence story. Once the inventory edit lands, a
|
|
107
108
|
* thrown later stage leaves durable state a naive re-run -- or the login-time
|
|
108
109
|
* sweep -- converges from.
|
|
109
110
|
*
|
|
110
111
|
* @param options {object}
|
|
111
112
|
* @param options.idStore {WebvhIdStore} the account's `id` collection store
|
|
112
113
|
* @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
|
|
113
|
-
* client's own did:webvh update-key seeds, which sign the
|
|
114
|
+
* client's own did:webvh update-key seeds, which sign the inventory edit
|
|
114
115
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
115
|
-
* public
|
|
116
|
-
* key, which the
|
|
116
|
+
* public inventory (its key-agreement publication and its recorded update
|
|
117
|
+
* key, which the inventory edit treats as a ladder anchor rather than truth
|
|
117
118
|
* -- see `removeUnlockKey`)
|
|
118
119
|
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
119
120
|
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
120
121
|
* ladder attribution but is not required
|
|
121
122
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
122
|
-
* stored account pointer; supplied, the
|
|
123
|
+
* stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
|
|
123
124
|
* resolving to any other account
|
|
124
125
|
* @param [options.verb] {string} what the caller is doing, for the
|
|
125
126
|
* pending-rotation refusal message (e.g. `'changing your passphrase'`)
|
|
@@ -134,16 +135,16 @@ export interface ClientAnnexPostureRetirement {
|
|
|
134
135
|
* called with `{ userKey, latestEpochId, descriptor }` after the roster read
|
|
135
136
|
* and BEFORE the fan-out. The key and the epoch pin must persist atomically
|
|
136
137
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
137
|
-
* @param [options.
|
|
138
|
-
* Promise<
|
|
139
|
-
* the module doc), run against the post-edit document;
|
|
140
|
-
*
|
|
138
|
+
* @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
|
|
139
|
+
* Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
|
|
140
|
+
* the module doc), run against the post-edit document; a throw is caught
|
|
141
|
+
* and reported as `{ action: 'skipped', reason: 'failed' }`
|
|
141
142
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) =>
|
|
142
143
|
* Promise<void>` -- the live-session adoption of a rotated key, run last so
|
|
143
144
|
* the session keeps operating without a re-login
|
|
144
145
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
145
146
|
*/
|
|
146
|
-
export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections,
|
|
147
|
+
export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted }: {
|
|
147
148
|
idStore: WebvhIdStore;
|
|
148
149
|
updateKeys: ClientWebvhUpdateKeys;
|
|
149
150
|
unlockKeys: StandingUnlockKeys;
|
|
@@ -160,9 +161,9 @@ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys
|
|
|
160
161
|
descriptor: CollectionEncryption;
|
|
161
162
|
}) => Promise<void>;
|
|
162
163
|
collections: CascadeCollections;
|
|
163
|
-
|
|
164
|
+
retireClientAnnexInventory?: (options: {
|
|
164
165
|
document: object;
|
|
165
|
-
}) => Promise<
|
|
166
|
+
}) => Promise<ClientAnnexInventoryRetirement>;
|
|
166
167
|
onRotationAdopted?: (rotation: {
|
|
167
168
|
userKey: UserKey;
|
|
168
169
|
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"m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AgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EAClB,EAAE;IACD,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,qBAAqB,CAAA;IACjC,UAAU,EAAE,kBAAkB,CAAA;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,yBAAyB,CAAA;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,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,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE;QACrC,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAC7C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAiE5C"}
|
package/dist/unlock/retire.js
CHANGED
|
@@ -2,23 +2,23 @@ import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
|
2
2
|
import { removeUnlockKey } from './standingWebvh.js';
|
|
3
3
|
/**
|
|
4
4
|
* Retires one standing unlock credential from an account. See the module doc
|
|
5
|
-
* for the order and the convergence story. Once the
|
|
5
|
+
* for the order and the convergence story. Once the inventory edit lands, a
|
|
6
6
|
* thrown later stage leaves durable state a naive re-run -- or the login-time
|
|
7
7
|
* sweep -- converges from.
|
|
8
8
|
*
|
|
9
9
|
* @param options {object}
|
|
10
10
|
* @param options.idStore {WebvhIdStore} the account's `id` collection store
|
|
11
11
|
* @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
|
|
12
|
-
* client's own did:webvh update-key seeds, which sign the
|
|
12
|
+
* client's own did:webvh update-key seeds, which sign the inventory edit
|
|
13
13
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
14
|
-
* public
|
|
15
|
-
* key, which the
|
|
14
|
+
* public inventory (its key-agreement publication and its recorded update
|
|
15
|
+
* key, which the inventory edit treats as a ladder anchor rather than truth
|
|
16
16
|
* -- see `removeUnlockKey`)
|
|
17
17
|
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
18
18
|
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
19
19
|
* ladder attribution but is not required
|
|
20
20
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
21
|
-
* stored account pointer; supplied, the
|
|
21
|
+
* stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
|
|
22
22
|
* resolving to any other account
|
|
23
23
|
* @param [options.verb] {string} what the caller is doing, for the
|
|
24
24
|
* pending-rotation refusal message (e.g. `'changing your passphrase'`)
|
|
@@ -33,17 +33,17 @@ import { removeUnlockKey } from './standingWebvh.js';
|
|
|
33
33
|
* called with `{ userKey, latestEpochId, descriptor }` after the roster read
|
|
34
34
|
* and BEFORE the fan-out. The key and the epoch pin must persist atomically
|
|
35
35
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
36
|
-
* @param [options.
|
|
37
|
-
* Promise<
|
|
38
|
-
* the module doc), run against the post-edit document;
|
|
39
|
-
*
|
|
36
|
+
* @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
|
|
37
|
+
* Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
|
|
38
|
+
* the module doc), run against the post-edit document; a throw is caught
|
|
39
|
+
* and reported as `{ action: 'skipped', reason: 'failed' }`
|
|
40
40
|
* @param [options.onRotationAdopted] {Function} `({ userKey }) =>
|
|
41
41
|
* Promise<void>` -- the live-session adoption of a rotated key, run last so
|
|
42
42
|
* the session keeps operating without a re-login
|
|
43
43
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
44
44
|
*/
|
|
45
|
-
export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections,
|
|
46
|
-
// 1. The document
|
|
45
|
+
export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted }) {
|
|
46
|
+
// 1. The document inventory edit -- the credential's standing, first. It
|
|
47
47
|
// resolves the document as it now stands, which is what stage 2 resolves
|
|
48
48
|
// its remaining recipients from.
|
|
49
49
|
const { did, doc, log } = await removeUnlockKey({
|
|
@@ -55,10 +55,19 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
55
55
|
...(verb !== undefined ? { verb } : {})
|
|
56
56
|
});
|
|
57
57
|
// 1b. The annex reach, against the post-edit document: strike the
|
|
58
|
-
// retired credential's rung
|
|
59
|
-
// the generation out from under it. Best-effort by
|
|
60
|
-
//
|
|
61
|
-
|
|
58
|
+
// retired credential's rung inventory out of the pointed generation, or swap
|
|
59
|
+
// the generation out from under it. Best-effort by contract, enforced here:
|
|
60
|
+
// a throw escaping the closure maps to the `failed` skip, so the roster
|
|
61
|
+
// rotation below always runs.
|
|
62
|
+
let clientAnnex;
|
|
63
|
+
if (retireClientAnnexInventory) {
|
|
64
|
+
try {
|
|
65
|
+
clientAnnex = await retireClientAnnexInventory({ document: doc });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
clientAnnex = { action: 'skipped', reason: 'failed' };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
62
71
|
// 2. The shared roster-and-cascade tail: the roster rotation onto the
|
|
63
72
|
// post-edit document (with its post-edit controller floor and its seal
|
|
64
73
|
// backstop), then the collection fan-out onto the fresh key.
|
|
@@ -74,7 +83,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
|
|
|
74
83
|
collections
|
|
75
84
|
});
|
|
76
85
|
if (!tail.rosterDescriptor || !tail.userKey) {
|
|
77
|
-
// No roster to rotate: the
|
|
86
|
+
// No roster to rotate: the inventory edit has landed, so the credential IS
|
|
78
87
|
// retired -- a completed ceremony with nothing rotated.
|
|
79
88
|
return {
|
|
80
89
|
rotated: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAuEA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAA;AAkC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EAsBlB;IACC,yEAAyE;IACzE,yEAAyE;IACzE,iCAAiC;IACjC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,eAAe,CAAC;QAC9C,OAAO;QACP,UAAU;QACV,UAAU;QACV,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,GAAG,CAAC,WAAW,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;SACxC,CAAA;IACH,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAA;AACH,CAAC"}
|
|
@@ -32,7 +32,7 @@ export interface UnlockClientIdentity {
|
|
|
32
32
|
* Assembles a client identity from its 32-byte client seed: the one place the
|
|
33
33
|
* agents, multibases, and roster kid are derived, shared by the standing
|
|
34
34
|
* credential derivation here and the recovery code's
|
|
35
|
-
* (`recoveryClientFromCode`), so the two
|
|
35
|
+
* (`recoveryClientFromCode`), so the two derivations can never disagree on how a
|
|
36
36
|
* seed becomes an identity.
|
|
37
37
|
*
|
|
38
38
|
* @param options {object}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The standing unlock credential's client identity: the deterministic key set
|
|
6
6
|
* every unlock method (a passphrase, a passkey PRF output) derives from its
|
|
7
|
-
* own unlock seed under the standing-credential
|
|
8
|
-
*
|
|
7
|
+
* own unlock seed under the standing-credential configuration -- the recovery-code
|
|
8
|
+
* configuration minus spend-on-use. The credential's key-agreement key holds a
|
|
9
9
|
* standing wrap in the user key roster (escrowed into every epoch, kept alive
|
|
10
10
|
* by rotation fan-out), and its binding MAC key authenticates the unlock
|
|
11
11
|
* record's account core, so a fresh browser holding nothing but the
|
|
@@ -37,7 +37,7 @@ const STANDING_BINDING_MAC_INFO = 'binding-mac';
|
|
|
37
37
|
* Assembles a client identity from its 32-byte client seed: the one place the
|
|
38
38
|
* agents, multibases, and roster kid are derived, shared by the standing
|
|
39
39
|
* credential derivation here and the recovery code's
|
|
40
|
-
* (`recoveryClientFromCode`), so the two
|
|
40
|
+
* (`recoveryClientFromCode`), so the two derivations can never disagree on how a
|
|
41
41
|
* seed becomes an identity.
|
|
42
42
|
*
|
|
43
43
|
* @param options {object}
|