@interop/wallet-core 0.7.0 → 0.8.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 +31 -3
- package/dist/descriptors/acquire.d.ts +110 -0
- package/dist/descriptors/acquire.d.ts.map +1 -0
- package/dist/{markers → descriptors}/acquire.js +28 -25
- package/dist/descriptors/acquire.js.map +1 -0
- package/dist/{markers → descriptors}/cipher.d.ts +19 -19
- package/dist/descriptors/cipher.d.ts.map +1 -0
- package/dist/{markers → descriptors}/cipher.js +11 -11
- package/dist/descriptors/cipher.js.map +1 -0
- package/dist/descriptors/index.d.ts +32 -0
- package/dist/descriptors/index.d.ts.map +1 -0
- package/dist/descriptors/index.js +31 -0
- package/dist/descriptors/index.js.map +1 -0
- package/dist/{markers → descriptors}/refresh.d.ts +8 -8
- package/dist/descriptors/refresh.d.ts.map +1 -0
- package/dist/{markers → descriptors}/refresh.js +8 -8
- package/dist/descriptors/refresh.js.map +1 -0
- package/dist/enrollment/enrollment.d.ts +4 -4
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +4 -4
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/keys/index.d.ts +7 -6
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +7 -6
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/pukRoster.d.ts +24 -20
- package/dist/keys/pukRoster.d.ts.map +1 -1
- package/dist/keys/pukRoster.js +27 -24
- package/dist/keys/pukRoster.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +6 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +7 -7
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/space/collections.d.ts +1 -1
- package/dist/space/collections.js +1 -1
- package/dist/sync/collections.d.ts +2 -1
- package/dist/sync/collections.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/markers/acquire.d.ts +0 -107
- package/dist/markers/acquire.d.ts.map +0 -1
- package/dist/markers/acquire.js.map +0 -1
- package/dist/markers/cipher.d.ts.map +0 -1
- package/dist/markers/cipher.js.map +0 -1
- package/dist/markers/index.d.ts +0 -30
- package/dist/markers/index.d.ts.map +0 -1
- package/dist/markers/index.js +0 -29
- package/dist/markers/index.js.map +0 -1
- package/dist/markers/refresh.d.ts.map +0 -1
- package/dist/markers/refresh.js.map +0 -1
|
@@ -35,7 +35,7 @@ import { enrollWebvhClient, mintClientWebvhUpdateKeys, updateKeyMultibase } from
|
|
|
35
35
|
import { clientSigningKeyMultibase, isWebvhDid, webvhZcapClient } from '../webvh/zcap.js';
|
|
36
36
|
import { addPukRosterRecipient } from '../keys/pukRoster.js';
|
|
37
37
|
import { readPukRoster } from '../keys/pukRoster.js';
|
|
38
|
-
import {
|
|
38
|
+
import { pukRosterDescriptorStore } from '../keys/rosterStore.js';
|
|
39
39
|
/**
|
|
40
40
|
* The connect-code prefix; the payload after it is base64url(JSON) of an
|
|
41
41
|
* `EnrollmentRequest` plus a `v` version stamp.
|
|
@@ -192,8 +192,8 @@ export async function mintEnrollmentRequest() {
|
|
|
192
192
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} the approving
|
|
193
193
|
* client's own (identity) key-agreement key, unwrapping each epoch for
|
|
194
194
|
* re-wrapping
|
|
195
|
-
* @param options.pukRosterStore {
|
|
196
|
-
* `key-map/puk.json`
|
|
195
|
+
* @param options.pukRosterStore {EncryptionDescriptorStore} the account's
|
|
196
|
+
* `key-map/puk.json` descriptor store
|
|
197
197
|
* @param options.idStore {WebvhIdStore} the account's `id` collection
|
|
198
198
|
* @returns {Promise<{ did: string }>} the account's did:webvh
|
|
199
199
|
*/
|
|
@@ -278,7 +278,7 @@ export async function completeEnrollmentCore({ clientSeed, webvhUpdateKeys, poin
|
|
|
278
278
|
// the add entry just published, unwrapping the PUK the enrolling client
|
|
279
279
|
// escrowed to this client's key-agreement key.
|
|
280
280
|
const zcapClient = webvhZcapClient({ keyAgent, did });
|
|
281
|
-
const store =
|
|
281
|
+
const store = pukRosterDescriptorStore({
|
|
282
282
|
storageServerUrl: pointer.host,
|
|
283
283
|
zcapClient,
|
|
284
284
|
spaceId: pointer.spaceId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/enrollment/enrollment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EA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,CAAC,SAAS,CAAC,CAAA;IAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,sBAAsB,EAAE,CAAA;IACpC,CAAC;IAED,yEAAyE;IACzE,wEAAwE;IACxE,+CAA+C;IAC/C,MAAM,UAAU,GAAG,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IACrD,MAAM,KAAK,GAAG,wBAAwB,CAAC;QACrC,gBAAgB,EAAE,OAAO,CAAC,IAAI;QAC9B,UAAU;QACV,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC;QAC/B,KAAK;QACL,qBAAqB,EAAE,eAAe;KACvC,CAAC,CAAA;IACF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,2BAA2B,CAC9B,CAAA;IACH,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAA;AAC7D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,19 +21,21 @@
|
|
|
21
21
|
* entries, and ZCap signing under the did:webvh verification-method id.
|
|
22
22
|
* - `@interop/wallet-core/keys` -- the per-user key (PUK) and its
|
|
23
23
|
* `key-map/puk.json` wrap-set roster.
|
|
24
|
-
* - `@interop/wallet-core/
|
|
24
|
+
* - `@interop/wallet-core/descriptors` -- collection encryption-descriptor
|
|
25
25
|
* acquisition (fetch / cache / offline fallback) and the unknown-epoch
|
|
26
26
|
* refresh policy, including a self-refreshing EDV document cipher.
|
|
27
27
|
* - `@interop/wallet-core/keyring` -- the unlock layer: the unlock derivation,
|
|
28
28
|
* the account-pointer record codec, and the unlock Space.
|
|
29
29
|
* - `@interop/wallet-core/enrollment` -- the client enrollment ceremony
|
|
30
30
|
* (connect code, approval, completion).
|
|
31
|
+
* - `@interop/wallet-core/recovery` -- recovery codes on the roster identity
|
|
32
|
+
* model: a code as a minimal always-enrolled wallet client.
|
|
31
33
|
*
|
|
32
34
|
* This root re-exports `sync` and `space` for convenience. `identity`,
|
|
33
|
-
* `request`, `display`, `webvh`, `keys`, `
|
|
34
|
-
* `enrollment` are deliberately NOT re-exported here, so
|
|
35
|
-
* of the root never pull the signing / KMS /
|
|
36
|
-
* (the was-client subpath-isolation pattern).
|
|
35
|
+
* `request`, `display`, `webvh`, `keys`, `descriptors`, `keyring`,
|
|
36
|
+
* `enrollment`, and `recovery` are deliberately NOT re-exported here, so
|
|
37
|
+
* plaintext consumers of the root never pull the signing / KMS /
|
|
38
|
+
* document-loader dependency graph (the was-client subpath-isolation pattern).
|
|
37
39
|
*/
|
|
38
40
|
export * from './sync/index.js';
|
|
39
41
|
export * from './space/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -21,19 +21,21 @@
|
|
|
21
21
|
* entries, and ZCap signing under the did:webvh verification-method id.
|
|
22
22
|
* - `@interop/wallet-core/keys` -- the per-user key (PUK) and its
|
|
23
23
|
* `key-map/puk.json` wrap-set roster.
|
|
24
|
-
* - `@interop/wallet-core/
|
|
24
|
+
* - `@interop/wallet-core/descriptors` -- collection encryption-descriptor
|
|
25
25
|
* acquisition (fetch / cache / offline fallback) and the unknown-epoch
|
|
26
26
|
* refresh policy, including a self-refreshing EDV document cipher.
|
|
27
27
|
* - `@interop/wallet-core/keyring` -- the unlock layer: the unlock derivation,
|
|
28
28
|
* the account-pointer record codec, and the unlock Space.
|
|
29
29
|
* - `@interop/wallet-core/enrollment` -- the client enrollment ceremony
|
|
30
30
|
* (connect code, approval, completion).
|
|
31
|
+
* - `@interop/wallet-core/recovery` -- recovery codes on the roster identity
|
|
32
|
+
* model: a code as a minimal always-enrolled wallet client.
|
|
31
33
|
*
|
|
32
34
|
* This root re-exports `sync` and `space` for convenience. `identity`,
|
|
33
|
-
* `request`, `display`, `webvh`, `keys`, `
|
|
34
|
-
* `enrollment` are deliberately NOT re-exported here, so
|
|
35
|
-
* of the root never pull the signing / KMS /
|
|
36
|
-
* (the was-client subpath-isolation pattern).
|
|
35
|
+
* `request`, `display`, `webvh`, `keys`, `descriptors`, `keyring`,
|
|
36
|
+
* `enrollment`, and `recovery` are deliberately NOT re-exported here, so
|
|
37
|
+
* plaintext consumers of the root never pull the signing / KMS /
|
|
38
|
+
* document-loader dependency graph (the was-client subpath-isolation pattern).
|
|
37
39
|
*/
|
|
38
40
|
export * from './sync/index.js';
|
|
39
41
|
export * from './space/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
|
package/dist/keys/index.d.ts
CHANGED
|
@@ -10,15 +10,16 @@
|
|
|
10
10
|
* vault key-agreement key + resolver from stored material.
|
|
11
11
|
* - `ensurePukRoster` / `addPukRosterRecipient` / `readPukRoster` /
|
|
12
12
|
* `pukRosterRecipientResolver` -- the `key-map/puk.json` roster over the
|
|
13
|
-
* was-client
|
|
14
|
-
* resource-hosted
|
|
15
|
-
* a recipient resolver backed by the locally verified did:webvh
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* was-client descriptor-store seam, with the three client-side guards a
|
|
14
|
+
* resource-hosted descriptor needs (`epochsMac`, the latest-seen epoch pin,
|
|
15
|
+
* and a recipient resolver backed by the locally verified did:webvh
|
|
16
|
+
* document).
|
|
17
|
+
* - `pukRosterDescriptorStore` -- that descriptor store, built from a bare
|
|
18
|
+
* signing client for the login-time direct read.
|
|
18
19
|
*/
|
|
19
20
|
export { mintPuk, pukVaultKeys } from './puk.js';
|
|
20
21
|
export type { Puk } from './puk.js';
|
|
21
22
|
export { addPukRosterRecipient, ensurePukRoster, PukRosterContinuityError, PukRosterIntegrityError, PukRosterUnwrapError, pukRosterRecipientResolver, readPukRoster } from './pukRoster.js';
|
|
22
23
|
export type { PukRosterReadResult, RosterRecipientDocument } from './pukRoster.js';
|
|
23
|
-
export {
|
|
24
|
+
export { pukRosterDescriptorStore } from './rosterStore.js';
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
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;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAChD,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACd,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/keys/index.js
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
* vault key-agreement key + resolver from stored material.
|
|
11
11
|
* - `ensurePukRoster` / `addPukRosterRecipient` / `readPukRoster` /
|
|
12
12
|
* `pukRosterRecipientResolver` -- the `key-map/puk.json` roster over the
|
|
13
|
-
* was-client
|
|
14
|
-
* resource-hosted
|
|
15
|
-
* a recipient resolver backed by the locally verified did:webvh
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* was-client descriptor-store seam, with the three client-side guards a
|
|
14
|
+
* resource-hosted descriptor needs (`epochsMac`, the latest-seen epoch pin,
|
|
15
|
+
* and a recipient resolver backed by the locally verified did:webvh
|
|
16
|
+
* document).
|
|
17
|
+
* - `pukRosterDescriptorStore` -- that descriptor store, built from a bare
|
|
18
|
+
* signing client for the login-time direct read.
|
|
18
19
|
*/
|
|
19
20
|
export { mintPuk, pukVaultKeys } from './puk.js';
|
|
20
21
|
export { addPukRosterRecipient, ensurePukRoster, PukRosterContinuityError, PukRosterIntegrityError, PukRosterUnwrapError, pukRosterRecipientResolver, readPukRoster } from './pukRoster.js';
|
|
21
|
-
export {
|
|
22
|
+
export { pukRosterDescriptorStore } from './rosterStore.js';
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
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;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGhD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACd,MAAM,gBAAgB,CAAA;AAMvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/keys/pukRoster.d.ts
CHANGED
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The PUK wrap set: the `key-map/puk.json` roster resource. Its body is a
|
|
6
|
-
* `CollectionEncryption`
|
|
6
|
+
* `CollectionEncryption` descriptor verbatim, whose current epoch IS the
|
|
7
|
+
* current
|
|
7
8
|
* per-user key -- the epoch id is the PUK's did:key and the wrapped secret is
|
|
8
9
|
* the PUK's raw 32-byte key, wrapped to each enrolled client's key-agreement
|
|
9
10
|
* key. The roster is the delivery channel for PUK rotation: each client keeps
|
|
10
11
|
* the PUK in its own local state under the unlock layer, and the roster's
|
|
11
12
|
* epoch stamp marks a cached copy stale.
|
|
12
13
|
*
|
|
13
|
-
* Everything mutates through was-client's
|
|
14
|
+
* Everything mutates through was-client's descriptor-store seam (the
|
|
14
15
|
* plain-resource adapter): read-with-etag, compare-and-swap writes, and a
|
|
15
|
-
* guarded create for the initially-absent roster. No
|
|
16
|
+
* guarded create for the initially-absent roster. No descriptor logic is
|
|
16
17
|
* reimplemented here.
|
|
17
18
|
*
|
|
18
|
-
* A resource-hosted
|
|
19
|
+
* A resource-hosted descriptor gets NONE of the server-side epoch invariants a
|
|
19
20
|
* Collection Description enforces (append-only epochs, monotone
|
|
20
21
|
* `currentEpoch`), so three client-side compensations are load-bearing alone
|
|
21
22
|
* against a tampering host:
|
|
@@ -40,11 +41,11 @@
|
|
|
40
41
|
*/
|
|
41
42
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
42
43
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
43
|
-
import { type
|
|
44
|
+
import { type EncryptionDescriptorStore, type RecipientPublicKey } from '@interop/was-client/edv';
|
|
44
45
|
import type { Puk } from './puk.js';
|
|
45
46
|
/**
|
|
46
47
|
* Thrown when a served roster fails its client-side authentication: a
|
|
47
|
-
* missing/unsupported/invalid `epochsMac`, or a
|
|
48
|
+
* missing/unsupported/invalid `epochsMac`, or a descriptor whose `currentEpoch`
|
|
48
49
|
* names no epoch in its own list. The server (or whoever can write to it) has
|
|
49
50
|
* produced a configuration no enrolled client authenticated.
|
|
50
51
|
*/
|
|
@@ -115,14 +116,15 @@ export declare function pukRosterRecipientResolver({ document }: {
|
|
|
115
116
|
* race to a concurrent first init converges on the winner's roster.
|
|
116
117
|
*
|
|
117
118
|
* @param options {object}
|
|
118
|
-
* @param options.store {
|
|
119
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
120
|
+
* store
|
|
119
121
|
* @param options.puk {Puk} the account's per-user key
|
|
120
122
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
121
123
|
* (identity) key-agreement key -- the roster recipient
|
|
122
|
-
* @returns {Promise<CollectionEncryption>} the roster
|
|
124
|
+
* @returns {Promise<CollectionEncryption>} the roster descriptor
|
|
123
125
|
*/
|
|
124
126
|
export declare function ensurePukRoster({ store, puk, clientKeyAgreementKey }: {
|
|
125
|
-
store:
|
|
127
|
+
store: EncryptionDescriptorStore;
|
|
126
128
|
puk: Puk;
|
|
127
129
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
128
130
|
}): Promise<CollectionEncryption>;
|
|
@@ -143,27 +145,28 @@ export declare function ensurePukRoster({ store, puk, clientKeyAgreementKey }: {
|
|
|
143
145
|
* is returned as-is.
|
|
144
146
|
*
|
|
145
147
|
* @param options {object}
|
|
146
|
-
* @param options.store {
|
|
148
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
149
|
+
* store
|
|
147
150
|
* @param options.recipient {RecipientPublicKey} the enrollee's public
|
|
148
151
|
* key-agreement key; `id` is the kid its own roster reads will look for
|
|
149
152
|
* @param options.ownerKeyAgreementKey {IKeyAgreementKey} the enrolling
|
|
150
153
|
* client's own (identity) key-agreement key, unwrapping each epoch for
|
|
151
154
|
* re-wrapping
|
|
152
|
-
* @returns {Promise<CollectionEncryption>} the refreshed roster
|
|
155
|
+
* @returns {Promise<CollectionEncryption>} the refreshed roster descriptor
|
|
153
156
|
*/
|
|
154
157
|
export declare function addPukRosterRecipient({ store, recipient, ownerKeyAgreementKey }: {
|
|
155
|
-
store:
|
|
158
|
+
store: EncryptionDescriptorStore;
|
|
156
159
|
recipient: RecipientPublicKey;
|
|
157
160
|
ownerKeyAgreementKey: IKeyAgreementKey;
|
|
158
161
|
}): Promise<CollectionEncryption>;
|
|
159
162
|
/**
|
|
160
|
-
* What a roster read resolves to: the authenticated
|
|
161
|
-
* (the cached one confirmed current, or a fresh one unwrapped from a
|
|
162
|
-
* epoch -- `rotated` says which), and the epoch id the caller must pin
|
|
163
|
-
* new latest-seen.
|
|
163
|
+
* What a roster read resolves to: the authenticated descriptor, the current
|
|
164
|
+
* PUK (the cached one confirmed current, or a fresh one unwrapped from a
|
|
165
|
+
* rotated epoch -- `rotated` says which), and the epoch id the caller must pin
|
|
166
|
+
* as the new latest-seen.
|
|
164
167
|
*/
|
|
165
168
|
export interface PukRosterReadResult {
|
|
166
|
-
|
|
169
|
+
descriptor: CollectionEncryption;
|
|
167
170
|
puk: Puk;
|
|
168
171
|
rotated: boolean;
|
|
169
172
|
latestEpochId: string;
|
|
@@ -180,7 +183,7 @@ export interface PukRosterReadResult {
|
|
|
180
183
|
* current; otherwise the current epoch was rotated by another client and
|
|
181
184
|
* this client's wrap is unwrapped with its own key-agreement key
|
|
182
185
|
* (`PukRosterUnwrapError` when it holds none).
|
|
183
|
-
* 3. **Authentication**: the
|
|
186
|
+
* 3. **Authentication**: the descriptor's `epochsMac` is verified under the
|
|
184
187
|
* current epoch's secret (`PukRosterIntegrityError` on any mismatch -- a
|
|
185
188
|
* fabricated configuration).
|
|
186
189
|
*
|
|
@@ -193,7 +196,8 @@ export interface PukRosterReadResult {
|
|
|
193
196
|
* the result's `rotated` is then true (the PUK was adopted from the roster).
|
|
194
197
|
*
|
|
195
198
|
* @param options {object}
|
|
196
|
-
* @param options.store {
|
|
199
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
200
|
+
* store
|
|
197
201
|
* @param [options.puk] {Puk} this client's cached PUK, when it holds one
|
|
198
202
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
199
203
|
* (identity) key-agreement key, unwrapping a rotated epoch
|
|
@@ -202,7 +206,7 @@ export interface PukRosterReadResult {
|
|
|
202
206
|
* @returns {Promise<PukRosterReadResult | null>}
|
|
203
207
|
*/
|
|
204
208
|
export declare function readPukRoster({ store, puk, clientKeyAgreementKey, pinnedEpochId }: {
|
|
205
|
-
store:
|
|
209
|
+
store: EncryptionDescriptorStore;
|
|
206
210
|
puk?: Puk;
|
|
207
211
|
clientKeyAgreementKey: IKeyAgreementKey;
|
|
208
212
|
pinnedEpochId?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pukRoster.d.ts","sourceRoot":"","sources":["../../src/keys/pukRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"pukRoster.d.ts","sourceRoot":"","sources":["../../src/keys/pukRoster.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAML,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,aAAa,EAA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AAmB;IAClC,UAAU,EAAE,oBAAoB,CAAA;IAChC,GAAG,EAAE,GAAG,CAAA;IACR,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,aAAa,CAAC,EAClC,KAAK,EACL,GAAG,EACH,qBAAqB,EACrB,aAAa,EACd,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CA0EtC"}
|
package/dist/keys/pukRoster.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addRecipient, initRecipients, ownerRecipient, unwrapEpochSecret, verifyEpochsMac } from '@interop/was-client/edv';
|
|
2
2
|
/**
|
|
3
3
|
* Thrown when a served roster fails its client-side authentication: a
|
|
4
|
-
* missing/unsupported/invalid `epochsMac`, or a
|
|
4
|
+
* missing/unsupported/invalid `epochsMac`, or a descriptor whose `currentEpoch`
|
|
5
5
|
* names no epoch in its own list. The server (or whoever can write to it) has
|
|
6
6
|
* produced a configuration no enrolled client authenticated.
|
|
7
7
|
*/
|
|
@@ -107,16 +107,17 @@ export function pukRosterRecipientResolver({ document }) {
|
|
|
107
107
|
* race to a concurrent first init converges on the winner's roster.
|
|
108
108
|
*
|
|
109
109
|
* @param options {object}
|
|
110
|
-
* @param options.store {
|
|
110
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
111
|
+
* store
|
|
111
112
|
* @param options.puk {Puk} the account's per-user key
|
|
112
113
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
113
114
|
* (identity) key-agreement key -- the roster recipient
|
|
114
|
-
* @returns {Promise<CollectionEncryption>} the roster
|
|
115
|
+
* @returns {Promise<CollectionEncryption>} the roster descriptor
|
|
115
116
|
*/
|
|
116
117
|
export async function ensurePukRoster({ store, puk, clientKeyAgreementKey }) {
|
|
117
118
|
const current = await store.read();
|
|
118
119
|
if (current !== null) {
|
|
119
|
-
return current.
|
|
120
|
+
return current.descriptor;
|
|
120
121
|
}
|
|
121
122
|
return initRecipients({
|
|
122
123
|
store,
|
|
@@ -141,13 +142,14 @@ export async function ensurePukRoster({ store, puk, clientKeyAgreementKey }) {
|
|
|
141
142
|
* is returned as-is.
|
|
142
143
|
*
|
|
143
144
|
* @param options {object}
|
|
144
|
-
* @param options.store {
|
|
145
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
146
|
+
* store
|
|
145
147
|
* @param options.recipient {RecipientPublicKey} the enrollee's public
|
|
146
148
|
* key-agreement key; `id` is the kid its own roster reads will look for
|
|
147
149
|
* @param options.ownerKeyAgreementKey {IKeyAgreementKey} the enrolling
|
|
148
150
|
* client's own (identity) key-agreement key, unwrapping each epoch for
|
|
149
151
|
* re-wrapping
|
|
150
|
-
* @returns {Promise<CollectionEncryption>} the refreshed roster
|
|
152
|
+
* @returns {Promise<CollectionEncryption>} the refreshed roster descriptor
|
|
151
153
|
*/
|
|
152
154
|
export async function addPukRosterRecipient({ store, recipient, ownerKeyAgreementKey }) {
|
|
153
155
|
const current = await store.read();
|
|
@@ -155,14 +157,14 @@ export async function addPukRosterRecipient({ store, recipient, ownerKeyAgreemen
|
|
|
155
157
|
throw new Error('The PUK roster does not exist yet; the account must finish ' +
|
|
156
158
|
'provisioning before a client can be enrolled.');
|
|
157
159
|
}
|
|
158
|
-
const
|
|
159
|
-
const currentEpoch = (
|
|
160
|
+
const descriptor = current.descriptor;
|
|
161
|
+
const currentEpoch = (descriptor.epochs ?? []).find(epoch => epoch.id === descriptor.currentEpoch);
|
|
160
162
|
const wrapped = currentEpoch?.recipients.some(entry => entry.header.kid === recipient.id);
|
|
161
163
|
if (wrapped) {
|
|
162
164
|
// A completed (or torn-after-the-wrap) earlier run: addRecipient writes
|
|
163
|
-
// every epoch's wrap in one
|
|
164
|
-
// means the escrow set is complete.
|
|
165
|
-
return
|
|
165
|
+
// every epoch's wrap in one descriptor write, so the current epoch
|
|
166
|
+
// standing means the escrow set is complete.
|
|
167
|
+
return descriptor;
|
|
166
168
|
}
|
|
167
169
|
return addRecipient({
|
|
168
170
|
store,
|
|
@@ -182,7 +184,7 @@ export async function addPukRosterRecipient({ store, recipient, ownerKeyAgreemen
|
|
|
182
184
|
* current; otherwise the current epoch was rotated by another client and
|
|
183
185
|
* this client's wrap is unwrapped with its own key-agreement key
|
|
184
186
|
* (`PukRosterUnwrapError` when it holds none).
|
|
185
|
-
* 3. **Authentication**: the
|
|
187
|
+
* 3. **Authentication**: the descriptor's `epochsMac` is verified under the
|
|
186
188
|
* current epoch's secret (`PukRosterIntegrityError` on any mismatch -- a
|
|
187
189
|
* fabricated configuration).
|
|
188
190
|
*
|
|
@@ -195,7 +197,8 @@ export async function addPukRosterRecipient({ store, recipient, ownerKeyAgreemen
|
|
|
195
197
|
* the result's `rotated` is then true (the PUK was adopted from the roster).
|
|
196
198
|
*
|
|
197
199
|
* @param options {object}
|
|
198
|
-
* @param options.store {
|
|
200
|
+
* @param options.store {EncryptionDescriptorStore} the roster's descriptor
|
|
201
|
+
* store
|
|
199
202
|
* @param [options.puk] {Puk} this client's cached PUK, when it holds one
|
|
200
203
|
* @param options.clientKeyAgreementKey {IKeyAgreementKey} this client's own
|
|
201
204
|
* (identity) key-agreement key, unwrapping a rotated epoch
|
|
@@ -208,10 +211,10 @@ export async function readPukRoster({ store, puk, clientKeyAgreementKey, pinnedE
|
|
|
208
211
|
if (current === null) {
|
|
209
212
|
return null;
|
|
210
213
|
}
|
|
211
|
-
const
|
|
212
|
-
const epochIds = (
|
|
213
|
-
const currentIndex =
|
|
214
|
-
? epochIds.indexOf(
|
|
214
|
+
const descriptor = current.descriptor;
|
|
215
|
+
const epochIds = (descriptor.epochs ?? []).map(epoch => epoch.id);
|
|
216
|
+
const currentIndex = descriptor.currentEpoch
|
|
217
|
+
? epochIds.indexOf(descriptor.currentEpoch)
|
|
215
218
|
: -1;
|
|
216
219
|
if (currentIndex === -1) {
|
|
217
220
|
throw new PukRosterIntegrityError('The PUK roster names no current epoch in its own epoch list.');
|
|
@@ -223,20 +226,20 @@ export async function readPukRoster({ store, puk, clientKeyAgreementKey, pinnedE
|
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
// The epochsMac construction's own version/alg are the caller's to check.
|
|
226
|
-
const epochsMac =
|
|
229
|
+
const epochsMac = descriptor.epochsMac;
|
|
227
230
|
if (!epochsMac || epochsMac.v !== 1 || epochsMac.alg !== 'HS256') {
|
|
228
231
|
throw new PukRosterIntegrityError('The PUK roster carries no supported epoch-configuration MAC.');
|
|
229
232
|
}
|
|
230
233
|
let currentPuk;
|
|
231
234
|
let rotated;
|
|
232
|
-
if (puk &&
|
|
235
|
+
if (puk && descriptor.currentEpoch === puk.id) {
|
|
233
236
|
currentPuk = puk;
|
|
234
237
|
rotated = false;
|
|
235
238
|
}
|
|
236
239
|
else {
|
|
237
240
|
// Rotated by another client: unwrap this client's entry in the current
|
|
238
241
|
// epoch with its own key-agreement key (rotation delivery).
|
|
239
|
-
const entry =
|
|
242
|
+
const entry = descriptor.epochs[currentIndex].recipients.find(recipient => recipient.header.kid === clientKeyAgreementKey.id);
|
|
240
243
|
if (!entry) {
|
|
241
244
|
throw new PukRosterUnwrapError('The PUK roster current epoch carries no wrap for this client.');
|
|
242
245
|
}
|
|
@@ -247,17 +250,17 @@ export async function readPukRoster({ store, puk, clientKeyAgreementKey, pinnedE
|
|
|
247
250
|
if (!secret) {
|
|
248
251
|
throw new PukRosterUnwrapError("This client's PUK roster entry failed to unwrap.");
|
|
249
252
|
}
|
|
250
|
-
currentPuk = { id:
|
|
253
|
+
currentPuk = { id: descriptor.currentEpoch, secret };
|
|
251
254
|
rotated = true;
|
|
252
255
|
}
|
|
253
|
-
if (!(await verifyEpochsMac({
|
|
256
|
+
if (!(await verifyEpochsMac({ descriptor, epochSecret: currentPuk.secret }))) {
|
|
254
257
|
throw new PukRosterIntegrityError('The PUK roster epoch configuration failed authentication.');
|
|
255
258
|
}
|
|
256
259
|
return {
|
|
257
|
-
|
|
260
|
+
descriptor,
|
|
258
261
|
puk: currentPuk,
|
|
259
262
|
rotated,
|
|
260
|
-
latestEpochId:
|
|
263
|
+
latestEpochId: descriptor.currentEpoch
|
|
261
264
|
};
|
|
262
265
|
}
|
|
263
266
|
//# sourceMappingURL=pukRoster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pukRoster.js","sourceRoot":"","sources":["../../src/keys/pukRoster.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pukRoster.js","sourceRoot":"","sources":["../../src/keys/pukRoster.ts"],"names":[],"mappings":"AA2CA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EAGhB,MAAM,yBAAyB,CAAA;AAGhC;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,aAAa,CAAQ;IACrB,YAAY,EAAE,aAAa,EAA6B;QACtD,KAAK,CACH,uEAAuE;YACrE,mCAAmC,CACtC,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;QACtC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,sBAAsB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QACF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,oBAAoB,CAC5B,kDAAkD,CACnD,CAAA;QACH,CAAC;QACD,UAAU,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,YAAa,EAAE,MAAM,EAAE,CAAA;QACrD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC;IAED,IACE,CAAC,CAAC,MAAM,eAAe,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EACxE,CAAC;QACD,MAAM,IAAI,uBAAuB,CAC/B,2DAA2D,CAC5D,CAAA;IACH,CAAC;IAED,OAAO;QACL,UAAU;QACV,GAAG,EAAE,UAAU;QACf,OAAO;QACP,aAAa,EAAE,UAAU,CAAC,YAAa;KACxC,CAAA;AACH,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { ZcapClient } from '@interop/ezcap';
|
|
2
|
-
import { type
|
|
2
|
+
import { type EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
3
3
|
/**
|
|
4
|
-
* Builds the compare-and-swap
|
|
5
|
-
* Space.
|
|
4
|
+
* Builds the compare-and-swap descriptor store over `key-map/puk.json` in a
|
|
5
|
+
* data Space.
|
|
6
6
|
*
|
|
7
7
|
* @param options {object}
|
|
8
8
|
* @param options.storageServerUrl {string}
|
|
9
9
|
* @param options.zcapClient {ZcapClient} the session's root signing client
|
|
10
10
|
* @param options.spaceId {string} the data Space id
|
|
11
|
-
* @returns {
|
|
11
|
+
* @returns {EncryptionDescriptorStore}
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function pukRosterDescriptorStore({ storageServerUrl, zcapClient, spaceId }: {
|
|
14
14
|
storageServerUrl: string;
|
|
15
15
|
zcapClient: ZcapClient;
|
|
16
16
|
spaceId: string;
|
|
17
|
-
}):
|
|
17
|
+
}): EncryptionDescriptorStore;
|
|
18
18
|
//# sourceMappingURL=rosterStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"rosterStore.d.ts","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,yBAAyB,CAAA;AAMhC;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,gBAAgB,EAChB,UAAU,EACV,OAAO,EACR,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,yBAAyB,CAQ5B"}
|
package/dist/keys/rosterStore.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The descriptor store over a Space's PUK wrap-set roster (`key-map/puk.json`).
|
|
6
6
|
* Standalone rather than a method on a wallet's remote-store class, because
|
|
7
7
|
* the login-time direct read checks the roster BEFORE any storage client (or
|
|
8
8
|
* cipher) is built: it takes the bare signing client instead of a store
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
* rather than as an absent roster.
|
|
15
15
|
*/
|
|
16
16
|
import { WasClient } from '@interop/was-client';
|
|
17
|
-
import {
|
|
17
|
+
import { resourceDescriptorStore } from '@interop/was-client/edv';
|
|
18
18
|
import { KEY_MAP_COLLECTION, PUK_ROSTER_RESOURCE } from '../space/collections.js';
|
|
19
19
|
/**
|
|
20
|
-
* Builds the compare-and-swap
|
|
21
|
-
* Space.
|
|
20
|
+
* Builds the compare-and-swap descriptor store over `key-map/puk.json` in a
|
|
21
|
+
* data Space.
|
|
22
22
|
*
|
|
23
23
|
* @param options {object}
|
|
24
24
|
* @param options.storageServerUrl {string}
|
|
25
25
|
* @param options.zcapClient {ZcapClient} the session's root signing client
|
|
26
26
|
* @param options.spaceId {string} the data Space id
|
|
27
|
-
* @returns {
|
|
27
|
+
* @returns {EncryptionDescriptorStore}
|
|
28
28
|
*/
|
|
29
|
-
export function
|
|
29
|
+
export function pukRosterDescriptorStore({ storageServerUrl, zcapClient, spaceId }) {
|
|
30
30
|
const was = new WasClient({ serverUrl: storageServerUrl, zcapClient });
|
|
31
|
-
return
|
|
31
|
+
return resourceDescriptorStore({
|
|
32
32
|
resource: was
|
|
33
33
|
.space(spaceId)
|
|
34
34
|
.collection(KEY_MAP_COLLECTION.id, { encryption: 'plaintext' })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterStore.js","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,
|
|
1
|
+
{"version":3,"file":"rosterStore.js","sourceRoot":"","sources":["../../src/keys/rosterStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,EACL,uBAAuB,EAExB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,yBAAyB,CAAA;AAEhC;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,gBAAgB,EAChB,UAAU,EACV,OAAO,EAKR;IACC,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,CAAA;IACtE,OAAO,uBAAuB,CAAC;QAC7B,QAAQ,EAAE,GAAG;aACV,KAAK,CAAC,OAAO,CAAC;aACd,UAAU,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;aAC9D,QAAQ,CAAC,mBAAmB,CAAC;KACjC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -110,7 +110,7 @@ export declare const DID_LOG_RESOURCE = "did.jsonl";
|
|
|
110
110
|
export declare const DID_KEYS_RESOURCE = "keys.json";
|
|
111
111
|
/**
|
|
112
112
|
* The per-user-key (PUK) wrap-set roster, sibling of `keys.json` in the same
|
|
113
|
-
* private `key-map` collection: a `CollectionEncryption`
|
|
113
|
+
* private `key-map` collection: a `CollectionEncryption` descriptor stored
|
|
114
114
|
* verbatim as the resource body, whose current epoch IS the current PUK (the
|
|
115
115
|
* epoch id is the PUK's did:key; the wrapped secret is the PUK's raw key,
|
|
116
116
|
* wrapped to each enrolled client's key-agreement key). Read directly with a
|
|
@@ -101,7 +101,7 @@ export const DID_LOG_RESOURCE = 'did.jsonl';
|
|
|
101
101
|
export const DID_KEYS_RESOURCE = 'keys.json';
|
|
102
102
|
/**
|
|
103
103
|
* The per-user-key (PUK) wrap-set roster, sibling of `keys.json` in the same
|
|
104
|
-
* private `key-map` collection: a `CollectionEncryption`
|
|
104
|
+
* private `key-map` collection: a `CollectionEncryption` descriptor stored
|
|
105
105
|
* verbatim as the resource body, whose current epoch IS the current PUK (the
|
|
106
106
|
* epoch id is the PUK's did:key; the wrapped secret is the PUK's raw key,
|
|
107
107
|
* wrapped to each enrolled client's key-agreement key). Read directly with a
|
|
@@ -31,7 +31,8 @@ import type { DocCipher, Json, ResolveConflict, SyncStore, WasSyncPort } from '.
|
|
|
31
31
|
* for insert-only content-addressed collections whose push settlement covers
|
|
32
32
|
* every 412.
|
|
33
33
|
*
|
|
34
|
-
* `encryption` selects the doc cipher and the server-side
|
|
34
|
+
* `encryption` selects the doc cipher and the server-side encryption
|
|
35
|
+
* declaration:
|
|
35
36
|
* `'edv'` (the default) envelopes every doc, `'plaintext'` ships it verbatim;
|
|
36
37
|
* `isPublic` grants collection-level world read on the server. Both replicas
|
|
37
38
|
* MUST agree on `collectionId` / `idDerivation` / `encryption` / `isPublic` for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/sync/collections.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACJ,eAAe,EACf,SAAS,EACT,WAAW,EACZ,MAAM,YAAY,CAAA;AAEnB
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/sync/collections.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACJ,eAAe,EACf,SAAS,EACT,WAAW,EACZ,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,oBAAoB,CAAC,EAAE,GAAG,OAAO,EAAE,cAAc,GAAG,IAAI;IACvE,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAA;IAClC,UAAU,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,OAAO,CAAA;IAC5C,aAAa,EAAE,CACb,EAAE,EAAE,EAAE,EACN,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,IAAI,KACV,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,aAAa,EAAE,CACb,EAAE,EAAE,EAAE,EACN,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,I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