@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
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The one refusal class the resource-log layer still owns after the generic
|
|
6
6
|
* client side moved to `@interop/vh-resource-log` -- the ceremony-tail
|
|
7
|
-
* license refusal --
|
|
8
|
-
*
|
|
9
|
-
* must not paper over with a cached copy). The generic
|
|
10
|
-
* (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
|
|
7
|
+
* license refusal -- beside a re-export of that library's read-side
|
|
8
|
+
* classification of its taxonomy ({@link isResourceLogRefusal}: which
|
|
9
|
+
* refusals a caller must not paper over with a cached copy). The generic
|
|
10
|
+
* taxonomy (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
|
|
11
11
|
* `ResourceLogClosedError`, `LogNotConfirmedError`, and the store port's
|
|
12
|
-
* `ResourceLogConflictError`)
|
|
13
|
-
* of
|
|
14
|
-
* assigns its `name` string explicitly and is
|
|
15
|
-
* package boundaries (the WC-64 rule; minified
|
|
16
|
-
*
|
|
17
|
-
* constructors and why this file stays import-free.
|
|
12
|
+
* `ResourceLogConflictError`) and the predicate over it are the library's;
|
|
13
|
+
* wallet-core defines none of them -- one owner per name. Like every class
|
|
14
|
+
* in that taxonomy, this one assigns its `name` string explicitly and is
|
|
15
|
+
* matched by `err.name` across package boundaries (the WC-64 rule; minified
|
|
16
|
+
* class names do not survive bundling).
|
|
18
17
|
*/
|
|
19
18
|
/**
|
|
20
19
|
* A ladder-signed append outside the ceremony-tail license: it is not the
|
|
@@ -33,45 +32,13 @@ export class ResourceLogLicenseError extends Error {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* nothing worse than replication lag: the pin is never regressed and nothing
|
|
44
|
-
* rolled back is adopted, so serving the cached copy while a lagging replica
|
|
45
|
-
* catches up is exactly the offline case, and refusing there would lock a
|
|
46
|
-
* healthy account out of its own start. A `fork` or an SCID/method switch is
|
|
47
|
-
* a refusal like fabrication.
|
|
48
|
-
*
|
|
49
|
-
* `ResourceLogLicenseError` is deliberately absent, so a license refusal on a
|
|
50
|
-
* READ lands in the soft transport class (warn, serve cached). Ratified
|
|
51
|
-
* behavior, not omission: the log is not corrupt and the signer genuinely
|
|
52
|
-
* holds the credential, so the append is unlicensed rather than forged. The
|
|
53
|
-
* two shapes that argues against -- a compromised still-listed key holder,
|
|
54
|
-
* and a genuine unlicensed entry N masking a forged entry N+1 under whole-log
|
|
55
|
-
* first-failure semantics -- were weighed and accepted (WC-149). The
|
|
56
|
-
* pre-write half of the license is where the class does its work: a
|
|
57
|
-
* conformant writer is refused before an unlicensed entry can land.
|
|
58
|
-
*
|
|
59
|
-
* Matched on `err.name` rather than `instanceof`: these errors are raised
|
|
60
|
-
* inside app-injected seams that can resolve to a different copy of this
|
|
61
|
-
* package (linked, or duplicated through a dependency tree), and an
|
|
62
|
-
* `instanceof` miss would drop a security refusal into a caller's
|
|
63
|
-
* warn-and-proceed branch. Callers add only the names the generic taxonomy
|
|
64
|
-
* does not carry.
|
|
65
|
-
*
|
|
66
|
-
* @param err {unknown}
|
|
67
|
-
* @returns {boolean}
|
|
35
|
+
* The read-side classification of the library's taxonomy, re-exported so
|
|
36
|
+
* every consumer here keeps one owner per name: `true` for a fabricated log
|
|
37
|
+
* (`ResourceLogIntegrityError`) and for a `ResourceLogContinuityError` with
|
|
38
|
+
* any reason but `rollback`. The rollback carve-out and the deliberate
|
|
39
|
+
* absence of {@link ResourceLogLicenseError} from the set (a license refusal
|
|
40
|
+
* met on a READ lands in the soft transport class -- ratified under WC-149)
|
|
41
|
+
* are documented on the library's own definition.
|
|
68
42
|
*/
|
|
69
|
-
export
|
|
70
|
-
const candidate = err;
|
|
71
|
-
if (candidate?.name === 'ResourceLogIntegrityError') {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return (candidate?.name === 'ResourceLogContinuityError' &&
|
|
75
|
-
candidate.reason !== 'rollback');
|
|
76
|
-
}
|
|
43
|
+
export { isResourceLogRefusal } from '@interop/vh-resource-log';
|
|
77
44
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
10
|
* hook), the ceremony-tail license the hook carries
|
|
11
11
|
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
|
|
12
|
-
*
|
|
12
|
+
* the log-class dispatch that says which log the license binds
|
|
13
|
+
* (`ResourceLogClass` / `controllerForLogClass`), and the import-free
|
|
14
|
+
* account-document leaf they are built on (`document.ts`
|
|
13
15
|
* -- relation resolution, ladder-VM recognition, the credential class),
|
|
14
16
|
* whose public home is `webvh`, which re-exports it.
|
|
15
17
|
* Everything generic -- the JSON Lines codec, the store port and
|
|
@@ -25,4 +27,5 @@ export { webvhResourceLogController, type ControllerInventory, type WebvhResourc
|
|
|
25
27
|
export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
|
|
26
28
|
export { attributeLadderRungsPerVersion, type LadderRungKeys } from './ladderRungs.js';
|
|
27
29
|
export { assertLadderAppendLicensed } from './license.js';
|
|
30
|
+
export { controllerForLogClass, type ResourceLogClass } from './logClass.js';
|
|
28
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* credential-inventory view, supplying the mandatory `admitAppend` admission
|
|
10
10
|
* hook), the ceremony-tail license the hook carries
|
|
11
11
|
* (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
|
|
12
|
-
*
|
|
12
|
+
* the log-class dispatch that says which log the license binds
|
|
13
|
+
* (`ResourceLogClass` / `controllerForLogClass`), and the import-free
|
|
14
|
+
* account-document leaf they are built on (`document.ts`
|
|
13
15
|
* -- relation resolution, ladder-VM recognition, the credential class),
|
|
14
16
|
* whose public home is `webvh`, which re-exports it.
|
|
15
17
|
* Everything generic -- the JSON Lines codec, the store port and
|
|
@@ -25,4 +27,5 @@ export { webvhResourceLogController } from './controller.js';
|
|
|
25
27
|
export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
|
|
26
28
|
export { attributeLadderRungsPerVersion } from './ladderRungs.js';
|
|
27
29
|
export { assertLadderAppendLicensed } from './license.js';
|
|
30
|
+
export { controllerForLogClass } from './logClass.js';
|
|
28
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAE/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAyB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The resource-log CLASS dispatch: which admission rule a controller view
|
|
6
|
+
* carries for the log it is about to verify or extend. One account document
|
|
7
|
+
* governs several logs -- the user key roster log, and one encryption
|
|
8
|
+
* descriptor log per governed collection -- so the rule is a property of the
|
|
9
|
+
* log, not of the document, and the adapter that reads the document
|
|
10
|
+
* (`webvhResourceLogController`) cannot know which log its view is about to
|
|
11
|
+
* serve. The class therefore rides the STORE, which is built for exactly one
|
|
12
|
+
* log and states its class at construction; the store passes its resolved
|
|
13
|
+
* view through {@link controllerForLogClass} before every read and every
|
|
14
|
+
* append, so read-side verification and write-side admission run under the
|
|
15
|
+
* same rule and no call site can exempt itself.
|
|
16
|
+
*
|
|
17
|
+
* The rules, one per member of {@link ResourceLogClass}. A new log class is
|
|
18
|
+
* added to the union with its rule stated here, rather than by exempting a
|
|
19
|
+
* caller (app-connect-spec `decisions/0003`, "Scope").
|
|
20
|
+
*/
|
|
21
|
+
import type { WebvhResourceLogController } from './controller.js';
|
|
22
|
+
/**
|
|
23
|
+
* The classes of resource log this wallet verifies, each naming the rule its
|
|
24
|
+
* views admit ladder-signed appends under.
|
|
25
|
+
*
|
|
26
|
+
* - `'user-key-roster'`: the user key roster log (`key-map/user-key.jsonl`),
|
|
27
|
+
* the log governing the account's root key. A ladder-signed append to it
|
|
28
|
+
* carries the ceremony-tail license (clause B of the ladder VM's authority
|
|
29
|
+
* clauses): one of the license's enumerated shapes, one-shot per licensed
|
|
30
|
+
* controller version, at most one ladder proof per entry. This is the
|
|
31
|
+
* adapter's own view, unchanged.
|
|
32
|
+
* - `'collection-descriptor'`: a per-collection encryption descriptor log
|
|
33
|
+
* (one per governed collection, the encrypted-collections profile's log
|
|
34
|
+
* form). A ladder-signed append admits on `assertionMethod` membership at
|
|
35
|
+
* the anchored version alone, with no shape check and no one-shot. The
|
|
36
|
+
* license exists to refuse the silent rekey of the account's root key to
|
|
37
|
+
* recipients of a credential thief's choosing; a descriptor append escrows
|
|
38
|
+
* one recipient into one collection and lands as a hash-chained entry
|
|
39
|
+
* signed by that credential's ladder VM, auditable by the account's clients
|
|
40
|
+
* and attributable to the credential, so the bound it leaves is
|
|
41
|
+
* detect-and-remediate rather than silence.
|
|
42
|
+
*/
|
|
43
|
+
export type ResourceLogClass = 'user-key-roster' | 'collection-descriptor';
|
|
44
|
+
/**
|
|
45
|
+
* Returns the controller view a log of the given class must be verified and
|
|
46
|
+
* appended to under: the adapter's licensed view for the roster class, and a
|
|
47
|
+
* view identical in every other member with a membership-only `admitAppend`
|
|
48
|
+
* for the collection-descriptor class.
|
|
49
|
+
*
|
|
50
|
+
* The hook stays a real function rather than being dropped, because the
|
|
51
|
+
* wallet-core extended view makes it mandatory: an account document can list
|
|
52
|
+
* ladder VMs, so a view over one always answers the question, and the
|
|
53
|
+
* collection-descriptor answer is "membership is enough". The library
|
|
54
|
+
* verifier has already settled `assertionMethod` membership at the entry's
|
|
55
|
+
* anchored controller version before the hook runs, so the hook resolves
|
|
56
|
+
* nothing and returns.
|
|
57
|
+
*
|
|
58
|
+
* @param options {object}
|
|
59
|
+
* @param options.controller {WebvhResourceLogController} the adapter's
|
|
60
|
+
* view over the verified account log
|
|
61
|
+
* @param options.logClass {ResourceLogClass} the class of the log this view
|
|
62
|
+
* will serve
|
|
63
|
+
* @returns {WebvhResourceLogController}
|
|
64
|
+
*/
|
|
65
|
+
export declare function controllerForLogClass({ controller, logClass }: {
|
|
66
|
+
controller: WebvhResourceLogController;
|
|
67
|
+
logClass: ResourceLogClass;
|
|
68
|
+
}): WebvhResourceLogController;
|
|
69
|
+
//# sourceMappingURL=logClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logClass.d.ts","sourceRoot":"","sources":["../../src/resourceLog/logClass.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,uBAAuB,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,QAAQ,EACT,EAAE;IACD,UAAU,EAAE,0BAA0B,CAAA;IACtC,QAAQ,EAAE,gBAAgB,CAAA;CAC3B,GAAG,0BAA0B,CAsB7B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the controller view a log of the given class must be verified and
|
|
3
|
+
* appended to under: the adapter's licensed view for the roster class, and a
|
|
4
|
+
* view identical in every other member with a membership-only `admitAppend`
|
|
5
|
+
* for the collection-descriptor class.
|
|
6
|
+
*
|
|
7
|
+
* The hook stays a real function rather than being dropped, because the
|
|
8
|
+
* wallet-core extended view makes it mandatory: an account document can list
|
|
9
|
+
* ladder VMs, so a view over one always answers the question, and the
|
|
10
|
+
* collection-descriptor answer is "membership is enough". The library
|
|
11
|
+
* verifier has already settled `assertionMethod` membership at the entry's
|
|
12
|
+
* anchored controller version before the hook runs, so the hook resolves
|
|
13
|
+
* nothing and returns.
|
|
14
|
+
*
|
|
15
|
+
* @param options {object}
|
|
16
|
+
* @param options.controller {WebvhResourceLogController} the adapter's
|
|
17
|
+
* view over the verified account log
|
|
18
|
+
* @param options.logClass {ResourceLogClass} the class of the log this view
|
|
19
|
+
* will serve
|
|
20
|
+
* @returns {WebvhResourceLogController}
|
|
21
|
+
*/
|
|
22
|
+
export function controllerForLogClass({ controller, logClass }) {
|
|
23
|
+
switch (logClass) {
|
|
24
|
+
case 'user-key-roster':
|
|
25
|
+
return controller;
|
|
26
|
+
case 'collection-descriptor':
|
|
27
|
+
return {
|
|
28
|
+
...controller,
|
|
29
|
+
async admitAppend() {
|
|
30
|
+
// Membership at the anchored version is the whole rule for this
|
|
31
|
+
// class, and the verifier has already checked it.
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
default: {
|
|
36
|
+
// Fail closed: a class this dispatch does not name (a cast, a caller
|
|
37
|
+
// outside the type system) gets no rule, not the permissive one.
|
|
38
|
+
const unknown = logClass;
|
|
39
|
+
throw new TypeError(`Unknown resource-log class ${JSON.stringify(unknown)}.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=logClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logClass.js","sourceRoot":"","sources":["../../src/resourceLog/logClass.ts"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,EACV,QAAQ,EAIT;IACC,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,iBAAiB;YACpB,OAAO,UAAU,CAAA;QACnB,KAAK,uBAAuB;YAC1B,OAAO;gBACL,GAAG,UAAU;gBACb,KAAK,CAAC,WAAW;oBACf,gEAAgE;oBAChE,kDAAkD;oBAClD,OAAM;gBACR,CAAC;aACF,CAAA;QACH,OAAO,CAAC,CAAC,CAAC;YACR,qEAAqE;YACrE,iEAAiE;YACjE,MAAM,OAAO,GAAU,QAAQ,CAAA;YAC/B,MAAM,IAAI,SAAS,CACjB,8BAA8B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CACzD,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -25,8 +25,10 @@ export declare const APP_CONNECTIONS_COLLECTION = "app-connections";
|
|
|
25
25
|
* friendly display name both wallets pass as the server-side collection name,
|
|
26
26
|
* and the storage attributes --
|
|
27
27
|
*
|
|
28
|
-
* - `encryption` -- `'edv'` stores each document as
|
|
29
|
-
* stores it verbatim.
|
|
28
|
+
* - `encryption` -- how documents are stored: `'edv'` stores each document as
|
|
29
|
+
* an EDV envelope, `'plaintext'` stores it verbatim. It says nothing about
|
|
30
|
+
* where the `encryption` descriptor lives; an `edv` collection is created
|
|
31
|
+
* bare and declared encrypted by its governing history log's genesis.
|
|
30
32
|
* - `isPublic` -- whether the collection is granted collection-level world read
|
|
31
33
|
* on the server.
|
|
32
34
|
*/
|
|
@@ -219,6 +221,24 @@ export declare const DID_KEYS_RESOURCE = "keys.json";
|
|
|
219
221
|
* directly with a compare-and-swap etag -- never replicated.
|
|
220
222
|
*/
|
|
221
223
|
export declare const USER_KEY_ROSTER_LOG_RESOURCE = "user-key.jsonl";
|
|
224
|
+
/**
|
|
225
|
+
* The governing history log of every encrypted wallet collection: the
|
|
226
|
+
* per-collection encryption descriptor log, at the Collection's own
|
|
227
|
+
* `meta/log` sub-resource.
|
|
228
|
+
*
|
|
229
|
+
* It is a Collection SUB-RESOURCE under the reserved `meta` segment, not a
|
|
230
|
+
* Resource in the Collection: it is absent from listings and from the changes
|
|
231
|
+
* feed, exempt from the envelope rule, covered by any capability whose target
|
|
232
|
+
* covers the Collection, and created and deleted with the Collection. Its
|
|
233
|
+
* body is plaintext JSON Lines, one signed entry per line, and the verified
|
|
234
|
+
* head entry's state IS the collection's `encryption` descriptor -- the
|
|
235
|
+
* server derives the Collection Description's `encryption` member from it, so
|
|
236
|
+
* no client writes that member on a governed collection.
|
|
237
|
+
*
|
|
238
|
+
* The transport is was-client's `resourceLogStore({ collection })`, which
|
|
239
|
+
* reads and writes exactly this sub-resource through the Collection handle.
|
|
240
|
+
*/
|
|
241
|
+
export declare const COLLECTION_HISTORY_LOG_SUBRESOURCE = "meta/log";
|
|
222
242
|
/**
|
|
223
243
|
* The enrolled-client display labels, sibling of `keys.json` and
|
|
224
244
|
* `user-key.jsonl` in the same private `key-map` collection: a plain-JSON map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/space/collections.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,8BAA8B,wBAAwB,CAAA;AACnE;;GAEG;AACH,eAAO,MAAM,6BAA6B,uBAAuB,CAAA;AACjE;;GAEG;AACH,eAAO,MAAM,0BAA0B,oBAAoB,CAAA;AAC3D;;GAEG;AACH,eAAO,MAAM,0BAA0B,oBAAoB,CAAA;AAE3D
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/space/collections.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C;;GAEG;AACH,eAAO,MAAM,8BAA8B,wBAAwB,CAAA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ED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,kBAK5C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAO1D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,EAIzD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,EAG7D,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAIvD;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,aAAa,CAAA;AAC/C;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,cAAc,CAAA;AAC5C;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,mBAAmB,CAAA;AAC5D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kCAAkC,aAAa,CAAA;AAC5D;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAC1D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,CAAA;AACrD;;GAEG;AACH,eAAO,MAAM,gBAAgB,iBAAiB,CAAA"}
|
|
@@ -269,6 +269,24 @@ export const DID_KEYS_RESOURCE = 'keys.json';
|
|
|
269
269
|
* directly with a compare-and-swap etag -- never replicated.
|
|
270
270
|
*/
|
|
271
271
|
export const USER_KEY_ROSTER_LOG_RESOURCE = 'user-key.jsonl';
|
|
272
|
+
/**
|
|
273
|
+
* The governing history log of every encrypted wallet collection: the
|
|
274
|
+
* per-collection encryption descriptor log, at the Collection's own
|
|
275
|
+
* `meta/log` sub-resource.
|
|
276
|
+
*
|
|
277
|
+
* It is a Collection SUB-RESOURCE under the reserved `meta` segment, not a
|
|
278
|
+
* Resource in the Collection: it is absent from listings and from the changes
|
|
279
|
+
* feed, exempt from the envelope rule, covered by any capability whose target
|
|
280
|
+
* covers the Collection, and created and deleted with the Collection. Its
|
|
281
|
+
* body is plaintext JSON Lines, one signed entry per line, and the verified
|
|
282
|
+
* head entry's state IS the collection's `encryption` descriptor -- the
|
|
283
|
+
* server derives the Collection Description's `encryption` member from it, so
|
|
284
|
+
* no client writes that member on a governed collection.
|
|
285
|
+
*
|
|
286
|
+
* The transport is was-client's `resourceLogStore({ collection })`, which
|
|
287
|
+
* reads and writes exactly this sub-resource through the Collection handle.
|
|
288
|
+
*/
|
|
289
|
+
export const COLLECTION_HISTORY_LOG_SUBRESOURCE = 'meta/log';
|
|
272
290
|
/**
|
|
273
291
|
* The enrolled-client display labels, sibling of `keys.json` and
|
|
274
292
|
* `user-key.jsonl` in the same private `key-map` collection: a plain-JSON map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/space/collections.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAA;AACnE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAA;AACjE;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAA;AAC3D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/space/collections.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,MAAM,CAAC,MAAM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AM,uBAAuB,GAAG,cAAc,CAAA;AACrD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAA"}
|
package/dist/space/index.d.ts
CHANGED
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
* `keyring.json`) -- outside the synced set, never replicated.
|
|
18
18
|
* - `provisionWalletSpace`, the one-shot full-roster provisioner every
|
|
19
19
|
* controller-tier wallet client runs (create-if-absent, never clobbering
|
|
20
|
-
* settled configuration). It
|
|
21
|
-
* epoch[0]
|
|
20
|
+
* settled configuration). It creates the encrypted collections BARE; their
|
|
21
|
+
* declaration and epoch[0] both arrive with the genesis of each one's
|
|
22
|
+
* governing history log, in the EDV-bearing `ensureWalletSpaceEpochs` in
|
|
22
23
|
* `@interop/wallet-core/keys`, kept out of this crypto-free module.
|
|
23
24
|
* - `plaintextCollection`, the one handle builder for the system collections
|
|
24
25
|
* whose resources never go through the encryption codec.
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
*/
|
|
36
37
|
export { deleteSpaceWithCapability } from './deleteSpace.js';
|
|
37
38
|
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
38
|
-
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, CLIENT_LABELS_RESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
39
|
+
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, CLIENT_LABELS_RESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
39
40
|
export type { SpaceProvisionSpec, SpaceCollectionSpec } from './collections.js';
|
|
40
41
|
export { provisionWalletSpace } from './provisioning.js';
|
|
41
42
|
export { plaintextCollection } from './plaintextCollection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,kCAAkC,EAClC,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/space/index.js
CHANGED
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
* `keyring.json`) -- outside the synced set, never replicated.
|
|
18
18
|
* - `provisionWalletSpace`, the one-shot full-roster provisioner every
|
|
19
19
|
* controller-tier wallet client runs (create-if-absent, never clobbering
|
|
20
|
-
* settled configuration). It
|
|
21
|
-
* epoch[0]
|
|
20
|
+
* settled configuration). It creates the encrypted collections BARE; their
|
|
21
|
+
* declaration and epoch[0] both arrive with the genesis of each one's
|
|
22
|
+
* governing history log, in the EDV-bearing `ensureWalletSpaceEpochs` in
|
|
22
23
|
* `@interop/wallet-core/keys`, kept out of this crypto-free module.
|
|
23
24
|
* - `plaintextCollection`, the one handle builder for the system collections
|
|
24
25
|
* whose resources never go through the encryption codec.
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
*/
|
|
36
37
|
export { deleteSpaceWithCapability } from './deleteSpace.js';
|
|
37
38
|
export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
38
|
-
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, CLIENT_LABELS_RESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
39
|
+
export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, CLIENT_LABELS_RESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
|
|
39
40
|
export { provisionWalletSpace } from './provisioning.js';
|
|
40
41
|
export { plaintextCollection } from './plaintextCollection.js';
|
|
41
42
|
export { ACTIVITY_TYPE, addHistoryNewAccount, addHistorySpaceCreated, addHistoryCredentialCreated, addHistoryCredentialDeleted, addHistoryCredentialShared, addHistoryCredentialUnshared, addHistoryLogin, addHistoryWalletLogin, addHistoryAppRevoke, addHistoryAgentRevoke, addHistoryClientRevoked, addHistoryGenerationCollected } from './activity.js';
|
package/dist/space/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,kCAAkC,EAClC,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
* `WALLET_SPACE_PROVISION_ROSTER` -- the synced feeds plus the non-synced
|
|
8
8
|
* system collections (`id`, `key-map`) -- so a Space's layout never depends on
|
|
9
9
|
* which app happened to provision it.
|
|
10
|
+
*
|
|
11
|
+
* An `edv` roster collection is created BARE here: no `encryption` member in
|
|
12
|
+
* its Collection Description. Such a collection is declared encrypted by its
|
|
13
|
+
* governing history log's genesis instead -- the guarded create the epoch[0]
|
|
14
|
+
* install runs (`ensureWalletSpaceEpochs`, `@interop/wallet-core/keys`). The
|
|
15
|
+
* order is forced: the server refuses to govern a Description that already
|
|
16
|
+
* carries a client-written `encryption` member, so a collection declared
|
|
17
|
+
* encrypted here could never become governed. `plaintext` specs are
|
|
18
|
+
* unchanged.
|
|
10
19
|
*/
|
|
11
20
|
import type { WasClient } from '@interop/was-client';
|
|
12
21
|
/**
|
|
@@ -24,12 +33,13 @@ import type { WasClient } from '@interop/was-client';
|
|
|
24
33
|
* heals a torn signup's missing collections without touching settled
|
|
25
34
|
* configuration.
|
|
26
35
|
*
|
|
27
|
-
* This
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
36
|
+
* This creates the containers and installs no key material and no descriptor:
|
|
37
|
+
* an `edv` roster collection is created with no `encryption` member at all,
|
|
38
|
+
* and both its declaration and its epoch[0] arrive together as the genesis of
|
|
39
|
+
* its governing history log, in `ensureWalletSpaceEpochs`
|
|
40
|
+
* (`@interop/wallet-core/keys`) -- the EDV-bearing second step kept out of
|
|
41
|
+
* this module so the root barrel stays crypto-free. Reads and writes on such
|
|
42
|
+
* a collection are refused fail-closed until that genesis lands.
|
|
33
43
|
*
|
|
34
44
|
* @param options {object}
|
|
35
45
|
* @param options.was {WasClient}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning.d.ts","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"provisioning.d.ts","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,GAAG,EACH,OAAO,EACP,aAAa,EACd,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB"}
|
|
@@ -15,12 +15,13 @@ import { WALLET_SPACE_NAME, WALLET_SPACE_PROVISION_ROSTER } from './collections.
|
|
|
15
15
|
* heals a torn signup's missing collections without touching settled
|
|
16
16
|
* configuration.
|
|
17
17
|
*
|
|
18
|
-
* This
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* This creates the containers and installs no key material and no descriptor:
|
|
19
|
+
* an `edv` roster collection is created with no `encryption` member at all,
|
|
20
|
+
* and both its declaration and its epoch[0] arrive together as the genesis of
|
|
21
|
+
* its governing history log, in `ensureWalletSpaceEpochs`
|
|
22
|
+
* (`@interop/wallet-core/keys`) -- the EDV-bearing second step kept out of
|
|
23
|
+
* this module so the root barrel stays crypto-free. Reads and writes on such
|
|
24
|
+
* a collection are refused fail-closed until that genesis lands.
|
|
24
25
|
*
|
|
25
26
|
* @param options {object}
|
|
26
27
|
* @param options.was {WasClient}
|
|
@@ -51,7 +52,10 @@ async function ensureCollection({ was, spaceId, controllerDid, spaceDescription,
|
|
|
51
52
|
controllerDid,
|
|
52
53
|
collectionId,
|
|
53
54
|
collectionName: name,
|
|
54
|
-
|
|
55
|
+
// An `edv` roster collection is declared encrypted by its governing
|
|
56
|
+
// log's genesis, never by a Description member: the server refuses to
|
|
57
|
+
// govern a Description that already carries one.
|
|
58
|
+
encryption: encryption === 'edv' ? 'governed' : encryption,
|
|
55
59
|
isPublic,
|
|
56
60
|
spaceDescription,
|
|
57
61
|
spaceName: WALLET_SPACE_NAME
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning.js","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provisioning.js","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AAGzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,GAAG,EACH,OAAO,EACP,aAAa,EAKd;IACC,wEAAwE;IACxE,yEAAyE;IACzE,sEAAsE;IACtE,4EAA4E;IAC5E,mDAAmD;IACnD,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC;QACzC,GAAG;QACH,OAAO;QACP,aAAa;QACb,SAAS,EAAE,iBAAiB;KAC7B,CAAC,CAAA;IACF,MAAM,OAAO,CAAC,GAAG,CACf,6BAA6B,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACvC,gBAAgB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAC1E,CACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,EAC9B,GAAG,EACH,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAOnD;IACC,IAAI,CAAC;QACH,MAAM,wBAAwB,CAAC;YAC7B,GAAG;YACH,OAAO;YACP,aAAa;YACb,YAAY;YACZ,cAAc,EAAE,IAAI;YACpB,oEAAoE;YACpE,sEAAsE;YACtE,iDAAiD;YACjD,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;YAC1D,QAAQ;YACR,gBAAgB;YAChB,SAAS,EAAE,iBAAiB;SAC7B,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kCAAkC,YAAY,eAAe,OAAO,IAAI,EACxE,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/dist/sync/engine.d.ts
CHANGED
|
@@ -43,8 +43,10 @@ export interface SyncEngineDeps {
|
|
|
43
43
|
/**
|
|
44
44
|
* Idempotent space + collection provisioning. For an encrypted collection
|
|
45
45
|
* this MUST include publishing the collection's encryption descriptor with
|
|
46
|
-
* its key-epoch roster (the wallet Space two-step: `provisionWalletSpace
|
|
47
|
-
* then `ensureWalletSpaceEpochs
|
|
46
|
+
* its key-epoch roster (the wallet Space two-step: `provisionWalletSpace`
|
|
47
|
+
* creates the collections bare, then `ensureWalletSpaceEpochs` declares
|
|
48
|
+
* each encrypted one and lands its epoch[0], as the genesis of the
|
|
49
|
+
* collection's own governing history log; `walletSpaceProvisioner` in
|
|
48
50
|
* `@interop/wallet-core/keys` builds the closure that runs both). The
|
|
49
51
|
* engine runs it ahead of every cycle's migration sweep and push, which is
|
|
50
52
|
* what enforces the descriptor-before-first-content-push ordering
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/sync/engine.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAQ/E;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,OAAO,CAAA;IAC5C;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/sync/engine.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,S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C,WAAW,GAAG,IAAI,CAAA;YACvB,KAAK,IAAI,CAAC,IAAI,EAAE,CAAA;QAClB,CAAC,EAAE,KAAK,CAAC,CAAA;IACX,CAAC;IAEO,UAAU;QAChB,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,WAAW,EAAE,CAAA;YAClB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACzB,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,MAAkB;QAClC,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAM;QACR,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC;CACF"}
|
package/dist/sync/index.d.ts
CHANGED
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
* WAS-enabled wallet apps share.
|
|
8
8
|
*
|
|
9
9
|
* - The wire contract and port seam (`WasSyncPort`, `SyncCheckpoint`, `WireDoc`,
|
|
10
|
-
* `Json`, `DocCipher`, `MasterState`, and the
|
|
11
|
-
* `WasSyncNotFoundError` / `UnknownEpochError`
|
|
12
|
-
* `@interop/was-client/sync` and are re-exported here so
|
|
13
|
-
* imports one package.
|
|
10
|
+
* `Json`, `DocCipher`, `MasterState`, `WriteAck`, and the
|
|
11
|
+
* `WasSyncConflictError` / `WasSyncNotFoundError` / `UnknownEpochError`
|
|
12
|
+
* signals) come from `@interop/was-client/sync` and are re-exported here so
|
|
13
|
+
* an engine consumer imports one package. The server's `ETag` is opaque and
|
|
14
|
+
* carried verbatim on `MasterState.etag` / `WireDoc.etag` / `WriteAck.etag`
|
|
15
|
+
* -- a caller echoes it back as a later write's `ifMatch` rather than
|
|
16
|
+
* rebuilding it from `version`.
|
|
14
17
|
* - The predicates that classify those signals (`isSyncConflictError` /
|
|
15
18
|
* `isSyncNotFoundError` / `isUnknownEpochError`) and the `SyncStatus`
|
|
16
19
|
* vocabulary ship from `@interop/was-client/sync` too. They are imported
|
|
@@ -34,10 +37,10 @@
|
|
|
34
37
|
* the shared core.
|
|
35
38
|
*/
|
|
36
39
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
37
|
-
export type { Json, SyncCheckpoint, WireDoc, MasterState, WasSyncPort, DocCipher } from '@interop/was-client/sync';
|
|
40
|
+
export type { Json, SyncCheckpoint, WireDoc, MasterState, WriteAck, WasSyncPort, DocCipher } from '@interop/was-client/sync';
|
|
38
41
|
export type { SyncStore, SyncedRow, ProjectionAction, ResolveConflict } from './types.js';
|
|
39
42
|
export { runPull, projectionForDoc } from './pull.js';
|
|
40
|
-
export { runPush
|
|
43
|
+
export { runPush } from './push.js';
|
|
41
44
|
export { remintPendingEnvelopes } from './remint.js';
|
|
42
45
|
export { SyncEngine } from './engine.js';
|
|
43
46
|
export type { SyncEngineDeps } from './engine.js';
|
package/dist/sync/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACR,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AAEjC,YAAY,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
|