@interop/wallet-core 0.68.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 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +9 -2
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +10 -0
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +14 -2
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +19 -4
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +83 -35
- package/dist/clientAnnex/mend.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/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 +13 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +11 -2
- 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/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 +4 -1
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +4 -1
- 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 +8 -1
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +8 -1
- package/dist/unlock/retire.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
|
@@ -2,51 +2,27 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The `@interop/wallet-core/descriptors` subpath:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* The `@interop/wallet-core/descriptors` subpath: the log-governed descriptor
|
|
6
|
+
* source, the wallet's implementation of `@interop/was-client/edv`'s
|
|
7
|
+
* `EncryptionDescriptorSource` seam for collections whose encryption
|
|
8
|
+
* descriptor is governed by a resource log. The acquisition, cache-fallback,
|
|
9
|
+
* and unknown-epoch refresh policy that source plugs into (`acquireDescriptor`,
|
|
10
|
+
* `DescriptorRefreshPolicy`, `createRefreshingEdvDocCipher`, and the
|
|
11
|
+
* `isKeyUnwrapError` matcher) ship from `@interop/was-client/edv`, and this
|
|
12
|
+
* subpath re-exports none of them: one owner per name.
|
|
11
13
|
*
|
|
12
|
-
* - `
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* log-governed source's refusal classes rethrow instead of falling back
|
|
25
|
-
* (except a continuity rollback, which is reconcilable divergence).
|
|
26
|
-
* - `logGovernedDescriptorSource` -- the `EncryptionDescriptorSource` for
|
|
27
|
-
* collections whose descriptor is governed by a resource log: every read
|
|
28
|
-
* (including the unknown-epoch refresh) re-verifies the log and resolves to
|
|
29
|
-
* its verified head state, refusing a head that is not a
|
|
30
|
-
* `WasEpochConfiguration`. It keys each collection's chain-head pin by
|
|
31
|
-
* `collectionDescriptorLogPinId` over the Space id, the library-named slot
|
|
32
|
-
* (`space/<spaceId>/key-map/<collectionId>.jsonl`), so no app builds one.
|
|
33
|
-
* - `DescriptorRefreshPolicy` -- the once-per-collection-per-session
|
|
34
|
-
* unknown-epoch refresh guard, plus the refresh-and-re-read-once wrapper
|
|
35
|
-
* for hosts whose reads scan rows and count unknown-epoch skips.
|
|
36
|
-
* - `createRefreshingEdvDocCipher` -- `createEdvDocCipher` bound to both: a
|
|
37
|
-
* cipher that acquires its own descriptor and, on an unknown-epoch decrypt,
|
|
38
|
-
* re-reads the description, swaps itself, and retries exactly once per
|
|
39
|
-
* instance.
|
|
40
|
-
* - `isKeyUnwrapError` -- how a host scanning rows tells "not a recipient of
|
|
41
|
-
* this epoch" from corruption, matched by `err.name` because the cipher is
|
|
42
|
-
* an injected seam. Its sibling `isUnknownEpochError` ships from
|
|
43
|
-
* `@interop/was-client/sync`, beside the class it matches. This one stays
|
|
44
|
-
* here on policy: it classifies a roster-membership failure the wallet
|
|
45
|
-
* layer owns, and no sync driver dispatches on it.
|
|
14
|
+
* - `logGovernedDescriptorSource` -- every read (including the unknown-epoch
|
|
15
|
+
* refresh) re-verifies the log and resolves to its verified head state,
|
|
16
|
+
* refusing a head that is not a `WasEpochConfiguration`. Reads run under the
|
|
17
|
+
* collection-descriptor log class, so a ladder-signed append admits on
|
|
18
|
+
* `assertionMethod` membership alone. It keys each collection's chain-head
|
|
19
|
+
* pin by `collectionDescriptorLogPinId` over the Space id, the library-named
|
|
20
|
+
* slot (`space/<spaceId>/<collectionId>/meta/log`, the log's own home), so no
|
|
21
|
+
* app builds one. It is the one governed-descriptor reader this subpath
|
|
22
|
+
* publishes: the bare-controller read under it
|
|
23
|
+
* (`readGovernedEpochConfiguration`, was-client's) states no log class and
|
|
24
|
+
* would read a collection log under the roster's license, so it stays
|
|
25
|
+
* module-internal.
|
|
46
26
|
*/
|
|
47
|
-
export {
|
|
48
|
-
export { collectionDescriptorLogPinId, EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource, readGovernedEpochConfiguration } from './logSource.js';
|
|
49
|
-
export { DescriptorRefreshPolicy } from './refresh.js';
|
|
50
|
-
export { createRefreshingEdvDocCipher } from './cipher.js';
|
|
51
|
-
export { isKeyUnwrapError } from './errors.js';
|
|
27
|
+
export { collectionDescriptorLogPinId, logGovernedDescriptorSource } from './logSource.js';
|
|
52
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAA"}
|
|
@@ -12,28 +12,44 @@
|
|
|
12
12
|
* log rather than adopting whatever the host serves. A verified head whose
|
|
13
13
|
* state is not an epoch configuration is refused fail-closed rather than
|
|
14
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.
|
|
15
28
|
*/
|
|
16
|
-
import type
|
|
17
|
-
import { type
|
|
18
|
-
import type
|
|
29
|
+
import { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration, type EncryptionDescriptorSource } from '@interop/was-client/edv';
|
|
30
|
+
import { type ResourceLogPinStore, type ResourceLogStore } from '@interop/vh-resource-log';
|
|
31
|
+
import { type WebvhResourceLogController } from '../resourceLog/index.js';
|
|
19
32
|
/**
|
|
20
|
-
* The state-document schema identifier
|
|
21
|
-
*
|
|
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.
|
|
22
37
|
*/
|
|
23
|
-
export
|
|
38
|
+
export { EPOCH_CONFIGURATION_STATE_TYPE, readGovernedEpochConfiguration };
|
|
24
39
|
/**
|
|
25
40
|
* The pin-slot key for a collection's governing descriptor log: the slot a
|
|
26
41
|
* keyed `ResourceLogPinStore` holds that log's chain-head pin under,
|
|
27
|
-
* `space/<spaceId>/
|
|
42
|
+
* `space/<spaceId>/<collectionId>/meta/log`. The library names it, as it
|
|
28
43
|
* names the account log's (`accountLogPinId`) and the roster's
|
|
29
|
-
* (`userKeyRosterPinId`) slots, so no app builds one of its own
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
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.
|
|
37
53
|
*
|
|
38
54
|
* @param options {object}
|
|
39
55
|
* @param options.spaceId {string} the data Space id
|
|
@@ -44,56 +60,29 @@ export declare function collectionDescriptorLogPinId({ spaceId, collectionId }:
|
|
|
44
60
|
spaceId: string;
|
|
45
61
|
collectionId: string;
|
|
46
62
|
}): string;
|
|
47
|
-
/**
|
|
48
|
-
* The one governed epoch-configuration read: the fail-closed boundary that
|
|
49
|
-
* decides whether a served log state may be treated as an encryption
|
|
50
|
-
* descriptor. Resolves the controller view, reads and fully verifies the log
|
|
51
|
-
* (chain, proofs, external authorization, and the chain-head pin, via
|
|
52
|
-
* `readResourceLog`), and refuses a verified head whose state is not a
|
|
53
|
-
* `WasEpochConfiguration` rather than handing it out as a descriptor.
|
|
54
|
-
* Resolves `null` for an absent log (the pre-genesis state) only while no pin
|
|
55
|
-
* is held for it; under a held pin an absent log is refused as a `rollback`,
|
|
56
|
-
* the library's rule. Both governed
|
|
57
|
-
* descriptor consumers -- the log-governed descriptor source below and the
|
|
58
|
-
* roster's log-governed descriptor store -- read through this helper, so a
|
|
59
|
-
* hardening applied here reaches every trusted descriptor read.
|
|
60
|
-
*
|
|
61
|
-
* @param options {object}
|
|
62
|
-
* @param options.store {ResourceLogStore} the log's transport seam
|
|
63
|
-
* @param options.resolveController {function}
|
|
64
|
-
* `() => Promise<ResourceLogController>` -- the caller's currently verified
|
|
65
|
-
* controller view, resolved per operation
|
|
66
|
-
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
67
|
-
* pin for this log
|
|
68
|
-
* @param options.logId {string} the pin-slot key for this log, from
|
|
69
|
-
* `resourceLogPinId`
|
|
70
|
-
* @returns {Promise<{ verified: VerifiedResourceLog; descriptor: CollectionEncryption; etag?: string } | null>}
|
|
71
|
-
*/
|
|
72
|
-
export declare function readGovernedEpochConfiguration({ store, resolveController, pinStore, logId }: {
|
|
73
|
-
store: ResourceLogStore;
|
|
74
|
-
resolveController: () => Promise<ResourceLogController>;
|
|
75
|
-
pinStore: ResourceLogPinStore;
|
|
76
|
-
logId: string;
|
|
77
|
-
}): Promise<{
|
|
78
|
-
verified: VerifiedResourceLog;
|
|
79
|
-
descriptor: CollectionEncryption;
|
|
80
|
-
etag?: string;
|
|
81
|
-
} | null>;
|
|
82
63
|
/**
|
|
83
64
|
* Builds the {@link EncryptionDescriptorSource} over per-collection resource
|
|
84
65
|
* logs. An absent log resolves `undefined` exactly like an absent
|
|
85
66
|
* Collection Description `encryption` member (a plaintext collection, or one
|
|
86
67
|
* whose provisioning has not landed), unless a pin is held for it, in which
|
|
87
68
|
* case the read refuses as a `rollback`; verification failures throw through --
|
|
88
|
-
*
|
|
89
|
-
* back to the cache.
|
|
69
|
+
* was-client's `acquireDescriptor` rethrows the refusal classes rather than
|
|
70
|
+
* falling back to the cache.
|
|
71
|
+
*
|
|
72
|
+
* Every read runs under the collection-descriptor log class
|
|
73
|
+
* ({@link controllerForLogClass}), so a ladder-signed append verifies on
|
|
74
|
+
* `assertionMethod` membership alone. Without that narrowing a reader would
|
|
75
|
+
* inherit the roster's ceremony-tail license and refuse a served log its own
|
|
76
|
+
* wallet's standing credential wrote.
|
|
90
77
|
*
|
|
91
78
|
* @param options {object}
|
|
92
79
|
* @param options.logFor {function} `(collectionId) => ResourceLogStore` --
|
|
93
|
-
* the collection's governing log's transport seam
|
|
80
|
+
* the collection's governing log's transport seam (was-client's
|
|
81
|
+
* `resourceLogStore({ collection })` over the collection's `meta/log`)
|
|
94
82
|
* @param options.resolveController {function}
|
|
95
|
-
* `() => Promise<
|
|
96
|
-
* controller view, resolved per operation
|
|
83
|
+
* `() => Promise<WebvhResourceLogController>` -- the caller's currently
|
|
84
|
+
* verified controller view, resolved per operation and narrowed here to
|
|
85
|
+
* this log class
|
|
97
86
|
* @param options.pinStore {ResourceLogPinStore} this client's chain-head
|
|
98
87
|
* pins, keyed per log; each collection's slot is
|
|
99
88
|
* {@link collectionDescriptorLogPinId} over `spaceId`
|
|
@@ -102,7 +91,7 @@ export declare function readGovernedEpochConfiguration({ store, resolveControlle
|
|
|
102
91
|
*/
|
|
103
92
|
export declare function logGovernedDescriptorSource({ logFor, resolveController, pinStore, spaceId }: {
|
|
104
93
|
logFor: (collectionId: string) => ResourceLogStore;
|
|
105
|
-
resolveController: () => Promise<
|
|
94
|
+
resolveController: () => Promise<WebvhResourceLogController>;
|
|
106
95
|
pinStore: ResourceLogPinStore;
|
|
107
96
|
spaceId: string;
|
|
108
97
|
}): EncryptionDescriptorSource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"logSource.d.ts","sourceRoot":"","sources":["../../src/descriptors/logSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAA;AAEhC;;;;;GAKG;AACH,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,OAAO,EACP,YAAY,EACb,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,MAAM,CAET;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACR,EAAE;IACD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAA;IAClD,iBAAiB,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAC5D,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,0BAA0B,CAmB7B"}
|
|
@@ -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"}
|
|
@@ -185,6 +185,15 @@ export interface AccountGenesisResult {
|
|
|
185
185
|
* EncryptionDescriptorStore` -- builds the user-key roster's descriptor
|
|
186
186
|
* store once the account DID is known (the log-governed store's controller
|
|
187
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
|
|
188
197
|
* @param [options.provideKmsAuthentication] {Function} `({ spaceReady }) =>
|
|
189
198
|
* Promise<KmsAuthenticationBinding | undefined>` -- the KMS authentication
|
|
190
199
|
* binding's acquisition; absent or resolving `undefined`, the genesis is
|
|
@@ -218,7 +227,7 @@ export interface AccountGenesisResult {
|
|
|
218
227
|
* genesis emits at the same point
|
|
219
228
|
* @returns {Promise<AccountGenesisResult>}
|
|
220
229
|
*/
|
|
221
|
-
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController, onStage }: {
|
|
230
|
+
export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, collectionStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController, onStage }: {
|
|
222
231
|
was: WasClient;
|
|
223
232
|
wasAsClient?: WasClient;
|
|
224
233
|
wasServerUrl: string;
|
|
@@ -231,6 +240,9 @@ export declare function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, s
|
|
|
231
240
|
rosterStoreFor: (options: {
|
|
232
241
|
did: string;
|
|
233
242
|
}) => EncryptionDescriptorStore;
|
|
243
|
+
collectionStoreFor: (options: {
|
|
244
|
+
did: string;
|
|
245
|
+
}) => (collectionId: string) => EncryptionDescriptorStore;
|
|
234
246
|
provideKmsAuthentication?: (options: {
|
|
235
247
|
spaceReady: Promise<unknown>;
|
|
236
248
|
}) => Promise<KmsAuthenticationBinding | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountGenesis.d.ts","sourceRoot":"","sources":["../../src/genesis/accountGenesis.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,E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A;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
|
|
@@ -217,7 +226,7 @@ export class AccountGenesisSpaceError extends Error {
|
|
|
217
226
|
* genesis emits at the same point
|
|
218
227
|
* @returns {Promise<AccountGenesisResult>}
|
|
219
228
|
*/
|
|
220
|
-
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController = true, onStage }) {
|
|
229
|
+
export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spaceId, keyAgent, clientKeyAgreementKey, userKey, updateKeys, idStore, rosterStoreFor, collectionStoreFor, provideKmsAuthentication, expectedDid, onDidPublished, promoteController = true, onStage }) {
|
|
221
230
|
const failed = [];
|
|
222
231
|
const stage = stageNotifier(onStage);
|
|
223
232
|
// 1. The Space and its collection roster, create-if-absent under this
|
|
@@ -303,7 +312,7 @@ export async function ensureAccountGenesis({ was, wasAsClient, wasServerUrl, spa
|
|
|
303
312
|
if (rosterDescriptor) {
|
|
304
313
|
try {
|
|
305
314
|
const fanOut = await ensureWalletSpaceEpochs({
|
|
306
|
-
|
|
315
|
+
storeFor: collectionStoreFor({ did }),
|
|
307
316
|
spaceId,
|
|
308
317
|
userKey,
|
|
309
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;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAsB,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD;;GAEG;AACH,MAAM,cAAc,GAAG,EAAE,CAAA;AAkBzB;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,cAAc,CAAC,MAAM,CAC1B,MAAM,CAAC,eAAe,CAAC,I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C,CAAC,CAAC,EAAE,CAAC;gBACvC,OAAO;gBACP,GAAG;aACJ,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG;QACH,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,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"}
|