@sd-jwt/sd-jwt-vc 0.7.1-next.2 → 0.7.2-next.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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.7.1](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v0.7.0...v0.7.1) (2024-05-21)
7
+
8
+ **Note:** Version bump only for package @sd-jwt/sd-jwt-vc
9
+
10
+
11
+
12
+
13
+
6
14
  # [0.7.0](https://github.com/openwallet-foundation-labs/sd-jwt-js/compare/v0.6.1...v0.7.0) (2024-05-13)
7
15
 
8
16
  **Note:** Version bump only for package @sd-jwt/sd-jwt-vc
package/dist/index.js CHANGED
@@ -86,12 +86,18 @@ var SDJwtVcInstance = class _SDJwtVcInstance extends import_core.SDJwtInstance {
86
86
  const controller = new AbortController();
87
87
  const timeoutId = setTimeout(() => controller.abort(), 1e4);
88
88
  try {
89
- const response = yield fetch(uri, { signal: controller.signal });
89
+ const response = yield fetch(uri, {
90
+ signal: controller.signal,
91
+ headers: { Accept: "application/statuslist+jwt" }
92
+ });
90
93
  if (!response.ok) {
91
94
  throw new Error(
92
95
  `Error fetching status list: ${response.status} ${yield response.text()}`
93
96
  );
94
97
  }
98
+ if (response.headers.get("content-type") !== "application/statuslist+jwt") {
99
+ throw new Error("Invalid content type");
100
+ }
95
101
  return response.text();
96
102
  } finally {
97
103
  clearTimeout(timeoutId);
package/dist/index.mjs CHANGED
@@ -63,12 +63,18 @@ var SDJwtVcInstance = class _SDJwtVcInstance extends SDJwtInstance {
63
63
  const controller = new AbortController();
64
64
  const timeoutId = setTimeout(() => controller.abort(), 1e4);
65
65
  try {
66
- const response = yield fetch(uri, { signal: controller.signal });
66
+ const response = yield fetch(uri, {
67
+ signal: controller.signal,
68
+ headers: { Accept: "application/statuslist+jwt" }
69
+ });
67
70
  if (!response.ok) {
68
71
  throw new Error(
69
72
  `Error fetching status list: ${response.status} ${yield response.text()}`
70
73
  );
71
74
  }
75
+ if (response.headers.get("content-type") !== "application/statuslist+jwt") {
76
+ throw new Error("Invalid content type");
77
+ }
72
78
  return response.text();
73
79
  } finally {
74
80
  clearTimeout(timeoutId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-jwt/sd-jwt-vc",
3
- "version": "0.7.1-next.2+0329a6b",
3
+ "version": "0.7.2-next.0+5f57edc",
4
4
  "description": "sd-jwt draft 7 implementation in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -39,13 +39,13 @@
39
39
  },
40
40
  "license": "Apache-2.0",
41
41
  "dependencies": {
42
- "@sd-jwt/core": "0.7.1-next.2+0329a6b",
43
- "@sd-jwt/jwt-status-list": "0.7.1-next.2+0329a6b",
44
- "@sd-jwt/utils": "0.7.1-next.2+0329a6b"
42
+ "@sd-jwt/core": "0.7.2-next.0+5f57edc",
43
+ "@sd-jwt/jwt-status-list": "0.7.2-next.0+5f57edc",
44
+ "@sd-jwt/utils": "0.7.2-next.0+5f57edc"
45
45
  },
46
46
  "devDependencies": {
47
- "@sd-jwt/crypto-nodejs": "0.7.1-next.2+0329a6b",
48
- "@sd-jwt/types": "0.7.1-next.2+0329a6b",
47
+ "@sd-jwt/crypto-nodejs": "0.7.2-next.0+5f57edc",
48
+ "@sd-jwt/types": "0.7.2-next.0+5f57edc",
49
49
  "jose": "^5.2.2"
50
50
  },
51
51
  "publishConfig": {
@@ -64,5 +64,5 @@
64
64
  "esm"
65
65
  ]
66
66
  },
67
- "gitHead": "0329a6b4e8ba11d2fd727c41606c17acbb68e3c5"
67
+ "gitHead": "5f57edcee454c51a4dd2e34bcd845a54554ee2b3"
68
68
  }
@@ -57,7 +57,10 @@ export class SDJwtVcInstance extends SDJwtInstance<SdJwtVcPayload> {
57
57
  const timeoutId = setTimeout(() => controller.abort(), 10000);
58
58
 
59
59
  try {
60
- const response = await fetch(uri, { signal: controller.signal });
60
+ const response = await fetch(uri, {
61
+ signal: controller.signal,
62
+ headers: { Accept: 'application/statuslist+jwt' },
63
+ });
61
64
  if (!response.ok) {
62
65
  throw new Error(
63
66
  `Error fetching status list: ${
@@ -66,6 +69,13 @@ export class SDJwtVcInstance extends SDJwtInstance<SdJwtVcPayload> {
66
69
  );
67
70
  }
68
71
 
72
+ // according to the spec the content type should be application/statuslist+jwt
73
+ if (
74
+ response.headers.get('content-type') !== 'application/statuslist+jwt'
75
+ ) {
76
+ throw new Error('Invalid content type');
77
+ }
78
+
69
79
  return response.text();
70
80
  } finally {
71
81
  clearTimeout(timeoutId);