@interop/wallet-core 0.51.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 +2 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +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 +33 -20
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +43 -17
- 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 +5 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +4 -4
- 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 +1 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +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 +5 -9
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
2
|
-
import { type ResourceLogStore } from '@interop/
|
|
3
|
-
import
|
|
2
|
+
import { type ResourceLogPinStore, type ResourceLogSigner, type ResourceLogStore } from '@interop/vh-resource-log';
|
|
3
|
+
import type { WebvhResourceLogController } from '../resourceLog/index.js';
|
|
4
4
|
import { EPOCH_CONFIGURATION_STATE_TYPE } from '../descriptors/logSource.js';
|
|
5
5
|
export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
6
6
|
/**
|
|
@@ -8,9 +8,10 @@ export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
|
8
8
|
* log, and can therefore be SEALED: `seal()` runs the sealing sweep
|
|
9
9
|
* (`sealResourceLog`) against the caller's currently verified controller
|
|
10
10
|
* view, appending the idempotent no-op backstop entry when the log's head
|
|
11
|
-
* still
|
|
12
|
-
* `'sealed'` -- and writing nothing when the log is
|
|
13
|
-
* or has no membership change to seal against --
|
|
11
|
+
* still carries a controller version before the controller's latest
|
|
12
|
+
* membership change -- `'sealed'` -- and writing nothing when the log is
|
|
13
|
+
* already sealed, absent, or has no membership change to seal against --
|
|
14
|
+
* `'noop'`.
|
|
14
15
|
*
|
|
15
16
|
* `setControllerFloor()` is the post-edit freshness contract: a ceremony that
|
|
16
17
|
* just extended the account log (a revocation about to rotate the roster)
|
|
@@ -18,14 +19,14 @@ export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
|
18
19
|
* store's subsequent operations never resolve to anything staler. The
|
|
19
20
|
* injected `resolveController` still wins whenever it is at or past the floor
|
|
20
21
|
* (it may be fresher -- a concurrent enrollment), so the floor supersedes
|
|
21
|
-
* only a stale cached view, which would otherwise
|
|
22
|
-
* the edit and leave the log unsealed with the
|
|
23
|
-
* removal.
|
|
22
|
+
* only a stale cached view, which would otherwise carry the rotation's
|
|
23
|
+
* controller version before the edit and leave the log unsealed with the
|
|
24
|
+
* seal backstop blind to the removal.
|
|
24
25
|
*/
|
|
25
26
|
export interface SealableEncryptionDescriptorStore extends EncryptionDescriptorStore {
|
|
26
27
|
seal(): Promise<'sealed' | 'noop'>;
|
|
27
28
|
setControllerFloor(options: {
|
|
28
|
-
controller:
|
|
29
|
+
controller: WebvhResourceLogController;
|
|
29
30
|
}): void;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
@@ -43,7 +44,7 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
43
44
|
*
|
|
44
45
|
* The controller view is resolved per operation (never held), so a caller
|
|
45
46
|
* that just edited the account document -- a revocation about to rotate the
|
|
46
|
-
* roster -- writes entries
|
|
47
|
+
* roster -- writes entries carrying the post-edit head it now verifies,
|
|
47
48
|
* which is exactly what makes its rotation the sealing append. The revocation
|
|
48
49
|
* orchestrator does not leave that freshness to the injected resolver's
|
|
49
50
|
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
@@ -52,9 +53,10 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
52
53
|
*
|
|
53
54
|
* @param options {object}
|
|
54
55
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
55
|
-
* @param options.resolveController {function}
|
|
56
|
-
* -- the caller's currently
|
|
57
|
-
* (`webvhResourceLogController` over a
|
|
56
|
+
* @param options.resolveController {function}
|
|
57
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
58
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
59
|
+
* `verifyAccountLog` result)
|
|
58
60
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head pin
|
|
59
61
|
* for this log
|
|
60
62
|
* @param options.logId {string} the pin-slot key for this log, from
|
|
@@ -65,7 +67,7 @@ export declare function isSealableDescriptorStore(store: EncryptionDescriptorSto
|
|
|
65
67
|
*/
|
|
66
68
|
export declare function logGovernedDescriptorStore({ log, resolveController, pinStore, logId, signer }: {
|
|
67
69
|
log: ResourceLogStore;
|
|
68
|
-
resolveController: () => Promise<
|
|
70
|
+
resolveController: () => Promise<WebvhResourceLogController>;
|
|
69
71
|
pinStore: ResourceLogPinStore;
|
|
70
72
|
logId: string;
|
|
71
73
|
signer: ResourceLogSigner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rosterLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EACL,8BAA8B,EAE/B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,8BAA8B,EAAE,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,iCAAkC,SAAQ,yBAAyB;IAClF,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAA;IAClC,kBAAkB,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,0BAA0B,CAAA;KAAE,GAAG,IAAI,CAAA;CAC9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,yBAAyB,GAC/B,KAAK,IAAI,iCAAiC,CAK5C;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACL,MAAM,EACP,EAAE;IACD,GAAG,EAAE,gBAAgB,CAAA;IACrB,iBAAiB,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAC5D,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iCAAiC,CAkOpC"}
|
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The log-governed descriptor store: an `EncryptionDescriptorStore` whose
|
|
6
|
+
* resource is governed by a resource log (the Resource Log Profile). Reads
|
|
7
|
+
* resolve to the VERIFIED head entry's state -- chain, proofs, external
|
|
8
|
+
* authorization, and the chain-head pin all checked before any descriptor is
|
|
9
|
+
* handed out -- and writes become signed log appends. Because the seam is
|
|
10
|
+
* unchanged, all of
|
|
11
|
+
* was-client's roster machinery (`initRecipients` / `addRecipient` /
|
|
12
|
+
* `removeRecipient`, with their compare-and-swap retry loops) drives the log
|
|
13
|
+
* without knowing it: a CAS conflict on the log (the library's
|
|
14
|
+
* `ResourceLogConflictError`, minted by the store adapter) is translated
|
|
15
|
+
* back to the `PreconditionFailedError` those loops already rebase on, at
|
|
16
|
+
* this boundary -- the `EncryptionDescriptorStore` port documents that
|
|
17
|
+
* class, and was-client's edv recipient loops match on it.
|
|
18
|
+
*
|
|
19
|
+
* This is the enforcement point for "roster state is adopted only from a
|
|
20
|
+
* verified log head": there is no read path around the verifier, and the
|
|
21
|
+
* retired detached `epochsSig` has no successor to check -- the entry
|
|
22
|
+
* proof's controller versionId in the did:webvh document took over its job
|
|
23
|
+
* wholesale.
|
|
24
|
+
*
|
|
25
|
+
* The store is {@link SealableEncryptionDescriptorStore}: `seal()` exposes
|
|
26
|
+
* the resource-log sealing sweep through the descriptor-store seam, so the
|
|
27
|
+
* ceremonies and the login sweep can close the one durable gap the recipient
|
|
28
|
+
* machinery leaves -- a rotation that no-ops (the retiree held no
|
|
29
|
+
* current-epoch wrap) appends nothing, leaving the log's head carrying a
|
|
30
|
+
* controller version before the membership change it should have sealed.
|
|
31
|
+
*/
|
|
32
|
+
import { PreconditionFailedError } from '@interop/was-client';
|
|
33
|
+
import { RESOURCE_LOG_METHOD } from '@interop/storage-core';
|
|
34
|
+
import { buildResourceLogEntry, buildResourceLogGenesis, confirmAppend, isResourceLogConflictError, ResourceLogClosedError, sealResourceLog, verifyResourceLog, verifyResourceLogAppend } from '@interop/vh-resource-log';
|
|
3
35
|
import { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration } from '../descriptors/logSource.js';
|
|
4
36
|
export { EPOCH_CONFIGURATION_STATE_TYPE };
|
|
5
37
|
/**
|
|
@@ -15,12 +47,32 @@ export function isSealableDescriptorStore(store) {
|
|
|
15
47
|
return (typeof store.seal ===
|
|
16
48
|
'function');
|
|
17
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Translates the log-store port's CAS conflict (the library's
|
|
52
|
+
* `ResourceLogConflictError`, matched by `name` -- it is minted in the store
|
|
53
|
+
* adapter's package, which may resolve its own library copy) into the
|
|
54
|
+
* `PreconditionFailedError` the `EncryptionDescriptorStore` port documents
|
|
55
|
+
* and was-client's edv recipient loops rebase on. Any other error -- an
|
|
56
|
+
* untranslated `PreconditionFailedError` included -- returns unchanged.
|
|
57
|
+
*
|
|
58
|
+
* @param err {unknown}
|
|
59
|
+
* @returns {unknown} the error to rethrow
|
|
60
|
+
*/
|
|
61
|
+
function asDescriptorStoreConflict(err) {
|
|
62
|
+
if (isResourceLogConflictError(err)) {
|
|
63
|
+
return new PreconditionFailedError(err.message, {
|
|
64
|
+
status: 412,
|
|
65
|
+
cause: err
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return err;
|
|
69
|
+
}
|
|
18
70
|
/**
|
|
19
71
|
* Builds the log-governed `EncryptionDescriptorStore`.
|
|
20
72
|
*
|
|
21
73
|
* The controller view is resolved per operation (never held), so a caller
|
|
22
74
|
* that just edited the account document -- a revocation about to rotate the
|
|
23
|
-
* roster -- writes entries
|
|
75
|
+
* roster -- writes entries carrying the post-edit head it now verifies,
|
|
24
76
|
* which is exactly what makes its rotation the sealing append. The revocation
|
|
25
77
|
* orchestrator does not leave that freshness to the injected resolver's
|
|
26
78
|
* wiring: it calls `setControllerFloor` with the view built from the edit's
|
|
@@ -29,9 +81,10 @@ export function isSealableDescriptorStore(store) {
|
|
|
29
81
|
*
|
|
30
82
|
* @param options {object}
|
|
31
83
|
* @param options.log {ResourceLogStore} the log's transport seam
|
|
32
|
-
* @param options.resolveController {function}
|
|
33
|
-
* -- the caller's currently
|
|
34
|
-
* (`webvhResourceLogController` over a
|
|
84
|
+
* @param options.resolveController {function}
|
|
85
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
86
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
87
|
+
* `verifyAccountLog` result)
|
|
35
88
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head pin
|
|
36
89
|
* for this log
|
|
37
90
|
* @param options.logId {string} the pin-slot key for this log, from
|
|
@@ -45,6 +98,11 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
45
98
|
// a replace builds its entry on that head, pinned to the same read's etag,
|
|
46
99
|
// so a stale head loses the CAS instead of forking.
|
|
47
100
|
let lastVerified = null;
|
|
101
|
+
// The controller view `lastVerified` was verified under: the library's
|
|
102
|
+
// pre-write pass reads the head's controller version as an index into
|
|
103
|
+
// THAT view's version list, so a replace may only run it against a view
|
|
104
|
+
// this one is a prefix of.
|
|
105
|
+
let lastVerifiedView = null;
|
|
48
106
|
// The freshness floor a post-edit ceremony set (see the interface doc).
|
|
49
107
|
let controllerFloor = null;
|
|
50
108
|
async function currentController() {
|
|
@@ -75,20 +133,27 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
75
133
|
});
|
|
76
134
|
await pinStore.write({ logId, pin: confirmed.pin });
|
|
77
135
|
lastVerified = confirmed;
|
|
136
|
+
lastVerifiedView = controller;
|
|
78
137
|
}
|
|
79
138
|
return {
|
|
80
139
|
async read() {
|
|
140
|
+
let view = null;
|
|
81
141
|
const current = await readGovernedEpochConfiguration({
|
|
82
142
|
store: log,
|
|
83
|
-
resolveController:
|
|
143
|
+
resolveController: async () => {
|
|
144
|
+
view = await currentController();
|
|
145
|
+
return view;
|
|
146
|
+
},
|
|
84
147
|
pinStore,
|
|
85
148
|
logId
|
|
86
149
|
});
|
|
87
150
|
if (current === null) {
|
|
88
151
|
lastVerified = null;
|
|
152
|
+
lastVerifiedView = null;
|
|
89
153
|
return null;
|
|
90
154
|
}
|
|
91
155
|
lastVerified = current.verified;
|
|
156
|
+
lastVerifiedView = view;
|
|
92
157
|
return {
|
|
93
158
|
descriptor: current.descriptor,
|
|
94
159
|
etag: current.etag
|
|
@@ -107,22 +172,18 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
107
172
|
throw new ResourceLogClosedError({ nextLog: lastVerified.terminal });
|
|
108
173
|
}
|
|
109
174
|
const controller = await currentController();
|
|
110
|
-
// The
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
// the
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
? null
|
|
123
|
-
: controller.versionIds.length - 1,
|
|
124
|
-
headAnchorIndex: lastVerified.headAnchorIndex
|
|
125
|
-
});
|
|
175
|
+
// The pre-write pass's precondition, enforced rather than assumed: the
|
|
176
|
+
// view that verified `lastVerified` must be a prefix of this one (the
|
|
177
|
+
// account log is append-only, so carrying its head version is enough).
|
|
178
|
+
// A resolver that regressed is reported as the port's conflict class,
|
|
179
|
+
// so the edv machinery re-reads under the current view and rebases
|
|
180
|
+
// instead of the pass refusing on a floor that indexes another list.
|
|
181
|
+
const verifiedHead = lastVerifiedView?.versionIds[lastVerifiedView.versionIds.length - 1];
|
|
182
|
+
if (verifiedHead !== undefined &&
|
|
183
|
+
!controller.versionIds.includes(verifiedHead)) {
|
|
184
|
+
throw new PreconditionFailedError('Cannot replace the governed descriptor: the controller view ' +
|
|
185
|
+
`resolved for this write does not carry version "${verifiedHead}", ` +
|
|
186
|
+
'which the preceding read verified against; re-read and retry.', { status: 412 });
|
|
126
187
|
}
|
|
127
188
|
const entry = await buildResourceLogEntry({
|
|
128
189
|
head: lastVerified.head,
|
|
@@ -130,9 +191,28 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
130
191
|
controller,
|
|
131
192
|
signer
|
|
132
193
|
});
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
|
|
194
|
+
// The library's pre-write pass, run BEFORE the append lands: the entry
|
|
195
|
+
// is verified as a reader would verify it at its ordinal (shape, chain,
|
|
196
|
+
// proof, membership at the head's controller version, and the
|
|
197
|
+
// controller's `admitAppend` hook carrying the ceremony-tail license).
|
|
198
|
+
// Read-back would refuse the same entry anyway, but only after it
|
|
199
|
+
// poisoned the served log for every reader.
|
|
200
|
+
await verifyResourceLogAppend({
|
|
201
|
+
entry,
|
|
202
|
+
controller,
|
|
203
|
+
head: lastVerified
|
|
204
|
+
});
|
|
205
|
+
// A stale validator throws the library's conflict error here,
|
|
206
|
+
// translated back to the PreconditionFailedError the edv machinery's
|
|
207
|
+
// CAS loop re-reads and rebases on (the descriptor-store port's
|
|
208
|
+
// documented class). An untranslated PreconditionFailedError from a
|
|
209
|
+
// store passes through unchanged, already satisfying the port.
|
|
210
|
+
try {
|
|
211
|
+
await log.append(entry, { ifMatch });
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
throw asDescriptorStoreConflict(err);
|
|
215
|
+
}
|
|
136
216
|
await settle({ entry, controller });
|
|
137
217
|
},
|
|
138
218
|
async create(descriptor) {
|
|
@@ -143,17 +223,53 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
143
223
|
controller,
|
|
144
224
|
signer
|
|
145
225
|
});
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
|
|
226
|
+
// The pre-write pass for a genesis: verified as a one-entry log before
|
|
227
|
+
// anything is created, so a non-member signer never leaves behind a
|
|
228
|
+
// log no reader accepts. `pin: null` is deliberate: the candidate is
|
|
229
|
+
// not served history, and continuity belongs to the read-back.
|
|
230
|
+
try {
|
|
231
|
+
await verifyResourceLog({
|
|
232
|
+
entries: [genesis],
|
|
233
|
+
controller,
|
|
234
|
+
expectedMethod: RESOURCE_LOG_METHOD,
|
|
235
|
+
pin: null
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
// A refused genesis against a log that already exists is a lost
|
|
240
|
+
// create race (matched by name: the class may come from another
|
|
241
|
+
// library copy), translated to the port's conflict class so the edv
|
|
242
|
+
// machinery re-reads and adopts the winner's descriptor. With no log
|
|
243
|
+
// served, or on any other class (a port bug), the error propagates
|
|
244
|
+
// with nothing adopted.
|
|
245
|
+
if (!(err instanceof Error && err.name === 'ResourceLogIntegrityError')) {
|
|
246
|
+
throw err;
|
|
247
|
+
}
|
|
248
|
+
if ((await log.read()) === null) {
|
|
249
|
+
throw err;
|
|
250
|
+
}
|
|
251
|
+
throw new PreconditionFailedError('The resource log create lost its guarded-create race: the genesis ' +
|
|
252
|
+
`was refused pre-write (${err.message}) and a log is already ` +
|
|
253
|
+
'served; re-read and adopt it.', { status: 412, cause: err });
|
|
254
|
+
}
|
|
255
|
+
// A lost guarded-create race throws the library's conflict error,
|
|
256
|
+
// translated so the edv machinery re-reads and adopts the winner's
|
|
257
|
+
// descriptor.
|
|
258
|
+
try {
|
|
259
|
+
await log.create(genesis);
|
|
260
|
+
}
|
|
261
|
+
catch (err) {
|
|
262
|
+
throw asDescriptorStoreConflict(err);
|
|
263
|
+
}
|
|
149
264
|
await settle({ entry: genesis, controller });
|
|
150
265
|
},
|
|
151
266
|
async seal() {
|
|
152
267
|
const controller = await currentController();
|
|
153
268
|
// Reuse the log view the most recent read or confirmed append on this
|
|
154
|
-
// store instance verified: a rotation that just appended
|
|
155
|
-
// the removal, so the sweep resolves noop with no
|
|
156
|
-
// view is safe (sealResourceLog's append path
|
|
269
|
+
// store instance verified: a rotation that just appended carries a
|
|
270
|
+
// version past the removal, so the sweep resolves noop with no
|
|
271
|
+
// re-fetch, and a stale view is safe (sealResourceLog's append path
|
|
272
|
+
// re-reads before writing).
|
|
157
273
|
const { sealed, verified } = await sealResourceLog({
|
|
158
274
|
store: log,
|
|
159
275
|
controller,
|
|
@@ -165,6 +281,7 @@ export function logGovernedDescriptorStore({ log, resolveController, pinStore, l
|
|
|
165
281
|
});
|
|
166
282
|
if (verified !== null) {
|
|
167
283
|
lastVerified = verified;
|
|
284
|
+
lastVerifiedView = controller;
|
|
168
285
|
}
|
|
169
286
|
return sealed ? 'sealed' : 'noop';
|
|
170
287
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rosterLogStore.js","sourceRoot":"","sources":["../../src/keys/rosterLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,uBAAuB,EAExB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAKxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,8BAA8B,EAAE,CAAA;AA2BzC;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAgC;IAEhC,OAAO,CACL,OAAQ,KAAoD,CAAC,IAAI;QACjE,UAAU,CACX,CAAA;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,yBAAyB,CAAC,GAAY;IAC7C,IAAI,0BAA0B,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,uBAAuB,CAAE,GAAa,CAAC,OAAO,EAAE;YACzD,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;SACX,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,GAAG,EACH,iBAAiB,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C,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAA;YACtC,CAAC;YACD,MAAM,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAA;QAC9C,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,UAAU,GAAG,MAAM,iBAAiB,EAAE,CAAA;YAC5C,sEAAsE;YACtE,mEAAmE;YACnE,+DAA+D;YAC/D,oEAAoE;YACpE,4BAA4B;YAC5B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,CAAC;gBACjD,KAAK,EAAE,GAAG;gBACV,UAAU;gBACV,cAAc,EAAE,mBAAmB;gBACnC,QAAQ;gBACR,KAAK;gBACL,MAAM;gBACN,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;aAC7D,CAAC,CAAA;YACF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,YAAY,GAAG,QAAQ,CAAA;gBACvB,gBAAgB,GAAG,UAAU,CAAA;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAA;QACnC,CAAC;QAED,kBAAkB,CAAC,EAAE,UAAU,EAAE;YAC/B,eAAe,GAAG,UAAU,CAAA;QAC9B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type IZcap } from '@interop/was-client';
|
|
20
20
|
import type { ZcapClient } from '@interop/ezcap';
|
|
21
|
-
import { type
|
|
21
|
+
import { type ResourceLogPinStore, type ResourceLogSigner } from '@interop/vh-resource-log';
|
|
22
|
+
import type { WebvhResourceLogController } from '../resourceLog/index.js';
|
|
22
23
|
import { type SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
23
24
|
/**
|
|
24
25
|
* The pin-slot key for a Space's user key roster log
|
|
@@ -42,17 +43,17 @@ export declare function userKeyRosterPinId({ spaceId }: {
|
|
|
42
43
|
* @param options.zcapClient {ZcapClient} the session's root signing client
|
|
43
44
|
* @param options.spaceId {string} the data Space id
|
|
44
45
|
* @param options.resolveController {function}
|
|
45
|
-
* `() => Promise<
|
|
46
|
-
* controller view (`webvhResourceLogController` over a
|
|
47
|
-
* result), resolved per operation so post-edit writers
|
|
48
|
-
* they just verified
|
|
46
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
47
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
48
|
+
* `verifyAccountLog` result), resolved per operation so post-edit writers
|
|
49
|
+
* anchor at the head they just verified
|
|
49
50
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
50
51
|
* pin for the roster log
|
|
51
52
|
* @param options.signer {ResourceLogSigner} this client's enrolled signing
|
|
52
53
|
* key ({@link userKeyRosterLogSigner})
|
|
53
54
|
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
54
55
|
* every roster request (a delegated Space-subtree zcap -- the transient
|
|
55
|
-
*
|
|
56
|
+
* session's generation delegation); absent, requests invoke the root
|
|
56
57
|
* capability as before
|
|
57
58
|
* @returns {SealableEncryptionDescriptorStore}
|
|
58
59
|
*/
|
|
@@ -60,7 +61,7 @@ export declare function userKeyRosterDescriptorStore({ storageServerUrl, zcapCli
|
|
|
60
61
|
storageServerUrl: string;
|
|
61
62
|
zcapClient: ZcapClient;
|
|
62
63
|
spaceId: string;
|
|
63
|
-
resolveController: () => Promise<
|
|
64
|
+
resolveController: () => Promise<WebvhResourceLogController>;
|
|
64
65
|
pinStore: ResourceLogPinStore;
|
|
65
66
|
signer: ResourceLogSigner;
|
|
66
67
|
capability?: IZcap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":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18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { WasClient } from '@interop/was-client';
|
|
20
20
|
import { resourceLogStore } from '@interop/was-client/log';
|
|
21
|
-
import { resourceLogPinId } from '
|
|
21
|
+
import { resourceLogPinId } from '@interop/vh-resource-log';
|
|
22
22
|
import { KEY_MAP_COLLECTION, USER_KEY_ROSTER_LOG_RESOURCE } from '../space/collections.js';
|
|
23
23
|
import { logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
24
24
|
/**
|
|
@@ -47,17 +47,17 @@ export function userKeyRosterPinId({ spaceId }) {
|
|
|
47
47
|
* @param options.zcapClient {ZcapClient} the session's root signing client
|
|
48
48
|
* @param options.spaceId {string} the data Space id
|
|
49
49
|
* @param options.resolveController {function}
|
|
50
|
-
* `() => Promise<
|
|
51
|
-
* controller view (`webvhResourceLogController` over a
|
|
52
|
-
* result), resolved per operation so post-edit writers
|
|
53
|
-
* they just verified
|
|
50
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
51
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
52
|
+
* `verifyAccountLog` result), resolved per operation so post-edit writers
|
|
53
|
+
* anchor at the head they just verified
|
|
54
54
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
55
55
|
* pin for the roster log
|
|
56
56
|
* @param options.signer {ResourceLogSigner} this client's enrolled signing
|
|
57
57
|
* key ({@link userKeyRosterLogSigner})
|
|
58
58
|
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
59
59
|
* every roster request (a delegated Space-subtree zcap -- the transient
|
|
60
|
-
*
|
|
60
|
+
* session's generation delegation); absent, requests invoke the root
|
|
61
61
|
* capability as before
|
|
62
62
|
* @returns {SealableEncryptionDescriptorStore}
|
|
63
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterStore.js","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;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AC;YACpB,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,4BAA4B,CAAC;SAC5D,CAAC;QACF,iBAAiB;QACjB,QAAQ;QACR,KAAK,EAAE,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC;QACtC,MAAM;KACP,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -115,7 +115,7 @@ export declare function ensureIndexedFirstEpoch({ collection, recipients }: {
|
|
|
115
115
|
* declared encrypted
|
|
116
116
|
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
117
117
|
* every collection request (a delegated Space-subtree zcap -- the transient
|
|
118
|
-
*
|
|
118
|
+
* session's generation delegation, for the tear heal on a promoted
|
|
119
119
|
* ladder-anchored account); absent, requests invoke the root capability
|
|
120
120
|
* @returns {Promise<WalletSpaceEpochsResult>} per collection id, the settled
|
|
121
121
|
* descriptor and whether this call installed its epoch[0] (`false` means an
|
package/dist/keys/spaceEpochs.js
CHANGED
|
@@ -83,7 +83,7 @@ export async function ensureIndexedFirstEpoch({ collection, recipients }) {
|
|
|
83
83
|
* declared encrypted
|
|
84
84
|
* @param [options.capability] {IZcap} an invocation capability attached to
|
|
85
85
|
* every collection request (a delegated Space-subtree zcap -- the transient
|
|
86
|
-
*
|
|
86
|
+
* session's generation delegation, for the tear heal on a promoted
|
|
87
87
|
* ladder-anchored account); absent, requests invoke the root capability
|
|
88
88
|
* @returns {Promise<WalletSpaceEpochsResult>} per collection id, the settled
|
|
89
89
|
* descriptor and whether this call installed its epoch[0] (`false` means an
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
51
51
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
52
52
|
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv';
|
|
53
|
-
import { type ResourceLogSigner } from '
|
|
53
|
+
import { type ResourceLogSigner } from '@interop/vh-resource-log';
|
|
54
54
|
import type { KeyAgreementDocument } from '../webvh/keyAgreement.js';
|
|
55
55
|
import { type ICapabilityAgent } from '../webvh/zcap.js';
|
|
56
56
|
import type { UserKey } from './userKey.js';
|
|
@@ -242,7 +242,7 @@ export declare function rotateUserKeyRoster({ store, document, retireRecipientId
|
|
|
242
242
|
* in ONE descriptor write -- the transient-recovery continuation's mandatory
|
|
243
243
|
* rotation. The shape is forced by the ceremony-tail license: on a client-less
|
|
244
244
|
* account the only roster signer is the ladder VM, whose append is one-shot at
|
|
245
|
-
* the continuation's
|
|
245
|
+
* the continuation's inventory-changing document entry, so the retiring wrap
|
|
246
246
|
* (the spent code's), the incoming recipients (the fresh credential's standing
|
|
247
247
|
* key and the replacement code's), and the fresh-epoch mint must all land in a
|
|
248
248
|
* single append. Composition of was-client's `replaceRecipient` with the same
|
|
@@ -252,7 +252,7 @@ export declare function rotateUserKeyRoster({ store, document, retireRecipientId
|
|
|
252
252
|
*
|
|
253
253
|
* The incoming recipients' keys are supplied by the caller (it derived them);
|
|
254
254
|
* the document must already back them -- the continuation's own entry
|
|
255
|
-
* published their
|
|
255
|
+
* published their inventory -- or the next rotation would drop them.
|
|
256
256
|
*
|
|
257
257
|
* @param options {object}
|
|
258
258
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyRoster.d.ts","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAOL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"userKeyRoster.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G,IAAI,CAAA;CAC9B,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addRecipient, initRecipients, ownerRecipient, removeRecipient, replaceRecipient, unwrapEpochSecret } from '@interop/was-client/edv';
|
|
2
|
-
import { vmFragmentOf } from '
|
|
2
|
+
import { vmFragmentOf } from '@interop/vh-resource-log';
|
|
3
3
|
import { commitmentMatcher, MULTIKEY_COMMITMENT_VM_TYPE } from '../webvh/didWebvh.js';
|
|
4
4
|
import { resolvedKeyAgreementMethods } from '../webvh/keyAgreement.js';
|
|
5
5
|
import { clientSigningKeyMultibase } from '../webvh/zcap.js';
|
|
@@ -261,7 +261,7 @@ export async function rotateUserKeyRoster({ store, document, retireRecipientId }
|
|
|
261
261
|
* in ONE descriptor write -- the transient-recovery continuation's mandatory
|
|
262
262
|
* rotation. The shape is forced by the ceremony-tail license: on a client-less
|
|
263
263
|
* account the only roster signer is the ladder VM, whose append is one-shot at
|
|
264
|
-
* the continuation's
|
|
264
|
+
* the continuation's inventory-changing document entry, so the retiring wrap
|
|
265
265
|
* (the spent code's), the incoming recipients (the fresh credential's standing
|
|
266
266
|
* key and the replacement code's), and the fresh-epoch mint must all land in a
|
|
267
267
|
* single append. Composition of was-client's `replaceRecipient` with the same
|
|
@@ -271,7 +271,7 @@ export async function rotateUserKeyRoster({ store, document, retireRecipientId }
|
|
|
271
271
|
*
|
|
272
272
|
* The incoming recipients' keys are supplied by the caller (it derived them);
|
|
273
273
|
* the document must already back them -- the continuation's own entry
|
|
274
|
-
* published their
|
|
274
|
+
* published their inventory -- or the next rotation would drop them.
|
|
275
275
|
*
|
|
276
276
|
* @param options {object}
|
|
277
277
|
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userKeyRoster.js","sourceRoot":"","sources":["../../src/keys/userKeyRoster.ts"],"names":[],"mappings":"AAmDA,OAAO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AAY,CAAE,CAAC,UAAU,CAAC,IAAI,CAC7D,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,qBAAqB,CAAC,EAAE,CAC/D,CAAA;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,wBAAwB,CAChC,oEAAoE,CACrE,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC;YACrC,KAAK;YACL,eAAe,EAAE,qBAAqB;SACvC,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,wBAAwB,CAChC,uDAAuD,CACxD,CAAA;QACH,CAAC;QACD,cAAc,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,YAAa,EAAE,MAAM,EAAE,CAAA;QACzD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC;IAED,OAAO;QACL,UAAU;QACV,OAAO,EAAE,cAAc;QACvB,OAAO;QACP,aAAa,EAAE,UAAU,CAAC,YAAa;KACxC,CAAA;AACH,CAAC"}
|
package/dist/recovery/index.d.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* code-derived key, so a storage host can never redirect recovery at
|
|
23
23
|
* another account.
|
|
24
24
|
* - `publishRecoveryKey` / `removeRecoveryKey` / `recoverWebvhClient` -- the
|
|
25
|
-
* document half: issuance's split
|
|
26
|
-
* wrappers over the unlock subpath's merged
|
|
25
|
+
* document half: issuance's split configuration and revocation's removal (thin
|
|
26
|
+
* wrappers over the unlock subpath's merged inventory core) and the
|
|
27
27
|
* self-enrolling recovery continuation. Its ladder-anchored variant (the
|
|
28
28
|
* transient-recovery continuation, `recoverWebvhLadderAnchored`) lives in
|
|
29
29
|
* `@interop/wallet-core/clientAnnex`.
|