@interop/was-client 0.38.1 → 0.38.2

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.
@@ -1,3 +1,31 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The blinded-index HMAC key of an encrypted Collection: minting it, rebuilding
6
+ * it from its raw secret, and resolving it from the `encryption` descriptor
7
+ * with a reader's own key-agreement key.
8
+ *
9
+ * A blinded index lets the server match a query without learning what it
10
+ * matched: attribute names and values are HMAC-SHA-256 tags under a
11
+ * per-collection key, so equal plaintext blinds to equal tokens and nothing
12
+ * else. That is why the key never rotates -- tokens must compare across the
13
+ * collection's whole history -- and why it is installed at provisioning or
14
+ * never: retro-fitting a key would leave every already-written envelope
15
+ * unindexed.
16
+ *
17
+ * Distribution reuses the epoch machinery verbatim: the 32-byte HMAC secret is
18
+ * wrapped to each recipient's X25519 key-agreement key with
19
+ * {@link wrapEpochSecret} (`ECDH-ES+A256KW`) and stored as a JWE `recipients`
20
+ * entry on the descriptor's `hmac` member, exactly as an epoch secret is stored
21
+ * on an epoch. There is deliberately no separate wrap primitive here: one wrap
22
+ * shape, one review surface.
23
+ *
24
+ * Removing a recipient drops its wrap entry but leaves the key itself alone, so
25
+ * a removed recipient keeps the blinding key -- an accepted, documented
26
+ * revocation asymmetry (it can confirm guessed attribute values if the server
27
+ * colludes).
28
+ */
1
29
  import { SHA256HMACKey } from '@interop/data-integrity-core';
2
30
  import type { IKeyAgreementKey } from '@interop/data-integrity-core';
3
31
  import type { EncryptionWithHmac } from '../types.js';
@@ -40,8 +68,10 @@ export declare function mintHmacKey(): Promise<{
40
68
  }>;
41
69
  /**
42
70
  * Rebuilds the concrete HMAC key from its raw secret -- what a reader does once
43
- * it has unwrapped the secret from its descriptor entry. The secret is imported
44
- * as a standard `oct` JWK, the serialization {@link SHA256HMACKey.from} accepts.
71
+ * it has unwrapped the secret from its descriptor entry. Imports the secret
72
+ * bytes directly ({@link SHA256HMACKey.fromSecret}, a WebCrypto `raw`-format
73
+ * import), so a minimal `crypto.subtle` shim without JWK support suffices on
74
+ * runtimes that lack WebCrypto (e.g. React Native's Hermes).
45
75
  *
46
76
  * @param options {object}
47
77
  * @param options.id {string} the key id (`indexed[].hmac.id`)
@@ -1 +1 @@
1
- {"version":3,"file":"hmacKey.d.ts","sourceRoot":"","sources":["../../src/edv/hmacKey.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGrD;;GAEG;AACH,eAAO,MAAM,aAAa,sBAAsB,CAAA;AAEhD;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACxD,MAAM,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/E;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC;IAC3C,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;CACnB,CAAC,CAGD;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,EAAE,EACF,MAAM,EACP,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,UAAU,CAAA;CACnB,GAAG,OAAO,CAAC,aAAa,CAAC,CAUzB;AAED;;;;;;;;;;;;;;;;GAgBG;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AED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,EACnC,UAAU,EACV,eAAe,EAChB,EAAE;IACD,UAAU,EAAE,kBAAkB,CAAA;IAC9B,eAAe,EAAE,gBAAgB,CAAA;CAClC,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAqBhC"}
@@ -26,7 +26,6 @@
26
26
  * revocation asymmetry (it can confirm guessed attribute values if the server
27
27
  * colludes).
28
28
  */
29
- import { base64urlnopad } from '@scure/base';
30
29
  import { SHA256HMACKey } from '@interop/data-integrity-core';
31
30
  import { EncryptionError } from '../errors.js';
32
31
  import { unwrapEpochSecret } from './epochCrypto.js';
@@ -48,8 +47,10 @@ export async function mintHmacKey() {
48
47
  }
49
48
  /**
50
49
  * Rebuilds the concrete HMAC key from its raw secret -- what a reader does once
51
- * it has unwrapped the secret from its descriptor entry. The secret is imported
52
- * as a standard `oct` JWK, the serialization {@link SHA256HMACKey.from} accepts.
50
+ * it has unwrapped the secret from its descriptor entry. Imports the secret
51
+ * bytes directly ({@link SHA256HMACKey.fromSecret}, a WebCrypto `raw`-format
52
+ * import), so a minimal `crypto.subtle` shim without JWK support suffices on
53
+ * runtimes that lack WebCrypto (e.g. React Native's Hermes).
53
54
  *
54
55
  * @param options {object}
55
56
  * @param options.id {string} the key id (`indexed[].hmac.id`)
@@ -57,15 +58,7 @@ export async function mintHmacKey() {
57
58
  * @returns {Promise<SHA256HMACKey>}
58
59
  */
59
60
  export async function hmacKeyFromSecret({ id, secret }) {
60
- return SHA256HMACKey.from({
61
- id,
62
- type: HMAC_KEY_TYPE,
63
- secretKeyJwk: {
64
- kty: 'oct',
65
- k: base64urlnopad.encode(secret),
66
- alg: 'HS256'
67
- }
68
- });
61
+ return SHA256HMACKey.fromSecret({ id, secret });
69
62
  }
70
63
  /**
71
64
  * Resolves the collection's blinding key from its `encryption` descriptor with
@@ -1 +1 @@
1
- {"version":3,"file":"hmacKey.js","sourceRoot":"","sources":["../../src/edv/h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,OAAO,aAAa,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,UAAU,EACV,eAAe,EAIhB;IACC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CACjC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,eAAe,CAAC,EAAE,CACzD,CAAA;IACD,MAAM,MAAM,GAAG,KAAK;QAClB,CAAC,CAAC,MAAM,iBAAiB,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QACrD,CAAC,CAAC,IAAI,CAAA;IACR,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,eAAe,CACvB,+CAA+C;YAC7C,KAAK,IAAI,CAAC,EAAE,0CAA0C;YACtD,KAAK,eAAe,CAAC,EAAE,6CAA6C;YACpE,sEAAsE;YACtE,0CAA0C,CAC7C,CAAA;IACH,CAAC;IACD,OAAO,iBAAiB,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;AACnD,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.38.1",
4
+ "version": "0.38.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "pnpm run clear && tsc",
@@ -60,7 +60,7 @@
60
60
  "types": "dist/index.d.ts",
61
61
  "sideEffects": false,
62
62
  "dependencies": {
63
- "@interop/data-integrity-core": "^8.4.0",
63
+ "@interop/data-integrity-core": "^8.5.0",
64
64
  "@interop/ed25519-signature": "^7.1.4",
65
65
  "@interop/edv-client": "^17.8.0",
66
66
  "@interop/ezcap": "^7.4.1",