@virtru/dsp-sdk 0.7.4 → 0.7.6

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/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Change Log - @virtru/dsp-sdk
2
2
 
3
- This log was last generated on Tue, 28 Apr 2026 16:40:32 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 21 May 2026 15:41:46 GMT and should not be manually modified.
4
+
5
+ ## 0.7.6
6
+ Thu, 21 May 2026 15:41:46 GMT
7
+
8
+ ### Patches
9
+
10
+ - Refresh the DSP SDK dependency so entitlement lookups use the Connect shared service endpoint.
11
+ - Move GetMyEntitlements to the Connect shared service endpoint.
12
+
13
+ ## 0.7.5
14
+ Thu, 14 May 2026 17:39:47 GMT
15
+
16
+ ### Patches
17
+
18
+ - fix FIPS AES-GCM decrypt to accept payload with authTag appended (opentdf-sdk >=0.16 contract)
4
19
 
5
20
  ## 0.7.4
6
21
  Tue, 28 Apr 2026 16:40:32 GMT
@@ -58,10 +58,11 @@ export async function decrypt(payload, key, iv, algorithm, authTag) {
58
58
  const algName = algorithm === AES_CBC_URN ? 'AES-CBC' : 'AES-GCM';
59
59
  let payloadBytes = new Uint8Array(payload.asArrayBuffer());
60
60
  const ivBytes = new Uint8Array(iv.asArrayBuffer());
61
- if (algName === 'AES-GCM') {
62
- if (!authTag) {
63
- throw new Error('Missing authTag for AES-GCM decryption');
64
- }
61
+ if (algName === 'AES-GCM' && authTag) {
62
+ // Legacy contract (opentdf-sdk <0.16): authTag passed separately —
63
+ // recombine for WebCrypto, which expects payload || authTag.
64
+ // >=0.16 (web-sdk PR #922): the tag is already appended to payload, so
65
+ // we pass it through unchanged. Mirrors DefaultCryptoService behaviour.
65
66
  const tagBytes = new Uint8Array(authTag.asArrayBuffer());
66
67
  const combined = new Uint8Array(payloadBytes.length + tagBytes.length);
67
68
  combined.set(payloadBytes, 0);
@@ -96,16 +96,13 @@ export async function getUserEntitlements(options) {
96
96
  refreshToken: options.refreshToken,
97
97
  cryptoService: options.cryptoService,
98
98
  });
99
- const accessToken = await authProvider.oidcAuth.get();
100
- const userEntitlementsResponse = await fetch(`${options.platformEndpoint}/shared/entitlements`, {
101
- body: JSON.stringify({}),
102
- headers: {
103
- Authorization: `Bearer ${accessToken}`,
104
- 'Content-Type': 'application/json',
105
- },
106
- method: 'POST',
99
+ const dspClient = new DSPClient({
100
+ authProvider,
101
+ platformUrl: options.platformEndpoint,
107
102
  });
108
- return (await userEntitlementsResponse.json());
103
+ return (await dspClient.v1.sharedService.getMyEntitlements({
104
+ attributeValueFqns: [],
105
+ }));
109
106
  }
110
107
  export const flattenObligations = (obligations) => Object.values(obligations).flatMap((feature) => feature?.fully_qualified_names || []);
111
108
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virtru/dsp-sdk",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "dist/src/index.js",
6
6
  "exports": {