diff --git a/lerna.json b/lerna.json index 45d20da..06e5495 100644 --- a/lerna.json +++ b/lerna.json @@ -4,9 +4,7 @@ "npmClient": "pnpm", "exact": true, "message": "chore(release): %s", - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "command": { "publish": { "conventionalCommits": true diff --git a/packages/browser-crypto/package.json b/packages/browser-crypto/package.json index 7938b4f..4de98a1 100644 --- a/packages/browser-crypto/package.json +++ b/packages/browser-crypto/package.json @@ -18,11 +18,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "repository": { "type": "git", "url": "https://github.com/openwallet-foundation-labs/sd-jwt-js" @@ -37,17 +33,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/core/package.json b/packages/core/package.json index 9bdc040..61ad3cc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -50,17 +46,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/decode/package.json b/packages/decode/package.json index 07b5860..9024184 100644 --- a/packages/decode/package.json +++ b/packages/decode/package.json @@ -18,11 +18,7 @@ "test:node": "vitest run ./src/test/*.spec.ts --coverage", "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -47,17 +43,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/hash/package.json b/packages/hash/package.json index 64c3514..310d973 100644 --- a/packages/hash/package.json +++ b/packages/hash/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -48,17 +44,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/jwt-status-list/package.json b/packages/jwt-status-list/package.json index 05018ae..1391401 100644 --- a/packages/jwt-status-list/package.json +++ b/packages/jwt-status-list/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt-vc", - "status-list", - "sd-jwt" - ], + "keywords": ["sd-jwt-vc", "status-list", "sd-jwt"], "engines": { "node": ">=18" }, @@ -50,17 +46,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/node-crypto/package.json b/packages/node-crypto/package.json index b99c2ee..ee73ee6 100644 --- a/packages/node-crypto/package.json +++ b/packages/node-crypto/package.json @@ -18,11 +18,7 @@ "test:node": "vitest run ./src/test/*.spec.ts", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -40,17 +36,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/present/package.json b/packages/present/package.json index 57452a7..5ec4223 100644 --- a/packages/present/package.json +++ b/packages/present/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -49,17 +45,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/sd-jwt-vc/package.json b/packages/sd-jwt-vc/package.json index 423e6ac..18c6367 100644 --- a/packages/sd-jwt-vc/package.json +++ b/packages/sd-jwt-vc/package.json @@ -20,11 +20,7 @@ "test:e2e": "vitest run ./test/*e2e.spec.ts --environment node", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -52,17 +48,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts b/packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts index cfe0727..2f9703f 100644 --- a/packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts +++ b/packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts @@ -57,7 +57,10 @@ export class SDJwtVcInstance extends SDJwtInstance { const timeoutId = setTimeout(() => controller.abort(), 10000); try { - const response = await fetch(uri, { signal: controller.signal }); + const response = await fetch(uri, { + signal: controller.signal, + headers: { Accept: 'application/statuslist+jwt' }, + }); if (!response.ok) { throw new Error( `Error fetching status list: ${ @@ -66,6 +69,13 @@ export class SDJwtVcInstance extends SDJwtInstance { ); } + // according to the spec the content type should be application/statuslist+jwt + if ( + response.headers.get('content-type') !== 'application/statuslist+jwt' + ) { + throw new Error('Invalid content type'); + } + return response.text(); } finally { clearTimeout(timeoutId); diff --git a/packages/types/package.json b/packages/types/package.json index 8b2bf65..e2189da 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -41,17 +37,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" } diff --git a/packages/utils/package.json b/packages/utils/package.json index a91c037..141798c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -19,11 +19,7 @@ "test:browser": "vitest run ./src/test/*.spec.ts --environment jsdom", "test:cov": "vitest run --coverage" }, - "keywords": [ - "sd-jwt", - "sdjwt", - "sd-jwt-vc" - ], + "keywords": ["sd-jwt", "sdjwt", "sd-jwt-vc"], "engines": { "node": ">=18" }, @@ -48,17 +44,12 @@ "access": "public" }, "tsup": { - "entry": [ - "./src/index.ts" - ], + "entry": ["./src/index.ts"], "sourceMap": true, "splitting": false, "clean": true, "dts": true, - "format": [ - "cjs", - "esm" - ] + "format": ["cjs", "esm"] }, "gitHead": "ded40e4551bde7ae93083181bf26bd1b38bbfcfb" }