@interop/wallet-core 0.67.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +12 -6
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +10 -7
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +11 -12
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +20 -30
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +7 -16
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +8 -18
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +8 -17
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +19 -34
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +26 -12
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +60 -57
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +3 -12
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +19 -32
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +2 -2
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +1 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +25 -70
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +34 -83
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +55 -68
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +82 -111
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +19 -8
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +89 -66
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +5 -12
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +7 -13
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -14
- package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
- package/dist/clientAnnex/rosterDeliveredEpochs.js +12 -12
- package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +6 -10
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +12 -17
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/descriptors/index.d.ts +21 -46
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +21 -45
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +45 -56
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +64 -74
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +15 -6
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +14 -7
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/keys/collectionLogStore.d.ts +73 -0
- package/dist/keys/collectionLogStore.d.ts.map +1 -0
- package/dist/keys/collectionLogStore.js +60 -0
- package/dist/keys/collectionLogStore.js.map +1 -0
- package/dist/keys/index.d.ts +18 -6
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +18 -6
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +44 -6
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +51 -238
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +2 -1
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts +67 -34
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +80 -30
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +26 -1
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +29 -2
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +5 -0
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +5 -0
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +54 -16
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +50 -22
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/recovery/continuation.d.ts +2 -7
- package/dist/recovery/continuation.d.ts.map +1 -1
- package/dist/recovery/continuation.js +2 -6
- package/dist/recovery/continuation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +11 -25
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +13 -26
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +18 -6
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +5 -3
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/errors.d.ts +17 -43
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +17 -50
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +6 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +6 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/logClass.d.ts +69 -0
- package/dist/resourceLog/logClass.d.ts.map +1 -0
- package/dist/resourceLog/logClass.js +43 -0
- package/dist/resourceLog/logClass.js.map +1 -0
- package/dist/space/collections.d.ts +22 -2
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +18 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/index.d.ts +4 -3
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +4 -3
- package/dist/space/index.js.map +1 -1
- package/dist/space/provisioning.d.ts +16 -6
- package/dist/space/provisioning.d.ts.map +1 -1
- package/dist/space/provisioning.js +11 -7
- package/dist/space/provisioning.js.map +1 -1
- package/dist/sync/engine.d.ts +4 -2
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/index.d.ts +9 -6
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +8 -5
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.d.ts +0 -29
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +30 -28
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/types.d.ts +39 -21
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +13 -7
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/retire.d.ts +12 -13
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +12 -15
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +8 -22
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +7 -18
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +5 -12
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +11 -22
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/delegatedLogStore.d.ts +7 -2
- package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
- package/dist/webvh/delegatedLogStore.js +9 -1
- package/dist/webvh/delegatedLogStore.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +69 -80
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +74 -117
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +2 -8
- package/dist/webvh/enrollClient.d.ts.map +1 -1
- package/dist/webvh/enrollClient.js +3 -8
- package/dist/webvh/enrollClient.js.map +1 -1
- package/dist/webvh/index.d.ts +1 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +1 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +3 -9
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +4 -9
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +24 -4
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +26 -7
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +16 -3
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +18 -3
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/package.json +4 -4
- package/dist/descriptors/acquire.d.ts +0 -122
- package/dist/descriptors/acquire.d.ts.map +0 -1
- package/dist/descriptors/acquire.js +0 -100
- package/dist/descriptors/acquire.js.map +0 -1
- package/dist/descriptors/cipher.d.ts +0 -71
- package/dist/descriptors/cipher.d.ts.map +0 -1
- package/dist/descriptors/cipher.js +0 -109
- package/dist/descriptors/cipher.js.map +0 -1
- package/dist/descriptors/errors.d.ts +0 -44
- package/dist/descriptors/errors.d.ts.map +0 -1
- package/dist/descriptors/errors.js +0 -46
- package/dist/descriptors/errors.js.map +0 -1
- package/dist/descriptors/refresh.d.ts +0 -62
- package/dist/descriptors/refresh.d.ts.map +0 -1
- package/dist/descriptors/refresh.js +0 -69
- package/dist/descriptors/refresh.js.map +0 -1
|
@@ -1,24 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The log-governed {@link EncryptionDescriptorSource}: descriptor acquisition
|
|
6
|
+
* for a collection whose encryption descriptor is governed by a resource log
|
|
7
|
+
* (the Resource Log Profile) rather than by its Collection Description. Every
|
|
8
|
+
* read -- including the unknown-epoch refresh's re-read -- resolves to the
|
|
9
|
+
* log's VERIFIED head state: chain, proofs, external authorization against
|
|
10
|
+
* the independently verified controller document, and the chain-head pin all
|
|
11
|
+
* checked before any descriptor is handed out, so a refresh re-verifies the
|
|
12
|
+
* log rather than adopting whatever the host serves. A verified head whose
|
|
13
|
+
* state is not an epoch configuration is refused fail-closed rather than
|
|
14
|
+
* handed out as a descriptor.
|
|
15
|
+
*
|
|
16
|
+
* The log lives at the collection's own `meta/log` sub-resource
|
|
17
|
+
* (`COLLECTION_HISTORY_LOG_SUBRESOURCE`), inside the URL subtree of the
|
|
18
|
+
* collection it governs. A share grantee or a connected app already holds a
|
|
19
|
+
* read capability over that subtree, so the same grant that lets them read
|
|
20
|
+
* the collection lets them verify its descriptor's history: no second grant,
|
|
21
|
+
* and no capability over the account's `key-map` collection.
|
|
22
|
+
*
|
|
23
|
+
* Reads here run under the collection-descriptor log CLASS: a ladder-signed
|
|
24
|
+
* append to one of these logs admits on `assertionMethod` membership alone,
|
|
25
|
+
* the roster's ceremony-tail license binding the roster log only. A reader
|
|
26
|
+
* that inherited the roster's rule would refuse a served log its own wallet
|
|
27
|
+
* wrote.
|
|
28
|
+
*/
|
|
29
|
+
import { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration } from '@interop/was-client/edv';
|
|
30
|
+
import { collectionLogPinId } from '@interop/vh-resource-log';
|
|
31
|
+
import { controllerForLogClass } from '../resourceLog/index.js';
|
|
4
32
|
/**
|
|
5
|
-
* The state-document schema identifier
|
|
6
|
-
*
|
|
33
|
+
* The governed read boundary and the state-document schema identifier live in
|
|
34
|
+
* `@interop/was-client/edv` (the pointer-following collection store reads
|
|
35
|
+
* through the same helper); re-exported here so the roster store and this
|
|
36
|
+
* module's consumers keep one import site.
|
|
7
37
|
*/
|
|
8
|
-
export
|
|
38
|
+
export { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration };
|
|
9
39
|
/**
|
|
10
40
|
* The pin-slot key for a collection's governing descriptor log: the slot a
|
|
11
41
|
* keyed `ResourceLogPinStore` holds that log's chain-head pin under,
|
|
12
|
-
* `space/<spaceId>/
|
|
42
|
+
* `space/<spaceId>/<collectionId>/meta/log`. The library names it, as it
|
|
13
43
|
* names the account log's (`accountLogPinId`) and the roster's
|
|
14
|
-
* (`userKeyRosterPinId`) slots, so no app builds one of its own
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
44
|
+
* (`userKeyRosterPinId`) slots, so no app builds one of its own.
|
|
45
|
+
*
|
|
46
|
+
* The slot follows the log's placement: the log is the collection's own
|
|
47
|
+
* `meta/log` sub-resource, inside the URL subtree of the collection it
|
|
48
|
+
* governs, so the read capability a share grantee or a connected app already
|
|
49
|
+
* holds covers it. The shape is host-free on purpose -- the Space id is what
|
|
50
|
+
* stays stable across a claimed host move, so a log served from a new host
|
|
51
|
+
* still lands in the same slot and is checked against the held pin rather
|
|
52
|
+
* than opening a fresh trust-on-first-use slate.
|
|
22
53
|
*
|
|
23
54
|
* @param options {object}
|
|
24
55
|
* @param options.spaceId {string} the data Space id
|
|
@@ -26,59 +57,7 @@ export const EPOCH_CONFIGURATION_STATE_TYPE = 'WasEpochConfiguration';
|
|
|
26
57
|
* @returns {string}
|
|
27
58
|
*/
|
|
28
59
|
export function collectionDescriptorLogPinId({ spaceId, collectionId }) {
|
|
29
|
-
return
|
|
30
|
-
spaceId,
|
|
31
|
-
collectionId: KEY_MAP_COLLECTION.id,
|
|
32
|
-
resourceId: `${collectionId}.jsonl`
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The one governed epoch-configuration read: the fail-closed boundary that
|
|
37
|
-
* decides whether a served log state may be treated as an encryption
|
|
38
|
-
* descriptor. Resolves the controller view, reads and fully verifies the log
|
|
39
|
-
* (chain, proofs, external authorization, and the chain-head pin, via
|
|
40
|
-
* `readResourceLog`), and refuses a verified head whose state is not a
|
|
41
|
-
* `WasEpochConfiguration` rather than handing it out as a descriptor.
|
|
42
|
-
* Resolves `null` for an absent log (the pre-genesis state) only while no pin
|
|
43
|
-
* is held for it; under a held pin an absent log is refused as a `rollback`,
|
|
44
|
-
* the library's rule. Both governed
|
|
45
|
-
* descriptor consumers -- the log-governed descriptor source below and the
|
|
46
|
-
* roster's log-governed descriptor store -- read through this helper, so a
|
|
47
|
-
* hardening applied here reaches every trusted descriptor read.
|
|
48
|
-
*
|
|
49
|
-
* @param options {object}
|
|
50
|
-
* @param options.store {ResourceLogStore} the log's transport seam
|
|
51
|
-
* @param options.resolveController {function}
|
|
52
|
-
* `() => Promise<ResourceLogController>` -- the caller's currently verified
|
|
53
|
-
* controller view, resolved per operation
|
|
54
|
-
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
55
|
-
* pin for this log
|
|
56
|
-
* @param options.logId {string} the pin-slot key for this log, from
|
|
57
|
-
* `resourceLogPinId`
|
|
58
|
-
* @returns {Promise<{ verified: VerifiedResourceLog; descriptor: CollectionEncryption; etag?: string } | null>}
|
|
59
|
-
*/
|
|
60
|
-
export async function readGovernedEpochConfiguration({ store, resolveController, pinStore, logId }) {
|
|
61
|
-
const controller = await resolveController();
|
|
62
|
-
const current = await readResourceLog({
|
|
63
|
-
store,
|
|
64
|
-
controller,
|
|
65
|
-
expectedMethod: RESOURCE_LOG_METHOD,
|
|
66
|
-
pinStore,
|
|
67
|
-
logId
|
|
68
|
-
});
|
|
69
|
-
if (current === null) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const state = current.verified.state;
|
|
73
|
-
if (state.type !== EPOCH_CONFIGURATION_STATE_TYPE) {
|
|
74
|
-
throw new ResourceLogIntegrityError(`The governed descriptor log carries state of type ` +
|
|
75
|
-
`"${state.type}", not "${EPOCH_CONFIGURATION_STATE_TYPE}".`);
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
verified: current.verified,
|
|
79
|
-
descriptor: state,
|
|
80
|
-
etag: current.etag
|
|
81
|
-
};
|
|
60
|
+
return collectionLogPinId({ spaceId, collectionId });
|
|
82
61
|
}
|
|
83
62
|
/**
|
|
84
63
|
* Builds the {@link EncryptionDescriptorSource} over per-collection resource
|
|
@@ -86,15 +65,23 @@ export async function readGovernedEpochConfiguration({ store, resolveController,
|
|
|
86
65
|
* Collection Description `encryption` member (a plaintext collection, or one
|
|
87
66
|
* whose provisioning has not landed), unless a pin is held for it, in which
|
|
88
67
|
* case the read refuses as a `rollback`; verification failures throw through --
|
|
89
|
-
*
|
|
90
|
-
* back to the cache.
|
|
68
|
+
* was-client's `acquireDescriptor` rethrows the refusal classes rather than
|
|
69
|
+
* falling back to the cache.
|
|
70
|
+
*
|
|
71
|
+
* Every read runs under the collection-descriptor log class
|
|
72
|
+
* ({@link controllerForLogClass}), so a ladder-signed append verifies on
|
|
73
|
+
* `assertionMethod` membership alone. Without that narrowing a reader would
|
|
74
|
+
* inherit the roster's ceremony-tail license and refuse a served log its own
|
|
75
|
+
* wallet's standing credential wrote.
|
|
91
76
|
*
|
|
92
77
|
* @param options {object}
|
|
93
78
|
* @param options.logFor {function} `(collectionId) => ResourceLogStore` --
|
|
94
|
-
* the collection's governing log's transport seam
|
|
79
|
+
* the collection's governing log's transport seam (was-client's
|
|
80
|
+
* `resourceLogStore({ collection })` over the collection's `meta/log`)
|
|
95
81
|
* @param options.resolveController {function}
|
|
96
|
-
* `() => Promise<
|
|
97
|
-
* controller view, resolved per operation
|
|
82
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
83
|
+
* verified controller view, resolved per operation and narrowed here to
|
|
84
|
+
* this log class
|
|
98
85
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
99
86
|
* pins, keyed per log; each collection's slot is
|
|
100
87
|
* {@link collectionDescriptorLogPinId} over `spaceId`
|
|
@@ -106,7 +93,10 @@ export function logGovernedDescriptorSource({ logFor, resolveController, pinStor
|
|
|
106
93
|
async collectionEncryption({ collectionId }) {
|
|
107
94
|
const current = await readGovernedEpochConfiguration({
|
|
108
95
|
store: logFor(collectionId),
|
|
109
|
-
resolveController
|
|
96
|
+
resolveController: async () => controllerForLogClass({
|
|
97
|
+
controller: await resolveController(),
|
|
98
|
+
logClass: 'collection-descriptor'
|
|
99
|
+
}),
|
|
110
100
|
pinStore,
|
|
111
101
|
logId: collectionDescriptorLogPinId({ spaceId, collectionId })
|
|
112
102
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logSource.js","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAE/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,kBAAkB,EAGnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,qBAAqB,EAEtB,MAAM,yBAAyB,CAAA;AAEhC;;;;;GAKG;AACH,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAC3C,OAAO,EACP,YAAY,EAIb;IACC,OAAO,kBAAkB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,OAAO,EAMR;IACC,OAAO;QACL,KAAK,CAAC,oBAAoB,CAAC,EAAE,YAAY,EAAE;YACzC,MAAM,OAAO,GAAG,MAAM,8BAA8B,CAAC;gBACnD,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC;gBAC3B,iBAAiB,EAAE,KAAK,IAAI,EAAE,CAC5B,qBAAqB,CAAC;oBACpB,UAAU,EAAE,MAAM,iBAAiB,EAAE;oBACrC,QAAQ,EAAE,uBAAuB;iBAClC,CAAC;gBACJ,QAAQ;gBACR,KAAK,EAAE,4BAA4B,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;aAC/D,CAAC,CAAA;YACF,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,OAAO,SAAS,CAAA;YAClB,CAAC;YACD,OAAO,OAAO,CAAC,UAAU,CAAA;QAC3B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -3,7 +3,6 @@ import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
|
3
3
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
4
4
|
import { type ClientWebvhUpdateKeys, type ICapabilityAgent, type KmsAuthenticationBinding, type PublishedWebvhLog, type WebvhIdStore } from '../webvh/index.js';
|
|
5
5
|
import { type UserKey, type WalletSpaceEpochsResult } from '../keys/index.js';
|
|
6
|
-
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
7
6
|
import { type StageNotifier } from '../log.js';
|
|
8
7
|
/**
|
|
9
8
|
* The complete key set a brand-new account mints locally before anything
|
|
@@ -186,6 +185,15 @@ export interface AccountGenesisResult {
|
|
|
186
185
|
* EncryptionDescriptorStore` -- builds the user-key roster's descriptor
|
|
187
186
|
* store once the account DID is known (the log-governed store's controller
|
|
188
187
|
* view and chain-head pin are the app's wiring)
|
|
188
|
+
* @param options.collectionStoreFor {Function} `({ did }) =>
|
|
189
|
+
* (collectionId: string) => EncryptionDescriptorStore` -- builds each
|
|
190
|
+
* encrypted collection's descriptor store once the account DID is known,
|
|
191
|
+
* the same wiring the roster's builder takes. It is handed `did` alone,
|
|
192
|
+
* since this ceremony's did:webvh stage returns only that: an app whose
|
|
193
|
+
* store resolves a controller view builds it from the published log it
|
|
194
|
+
* fetches itself (`webvhResourceLogController` over a `verifyAccountLog`
|
|
195
|
+
* result), unlike the credential-anchored genesis, which hands its own
|
|
196
|
+
* head through
|
|
189
197
|
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
190
198
|
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
191
199
|
* binding's acquisition; absent or resolving `undefined`, the genesis is
|
|
@@ -201,9 +209,8 @@ export interface AccountGenesisResult {
|
|
|
201
209
|
* the thunk mints instead of adopting
|
|
202
210
|
* @param [options.expectedDid] {string} the account's did:webvh from the
|
|
203
211
|
* caller's stored account pointer, when it already names one; the genesis
|
|
204
|
-
* read then refuses a published log resolving to any other account
|
|
205
|
-
*
|
|
206
|
-
* chain-head pin for the account log
|
|
212
|
+
* read then refuses a published log resolving to any other account. That
|
|
213
|
+
* read and the publish run under the `idStore`'s own chain-head pin
|
|
207
214
|
* @param [options.onDidPublished] {Function} `({ did }) => Promise<void>`
|
|
208
215
|
* -- runs between the DID publication and the roster genesis, so the app
|
|
209
216
|
* can adopt the DID (and drop any verified-log memo) before the roster
|
|
@@ -220,7 +227,7 @@ export interface AccountGenesisResult {
|
|
|
220
227
|
* genesis emits at the same point
|
|
221
228
|
* @returns {Promise<AccountGenesisResult>}
|
|
222
229
|
*/
|
|
223
|
-
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid,
|
|
230
|
+
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, collectionStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController, onStage }: {
|
|
224
231
|
was: WasClient;
|
|
225
232
|
wasAsClient?: WasClient;
|
|
226
233
|
wasServerUrl: string;
|
|
@@ -233,11 +240,13 @@ export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, s
|
|
|
233
240
|
rosterStoreFor: (options: {
|
|
234
241
|
did: string;
|
|
235
242
|
}) => EncryptionDescriptorStore;
|
|
243
|
+
collectionStoreFor: (options: {
|
|
244
|
+
did: string;
|
|
245
|
+
}) => (collectionId: string) => EncryptionDescriptorStore;
|
|
236
246
|
provideKmsAuthentication?: (options: {
|
|
237
247
|
spaceReady: Promise<unknown>;
|
|
238
248
|
}) => Promise<KmsAuthenticationBinding | undefined>;
|
|
239
249
|
expectedDid?: string;
|
|
240
|
-
accountLogPinStore?: ResourceLogPinStore;
|
|
241
250
|
onDidPublished?: (published: {
|
|
242
251
|
did: string;
|
|
243
252
|
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountGenesis.d.ts","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAGpE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB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ACxB,WAAW,EACX,cAAc,EACd,iBAAwB,EACxB,OAAO,EACR,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,qBAAqB,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;IACrB,cAAc,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,yBAAyB,CAAA;IACvE,kBAAkB,EAAE,CAAC,OAAO,EAAE;QAC5B,GAAG,EAAE,MAAM,CAAA;KACZ,KAAK,CAAC,YAAY,EAAE,MAAM,KAAK,yBAAyB,CAAA;IACzD,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE;QACnC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;KAC7B,KAAK,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAA;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoIhC"}
|
|
@@ -184,6 +184,15 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
184
184
|
* EncryptionDescriptorStore` -- builds the user-key roster's descriptor
|
|
185
185
|
* store once the account DID is known (the log-governed store's controller
|
|
186
186
|
* view and chain-head pin are the app's wiring)
|
|
187
|
+
* @param options.collectionStoreFor {Function} `({ did }) =>
|
|
188
|
+
* (collectionId: string) => EncryptionDescriptorStore` -- builds each
|
|
189
|
+
* encrypted collection's descriptor store once the account DID is known,
|
|
190
|
+
* the same wiring the roster's builder takes. It is handed `did` alone,
|
|
191
|
+
* since this ceremony's did:webvh stage returns only that: an app whose
|
|
192
|
+
* store resolves a controller view builds it from the published log it
|
|
193
|
+
* fetches itself (`webvhResourceLogController` over a `verifyAccountLog`
|
|
194
|
+
* result), unlike the credential-anchored genesis, which hands its own
|
|
195
|
+
* head through
|
|
187
196
|
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
188
197
|
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
189
198
|
* binding's acquisition; absent or resolving `undefined`, the genesis is
|
|
@@ -199,9 +208,8 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
199
208
|
* the thunk mints instead of adopting
|
|
200
209
|
* @param [options.expectedDid] {string} the account's did:webvh from the
|
|
201
210
|
* caller's stored account pointer, when it already names one; the genesis
|
|
202
|
-
* read then refuses a published log resolving to any other account
|
|
203
|
-
*
|
|
204
|
-
* chain-head pin for the account log
|
|
211
|
+
* read then refuses a published log resolving to any other account. That
|
|
212
|
+
* read and the publish run under the `idStore`'s own chain-head pin
|
|
205
213
|
* @param [options.onDidPublished] {Function} `({ did }) => Promise<void>`
|
|
206
214
|
* -- runs between the DID publication and the roster genesis, so the app
|
|
207
215
|
* can adopt the DID (and drop any verified-log memo) before the roster
|
|
@@ -218,7 +226,7 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
218
226
|
* genesis emits at the same point
|
|
219
227
|
* @returns {Promise<AccountGenesisResult>}
|
|
220
228
|
*/
|
|
221
|
-
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid,
|
|
229
|
+
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, collectionStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController = true, onStage }) {
|
|
222
230
|
const failed = [];
|
|
223
231
|
const stage = stageNotifier(onStage);
|
|
224
232
|
// 1. The Space and its collection roster, create-if-absent under this
|
|
@@ -274,8 +282,7 @@ export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spa
|
|
|
274
282
|
keyAgreementKeyMultibase
|
|
275
283
|
},
|
|
276
284
|
updateKeys,
|
|
277
|
-
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
278
|
-
...(accountLogPinStore ? { pinStore: accountLogPinStore } : {})
|
|
285
|
+
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
279
286
|
});
|
|
280
287
|
await onDidPublished?.({ did });
|
|
281
288
|
// 4. The user-key roster genesis, strictly after the DID publication: the
|
|
@@ -305,7 +312,7 @@ export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spa
|
|
|
305
312
|
if (rosterDescriptor) {
|
|
306
313
|
try {
|
|
307
314
|
const fanOut = await ensureWalletSpaceEpochs({
|
|
308
|
-
|
|
315
|
+
storeFor: collectionStoreFor({ did }),
|
|
309
316
|
spaceId,
|
|
310
317
|
userKey,
|
|
311
318
|
rosterDescriptor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountGenesis.js","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EAM1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EAGZ,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"acc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jD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM;KACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The descriptor store over ONE encrypted collection's governing history log
|
|
6
|
+
* -- the collection's own `meta/log` sub-resource, whose verified head state
|
|
7
|
+
* IS its `encryption` descriptor. The sibling of the user key roster's
|
|
8
|
+
* builder ({@link userKeyRosterDescriptorStore}), over the same wrapped
|
|
9
|
+
* `logGovernedDescriptorStore`: reads resolve to the verified head, writes
|
|
10
|
+
* are signed appends, and `create` is the guarded genesis (`If-None-Match:
|
|
11
|
+
* *`) that declares the Collection governed. The server derives the
|
|
12
|
+
* Collection Description's `encryption` member from that log, so a governed
|
|
13
|
+
* collection's descriptor is never client-written into its Description.
|
|
14
|
+
*
|
|
15
|
+
* The transport seam is was-client's `resourceLogStore({ collection })`, so
|
|
16
|
+
* the handle passed in is the whole address: the store derives its own
|
|
17
|
+
* chain-head pin slot from the handle's Space and collection ids
|
|
18
|
+
* ({@link collectionDescriptorLogPinId}), and no caller names a `logId`.
|
|
19
|
+
*/
|
|
20
|
+
import type { Collection } from '@interop/was-client';
|
|
21
|
+
import type { ResourceLogPinStore, ResourceLogSigner } from '@interop/vh-resource-log';
|
|
22
|
+
import type { WebvhResourceLogController } from '../resourceLog/index.js';
|
|
23
|
+
import { type SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
24
|
+
/**
|
|
25
|
+
* Builds the log-governed, sealable descriptor store over one collection's
|
|
26
|
+
* governing history log.
|
|
27
|
+
*
|
|
28
|
+
* Reads resolve to the log's verified head (chain, entry proofs, external
|
|
29
|
+
* authorization against the independently verified account document, and the
|
|
30
|
+
* chain-head pin, all checked before a descriptor is handed out); writes are
|
|
31
|
+
* signed appends of the full next state; `create` is the guarded genesis that
|
|
32
|
+
* declares the Collection governed -- the epoch[0] install
|
|
33
|
+
* ({@link ensureIndexedFirstEpoch}) is what runs it. `seal()` is the backstop
|
|
34
|
+
* for a rotation that no-op'd and so left the log anchored before the account
|
|
35
|
+
* document's latest membership change, and `setMinimumControllerVersion` is
|
|
36
|
+
* the post-edit anchor a ceremony sets so its appends never resolve to a
|
|
37
|
+
* cached pre-edit view.
|
|
38
|
+
*
|
|
39
|
+
* The signer is the same `ResourceLogSigner` the roster takes: an enrolled
|
|
40
|
+
* client's account key ({@link userKeyRosterLogSigner}), or a standing
|
|
41
|
+
* credential's ladder VM on a credential-anchored account.
|
|
42
|
+
*
|
|
43
|
+
* The store's class is `collection-descriptor`, so a ladder-signed append is
|
|
44
|
+
* admitted on `assertionMethod` membership at the anchored version alone.
|
|
45
|
+
* The ceremony-tail license binds the user key roster log only: a descriptor
|
|
46
|
+
* append escrows one recipient into one collection, lands as a hash-chained
|
|
47
|
+
* entry attributable to that credential, and is auditable by the account's
|
|
48
|
+
* clients.
|
|
49
|
+
*
|
|
50
|
+
* @param options {object}
|
|
51
|
+
* @param options.collection {Collection} the collection handle whose
|
|
52
|
+
* `meta/log` is the log; its `spaceId` and `id` are what the pin slot is
|
|
53
|
+
* derived from, and its capability wiring is what every request rides
|
|
54
|
+
* @param options.resolveController {function}
|
|
55
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
56
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
57
|
+
* `verifyAccountLog` result), resolved per operation
|
|
58
|
+
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
59
|
+
* pins, keyed per log
|
|
60
|
+
* @param options.signer {ResourceLogSigner} the signing key the appends
|
|
61
|
+
* this store writes are proved by. It must be listed under
|
|
62
|
+
* `assertionMethod` in the account document at the version the append
|
|
63
|
+
* anchors at, so a ceremony that strikes a key builds its collection stores
|
|
64
|
+
* on one its own edit leaves standing
|
|
65
|
+
* @returns {SealableEncryptionDescriptorStore}
|
|
66
|
+
*/
|
|
67
|
+
export declare function collectionDescriptorLogStore({ collection, resolveController, pinStore, signer }: {
|
|
68
|
+
collection: Collection;
|
|
69
|
+
resolveController: () => Promise<WebvhResourceLogController>;
|
|
70
|
+
pinStore: ResourceLogPinStore;
|
|
71
|
+
signer: ResourceLogSigner;
|
|
72
|
+
}): SealableEncryptionDescriptorStore;
|
|
73
|
+
//# sourceMappingURL=collectionLogStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionLogStore.d.ts","sourceRoot":"","sources":["../../src/keys/collectionLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACP,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,iBAAiB,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAC5D,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iCAAiC,CAYpC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { resourceLogStore } from '@interop/was-client/log';
|
|
2
|
+
import { collectionDescriptorLogPinId } from '../descriptors/logSource.js';
|
|
3
|
+
import { logGovernedDescriptorStore } from './rosterLogStore.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the log-governed, sealable descriptor store over one collection's
|
|
6
|
+
* governing history log.
|
|
7
|
+
*
|
|
8
|
+
* Reads resolve to the log's verified head (chain, entry proofs, external
|
|
9
|
+
* authorization against the independently verified account document, and the
|
|
10
|
+
* chain-head pin, all checked before a descriptor is handed out); writes are
|
|
11
|
+
* signed appends of the full next state; `create` is the guarded genesis that
|
|
12
|
+
* declares the Collection governed -- the epoch[0] install
|
|
13
|
+
* ({@link ensureIndexedFirstEpoch}) is what runs it. `seal()` is the backstop
|
|
14
|
+
* for a rotation that no-op'd and so left the log anchored before the account
|
|
15
|
+
* document's latest membership change, and `setMinimumControllerVersion` is
|
|
16
|
+
* the post-edit anchor a ceremony sets so its appends never resolve to a
|
|
17
|
+
* cached pre-edit view.
|
|
18
|
+
*
|
|
19
|
+
* The signer is the same `ResourceLogSigner` the roster takes: an enrolled
|
|
20
|
+
* client's account key ({@link userKeyRosterLogSigner}), or a standing
|
|
21
|
+
* credential's ladder VM on a credential-anchored account.
|
|
22
|
+
*
|
|
23
|
+
* The store's class is `collection-descriptor`, so a ladder-signed append is
|
|
24
|
+
* admitted on `assertionMethod` membership at the anchored version alone.
|
|
25
|
+
* The ceremony-tail license binds the user key roster log only: a descriptor
|
|
26
|
+
* append escrows one recipient into one collection, lands as a hash-chained
|
|
27
|
+
* entry attributable to that credential, and is auditable by the account's
|
|
28
|
+
* clients.
|
|
29
|
+
*
|
|
30
|
+
* @param options {object}
|
|
31
|
+
* @param options.collection {Collection} the collection handle whose
|
|
32
|
+
* `meta/log` is the log; its `spaceId` and `id` are what the pin slot is
|
|
33
|
+
* derived from, and its capability wiring is what every request rides
|
|
34
|
+
* @param options.resolveController {function}
|
|
35
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
36
|
+
* verified controller view (`webvhResourceLogController` over a
|
|
37
|
+
* `verifyAccountLog` result), resolved per operation
|
|
38
|
+
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
39
|
+
* pins, keyed per log
|
|
40
|
+
* @param options.signer {ResourceLogSigner} the signing key the appends
|
|
41
|
+
* this store writes are proved by. It must be listed under
|
|
42
|
+
* `assertionMethod` in the account document at the version the append
|
|
43
|
+
* anchors at, so a ceremony that strikes a key builds its collection stores
|
|
44
|
+
* on one its own edit leaves standing
|
|
45
|
+
* @returns {SealableEncryptionDescriptorStore}
|
|
46
|
+
*/
|
|
47
|
+
export function collectionDescriptorLogStore({ collection, resolveController, pinStore, signer }) {
|
|
48
|
+
return logGovernedDescriptorStore({
|
|
49
|
+
log: resourceLogStore({ collection }),
|
|
50
|
+
resolveController,
|
|
51
|
+
pinStore,
|
|
52
|
+
logId: collectionDescriptorLogPinId({
|
|
53
|
+
spaceId: collection.spaceId,
|
|
54
|
+
collectionId: collection.id
|
|
55
|
+
}),
|
|
56
|
+
signer,
|
|
57
|
+
logClass: 'collection-descriptor'
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=collectionLogStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionLogStore.js","sourceRoot":"","sources":["../../src/keys/collectionLogStore.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAK1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE1E,OAAO,EACL,0BAA0B,EAE3B,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAC3C,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,MAAM,EAMP;IACC,OAAO,0BAA0B,CAAC;QAChC,GAAG,EAAE,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;QACrC,iBAAiB;QACjB,QAAQ;QACR,KAAK,EAAE,4BAA4B,CAAC;YAClC,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,YAAY,EAAE,UAAU,CAAC,EAAE;SAC5B,CAAC;QACF,MAAM;QACN,QAAQ,EAAE,uBAAuB;KAClC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -22,13 +22,23 @@
|
|
|
22
22
|
* current epoch, refusing a `currentEpoch` that names no epoch in its own
|
|
23
23
|
* list" (`UserKeyRosterIntegrityError`); every roster and collection
|
|
24
24
|
* descriptor read that needs the current epoch goes through it.
|
|
25
|
-
* - `
|
|
26
|
-
*
|
|
25
|
+
* - `collectionDescriptorLogStore` -- the same store over ONE encrypted
|
|
26
|
+
* collection's governing history log (the collection's `meta/log`
|
|
27
|
+
* sub-resource, whose verified head state is its `encryption` descriptor).
|
|
28
|
+
* It derives its own chain-head pin slot from the collection handle, and
|
|
29
|
+
* carries the `collection-descriptor` log class, whose ladder-signed
|
|
30
|
+
* appends admit on `assertionMethod` membership alone.
|
|
31
|
+
* - `userKeyRosterDescriptorStore` -- the same store over the user key roster:
|
|
32
|
+
* reads resolve to the roster log's verified head
|
|
27
33
|
* (`key-map/user-key.jsonl`), writes append signed entries; built from a
|
|
28
34
|
* bare signing client for the login-time direct read. Sealable
|
|
29
35
|
* (`SealableEncryptionDescriptorStore` / `isSealableDescriptorStore`):
|
|
30
36
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
31
37
|
* anchors before the account document's latest membership change.
|
|
38
|
+
*
|
|
39
|
+
* Those two builders are the subpath's whole store surface. Each states its
|
|
40
|
+
* log class at construction, and the generic wrapper under them takes a
|
|
41
|
+
* caller-chosen class and log id, so it stays module-internal.
|
|
32
42
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
33
43
|
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
34
44
|
* it converges onto the account document instead.
|
|
@@ -52,9 +62,10 @@
|
|
|
52
62
|
* names (also the completion sweep's driver).
|
|
53
63
|
* - `rotateRosterToDocumentAndCascade` -- the shared roster-and-cascade tail
|
|
54
64
|
* every account-membership ceremony ends with (a client disconnected, a
|
|
55
|
-
* standing unlock credential retired): the post-edit minimum controller
|
|
56
|
-
*
|
|
57
|
-
*
|
|
65
|
+
* standing unlock credential retired): the post-edit minimum controller
|
|
66
|
+
* version on the roster store AND on every log-governed collection store
|
|
67
|
+
* the fan-out touches, the convergence rotation with its seal backstop, and
|
|
68
|
+
* the collection fan-out onto the fresh user key.
|
|
58
69
|
* - `retireRosterRecipientAndCascade` -- the same tail for a ceremony that
|
|
59
70
|
* rotates BEFORE its document edit (the two forgets): the minimum
|
|
60
71
|
* controller version at the caller's anchor, one named recipient retired
|
|
@@ -82,8 +93,9 @@ export { anchorRosterStoreAt, retireRosterRecipientAndCascade, rotateRosterToDoc
|
|
|
82
93
|
export type { CascadeCollections, RosterCascadeResult, RosterSealReport, UserKeyAdoptedHook } from './userKeyRosterCascade.js';
|
|
83
94
|
export type { DescriptorStoreRead, UserKeyRosterReadResult } from './userKeyRoster.js';
|
|
84
95
|
export type { KeyAgreementDocument } from '../resourceLog/document.js';
|
|
96
|
+
export { collectionDescriptorLogStore } from './collectionLogStore.js';
|
|
85
97
|
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
86
|
-
export {
|
|
98
|
+
export { isSealableDescriptorStore } from './rosterLogStore.js';
|
|
87
99
|
export type { SealableEncryptionDescriptorStore } from './rosterLogStore.js';
|
|
88
100
|
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs, WalletSpaceProvisioningError, walletSpaceProvisioner } from './spaceEpochs.js';
|
|
89
101
|
export type { WalletSpaceEpochsResult } from './spaceEpochs.js';
|
package/dist/keys/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,cAAc,EACd,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,8BAA8B,EAC9B,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,YAAY,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAA;AAE5E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/keys/index.js
CHANGED
|
@@ -22,13 +22,23 @@
|
|
|
22
22
|
* current epoch, refusing a `currentEpoch` that names no epoch in its own
|
|
23
23
|
* list" (`UserKeyRosterIntegrityError`); every roster and collection
|
|
24
24
|
* descriptor read that needs the current epoch goes through it.
|
|
25
|
-
* - `
|
|
26
|
-
*
|
|
25
|
+
* - `collectionDescriptorLogStore` -- the same store over ONE encrypted
|
|
26
|
+
* collection's governing history log (the collection's `meta/log`
|
|
27
|
+
* sub-resource, whose verified head state is its `encryption` descriptor).
|
|
28
|
+
* It derives its own chain-head pin slot from the collection handle, and
|
|
29
|
+
* carries the `collection-descriptor` log class, whose ladder-signed
|
|
30
|
+
* appends admit on `assertionMethod` membership alone.
|
|
31
|
+
* - `userKeyRosterDescriptorStore` -- the same store over the user key roster:
|
|
32
|
+
* reads resolve to the roster log's verified head
|
|
27
33
|
* (`key-map/user-key.jsonl`), writes append signed entries; built from a
|
|
28
34
|
* bare signing client for the login-time direct read. Sealable
|
|
29
35
|
* (`SealableEncryptionDescriptorStore` / `isSealableDescriptorStore`):
|
|
30
36
|
* `seal()` appends the idempotent backstop entry when the log's head still
|
|
31
37
|
* anchors before the account document's latest membership change.
|
|
38
|
+
*
|
|
39
|
+
* Those two builders are the subpath's whole store surface. Each states its
|
|
40
|
+
* log class at construction, and the generic wrapper under them takes a
|
|
41
|
+
* caller-chosen class and log id, so it stays module-internal.
|
|
32
42
|
* - `rosterRecipientKid` -- the one builder of a client's roster kid, shared by
|
|
33
43
|
* the enrollment wrap and the roster read. A retiring rotation names no kid:
|
|
34
44
|
* it converges onto the account document instead.
|
|
@@ -52,9 +62,10 @@
|
|
|
52
62
|
* names (also the completion sweep's driver).
|
|
53
63
|
* - `rotateRosterToDocumentAndCascade` -- the shared roster-and-cascade tail
|
|
54
64
|
* every account-membership ceremony ends with (a client disconnected, a
|
|
55
|
-
* standing unlock credential retired): the post-edit minimum controller
|
|
56
|
-
*
|
|
57
|
-
*
|
|
65
|
+
* standing unlock credential retired): the post-edit minimum controller
|
|
66
|
+
* version on the roster store AND on every log-governed collection store
|
|
67
|
+
* the fan-out touches, the convergence rotation with its seal backstop, and
|
|
68
|
+
* the collection fan-out onto the fresh user key.
|
|
58
69
|
* - `retireRosterRecipientAndCascade` -- the same tail for a ceremony that
|
|
59
70
|
* rotates BEFORE its document edit (the two forgets): the minimum
|
|
60
71
|
* controller version at the caller's anchor, one named recipient retired
|
|
@@ -76,8 +87,9 @@ export { assertEnrolledClientKeyRecord, decodeClientKeyRecord, encodeClientKeyRe
|
|
|
76
87
|
export { addUserKeyRosterRecipient, convergeUserKeyRosterToDocument, currentEpochOf, enrolledClientRosterRecipients, ensureUserKeyRoster, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, userKeyRosterLogSigner, userKeyRosterRecipientResolver, readUserKeyRoster, replaceUserKeyRosterRecipients, rosterRecipientKid, rosterRecipientsToRetire, rosterWrapsRecipient, rotateUserKeyRoster } from './userKeyRoster.js';
|
|
77
88
|
export { cascadeCollectionsToUserKey, userKeyAsRecipient, rotateCollectionEpochsToUserKey, unwrapUserKeyGenerations } from './userKeyCascade.js';
|
|
78
89
|
export { anchorRosterStoreAt, retireRosterRecipientAndCascade, rotateRosterToDocumentAndCascade } from './userKeyRosterCascade.js';
|
|
90
|
+
export { collectionDescriptorLogStore } from './collectionLogStore.js';
|
|
79
91
|
export { userKeyRosterDescriptorStore, userKeyRosterPinId } from './rosterStore.js';
|
|
80
|
-
export {
|
|
92
|
+
export { isSealableDescriptorStore } from './rosterLogStore.js';
|
|
81
93
|
export { ensureIndexedFirstEpoch, ensureWalletSpaceEpochs, WalletSpaceProvisioningError, walletSpaceProvisioner } from './spaceEpochs.js';
|
|
82
94
|
export { readClientLabels, removeClientLabel, setClientLabel } from './clientLabels.js';
|
|
83
95
|
export { wasClientLabelsStore } from './wasLabelsStore.js';
|
package/dist/keys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG5D,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAA;AAQ7B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EA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