@interop/was-client 0.20.0 → 0.22.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/dist/Resource.d.ts +16 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +22 -0
- package/dist/Resource.js.map +1 -1
- package/dist/edv/index.d.ts +7 -1
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +6 -1
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/markerStore.d.ts +118 -0
- package/dist/edv/markerStore.d.ts.map +1 -0
- package/dist/edv/markerStore.js +108 -0
- package/dist/edv/markerStore.js.map +1 -0
- package/dist/edv/recipients.d.ts +81 -35
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +204 -79
- package/dist/edv/recipients.js.map +1 -1
- package/package.json +3 -3
package/dist/Resource.d.ts
CHANGED
|
@@ -41,6 +41,22 @@ export declare class Resource {
|
|
|
41
41
|
* @returns {Promise<Json | Blob | null>}
|
|
42
42
|
*/
|
|
43
43
|
get(): Promise<Json | Blob | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Reads the resource together with its `ETag` validator (the backend's
|
|
46
|
+
* `conditional-writes` feature) -- the Resource counterpart of
|
|
47
|
+
* `Collection.describeWithEtag`. The `ETag` is the opaque validator to pass
|
|
48
|
+
* to {@link put}'s `ifMatch` for a lost-update-safe (compare-and-swap)
|
|
49
|
+
* write. The value is decoded like {@link get} (JSON parsed, binary as a
|
|
50
|
+
* `Blob`, decrypted on an encrypted collection). Returns `null` if the
|
|
51
|
+
* resource is missing or not visible to you (404 conflation caveat); `etag`
|
|
52
|
+
* is absent against a backend that does not version resources.
|
|
53
|
+
*
|
|
54
|
+
* @returns {Promise<{ data: Json | Blob; etag?: string } | null>}
|
|
55
|
+
*/
|
|
56
|
+
getWithEtag(): Promise<{
|
|
57
|
+
data: Json | Blob;
|
|
58
|
+
etag?: string;
|
|
59
|
+
} | null>;
|
|
44
60
|
/**
|
|
45
61
|
* Reads the resource body as text. Returns `null` on a missing/unauthorized
|
|
46
62
|
* resource (404 conflation caveat). A raw escape hatch: it does NOT run the
|
package/dist/Resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resource.d.ts","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAc1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,YAAY,CAAA;AAkBnB,qBAAa,QAAQ;;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IA8BnB;;;;;;;;;;;;;;;;OAgBG;gBACS,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,UAAU,EACV,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,EACX,EAAE;QACD,OAAO,EAAE,aAAa,CAAA;QACtB,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;QACpB,UAAU,EAAE,MAAM,CAAA;QAClB,UAAU,CAAC,EAAE,KAAK,CAAA;QAClB,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAA;QACpC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QAClC,UAAU,CAAC,EAAE,kBAAkB,CAAA;KAChC;IA0DD;;;;;;OAMG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAMxC;;;;;;;;;;;;;OAaG;IACG,OAAO,IAAI,OAAO,CAAC,M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IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;;;OAMG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ1D;;;;;;OAMG;IACG,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAOjD;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtD;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAOlC;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAMnC"}
|
package/dist/Resource.js
CHANGED
|
@@ -140,6 +140,28 @@ export class Resource {
|
|
|
140
140
|
const response = await this.#read();
|
|
141
141
|
return response === null ? null : codec.decode(response, this.id);
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Reads the resource together with its `ETag` validator (the backend's
|
|
145
|
+
* `conditional-writes` feature) -- the Resource counterpart of
|
|
146
|
+
* `Collection.describeWithEtag`. The `ETag` is the opaque validator to pass
|
|
147
|
+
* to {@link put}'s `ifMatch` for a lost-update-safe (compare-and-swap)
|
|
148
|
+
* write. The value is decoded like {@link get} (JSON parsed, binary as a
|
|
149
|
+
* `Blob`, decrypted on an encrypted collection). Returns `null` if the
|
|
150
|
+
* resource is missing or not visible to you (404 conflation caveat); `etag`
|
|
151
|
+
* is absent against a backend that does not version resources.
|
|
152
|
+
*
|
|
153
|
+
* @returns {Promise<{ data: Json | Blob; etag?: string } | null>}
|
|
154
|
+
*/
|
|
155
|
+
async getWithEtag() {
|
|
156
|
+
const codec = await this.#codec();
|
|
157
|
+
const response = await this.#read();
|
|
158
|
+
if (response === null) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const data = await codec.decode(response, this.id);
|
|
162
|
+
const etag = readEtag(response);
|
|
163
|
+
return etag !== undefined ? { data, etag } : { data };
|
|
164
|
+
}
|
|
143
165
|
/**
|
|
144
166
|
* Reads the resource body as text. Returns `null` on a missing/unauthorized
|
|
145
167
|
* resource (404 conflation caveat). A raw escape hatch: it does NOT run the
|
package/dist/Resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAY7B;;;;;;;;;;;GAWG;AACH,SAAS,aAAa,CAAC,QAAsB;IAC3C,OAAO,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAChF,CAAC;AAED,MAAM,OAAO,QAAQ;IACV,OAAO,CAAQ;IACf,YAAY,CAAQ;IACpB,EAAE,CAAQ;IAEV,QAAQ,CAAe;IACvB,WAA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AAM;YACN,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS;QACb,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE;YACnC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW;QACf,OAAO,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YACjC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/edv/index.d.ts
CHANGED
|
@@ -20,13 +20,19 @@
|
|
|
20
20
|
* `addRecipient` / `removeRecipient` manage the readers and rotate the epoch
|
|
21
21
|
* key, so the same `createEdvEncryption` provider transparently encrypts each
|
|
22
22
|
* write under the current epoch and decrypts any epoch a reader still holds.
|
|
23
|
+
* They mutate the marker through the marker-store seam: the Collection
|
|
24
|
+
* Description by default, or any `MarkerStore` -- e.g. `resourceMarkerStore`
|
|
25
|
+
* for a marker hosted as a plain JSON Resource.
|
|
23
26
|
*/
|
|
24
27
|
export { createEdvEncryption, EdvCodec } from './EdvCodec.js';
|
|
25
28
|
export type { EdvKeys } from './EdvCodec.js';
|
|
26
29
|
export { WasTransport, JOSE_CONTENT_TYPE } from './WasTransport.js';
|
|
27
30
|
export { initRecipients, addRecipient, removeRecipient } from './recipients.js';
|
|
28
31
|
export type { OwnerKey, RecipientPublicKey } from './recipients.js';
|
|
29
|
-
export {
|
|
32
|
+
export { collectionMarkerStore, resourceMarkerStore } from './markerStore.js';
|
|
33
|
+
export type { MarkerStore } from './markerStore.js';
|
|
34
|
+
export { mintEpoch, epochKeyIdFor, unwrapEpochSecret } from './epochCrypto.js';
|
|
35
|
+
export { verifyEpochsMac } from './epochMac.js';
|
|
30
36
|
export { createEdvDocCipher, ownerRecipient, UnknownEpochError, isEncryptedEnvelope } from './docCipher.js';
|
|
31
37
|
export type { DocCipher } from './docCipher.js';
|
|
32
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/edv/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC/E,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/edv/index.js
CHANGED
|
@@ -20,10 +20,15 @@
|
|
|
20
20
|
* `addRecipient` / `removeRecipient` manage the readers and rotate the epoch
|
|
21
21
|
* key, so the same `createEdvEncryption` provider transparently encrypts each
|
|
22
22
|
* write under the current epoch and decrypts any epoch a reader still holds.
|
|
23
|
+
* They mutate the marker through the marker-store seam: the Collection
|
|
24
|
+
* Description by default, or any `MarkerStore` -- e.g. `resourceMarkerStore`
|
|
25
|
+
* for a marker hosted as a plain JSON Resource.
|
|
23
26
|
*/
|
|
24
27
|
export { createEdvEncryption, EdvCodec } from './EdvCodec.js';
|
|
25
28
|
export { WasTransport, JOSE_CONTENT_TYPE } from './WasTransport.js';
|
|
26
29
|
export { initRecipients, addRecipient, removeRecipient } from './recipients.js';
|
|
27
|
-
export {
|
|
30
|
+
export { collectionMarkerStore, resourceMarkerStore } from './markerStore.js';
|
|
31
|
+
export { mintEpoch, epochKeyIdFor, unwrapEpochSecret } from './epochCrypto.js';
|
|
32
|
+
export { verifyEpochsMac } from './epochMac.js';
|
|
28
33
|
export { createEdvDocCipher, ownerRecipient, UnknownEpochError, isEncryptedEnvelope } from './docCipher.js';
|
|
29
34
|
//# sourceMappingURL=index.js.map
|
package/dist/edv/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/edv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE/E,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE7E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The marker-store seam: where a `CollectionEncryption` marker lives and how it
|
|
6
|
+
* is compare-and-swapped. The recipient primitives (`initRecipients` /
|
|
7
|
+
* `addRecipient` / `removeRecipient`) mutate a marker only through this port,
|
|
8
|
+
* so the same key-epoch machinery manages a Collection's own `encryption`
|
|
9
|
+
* marker (the classic host) or a marker hosted as a plain JSON Resource (e.g. a
|
|
10
|
+
* per-user-key roster in a private collection).
|
|
11
|
+
*
|
|
12
|
+
* Two adapters:
|
|
13
|
+
*
|
|
14
|
+
* - {@link collectionMarkerStore} -- the Collection Description's `encryption`
|
|
15
|
+
* member, read with `describeWithEtag` and written back with
|
|
16
|
+
* `replaceDescription` + `If-Match`. The server enforces the marker
|
|
17
|
+
* invariants (append-only epochs, monotone `currentEpoch`, non-decreasing
|
|
18
|
+
* `version`) on this path.
|
|
19
|
+
* - {@link resourceMarkerStore} -- a marker stored verbatim as a JSON Resource.
|
|
20
|
+
* The server treats the resource as opaque content and enforces NO marker
|
|
21
|
+
* invariants there; integrity rests on the client-side `epochsMac` (verified
|
|
22
|
+
* by writers before encrypting) plus client-side epoch pinning. Both the
|
|
23
|
+
* compare-and-swap and the create-if-absent guard ride the backend's
|
|
24
|
+
* `conditional-writes` feature. The hosting collection must be plaintext: on
|
|
25
|
+
* an encrypted collection the EDV codec computes the write preconditions
|
|
26
|
+
* itself and the store's `ifMatch` would not be honored.
|
|
27
|
+
*/
|
|
28
|
+
import type { Collection } from '../Collection.js';
|
|
29
|
+
import type { Resource } from '../Resource.js';
|
|
30
|
+
import type { CollectionEncryption } from '../types.js';
|
|
31
|
+
/**
|
|
32
|
+
* Where a `CollectionEncryption` marker lives: a read-with-validator plus a
|
|
33
|
+
* compare-and-swap write, the two operations the recipient primitives' CAS
|
|
34
|
+
* loop needs. Implementations host the marker anywhere a versioned JSON value
|
|
35
|
+
* can live; the two shipped adapters are {@link collectionMarkerStore} and
|
|
36
|
+
* {@link resourceMarkerStore}.
|
|
37
|
+
*/
|
|
38
|
+
export interface MarkerStore {
|
|
39
|
+
/**
|
|
40
|
+
* Reads the current marker together with the opaque `etag` validator the
|
|
41
|
+
* next {@link replace} must be compare-and-swapped against. Resolves `null`
|
|
42
|
+
* when no marker exists yet AND this store can create one (the resource
|
|
43
|
+
* adapter before the first `initRecipients`); a store whose host must
|
|
44
|
+
* already exist (the description adapter) throws instead of resolving
|
|
45
|
+
* `null`. Throws when the hosted value is not an `edv`-scheme marker.
|
|
46
|
+
*
|
|
47
|
+
* @returns {Promise<{ marker: CollectionEncryption; etag?: string } | null>}
|
|
48
|
+
*/
|
|
49
|
+
read(): Promise<{
|
|
50
|
+
marker: CollectionEncryption;
|
|
51
|
+
etag?: string;
|
|
52
|
+
} | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Replaces the marker, compare-and-swapped against `ifMatch` (the validator
|
|
55
|
+
* from {@link read}); a stale validator throws `PreconditionFailedError`
|
|
56
|
+
* (412). Must follow a {@link read} on the same store instance -- an adapter
|
|
57
|
+
* may forward sibling state observed by its most recent read (the
|
|
58
|
+
* description adapter forwards the description's `name` / `backend`).
|
|
59
|
+
*
|
|
60
|
+
* @param marker {CollectionEncryption}
|
|
61
|
+
* @param options {object}
|
|
62
|
+
* @param [options.ifMatch] {string} the validator from the prior read;
|
|
63
|
+
* absent against a host that does not version its writes
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
|
+
*/
|
|
66
|
+
replace(marker: CollectionEncryption, options: {
|
|
67
|
+
ifMatch?: string;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Creates the FIRST marker where {@link read} resolved `null`, guarded
|
|
71
|
+
* create-if-absent (`If-None-Match: *`); throws `PreconditionFailedError`
|
|
72
|
+
* (412) when a concurrent writer created one first. Absent on stores whose
|
|
73
|
+
* host always exists (the description adapter).
|
|
74
|
+
*
|
|
75
|
+
* @param marker {CollectionEncryption}
|
|
76
|
+
* @returns {Promise<void>}
|
|
77
|
+
*/
|
|
78
|
+
create?(marker: CollectionEncryption): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The Collection Description adapter: the marker is the Description's
|
|
82
|
+
* `encryption` member. Read fails closed when the Description is unreadable
|
|
83
|
+
* (WAS masks unauthorized reads as 404) or the collection is not declared
|
|
84
|
+
* encrypted with the `edv` scheme; the CAS write forwards the description's
|
|
85
|
+
* sibling fields (`name` / `backend`) observed by the most recent read, so
|
|
86
|
+
* the replace-semantics PUT does not drop them. No `create`: a Collection
|
|
87
|
+
* Description always exists, so a first marker is declared via
|
|
88
|
+
* `collection.configure({ encryption })`, never through this store.
|
|
89
|
+
*
|
|
90
|
+
* @param options {object}
|
|
91
|
+
* @param options.collection {Collection}
|
|
92
|
+
* @returns {MarkerStore}
|
|
93
|
+
*/
|
|
94
|
+
export declare function collectionMarkerStore({ collection }: {
|
|
95
|
+
collection: Collection;
|
|
96
|
+
}): MarkerStore;
|
|
97
|
+
/**
|
|
98
|
+
* The plain-JSON-Resource adapter: the marker is the resource's entire
|
|
99
|
+
* content, stored verbatim. Read resolves `null` when the resource is absent
|
|
100
|
+
* (the pre-`initRecipients` state -- `create` then writes the first marker
|
|
101
|
+
* with `If-None-Match: *`), and throws when the resource holds something other
|
|
102
|
+
* than an `edv`-scheme marker object.
|
|
103
|
+
*
|
|
104
|
+
* The server enforces no marker invariants on a resource (unlike a Collection
|
|
105
|
+
* Description): rollback/tamper detection rests on the marker's `epochsMac`
|
|
106
|
+
* and client-side epoch pinning, and the CAS/create guards ride the backend's
|
|
107
|
+
* `conditional-writes` feature. Host the resource in a plaintext collection --
|
|
108
|
+
* on an encrypted collection the EDV codec computes the write preconditions
|
|
109
|
+
* itself, so this store's `ifMatch` would not be honored.
|
|
110
|
+
*
|
|
111
|
+
* @param options {object}
|
|
112
|
+
* @param options.resource {Resource}
|
|
113
|
+
* @returns {MarkerStore}
|
|
114
|
+
*/
|
|
115
|
+
export declare function resourceMarkerStore({ resource }: {
|
|
116
|
+
resource: Resource;
|
|
117
|
+
}): MarkerStore;
|
|
118
|
+
//# sourceMappingURL=markerStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markerStore.d.ts","sourceRoot":"","sources":["../../src/edv/markerStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,aAAa,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,IAAI,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,oBAAoB,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;IAEvE;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5B,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACrD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,WAAW,CAoCd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAA;CACnB,GAAG,WAAW,CAgCd"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { unreadableDescriptionError } from '../internal/describe.js';
|
|
2
|
+
import { ValidationError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* The Collection Description adapter: the marker is the Description's
|
|
5
|
+
* `encryption` member. Read fails closed when the Description is unreadable
|
|
6
|
+
* (WAS masks unauthorized reads as 404) or the collection is not declared
|
|
7
|
+
* encrypted with the `edv` scheme; the CAS write forwards the description's
|
|
8
|
+
* sibling fields (`name` / `backend`) observed by the most recent read, so
|
|
9
|
+
* the replace-semantics PUT does not drop them. No `create`: a Collection
|
|
10
|
+
* Description always exists, so a first marker is declared via
|
|
11
|
+
* `collection.configure({ encryption })`, never through this store.
|
|
12
|
+
*
|
|
13
|
+
* @param options {object}
|
|
14
|
+
* @param options.collection {Collection}
|
|
15
|
+
* @returns {MarkerStore}
|
|
16
|
+
*/
|
|
17
|
+
export function collectionMarkerStore({ collection }) {
|
|
18
|
+
// The sibling description fields observed by the most recent read, forwarded
|
|
19
|
+
// verbatim by the CAS write (the server's replace semantics would otherwise
|
|
20
|
+
// drop them). Safe to forward even if stale: the write is pinned to the same
|
|
21
|
+
// read's ETag, so a concurrent description change fails the CAS instead.
|
|
22
|
+
let described;
|
|
23
|
+
return {
|
|
24
|
+
async read() {
|
|
25
|
+
const current = await collection.describeWithEtag();
|
|
26
|
+
if (current === null) {
|
|
27
|
+
throw unreadableDescriptionError({
|
|
28
|
+
operation: 'manage recipients',
|
|
29
|
+
advice: 'Use a capability that can read the Collection Description.'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const marker = current.description.encryption;
|
|
33
|
+
if (!marker || marker.scheme !== 'edv') {
|
|
34
|
+
throw new ValidationError('Cannot manage recipients: this collection is not declared ' +
|
|
35
|
+
"encrypted with the 'edv' scheme.");
|
|
36
|
+
}
|
|
37
|
+
described = current.description;
|
|
38
|
+
return { marker, etag: current.etag };
|
|
39
|
+
},
|
|
40
|
+
async replace(marker, { ifMatch }) {
|
|
41
|
+
await collection.replaceDescription({
|
|
42
|
+
name: described?.name,
|
|
43
|
+
backend: described?.backend,
|
|
44
|
+
encryption: marker
|
|
45
|
+
}, { ifMatch });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The plain-JSON-Resource adapter: the marker is the resource's entire
|
|
51
|
+
* content, stored verbatim. Read resolves `null` when the resource is absent
|
|
52
|
+
* (the pre-`initRecipients` state -- `create` then writes the first marker
|
|
53
|
+
* with `If-None-Match: *`), and throws when the resource holds something other
|
|
54
|
+
* than an `edv`-scheme marker object.
|
|
55
|
+
*
|
|
56
|
+
* The server enforces no marker invariants on a resource (unlike a Collection
|
|
57
|
+
* Description): rollback/tamper detection rests on the marker's `epochsMac`
|
|
58
|
+
* and client-side epoch pinning, and the CAS/create guards ride the backend's
|
|
59
|
+
* `conditional-writes` feature. Host the resource in a plaintext collection --
|
|
60
|
+
* on an encrypted collection the EDV codec computes the write preconditions
|
|
61
|
+
* itself, so this store's `ifMatch` would not be honored.
|
|
62
|
+
*
|
|
63
|
+
* @param options {object}
|
|
64
|
+
* @param options.resource {Resource}
|
|
65
|
+
* @returns {MarkerStore}
|
|
66
|
+
*/
|
|
67
|
+
export function resourceMarkerStore({ resource }) {
|
|
68
|
+
return {
|
|
69
|
+
async read() {
|
|
70
|
+
const current = await resource.getWithEtag();
|
|
71
|
+
if (current === null) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
const marker = current.data;
|
|
75
|
+
if (marker === null ||
|
|
76
|
+
typeof marker !== 'object' ||
|
|
77
|
+
Array.isArray(marker) ||
|
|
78
|
+
marker instanceof Blob ||
|
|
79
|
+
marker.scheme !== 'edv') {
|
|
80
|
+
throw new ValidationError(`Cannot manage recipients: the resource "${resource.id}" does not ` +
|
|
81
|
+
"hold a CollectionEncryption marker with the 'edv' scheme.");
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
marker: marker,
|
|
85
|
+
etag: current.etag
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
async replace(marker, { ifMatch }) {
|
|
89
|
+
await resource.put(markerAsJson(marker), { ifMatch });
|
|
90
|
+
},
|
|
91
|
+
async create(marker) {
|
|
92
|
+
await resource.put(markerAsJson(marker), { ifNoneMatch: true });
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Casts a marker to the `JsonObject` a resource write takes. The marker types
|
|
98
|
+
* are interfaces without index signatures, so they do not structurally satisfy
|
|
99
|
+
* `JsonObject` -- but a marker is plain JSON by construction (it round-trips
|
|
100
|
+
* through the Collection Description on the classic host), so this is sound.
|
|
101
|
+
*
|
|
102
|
+
* @param marker {CollectionEncryption}
|
|
103
|
+
* @returns {JsonObject}
|
|
104
|
+
*/
|
|
105
|
+
function markerAsJson(marker) {
|
|
106
|
+
return marker;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=markerStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markerStore.js","sourceRoot":"","sources":["../../src/edv/markerStore.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAyD9C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,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CAAC;YACD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAA;YAC3B,IACE,MAAM,KAAK,IAAI;gBACf,OAAO,MAAM,KAAK,QAAQ;gBAC1B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBACrB,MAAM,YAAY,IAAI;gBACrB,MAA+B,CAAC,MAAM,KAAK,KAAK,EACjD,CAAC;gBACD,MAAM,IAAI,eAAe,CACvB,2CAA2C,QAAQ,CAAC,EAAE,aAAa;oBACjE,2DAA2D,CAC9D,CAAA;YACH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,MAAyC;gBACjD,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAA;QACH,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE;YAC/B,MAAM,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;QACvD,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,MAAM;YACjB,MAAM,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;QACjE,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,MAA4B;IAChD,OAAO,MAA+B,CAAA;AACxC,CAAC"}
|
package/dist/edv/recipients.d.ts
CHANGED
|
@@ -5,14 +5,20 @@
|
|
|
5
5
|
* Recipient and key-epoch management for multi-recipient encrypted Collections:
|
|
6
6
|
* initializing the first epoch, adding a reader (escrow -- history included),
|
|
7
7
|
* and removing a reader (the full revoke-and-rotate procedure). Each operation
|
|
8
|
-
* mutates
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* mutates a `CollectionEncryption` marker through the marker-store seam (see
|
|
9
|
+
* `markerStore.ts`) -- the Collection Description's `encryption` member for the
|
|
10
|
+
* `collection` sugar, or any explicit `store`, such as a marker hosted as a
|
|
11
|
+
* plain JSON Resource -- and writes it back with a compare-and-swap
|
|
12
|
+
* (`If-Match`), retrying on a concurrent change so two racing recipient edits
|
|
13
|
+
* cannot clobber one another.
|
|
11
14
|
*
|
|
12
15
|
* The two axes stay separate and are both required to actually remove a reader:
|
|
13
16
|
*
|
|
14
|
-
* - **pull** -- the
|
|
15
|
-
* the server
|
|
17
|
+
* - **pull** -- the reader's server-side access. For a Collection this is the
|
|
18
|
+
* zcap the server checks at request time: revoking it stops the server
|
|
19
|
+
* serving that reader ciphertext. Immediate and total. A marker whose pull
|
|
20
|
+
* axis lives elsewhere (e.g. a DID document naming the readers) supplies a
|
|
21
|
+
* `pull` action instead of the default zcap revocation.
|
|
16
22
|
* - **read** -- possession of an epoch key. Rotating the epoch means resources
|
|
17
23
|
* written afterward are encrypted under a key the removed reader does not
|
|
18
24
|
* hold. Prospective only.
|
|
@@ -27,6 +33,7 @@
|
|
|
27
33
|
import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
28
34
|
import type { Collection } from '../Collection.js';
|
|
29
35
|
import type { Space } from '../Space.js';
|
|
36
|
+
import type { MarkerStore } from './markerStore.js';
|
|
30
37
|
import type { CollectionEncryption, IDelegatedZcap } from '../types.js';
|
|
31
38
|
import type { RecipientPublicKey } from './epochCrypto.js';
|
|
32
39
|
export type { RecipientPublicKey } from './epochCrypto.js';
|
|
@@ -38,21 +45,40 @@ export interface OwnerKey {
|
|
|
38
45
|
keyAgreementKey: IKeyAgreementKey;
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
|
-
* Initializes the first key epoch on a
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
48
|
+
* Initializes the first key epoch on a marker that has no epochs yet: mints a
|
|
49
|
+
* fresh epoch key, wraps it to each initial recipient, and writes
|
|
50
|
+
* `epochs: [epoch]` / `currentEpoch` back with a compare-and-swap. After this,
|
|
51
|
+
* resources written by any recipient are encrypted under the epoch, and readers
|
|
52
|
+
* unwrap it with their own key-agreement key.
|
|
53
|
+
*
|
|
54
|
+
* On the `collection` host the collection must already be declared encrypted
|
|
55
|
+
* (its marker exists; this fills in the first epochs). On a store whose marker
|
|
56
|
+
* host starts absent (e.g. `resourceMarkerStore`, whose roster resource does
|
|
57
|
+
* not exist before the first init), the marker itself is created from scratch
|
|
58
|
+
* with a create-if-absent guard (`If-None-Match: *`), so two racing first
|
|
59
|
+
* inits cannot clobber one another.
|
|
46
60
|
*
|
|
47
61
|
* @param options {object}
|
|
48
|
-
* @param options.collection {Collection} the (already encrypted) collection
|
|
62
|
+
* @param [options.collection] {Collection} the (already encrypted) collection
|
|
63
|
+
* whose Description hosts the marker; exactly one of `collection` / `store`
|
|
64
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
49
65
|
* @param options.recipients {RecipientPublicKey[]} the initial readers' public
|
|
50
66
|
* key-agreement keys (each `id` is the reader's `kid`)
|
|
67
|
+
* @param [options.epoch] {{ epochId: string, secret: Uint8Array }} a
|
|
68
|
+
* pre-minted first epoch to install instead of minting one -- for a caller
|
|
69
|
+
* whose epoch key already exists (e.g. a per-user key being enrolled into
|
|
70
|
+
* its wrap-set roster). The `epochId` must be the key's did:key and `secret`
|
|
71
|
+
* its raw 32-byte private key, exactly what {@link mintEpoch} returns.
|
|
51
72
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
52
73
|
*/
|
|
53
|
-
export declare function initRecipients({ collection, recipients }: {
|
|
54
|
-
collection
|
|
74
|
+
export declare function initRecipients({ collection, store, recipients, epoch: premintedEpoch }: {
|
|
75
|
+
collection?: Collection;
|
|
76
|
+
store?: MarkerStore;
|
|
55
77
|
recipients: RecipientPublicKey[];
|
|
78
|
+
epoch?: {
|
|
79
|
+
epochId: string;
|
|
80
|
+
secret: Uint8Array;
|
|
81
|
+
};
|
|
56
82
|
}): Promise<CollectionEncryption>;
|
|
57
83
|
/**
|
|
58
84
|
* Adds a reader to a multi-recipient encrypted Collection. Escrow semantics: the
|
|
@@ -65,14 +91,17 @@ export declare function initRecipients({ collection, recipients }: {
|
|
|
65
91
|
* a compare-and-swap, retried on a concurrent change.
|
|
66
92
|
*
|
|
67
93
|
* @param options {object}
|
|
68
|
-
* @param options.collection {Collection} the collection
|
|
94
|
+
* @param [options.collection] {Collection} the collection whose Description
|
|
95
|
+
* hosts the marker; exactly one of `collection` / `store`
|
|
96
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
69
97
|
* @param options.recipient {RecipientPublicKey} the new reader's public KAK
|
|
70
98
|
* @param options.owner {OwnerKey} the caller's own key-agreement key, to
|
|
71
99
|
* unwrap each epoch key for re-wrapping to the new reader
|
|
72
100
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
73
101
|
*/
|
|
74
|
-
export declare function addRecipient({ collection, recipient, owner }: {
|
|
75
|
-
collection
|
|
102
|
+
export declare function addRecipient({ collection, store, recipient, owner }: {
|
|
103
|
+
collection?: Collection;
|
|
104
|
+
store?: MarkerStore;
|
|
76
105
|
recipient: RecipientPublicKey;
|
|
77
106
|
owner: OwnerKey;
|
|
78
107
|
}): Promise<CollectionEncryption>;
|
|
@@ -85,17 +114,21 @@ export declare function addRecipient({ collection, recipient, owner }: {
|
|
|
85
114
|
* as a new epoch, and repoint `currentEpoch`, with a compare-and-swap.
|
|
86
115
|
* Resources written afterward are unreadable to the removed reader (the read
|
|
87
116
|
* axis; prospective).
|
|
88
|
-
* 2. **
|
|
89
|
-
*
|
|
117
|
+
* 2. **Pull the reader's server-side access** (the pull axis; immediate). By
|
|
118
|
+
* default that revokes the reader's zcap(s) via `space.revoke()`, so the
|
|
119
|
+
* server stops serving it ciphertext; a caller whose pull axis lives
|
|
120
|
+
* elsewhere (e.g. a DID document naming the readers) supplies its own
|
|
121
|
+
* `pull` action instead.
|
|
90
122
|
*
|
|
91
|
-
* The rotation runs first so it is durable before the irreversible
|
|
92
|
-
* a rotation that keeps losing the compare-and-swap throws with nothing
|
|
93
|
-
* leaving the operation safely retryable rather than half-applied. The
|
|
94
|
-
* step tolerates an already-revoked capability (a retry re-revokes) so
|
|
95
|
-
* operation converges
|
|
123
|
+
* The rotation runs first so it is durable before the irreversible pull:
|
|
124
|
+
* a rotation that keeps losing the compare-and-swap throws with nothing pulled,
|
|
125
|
+
* leaving the operation safely retryable rather than half-applied. The default
|
|
126
|
+
* revoke step tolerates an already-revoked capability (a retry re-revokes) so
|
|
127
|
+
* the operation converges; a custom `pull` should likewise tolerate a retry.
|
|
128
|
+
* The rotation itself is likewise idempotent with respect
|
|
96
129
|
* to retries: when the current epoch already excludes the departing reader
|
|
97
|
-
* (a prior attempt's rotation landed but its
|
|
98
|
-
* fresh epoch is minted or appended -- the retry skips straight to the
|
|
130
|
+
* (a prior attempt's rotation landed but its pull failed transiently), no
|
|
131
|
+
* fresh epoch is minted or appended -- the retry skips straight to the pull
|
|
99
132
|
* step instead of accumulating a redundant epoch per attempt.
|
|
100
133
|
*
|
|
101
134
|
* Important: this does not re-encrypt existing resources, so the removed
|
|
@@ -103,24 +136,37 @@ export declare function addRecipient({ collection, recipient, owner }: {
|
|
|
103
136
|
* resource whose ciphertext it gets. Neither half alone removes a reader.
|
|
104
137
|
*
|
|
105
138
|
* @param options {object}
|
|
106
|
-
* @param options.collection {Collection} the collection
|
|
107
|
-
*
|
|
139
|
+
* @param [options.collection] {Collection} the collection whose Description
|
|
140
|
+
* hosts the marker; exactly one of `collection` / `store`
|
|
141
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
142
|
+
* @param [options.space] {Space} the collection's Space, for the default
|
|
143
|
+
* pull axis (zcap revocation); required together with `revoke` unless a
|
|
144
|
+
* custom `pull` is supplied
|
|
108
145
|
* @param options.recipientId {string} the removed reader's key-agreement key
|
|
109
146
|
* id (`kid`), dropped from the new epoch's recipients
|
|
110
|
-
* @param options.revoke {IDelegatedZcap | IDelegatedZcap[]} the reader's
|
|
111
|
-
* delegated capability/capabilities to revoke (the pull axis)
|
|
147
|
+
* @param [options.revoke] {IDelegatedZcap | IDelegatedZcap[]} the reader's
|
|
148
|
+
* delegated capability/capabilities to revoke (the default pull axis);
|
|
149
|
+
* required together with `space` unless a custom `pull` is supplied
|
|
150
|
+
* @param [options.pull] {function} a caller-supplied pull action replacing
|
|
151
|
+
* the default zcap revocation. Runs only after the rotation is durable, and
|
|
152
|
+
* should tolerate being re-run (removeRecipient is retried to convergence).
|
|
153
|
+
* Mutually exclusive with `space` / `revoke`.
|
|
112
154
|
* @param [options.resolveRecipientKey] {function} resolves a remaining
|
|
113
155
|
* recipient's `kid` to its public key-agreement key, so the fresh epoch key
|
|
114
156
|
* can be wrapped to it. Defaults to a `did:key` resolver (the `kid` fragment
|
|
115
157
|
* is the X25519 public key); override for recipients whose `kid` is not a
|
|
116
|
-
* self-describing `did:key`.
|
|
158
|
+
* self-describing `did:key`. May resolve `null` to signal drop-this-kid:
|
|
159
|
+
* the rotation then excludes that entry from the fresh epoch instead of
|
|
160
|
+
* throwing (subject to the no-recipients-remaining guard).
|
|
117
161
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
118
162
|
*/
|
|
119
|
-
export declare function removeRecipient({ collection, space, recipientId, revoke, resolveRecipientKey }: {
|
|
120
|
-
collection
|
|
121
|
-
|
|
163
|
+
export declare function removeRecipient({ collection, store, space, recipientId, revoke, pull, resolveRecipientKey }: {
|
|
164
|
+
collection?: Collection;
|
|
165
|
+
store?: MarkerStore;
|
|
166
|
+
space?: Space;
|
|
122
167
|
recipientId: string;
|
|
123
|
-
revoke
|
|
124
|
-
|
|
168
|
+
revoke?: IDelegatedZcap | IDelegatedZcap[];
|
|
169
|
+
pull?: () => Promise<void>;
|
|
170
|
+
resolveRecipientKey?: (kid: string) => Promise<RecipientPublicKey | null>;
|
|
125
171
|
}): Promise<CollectionEncryption>;
|
|
126
172
|
//# sourceMappingURL=recipients.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipients.d.ts","sourceRoot":"","sources":["../../src/edv/recipients.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"recipients.d.ts","sourceRoot":"","sources":["../../src/edv/recipients.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EACV,oBAAoB,EAEpB,cAAc,EACf,MAAM,aAAa,CAAA;AAQpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,eAAe,EAAE,gBAAgB,CAAA;CAClC;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,cAAc,CAAC,EACnC,UAAU,EACV,KAAK,EACL,UAAU,EACV,KAAK,EAAE,cAAc,EACtB,EAAE;IACD,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,kBAAkB,EAAE,CAAA;IAChC,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,CAAA;CAChD,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA6ChC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAAC,EACjC,UAAU,EACV,KAAK,EACL,SAAS,EACT,KAAK,EACN,EAAE;IACD,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,SAAS,EAAE,kBAAkB,CAAA;IAC7B,KAAK,EAAE,QAAQ,CAAA;CAChB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAuDhC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,mBAAgD,EACjD,EAAE;IACD,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAA;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;CAC1E,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgGhC"}
|
package/dist/edv/recipients.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { unreadableDescriptionError } from '../internal/describe.js';
|
|
2
1
|
import { PreconditionFailedError, ValidationError } from '../errors.js';
|
|
2
|
+
import { collectionMarkerStore } from './markerStore.js';
|
|
3
3
|
import { didKeyResolver, mintEpoch, unwrapEpochSecret, wrapEpochSecret } from './epochCrypto.js';
|
|
4
4
|
import { computeEpochsMac } from './epochMac.js';
|
|
5
5
|
/**
|
|
@@ -8,29 +8,47 @@ import { computeEpochsMac } from './epochMac.js';
|
|
|
8
8
|
*/
|
|
9
9
|
const MAX_CAS_ATTEMPTS = 3;
|
|
10
10
|
/**
|
|
11
|
-
* Initializes the first key epoch on a
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* Initializes the first key epoch on a marker that has no epochs yet: mints a
|
|
12
|
+
* fresh epoch key, wraps it to each initial recipient, and writes
|
|
13
|
+
* `epochs: [epoch]` / `currentEpoch` back with a compare-and-swap. After this,
|
|
14
|
+
* resources written by any recipient are encrypted under the epoch, and readers
|
|
15
|
+
* unwrap it with their own key-agreement key.
|
|
16
|
+
*
|
|
17
|
+
* On the `collection` host the collection must already be declared encrypted
|
|
18
|
+
* (its marker exists; this fills in the first epochs). On a store whose marker
|
|
19
|
+
* host starts absent (e.g. `resourceMarkerStore`, whose roster resource does
|
|
20
|
+
* not exist before the first init), the marker itself is created from scratch
|
|
21
|
+
* with a create-if-absent guard (`If-None-Match: *`), so two racing first
|
|
22
|
+
* inits cannot clobber one another.
|
|
16
23
|
*
|
|
17
24
|
* @param options {object}
|
|
18
|
-
* @param options.collection {Collection} the (already encrypted) collection
|
|
25
|
+
* @param [options.collection] {Collection} the (already encrypted) collection
|
|
26
|
+
* whose Description hosts the marker; exactly one of `collection` / `store`
|
|
27
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
19
28
|
* @param options.recipients {RecipientPublicKey[]} the initial readers' public
|
|
20
29
|
* key-agreement keys (each `id` is the reader's `kid`)
|
|
30
|
+
* @param [options.epoch] {{ epochId: string, secret: Uint8Array }} a
|
|
31
|
+
* pre-minted first epoch to install instead of minting one -- for a caller
|
|
32
|
+
* whose epoch key already exists (e.g. a per-user key being enrolled into
|
|
33
|
+
* its wrap-set roster). The `epochId` must be the key's did:key and `secret`
|
|
34
|
+
* its raw 32-byte private key, exactly what {@link mintEpoch} returns.
|
|
21
35
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
22
36
|
*/
|
|
23
|
-
export async function initRecipients({ collection, recipients }) {
|
|
37
|
+
export async function initRecipients({ collection, store, recipients, epoch: premintedEpoch }) {
|
|
24
38
|
if (recipients.length === 0) {
|
|
25
39
|
throw new ValidationError('initRecipients needs at least one recipient to wrap the epoch key to.');
|
|
26
40
|
}
|
|
27
|
-
const { epochId, secret } = await mintEpoch();
|
|
41
|
+
const { epochId, secret } = premintedEpoch ?? (await mintEpoch());
|
|
28
42
|
const epoch = {
|
|
29
43
|
id: epochId,
|
|
30
44
|
recipients: await Promise.all(recipients.map(recipient => wrapEpochSecret({ epochSecret: secret, recipient })))
|
|
31
45
|
};
|
|
32
46
|
return casUpdateMarker({
|
|
33
|
-
collection,
|
|
47
|
+
store: markerStoreFor({ collection, store }),
|
|
48
|
+
// A store whose marker starts absent initializes from a bare `edv` marker
|
|
49
|
+
// (the create-if-absent branch); a Collection Description's marker always
|
|
50
|
+
// exists, so its adapter never reaches the seed.
|
|
51
|
+
seed: { scheme: 'edv' },
|
|
34
52
|
mutate: async (marker) => {
|
|
35
53
|
if (marker.epochs && marker.epochs.length > 0) {
|
|
36
54
|
throw new ValidationError('This collection already has key epochs; use addRecipient to add a ' +
|
|
@@ -65,15 +83,17 @@ export async function initRecipients({ collection, recipients }) {
|
|
|
65
83
|
* a compare-and-swap, retried on a concurrent change.
|
|
66
84
|
*
|
|
67
85
|
* @param options {object}
|
|
68
|
-
* @param options.collection {Collection} the collection
|
|
86
|
+
* @param [options.collection] {Collection} the collection whose Description
|
|
87
|
+
* hosts the marker; exactly one of `collection` / `store`
|
|
88
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
69
89
|
* @param options.recipient {RecipientPublicKey} the new reader's public KAK
|
|
70
90
|
* @param options.owner {OwnerKey} the caller's own key-agreement key, to
|
|
71
91
|
* unwrap each epoch key for re-wrapping to the new reader
|
|
72
92
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
73
93
|
*/
|
|
74
|
-
export async function addRecipient({ collection, recipient, owner }) {
|
|
94
|
+
export async function addRecipient({ collection, store, recipient, owner }) {
|
|
75
95
|
return casUpdateMarker({
|
|
76
|
-
collection,
|
|
96
|
+
store: markerStoreFor({ collection, store }),
|
|
77
97
|
mutate: async (marker) => {
|
|
78
98
|
const epochs = marker.epochs;
|
|
79
99
|
if (!epochs || epochs.length === 0) {
|
|
@@ -124,17 +144,21 @@ export async function addRecipient({ collection, recipient, owner }) {
|
|
|
124
144
|
* as a new epoch, and repoint `currentEpoch`, with a compare-and-swap.
|
|
125
145
|
* Resources written afterward are unreadable to the removed reader (the read
|
|
126
146
|
* axis; prospective).
|
|
127
|
-
* 2. **
|
|
128
|
-
*
|
|
147
|
+
* 2. **Pull the reader's server-side access** (the pull axis; immediate). By
|
|
148
|
+
* default that revokes the reader's zcap(s) via `space.revoke()`, so the
|
|
149
|
+
* server stops serving it ciphertext; a caller whose pull axis lives
|
|
150
|
+
* elsewhere (e.g. a DID document naming the readers) supplies its own
|
|
151
|
+
* `pull` action instead.
|
|
129
152
|
*
|
|
130
|
-
* The rotation runs first so it is durable before the irreversible
|
|
131
|
-
* a rotation that keeps losing the compare-and-swap throws with nothing
|
|
132
|
-
* leaving the operation safely retryable rather than half-applied. The
|
|
133
|
-
* step tolerates an already-revoked capability (a retry re-revokes) so
|
|
134
|
-
* operation converges
|
|
153
|
+
* The rotation runs first so it is durable before the irreversible pull:
|
|
154
|
+
* a rotation that keeps losing the compare-and-swap throws with nothing pulled,
|
|
155
|
+
* leaving the operation safely retryable rather than half-applied. The default
|
|
156
|
+
* revoke step tolerates an already-revoked capability (a retry re-revokes) so
|
|
157
|
+
* the operation converges; a custom `pull` should likewise tolerate a retry.
|
|
158
|
+
* The rotation itself is likewise idempotent with respect
|
|
135
159
|
* to retries: when the current epoch already excludes the departing reader
|
|
136
|
-
* (a prior attempt's rotation landed but its
|
|
137
|
-
* fresh epoch is minted or appended -- the retry skips straight to the
|
|
160
|
+
* (a prior attempt's rotation landed but its pull failed transiently), no
|
|
161
|
+
* fresh epoch is minted or appended -- the retry skips straight to the pull
|
|
138
162
|
* step instead of accumulating a redundant epoch per attempt.
|
|
139
163
|
*
|
|
140
164
|
* Important: this does not re-encrypt existing resources, so the removed
|
|
@@ -142,28 +166,43 @@ export async function addRecipient({ collection, recipient, owner }) {
|
|
|
142
166
|
* resource whose ciphertext it gets. Neither half alone removes a reader.
|
|
143
167
|
*
|
|
144
168
|
* @param options {object}
|
|
145
|
-
* @param options.collection {Collection} the collection
|
|
146
|
-
*
|
|
169
|
+
* @param [options.collection] {Collection} the collection whose Description
|
|
170
|
+
* hosts the marker; exactly one of `collection` / `store`
|
|
171
|
+
* @param [options.store] {MarkerStore} an explicit marker store
|
|
172
|
+
* @param [options.space] {Space} the collection's Space, for the default
|
|
173
|
+
* pull axis (zcap revocation); required together with `revoke` unless a
|
|
174
|
+
* custom `pull` is supplied
|
|
147
175
|
* @param options.recipientId {string} the removed reader's key-agreement key
|
|
148
176
|
* id (`kid`), dropped from the new epoch's recipients
|
|
149
|
-
* @param options.revoke {IDelegatedZcap | IDelegatedZcap[]} the reader's
|
|
150
|
-
* delegated capability/capabilities to revoke (the pull axis)
|
|
177
|
+
* @param [options.revoke] {IDelegatedZcap | IDelegatedZcap[]} the reader's
|
|
178
|
+
* delegated capability/capabilities to revoke (the default pull axis);
|
|
179
|
+
* required together with `space` unless a custom `pull` is supplied
|
|
180
|
+
* @param [options.pull] {function} a caller-supplied pull action replacing
|
|
181
|
+
* the default zcap revocation. Runs only after the rotation is durable, and
|
|
182
|
+
* should tolerate being re-run (removeRecipient is retried to convergence).
|
|
183
|
+
* Mutually exclusive with `space` / `revoke`.
|
|
151
184
|
* @param [options.resolveRecipientKey] {function} resolves a remaining
|
|
152
185
|
* recipient's `kid` to its public key-agreement key, so the fresh epoch key
|
|
153
186
|
* can be wrapped to it. Defaults to a `did:key` resolver (the `kid` fragment
|
|
154
187
|
* is the X25519 public key); override for recipients whose `kid` is not a
|
|
155
|
-
* self-describing `did:key`.
|
|
188
|
+
* self-describing `did:key`. May resolve `null` to signal drop-this-kid:
|
|
189
|
+
* the rotation then excludes that entry from the fresh epoch instead of
|
|
190
|
+
* throwing (subject to the no-recipients-remaining guard).
|
|
156
191
|
* @returns {Promise<CollectionEncryption>} the new marker
|
|
157
192
|
*/
|
|
158
|
-
export async function removeRecipient({ collection, space, recipientId, revoke, resolveRecipientKey = defaultResolveRecipientKey }) {
|
|
193
|
+
export async function removeRecipient({ collection, store, space, recipientId, revoke, pull, resolveRecipientKey = defaultResolveRecipientKey }) {
|
|
194
|
+
const markerStore = markerStoreFor({ collection, store });
|
|
195
|
+
// Resolve the pull axis up front, before any rotation, so a malformed call
|
|
196
|
+
// fails before the marker is mutated.
|
|
197
|
+
const pullAxis = resolvePullAxis({ space, revoke, pull });
|
|
159
198
|
// 1. Read axis: mint a fresh epoch, wrap it to every remaining recipient,
|
|
160
199
|
// append it, and repoint `currentEpoch` (compare-and-swap, retried on race).
|
|
161
|
-
// Rotate FIRST so the rotation is durable before any irreversible
|
|
162
|
-
// if the CAS keeps losing the race and throws, the reader is neither
|
|
200
|
+
// Rotate FIRST so the rotation is durable before any irreversible pull:
|
|
201
|
+
// if the CAS keeps losing the race and throws, the reader is neither pulled
|
|
163
202
|
// nor rotated, so `removeRecipient` is safely retryable to convergence.
|
|
164
203
|
const { epochId, secret } = await mintEpoch();
|
|
165
204
|
const rotatedMarker = await casUpdateMarker({
|
|
166
|
-
|
|
205
|
+
store: markerStore,
|
|
167
206
|
mutate: async (marker) => {
|
|
168
207
|
const epochs = marker.epochs;
|
|
169
208
|
if (!epochs || epochs.length === 0) {
|
|
@@ -195,10 +234,22 @@ export async function removeRecipient({ collection, space, recipientId, revoke,
|
|
|
195
234
|
throw new ValidationError('Cannot removeRecipient: no recipients would remain after the ' +
|
|
196
235
|
'removal (a collection with no readers cannot be rotated to).');
|
|
197
236
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
237
|
+
// Wrap the fresh epoch key to each remaining recipient. The resolver may
|
|
238
|
+
// signal drop-this-kid by resolving `null` (e.g. a roster entry whose
|
|
239
|
+
// key material is no longer resolvable), so the rotation excludes that
|
|
240
|
+
// entry instead of throwing.
|
|
241
|
+
const wrapped = await Promise.all([...remaining].map(async (kid) => {
|
|
242
|
+
const recipient = await resolveRecipientKey(kid);
|
|
243
|
+
return recipient === null
|
|
244
|
+
? null
|
|
245
|
+
: wrapEpochSecret({ epochSecret: secret, recipient });
|
|
246
|
+
}));
|
|
247
|
+
const newRecipients = wrapped.filter(entry => entry !== null);
|
|
248
|
+
if (newRecipients.length === 0) {
|
|
249
|
+
throw new ValidationError('Cannot removeRecipient: no recipients would remain after the ' +
|
|
250
|
+
'removal (resolveRecipientKey dropped every remaining entry, ' +
|
|
251
|
+
'and a collection with no readers cannot be rotated to).');
|
|
252
|
+
}
|
|
202
253
|
const newEpoch = {
|
|
203
254
|
id: epochId,
|
|
204
255
|
recipients: newRecipients
|
|
@@ -218,26 +269,55 @@ export async function removeRecipient({ collection, space, recipientId, revoke,
|
|
|
218
269
|
return { ...next, epochsMac };
|
|
219
270
|
}
|
|
220
271
|
});
|
|
221
|
-
// 2. Pull axis:
|
|
222
|
-
// is durable
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
272
|
+
// 2. Pull axis: withdraw the reader's server-side access AFTER the rotation
|
|
273
|
+
// is durable -- the default zcap revocation, or the caller-supplied `pull`.
|
|
274
|
+
await pullAxis();
|
|
275
|
+
return rotatedMarker;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Resolves the pull axis of {@link removeRecipient} -- exactly one of the
|
|
279
|
+
* default zcap revocation (`space` + `revoke`) or a caller-supplied `pull`
|
|
280
|
+
* action -- into the single action run after the rotation is durable.
|
|
281
|
+
*
|
|
282
|
+
* @param options {object}
|
|
283
|
+
* @param [options.space] {Space}
|
|
284
|
+
* @param [options.revoke] {IDelegatedZcap | IDelegatedZcap[]}
|
|
285
|
+
* @param [options.pull] {function}
|
|
286
|
+
* @returns {function} the pull action
|
|
287
|
+
*/
|
|
288
|
+
function resolvePullAxis({ space, revoke, pull }) {
|
|
289
|
+
if (pull !== undefined) {
|
|
290
|
+
if (space !== undefined || revoke !== undefined) {
|
|
291
|
+
throw new ValidationError('removeRecipient takes either the default pull axis (`space` + ' +
|
|
292
|
+
'`revoke`, the zcap revocation) or a custom `pull` action, not both.');
|
|
232
293
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
294
|
+
return pull;
|
|
295
|
+
}
|
|
296
|
+
if (space === undefined || revoke === undefined) {
|
|
297
|
+
throw new ValidationError('removeRecipient needs its pull axis: pass `space` and `revoke` (the ' +
|
|
298
|
+
'default zcap revocation), or a custom `pull` action.');
|
|
299
|
+
}
|
|
300
|
+
// The default pull: revoke the reader's capability/capabilities. Tolerate an
|
|
301
|
+
// already-revoked capability so a retry (after a transient revoke failure)
|
|
302
|
+
// converges rather than throwing in the loop: `space.revoke` is not
|
|
303
|
+
// idempotent and reports an already-revoked capability as ValidationError.
|
|
304
|
+
// That same status also covers tampered/expired/foreign capabilities, which
|
|
305
|
+
// the client cannot distinguish here, so this swallows only ValidationError
|
|
306
|
+
// and re-throws anything else.
|
|
307
|
+
const toRevoke = Array.isArray(revoke) ? revoke : [revoke];
|
|
308
|
+
return async function revokeZcaps() {
|
|
309
|
+
for (const zcap of toRevoke) {
|
|
310
|
+
try {
|
|
311
|
+
await space.revoke(zcap);
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
if (err instanceof ValidationError) {
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
throw err;
|
|
236
318
|
}
|
|
237
|
-
throw err;
|
|
238
319
|
}
|
|
239
|
-
}
|
|
240
|
-
return rotatedMarker;
|
|
320
|
+
};
|
|
241
321
|
}
|
|
242
322
|
/**
|
|
243
323
|
* The default recipient-key resolver: treats a `kid` as a self-describing
|
|
@@ -252,46 +332,91 @@ async function defaultResolveRecipientKey(kid) {
|
|
|
252
332
|
return { id: resolved.id, publicKeyMultibase: resolved.publicKeyMultibase };
|
|
253
333
|
}
|
|
254
334
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
335
|
+
* Resolves the marker store a recipient operation targets: the explicit
|
|
336
|
+
* `store`, or the Collection Description adapter over the `collection` sugar.
|
|
337
|
+
* Exactly one of the two must be supplied.
|
|
338
|
+
*
|
|
339
|
+
* @param options {object}
|
|
340
|
+
* @param [options.collection] {Collection}
|
|
341
|
+
* @param [options.store] {MarkerStore}
|
|
342
|
+
* @returns {MarkerStore}
|
|
343
|
+
*/
|
|
344
|
+
function markerStoreFor({ collection, store }) {
|
|
345
|
+
if (collection !== undefined && store !== undefined) {
|
|
346
|
+
throw new ValidationError('Pass either `collection` (the Collection Description hosts the ' +
|
|
347
|
+
'marker) or `store` (an explicit marker store), not both.');
|
|
348
|
+
}
|
|
349
|
+
if (store !== undefined) {
|
|
350
|
+
return store;
|
|
351
|
+
}
|
|
352
|
+
if (collection !== undefined) {
|
|
353
|
+
return collectionMarkerStore({ collection });
|
|
354
|
+
}
|
|
355
|
+
throw new ValidationError('A recipient operation needs its marker host: pass `collection` or ' +
|
|
356
|
+
'`store`.');
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Reads the store's marker, applies `mutate`, and writes the result back with
|
|
360
|
+
* a compare-and-swap (`If-Match`). Retries on a stale (`412`) validator,
|
|
361
|
+
* re-reading the fresh marker each time, up to {@link MAX_CAS_ATTEMPTS};
|
|
362
|
+
* surfaces {@link PreconditionFailedError} if it keeps losing the race. A
|
|
363
|
+
* `mutate` that resolves `null` signals "no change needed" (the marker already
|
|
364
|
+
* reflects the desired state, e.g. an idempotent retry): nothing is written
|
|
365
|
+
* and the current marker is returned as-is.
|
|
366
|
+
*
|
|
367
|
+
* When the store reports no marker yet (`read()` resolves `null`, e.g. the
|
|
368
|
+
* resource adapter before the first `initRecipients`), the optional `seed` is
|
|
369
|
+
* mutated instead and the result written with the store's create-if-absent
|
|
370
|
+
* guard (`If-None-Match: *`). Only `initRecipients` passes a seed; without
|
|
371
|
+
* one an absent marker is refused. Losing the create race (a concurrent
|
|
372
|
+
* writer created the first marker) re-enters the loop and re-reads, like a
|
|
373
|
+
* stale CAS.
|
|
262
374
|
*
|
|
263
375
|
* @param options {object}
|
|
264
|
-
* @param options.
|
|
376
|
+
* @param options.store {MarkerStore}
|
|
265
377
|
* @param options.mutate {function} marker to the next marker (may be async),
|
|
266
378
|
* or `null` to skip the write
|
|
379
|
+
* @param [options.seed] {CollectionEncryption} the marker to mutate when the
|
|
380
|
+
* store holds none yet
|
|
267
381
|
* @returns {Promise<CollectionEncryption>} the written (or current) marker
|
|
268
382
|
*/
|
|
269
|
-
async function casUpdateMarker({
|
|
383
|
+
async function casUpdateMarker({ store, mutate, seed }) {
|
|
270
384
|
let lastError;
|
|
271
385
|
for (let attempt = 0; attempt < MAX_CAS_ATTEMPTS; attempt++) {
|
|
272
|
-
const current = await
|
|
386
|
+
const current = await store.read();
|
|
273
387
|
if (current === null) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
388
|
+
if (seed === undefined) {
|
|
389
|
+
throw new ValidationError('Cannot manage recipients: this marker store holds no encryption ' +
|
|
390
|
+
'marker yet. Call initRecipients first.');
|
|
391
|
+
}
|
|
392
|
+
if (store.create === undefined) {
|
|
393
|
+
throw new ValidationError('Cannot initialize recipients: this marker store holds no marker ' +
|
|
394
|
+
'and does not support creating one.');
|
|
395
|
+
}
|
|
396
|
+
const created = await mutate(seed);
|
|
397
|
+
if (created === null) {
|
|
398
|
+
return seed;
|
|
399
|
+
}
|
|
400
|
+
try {
|
|
401
|
+
await store.create(created);
|
|
402
|
+
return created;
|
|
403
|
+
}
|
|
404
|
+
catch (err) {
|
|
405
|
+
if (err instanceof PreconditionFailedError) {
|
|
406
|
+
// A concurrent writer created the first marker: re-read and re-apply.
|
|
407
|
+
lastError = err;
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
throw err;
|
|
411
|
+
}
|
|
283
412
|
}
|
|
284
|
-
const next = await mutate(marker);
|
|
413
|
+
const next = await mutate(current.marker);
|
|
285
414
|
if (next === null) {
|
|
286
415
|
// The marker already reflects the desired state: nothing to write.
|
|
287
|
-
return marker;
|
|
416
|
+
return current.marker;
|
|
288
417
|
}
|
|
289
418
|
try {
|
|
290
|
-
await
|
|
291
|
-
name: current.description.name,
|
|
292
|
-
backend: current.description.backend,
|
|
293
|
-
encryption: next
|
|
294
|
-
}, { ifMatch: current.etag });
|
|
419
|
+
await store.replace(next, { ifMatch: current.etag });
|
|
295
420
|
return next;
|
|
296
421
|
}
|
|
297
422
|
catch (err) {
|
|
@@ -304,7 +429,7 @@ async function casUpdateMarker({ collection, mutate }) {
|
|
|
304
429
|
}
|
|
305
430
|
}
|
|
306
431
|
throw new PreconditionFailedError(`Recipient change lost the compare-and-swap race after ${MAX_CAS_ATTEMPTS} ` +
|
|
307
|
-
'attempts (another writer kept updating the
|
|
432
|
+
'attempts (another writer kept updating the stored marker). ' +
|
|
308
433
|
'Retry the operation.', { cause: lastError });
|
|
309
434
|
}
|
|
310
435
|
//# sourceMappingURL=recipients.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipients.js","sourceRoot":"","sources":["../../src/edv/recipients.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recipients.js","sourceRoot":"","sources":["../../src/edv/recipients.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAOxD,OAAO,EACL,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAahD;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CA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AAI,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAA;YACb,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBAC3B,OAAO,OAAO,CAAA;YAChB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,uBAAuB,EAAE,CAAC;oBAC3C,sEAAsE;oBACtE,SAAS,GAAG,GAAG,CAAA;oBACf,SAAQ;gBACV,CAAC;gBACD,MAAM,GAAG,CAAA;YACX,CAAC;QACH,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACzC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,mEAAmE;YACnE,OAAO,OAAO,CAAC,MAAM,CAAA;QACvB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;YACpD,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,uBAAuB,EAAE,CAAC;gBAC3C,oEAAoE;gBACpE,SAAS,GAAG,GAAG,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC;IACD,MAAM,IAAI,uBAAuB,CAC/B,yDAAyD,gBAAgB,GAAG;QAC1E,6DAA6D;QAC7D,sBAAsB,EACxB,EAAE,KAAK,EAAE,SAAkB,EAAE,CAC9B,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/was-client",
|
|
3
3
|
"description": "A developer-friendly client for Wallet Attached Storage (WAS) servers.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"types": "dist/index.d.ts",
|
|
49
49
|
"sideEffects": false,
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@interop/data-integrity-core": "^8.
|
|
51
|
+
"@interop/data-integrity-core": "^8.4.0",
|
|
52
52
|
"@interop/ed25519-signature": "^7.1.4",
|
|
53
53
|
"@interop/edv-client": "^17.8.0",
|
|
54
54
|
"@interop/ezcap": "^7.4.1",
|
|
55
55
|
"@interop/http-client": "^1.0.4",
|
|
56
56
|
"@interop/minimal-cipher": "^7.8.0",
|
|
57
|
-
"@interop/storage-core": "^0.3.
|
|
57
|
+
"@interop/storage-core": "^0.3.9",
|
|
58
58
|
"@interop/x25519-key-agreement-key": "^5.2.1",
|
|
59
59
|
"@noble/hashes": "^2.2.0",
|
|
60
60
|
"@scure/base": "^2.2.0",
|