Skip to content

Commit

Permalink
Cre8/issue230 (openwallet-foundation#238)
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
cre8 authored May 21, 2024
1 parent 0c36bb0 commit 5f57edc
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 124 deletions.
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"npmClient": "pnpm",
"exact": true,
"message": "chore(release): %s",
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"command": {
"publish": {
"conventionalCommits": true
Expand Down
15 changes: 3 additions & 12 deletions packages/browser-crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/decode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/hash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/jwt-status-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/node-crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/present/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/sd-jwt-vc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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"
}
12 changes: 11 additions & 1 deletion packages/sd-jwt-vc/src/sd-jwt-vc-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export class SDJwtVcInstance extends SDJwtInstance<SdJwtVcPayload> {
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: ${
Expand All @@ -66,6 +69,13 @@ export class SDJwtVcInstance extends SDJwtInstance<SdJwtVcPayload> {
);
}

// 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);
Expand Down
15 changes: 3 additions & 12 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}
15 changes: 3 additions & 12 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
}

0 comments on commit 5f57edc

Please sign in to comment.