@interop/was-client 0.34.0 → 0.35.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.
Files changed (50) hide show
  1. package/README.md +112 -0
  2. package/dist/Collection.d.ts +172 -1
  3. package/dist/Collection.d.ts.map +1 -1
  4. package/dist/Collection.js +368 -2
  5. package/dist/Collection.js.map +1 -1
  6. package/dist/codec.d.ts +101 -3
  7. package/dist/codec.d.ts.map +1 -1
  8. package/dist/edv/EdvCodec.d.ts +34 -4
  9. package/dist/edv/EdvCodec.d.ts.map +1 -1
  10. package/dist/edv/EdvCodec.js +268 -42
  11. package/dist/edv/EdvCodec.js.map +1 -1
  12. package/dist/edv/docCipher.d.ts.map +1 -1
  13. package/dist/edv/docCipher.js +5 -9
  14. package/dist/edv/docCipher.js.map +1 -1
  15. package/dist/edv/hmacKey.d.ts +76 -0
  16. package/dist/edv/hmacKey.d.ts.map +1 -0
  17. package/dist/edv/hmacKey.js +105 -0
  18. package/dist/edv/hmacKey.js.map +1 -0
  19. package/dist/edv/index.d.ts +7 -0
  20. package/dist/edv/index.d.ts.map +1 -1
  21. package/dist/edv/index.js +6 -0
  22. package/dist/edv/index.js.map +1 -1
  23. package/dist/edv/recipients.d.ts +22 -3
  24. package/dist/edv/recipients.d.ts.map +1 -1
  25. package/dist/edv/recipients.js +197 -21
  26. package/dist/edv/recipients.js.map +1 -1
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/internal/codec.d.ts.map +1 -1
  30. package/dist/internal/codec.js +64 -3
  31. package/dist/internal/codec.js.map +1 -1
  32. package/dist/internal/content.d.ts +12 -0
  33. package/dist/internal/content.d.ts.map +1 -1
  34. package/dist/internal/content.js +18 -0
  35. package/dist/internal/content.js.map +1 -1
  36. package/dist/internal/indexSchema.d.ts +95 -0
  37. package/dist/internal/indexSchema.d.ts.map +1 -0
  38. package/dist/internal/indexSchema.js +120 -0
  39. package/dist/internal/indexSchema.js.map +1 -0
  40. package/dist/internal/paths.d.ts +6 -0
  41. package/dist/internal/paths.d.ts.map +1 -1
  42. package/dist/internal/paths.js +8 -0
  43. package/dist/internal/paths.js.map +1 -1
  44. package/dist/paths.d.ts +1 -1
  45. package/dist/paths.d.ts.map +1 -1
  46. package/dist/paths.js +1 -1
  47. package/dist/paths.js.map +1 -1
  48. package/dist/types.d.ts +40 -1
  49. package/dist/types.d.ts.map +1 -1
  50. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  import { EdvClientCore } from '@interop/edv-client';
2
2
  import type { IKeyAgreementKey, IKeyResolver } from '@interop/data-integrity-core';
3
- import type { EncodedWrite, EncryptionProvider, ResourceCodec, ResponseLike } from '../codec.js';
3
+ import type { CodecIndexing, EncodedWrite, EncryptionProvider, ResourceCodec, ResponseLike } from '../codec.js';
4
+ import type { BlindingKey } from './hmacKey.js';
4
5
  import type { Json, ResourceData, ResourceMetadataCustom } from '../types.js';
5
6
  /**
6
7
  * A {@link ResourceCodec} that encrypts on write and decrypts on read using an
@@ -30,9 +31,13 @@ export declare class EdvCodec implements ResourceCodec {
30
31
  * JWE ciphertext, content-addressed)
31
32
  * @param [options.version] {number} the EDV-over-WAS scheme version to bind
32
33
  * into each envelope's `was.v` (defaults to {@link EDV_SCHEME_VERSION})
33
- * @param [options.collectionId] {string} labels decrypt-routing errors
34
+ * @param options.collectionId {string} the Collection this codec reads and
35
+ * writes: bound into the Collection metadata envelope's `was.collection`
36
+ * (and checked on read), and it labels decrypt-routing errors
37
+ * @param [options.hmac] {BlindingKey} the collection's blinded-index key,
38
+ * where it declares one
34
39
  */
35
- constructor({ edv, keyAgreementKey, readKeys, writeEpoch, contentType, maxBlobBytes, idDerivation, version, collectionId }: {
40
+ constructor({ edv, keyAgreementKey, readKeys, writeEpoch, contentType, maxBlobBytes, idDerivation, version, collectionId, hmac }: {
36
41
  edv: EdvClientCore;
37
42
  keyAgreementKey: IKeyAgreementKey;
38
43
  readKeys: IKeyAgreementKey[];
@@ -41,8 +46,19 @@ export declare class EdvCodec implements ResourceCodec {
41
46
  maxBlobBytes: number;
42
47
  idDerivation: 'random' | 'content';
43
48
  version?: number;
44
- collectionId?: string;
49
+ collectionId: string;
50
+ hmac?: BlindingKey | null;
45
51
  });
52
+ /**
53
+ * The collection's blinded-index key, or `null` where it declares none.
54
+ *
55
+ * @returns {BlindingKey | null}
56
+ */
57
+ get blindingKey(): BlindingKey | null;
58
+ /**
59
+ * @inheritdoc
60
+ */
61
+ get indexing(): CodecIndexing | undefined;
46
62
  /**
47
63
  * @inheritdoc
48
64
  */
@@ -70,6 +86,7 @@ export declare class EdvCodec implements ResourceCodec {
70
86
  id?: string;
71
87
  }): Promise<{
72
88
  custom: object;
89
+ epoch: string;
73
90
  }>;
74
91
  /**
75
92
  * @inheritdoc
@@ -78,6 +95,11 @@ export declare class EdvCodec implements ResourceCodec {
78
95
  * absent `custom` (no metadata written yet, or cleared) decodes to `{}`; a
79
96
  * present value must be an EDV envelope (else {@link EncryptionError}, the
80
97
  * `_assertEnvelope` guard), so a foreign plaintext `custom` fails closed.
98
+ *
99
+ * An omitted `expectedId` means the Collection-level metadata slot (a
100
+ * Resource metadata read always passes its resource id), so an envelope bound
101
+ * to a resource is refused there as a server-side swap, and one that does not
102
+ * bind this Collection's own id is refused as an envelope of some other slot.
81
103
  */
82
104
  decodeMeta({ custom }: {
83
105
  custom?: unknown;
@@ -89,6 +111,14 @@ export declare class EdvCodec implements ResourceCodec {
89
111
  export interface EdvKeys {
90
112
  keyAgreementKey: IKeyAgreementKey;
91
113
  keyResolver: IKeyResolver;
114
+ /**
115
+ * The collection's blinded-index key, for a keystore that custodies the HMAC
116
+ * key directly rather than reading it off the descriptor. An explicitly
117
+ * supplied key wins over unwrapping the descriptor's `hmac` member; omit it
118
+ * to let the descriptor decide (and to get `null` when the collection
119
+ * declares no blinded index at all).
120
+ */
121
+ hmac?: BlindingKey;
92
122
  }
93
123
  /**
94
124
  * Builds an {@link EncryptionProvider} for the `ed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54
  * encrypted into an EDV Document envelope with the same `documentCipher` used
55
55
  * for content and stored opaquely under `/meta`; the server never sees
56
56
  * plaintext `name`/`tags`. A reader with the keys decrypts it back
57
- * transparently via `meta()`.
57
+ * transparently via `meta()`. The Collection-level `/meta` surface
58
+ * (`Collection.meta()` / `setMeta()`) runs through the same pair, with no
59
+ * resource id to bind: its envelope binds the collection id
60
+ * (`was.collection`) instead, and the decode side refuses both a
61
+ * resource-bound envelope served into that slot and a collection-bound one
62
+ * served into a resource's.
58
63
  */
59
64
  import { base64, base64urlnopad } from '@scure/base';
60
65
  import { EdvClientCore, assertDocId } from '@interop/edv-client';
66
+ import { EMPTY_INDEX_SCHEMA, assertQueryAttributes } from '../internal/indexSchema.js';
61
67
  import { EncryptionError, IntegrityError, KeyUnwrapError, UnknownEpochError, ValidationError } from '../errors.js';
62
68
  import { readEtag } from '../internal/conditional.js';
63
69
  import { isEncryptedEnvelope } from '../sync/envelope.js';
64
70
  import { resolveEpochKeys } from './epochKeys.js';
65
71
  import { didKeyResolver } from './epochCrypto.js';
72
+ import { resolveHmacKey } from './hmacKey.js';
66
73
  import { isBlob, isTextContentType, readJsonData, resolvePayload } from '../internal/content.js';
67
74
  import { DEFAULT_CONTENT_TYPE, EDV_SCHEME_VERSION, envelopeBytes } from './constants.js';
68
75
  /**
@@ -95,21 +102,26 @@ const UTF8_DECODER = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
95
102
  const HEADER_DECODER = new TextDecoder();
96
103
  /**
97
104
  * Builds the AEAD-bound `was` protected-header parameter: the scheme version
98
- * and key epoch always, and the resource id when it is known at encrypt time
99
- * (absent for a content-derived id, which does not exist until after
100
- * encryption). The one shape both the content and the metadata write paths
101
- * bind.
105
+ * and key epoch always, and then exactly one slot marker -- the resource id
106
+ * when it is known at encrypt time (absent for a content-derived id, which
107
+ * does not exist until after encryption), or the collection id for the
108
+ * Collection metadata envelope, which belongs to no resource. The one shape
109
+ * both the content and the metadata write paths bind.
102
110
  *
103
111
  * @param options {object}
104
112
  * @param options.version {number} the EDV-over-WAS scheme version
105
113
  * @param [options.resource] {string} the resource id the envelope is bound to
114
+ * @param [options.collection] {string} the collection id the envelope is
115
+ * bound to (the Collection metadata slot only, never alongside `resource`)
106
116
  * @param [options.epoch] {string} the key epoch the write encrypts under
107
- * @returns {{ v: number, resource?: string, epoch?: string }}
117
+ * @returns {{ v: number, resource?: string, collection?: string,
118
+ * epoch?: string }}
108
119
  */
109
- function wasParam({ version, resource, epoch }) {
120
+ function wasParam({ version, resource, collection, epoch }) {
110
121
  return {
111
122
  v: version,
112
123
  ...(resource !== undefined && { resource }),
124
+ ...(collection !== undefined && { collection }),
113
125
  ...(epoch !== undefined && { epoch })
114
126
  };
115
127
  }
@@ -201,10 +213,31 @@ export class EdvCodec {
201
213
  */
202
214
  #version;
203
215
  /**
204
- * Labels decrypt-routing errors ({@link UnknownEpochError}); the codec is
205
- * otherwise collection-agnostic.
216
+ * The id of the Collection this codec was built for. It is bound into the
217
+ * Collection metadata envelope's `was.collection` on write and required to
218
+ * match on read, and it labels decrypt-routing errors
219
+ * ({@link UnknownEpochError}).
206
220
  */
207
221
  #collectionId;
222
+ /**
223
+ * The collection's blinded-index key, or `null` where the collection
224
+ * declares none. It blinds attribute names and values both on write (the
225
+ * `indexed` entries an envelope carries) and on query, so equal plaintext
226
+ * yields equal tokens and the server can match without learning either.
227
+ */
228
+ #blindingKey;
229
+ /**
230
+ * The collection's persisted index schema, as last applied through
231
+ * {@link indexing}. Empty until the schema is loaded (at codec resolution) or
232
+ * a `declareIndex` installs one -- and while it is empty the write seam emits
233
+ * no `indexed` entries, since there is nothing declared to index.
234
+ */
235
+ #schema = EMPTY_INDEX_SCHEMA;
236
+ /**
237
+ * The scheme-agnostic search capability handed to the handle layer, present
238
+ * exactly when this collection declares a blinding key.
239
+ */
240
+ #indexing;
208
241
  /**
209
242
  * @param options {object}
210
243
  * @param options.edv {EdvClientCore} holds the cipher + key resolver
@@ -225,9 +258,13 @@ export class EdvCodec {
225
258
  * JWE ciphertext, content-addressed)
226
259
  * @param [options.version] {number} the EDV-over-WAS scheme version to bind
227
260
  * into each envelope's `was.v` (defaults to {@link EDV_SCHEME_VERSION})
228
- * @param [options.collectionId] {string} labels decrypt-routing errors
261
+ * @param options.collectionId {string} the Collection this codec reads and
262
+ * writes: bound into the Collection metadata envelope's `was.collection`
263
+ * (and checked on read), and it labels decrypt-routing errors
264
+ * @param [options.hmac] {BlindingKey} the collection's blinded-index key,
265
+ * where it declares one
229
266
  */
230
- constructor({ edv, keyAgreementKey, readKeys, writeEpoch, contentType, maxBlobBytes, idDerivation, version, collectionId }) {
267
+ constructor({ edv, keyAgreementKey, readKeys, writeEpoch, contentType, maxBlobBytes, idDerivation, version, collectionId, hmac }) {
231
268
  this.#edv = edv;
232
269
  this.#recipients =
233
270
  edv.documentCipher.createDefaultRecipients(keyAgreementKey);
@@ -237,7 +274,81 @@ export class EdvCodec {
237
274
  this.#maxBlobBytes = maxBlobBytes;
238
275
  this.#idDerivation = idDerivation;
239
276
  this.#version = version ?? EDV_SCHEME_VERSION;
240
- this.#collectionId = collectionId ?? '(unknown)';
277
+ this.#collectionId = collectionId;
278
+ this.#blindingKey = hmac ?? null;
279
+ if (this.#blindingKey !== null) {
280
+ this.#indexing = {
281
+ applySchema: (schema) => this.#applySchema(schema),
282
+ schema: () => this.#schema,
283
+ buildQuery: (input) => this.#buildQuery(input)
284
+ };
285
+ }
286
+ }
287
+ /**
288
+ * The collection's blinded-index key, or `null` where it declares none.
289
+ *
290
+ * @returns {BlindingKey | null}
291
+ */
292
+ get blindingKey() {
293
+ return this.#blindingKey;
294
+ }
295
+ /**
296
+ * @inheritdoc
297
+ */
298
+ get indexing() {
299
+ return this.#indexing;
300
+ }
301
+ /**
302
+ * Installs the persisted schema: records it, then registers each declared
303
+ * attribute with the EDV core, whose index helper is what actually blinds
304
+ * attributes on write and builds query terms. Registration is idempotent, so
305
+ * re-applying the same schema (or a superset of it) is safe.
306
+ *
307
+ * @param schema {IndexSchema}
308
+ * @returns {void}
309
+ */
310
+ #applySchema(schema) {
311
+ this.#schema = schema;
312
+ for (const entry of schema.indexes) {
313
+ this.#edv.ensureIndex({
314
+ attribute: entry.attribute,
315
+ unique: entry.unique === true
316
+ });
317
+ }
318
+ }
319
+ /**
320
+ * Blinds a caller's search terms with the collection's blinding key. Refuses
321
+ * an attribute the persisted schema does not declare (see
322
+ * `assertQueryAttributes`), and refuses a query that blinded to no terms at
323
+ * all -- the residual footgun the name check cannot see, e.g. a compound
324
+ * index queried by something other than a leading prefix of its members.
325
+ *
326
+ * @param input {object}
327
+ * @param [input.equals] {object | object[]}
328
+ * @param [input.has] {string | string[]}
329
+ * @returns {Promise<BlindedQuery>}
330
+ */
331
+ async #buildQuery({ equals, has }) {
332
+ const hmac = this.#blindingKey;
333
+ if (hmac === null) {
334
+ throw new EncryptionError(`Collection ${this.#collectionId} declares no blinded-index key, so ` +
335
+ 'its contents cannot be searched.');
336
+ }
337
+ assertQueryAttributes({ schema: this.#schema, equals, has });
338
+ const query = (await this.#edv.indexHelper.buildQuery({
339
+ hmac,
340
+ equals,
341
+ has
342
+ }));
343
+ const termless = (query.equals?.every(term => Object.keys(term).length === 0) ?? false) ||
344
+ query.has?.length === 0;
345
+ if (termless) {
346
+ throw new ValidationError('This search blinded to no index terms, so it would match nothing. ' +
347
+ 'A compound index can only be queried by a leading prefix of its ' +
348
+ "attributes; check the collection's declared indexes with " +
349
+ 'indexes().');
350
+ }
351
+ return query;
241
352
  }
242
353
  /**
243
354
  * @inheritdoc
@@ -303,7 +414,11 @@ export class EdvCodec {
303
414
  },
304
415
  recipients: this.#recipients,
305
416
  keyResolver: this.#edv.keyResolver,
306
- hmac: undefined,
417
+ // Blind the declared attributes into the envelope's cleartext `indexed`
418
+ // entries, so the server can match a search without decrypting anything.
419
+ // Absent a blinding key or a declared attribute there is nothing to
420
+ // index, and passing no hmac carries any prior entries through verbatim.
421
+ hmac: this.#writeBlindingKey(),
307
422
  update: priorDoc !== null,
308
423
  additionalProtectedParams: { was }
309
424
  });
@@ -343,12 +458,26 @@ export class EdvCodec {
343
458
  epoch: this.#writeEpoch
344
459
  };
345
460
  }
461
+ /**
462
+ * The blinding key a content write should index with: the collection's key
463
+ * once the applied schema declares at least one attribute, else `undefined`
464
+ * (the cipher then computes no `indexed` entries and passes any already
465
+ * stored on the prior envelope through unchanged).
466
+ *
467
+ * @returns {BlindingKey | undefined}
468
+ */
469
+ #writeBlindingKey() {
470
+ if (this.#blindingKey === null || this.#schema.indexes.length === 0) {
471
+ return undefined;
472
+ }
473
+ return this.#blindingKey;
474
+ }
346
475
  /**
347
476
  * @inheritdoc
348
477
  */
349
478
  async decode(response, expectedId) {
350
479
  const stored = await readJsonData(response);
351
- const decrypted = await this.#openEnvelope(stored, expectedId);
480
+ const decrypted = await this.#openEnvelope({ doc: stored, expectedId });
352
481
  return this.#fromDocument(decrypted.content, decrypted.meta);
353
482
  }
354
483
  /**
@@ -358,17 +487,24 @@ export class EdvCodec {
358
487
  * protected header authentic, so the order is load-bearing). The one opening
359
488
  * shared by {@link decode} and {@link decodeMeta}.
360
489
  *
361
- * @param doc {unknown} the stored document read from the server
362
- * @param [expectedId] {string} the resource id the read targeted
490
+ * @param options {object}
491
+ * @param options.doc {unknown} the stored document read from the server
492
+ * @param [options.expectedId] {string} the resource id the read targeted
493
+ * @param [options.collectionSlot] {boolean} the read addressed the
494
+ * Collection metadata slot, which belongs to no resource: an envelope bound
495
+ * to a resource id is refused there, and one bound to this Collection's id
496
+ * is required (see {@link _verifyBinding}). Set only by the
497
+ * Collection-level metadata read
363
498
  * @returns {Promise<{ content?: unknown; meta?: Record<string, unknown>;
364
499
  * keyId: string }>} the decrypted document
365
500
  */
366
- async #openEnvelope(doc, expectedId) {
501
+ async #openEnvelope({ doc, expectedId, collectionSlot }) {
367
502
  this.#assertEnvelope(doc, 'read');
368
503
  const decrypted = await this.#decrypt(doc);
369
504
  await this.#verifyBinding({
370
505
  jwe: doc.jwe,
371
506
  expectedId,
507
+ collectionSlot,
372
508
  keyId: decrypted.keyId
373
509
  });
374
510
  return decrypted;
@@ -457,12 +593,34 @@ export class EdvCodec {
457
593
  * envelope stamps its scheme version) -- {@link EncryptionError}. Greater
458
594
  * than this codec's scheme version: a future-scheme envelope this client
459
595
  * does not implement -- {@link EncryptionError}.
596
+ * Then the slot markers, which declare positively which of the profile's
597
+ * slots the envelope was written for -- `was.resource` a resource slot,
598
+ * `was.collection` the Collection metadata slot, neither a content-derived
599
+ * content envelope. A read of the Collection metadata slot
600
+ * (`collectionSlot`) enforces:
601
+ *
602
+ * - `was.resource` present: refused outright -- a resource's envelope was
603
+ * served in the Collection's metadata slot, which belongs to no resource --
604
+ * {@link IntegrityError}.
605
+ * - `was.collection` missing or not a string: refused -- the envelope belongs
606
+ * to some other slot, notably a content-derived content envelope, whose
607
+ * member set is otherwise identical -- {@link IntegrityError}.
608
+ * - `was.collection` not this codec's collection id: one Collection's
609
+ * metadata served as another's -- {@link IntegrityError}.
610
+ *
611
+ * A read of a resource slot (content or resource metadata) enforces:
612
+ *
613
+ * - `was.collection` present: refused before any id comparison -- the
614
+ * Collection's metadata envelope was served in a resource slot --
615
+ * {@link IntegrityError}.
460
616
  * - `was.resource` present and the expected id known: a mismatch is a server-side
461
617
  * swap of two resources' envelopes -- {@link IntegrityError}.
462
618
  * - `resource` absent (a content-derived write) and the expected
463
619
  * id known: the envelope's ciphertext must re-derive to the expected id
464
620
  * ({@link EdvDocumentCipher.deriveId}); a mismatch means the envelope was
465
621
  * copied under a different id -- {@link IntegrityError}.
622
+ *
623
+ * Finally, unconditionally:
466
624
  * - `was.epoch` missing or not a string: refused like a missing `was` --
467
625
  * {@link EncryptionError}. Present, it must equal the epoch (the `did:key`
468
626
  * before the `#`) of the key that actually decrypted -- a mismatch is a
@@ -473,11 +631,13 @@ export class EdvCodec {
473
631
  * @param options.jwe {unknown} the envelope's JWE (its `protected` header is
474
632
  * parsed for `was`)
475
633
  * @param [options.expectedId] {string} the resource id the read targeted
634
+ * @param [options.collectionSlot] {boolean} the read addressed the
635
+ * Collection metadata slot
476
636
  * @param options.keyId {string} the id of the key that decrypted, for the
477
637
  * epoch check
478
638
  * @returns {Promise<void>}
479
639
  */
480
- async #verifyBinding({ jwe, expectedId, keyId }) {
640
+ async #verifyBinding({ jwe, expectedId, collectionSlot, keyId }) {
481
641
  const was = parseWasHeader(jwe);
482
642
  if (was === undefined) {
483
643
  throw new EncryptionError('Cannot decrypt this resource: its envelope carries no `was` binding ' +
@@ -496,24 +656,55 @@ export class EdvCodec {
496
656
  `EDV-over-WAS scheme version ${was.v}, which this client (version ` +
497
657
  `${this.#version}) does not implement. Upgrade the client.`);
498
658
  }
499
- if (typeof was.resource === 'string') {
500
- if (expectedId !== undefined && was.resource !== expectedId) {
501
- throw new IntegrityError(`Cannot decrypt this resource: the stored envelope is bound to a ` +
502
- `different resource id ("${was.resource}") than the one requested ` +
503
- `("${expectedId}"). The server swapped two resources' envelopes.`);
659
+ if (collectionSlot) {
660
+ if (typeof was.resource === 'string') {
661
+ throw new IntegrityError(`Cannot decrypt this Collection's metadata: the stored envelope is ` +
662
+ `bound to resource "${was.resource}", but the Collection metadata ` +
663
+ "slot belongs to no resource. The server swapped a resource's " +
664
+ "metadata envelope into the Collection's metadata slot.");
665
+ }
666
+ if (typeof was.collection !== 'string') {
667
+ throw new IntegrityError(`Cannot decrypt this Collection's metadata: the stored envelope ` +
668
+ 'binds no `was.collection`, so it was written for some other slot ' +
669
+ '(a content envelope, whose binding is otherwise identical). The ' +
670
+ "server served a foreign envelope in the Collection's metadata slot.");
671
+ }
672
+ if (was.collection !== this.#collectionId) {
673
+ throw new IntegrityError(`Cannot decrypt this Collection's metadata: the stored envelope is ` +
674
+ `bound to collection "${was.collection}", not to the requested ` +
675
+ `collection ("${this.#collectionId}"). The server served one ` +
676
+ "Collection's metadata as another's.");
504
677
  }
505
678
  }
506
- else if (expectedId !== undefined) {
507
- // Content-derived write (no `resource`): the id is a function of the
508
- // ciphertext, so re-derive and compare.
509
- const { documentCipher } = this.#edv;
510
- const derived = await documentCipher.deriveId({
511
- jwe: jwe
512
- });
513
- if (derived !== expectedId) {
514
- throw new IntegrityError(`Cannot decrypt this resource: its content-derived id ("${derived}") ` +
515
- `does not match the requested id ("${expectedId}"). The server ` +
516
- 'served this envelope under an id it was not written for.');
679
+ else {
680
+ // A resource slot (content or resource metadata). The Collection's own
681
+ // metadata envelope has no business here, whatever id it names, so it is
682
+ // refused before any resource-id comparison.
683
+ if (was.collection !== undefined) {
684
+ throw new IntegrityError(`Cannot decrypt this resource: the stored envelope is bound to ` +
685
+ `collection "${String(was.collection)}", but a resource's slot ` +
686
+ 'belongs to no collection binding. The server served the ' +
687
+ "Collection's own metadata envelope in a resource's slot.");
688
+ }
689
+ if (typeof was.resource === 'string') {
690
+ if (expectedId !== undefined && was.resource !== expectedId) {
691
+ throw new IntegrityError(`Cannot decrypt this resource: the stored envelope is bound to a ` +
692
+ `different resource id ("${was.resource}") than the one requested ` +
693
+ `("${expectedId}"). The server swapped two resources' envelopes.`);
694
+ }
695
+ }
696
+ else if (expectedId !== undefined) {
697
+ // Content-derived write (no `resource`): the id is a function of the
698
+ // ciphertext, so re-derive and compare.
699
+ const { documentCipher } = this.#edv;
700
+ const derived = await documentCipher.deriveId({
701
+ jwe: jwe
702
+ });
703
+ if (derived !== expectedId) {
704
+ throw new IntegrityError(`Cannot decrypt this resource: its content-derived id ("${derived}") ` +
705
+ `does not match the requested id ("${expectedId}"). The server ` +
706
+ 'served this envelope under an id it was not written for.');
707
+ }
517
708
  }
518
709
  }
519
710
  if (typeof was.epoch !== 'string') {
@@ -548,23 +739,39 @@ export class EdvCodec {
548
739
  const id = (await this.#edv.generateId());
549
740
  // Bind the `was` parameter to the RESOURCE id (not the metadata envelope's
550
741
  // own random EDV id), so a server-side swap of two resources' metadata is
551
- // AEAD-detected on decode. The metadata envelope always knows the resource
552
- // id at encrypt time, so `resource` is always present here (never
553
- // content-derived). It seals to the current epoch key like every write,
554
- // so it binds `was.epoch` like every write.
742
+ // AEAD-detected on decode. A Resource-level write always knows that id at
743
+ // encrypt time (it is never content-derived here); a Collection-level write
744
+ // has no resource to bind and binds this collection's id instead, so its
745
+ // slot is declared positively -- a content envelope (which binds neither
746
+ // marker) served in the Collection metadata slot is then detected too. It
747
+ // seals to the current epoch key like every write, so it binds `was.epoch`
748
+ // like every write.
555
749
  const was = wasParam({
556
750
  version: this.#version,
557
- resource: resourceId,
751
+ ...(resourceId === undefined
752
+ ? { collection: this.#collectionId }
753
+ : { resource: resourceId }),
558
754
  epoch: this.#writeEpoch
559
755
  });
560
756
  const encrypted = await documentCipher.encrypt({
561
757
  doc: { id, content: custom },
562
758
  recipients: this.#recipients,
563
759
  keyResolver: this.#edv.keyResolver,
760
+ // Deliberately un-blinded, even on a searchable collection: this envelope
761
+ // is the WAS `/meta` value, not part of the resource's content document,
762
+ // and it is stored in a different slot the search endpoint never reads.
763
+ // The `meta.*` attribute paths a declared index may name address the
764
+ // *content document's* own `meta` (the content type and inline-encoding
765
+ // discriminator), which is a different object entirely -- so blinding
766
+ // here would emit entries that can never match a query and would leak the
767
+ // shape of the metadata into a slot with no index at all.
564
768
  hmac: undefined,
565
769
  additionalProtectedParams: { was }
566
770
  });
567
- return { custom: encrypted };
771
+ // Surface the epoch this envelope sealed under: a Collection-level `/meta`
772
+ // PUT carries it as the body's top-level `epoch` stamp (the server clears
773
+ // that stamp when it is omitted).
774
+ return { custom: encrypted, epoch: this.#writeEpoch };
568
775
  }
569
776
  /**
570
777
  * @inheritdoc
@@ -573,12 +780,21 @@ export class EdvCodec {
573
780
  * absent `custom` (no metadata written yet, or cleared) decodes to `{}`; a
574
781
  * present value must be an EDV envelope (else {@link EncryptionError}, the
575
782
  * `_assertEnvelope` guard), so a foreign plaintext `custom` fails closed.
783
+ *
784
+ * An omitted `expectedId` means the Collection-level metadata slot (a
785
+ * Resource metadata read always passes its resource id), so an envelope bound
786
+ * to a resource is refused there as a server-side swap, and one that does not
787
+ * bind this Collection's own id is refused as an envelope of some other slot.
576
788
  */
577
789
  async decodeMeta({ custom }, expectedId) {
578
790
  if (custom === undefined || custom === null) {
579
791
  return {};
580
792
  }
581
- const decrypted = await this.#openEnvelope(custom, expectedId);
793
+ const decrypted = await this.#openEnvelope({
794
+ doc: custom,
795
+ expectedId,
796
+ collectionSlot: expectedId === undefined
797
+ });
582
798
  return (decrypted.content ?? {});
583
799
  }
584
800
  /**
@@ -865,13 +1081,23 @@ export function createEdvEncryption({ resolveKeys, contentType = DEFAULT_CONTENT
865
1081
  // resource's recipient (the epoch public key) resolves through the
866
1082
  // standard did:key resolver, independent of the reader's own keystore.
867
1083
  const keyAgreementKey = epochKeys.writeKey;
1084
+ // The collection's blinding key: an explicitly supplied one (a keystore
1085
+ // custodying the HMAC key itself) wins over unwrapping the descriptor's
1086
+ // `hmac` member; `null` means the collection declares no blinded index.
1087
+ const hmac = resolved.hmac ??
1088
+ (await resolveHmacKey({
1089
+ encryption,
1090
+ keyAgreementKey: resolved.keyAgreementKey
1091
+ }));
868
1092
  const edv = new EdvClientCore({
869
1093
  keyAgreementKey,
870
- keyResolver: didKeyResolver
1094
+ keyResolver: didKeyResolver,
1095
+ ...(hmac !== null && { hmac })
871
1096
  });
872
1097
  return new EdvCodec({
873
1098
  edv,
874
1099
  keyAgreementKey,
1100
+ hmac,
875
1101
  readKeys: epochKeys.readKeys,
876
1102
  writeEpoch: epochKeys.writeEpoch,
877
1103
  contentType,
@@ -1 +1 @@
1
- {"version":3,"file":"EdvCodec.js","sourceRoot":"","sources":["../../src/edv/EdvCodec.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAahE,OAAO,EACL,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