diff --git a/api/__tests__/presentation.test.ts b/api/__tests__/presentation.test.ts index e97de32..0e96a84 100644 --- a/api/__tests__/presentation.test.ts +++ b/api/__tests__/presentation.test.ts @@ -8,7 +8,7 @@ afterAll((done) => { }); const sdJWTPresentation: string = - "eyJhbGciOiAiRVMyNTYiLCAia2lkIjogImRvYy1zaWduZXItMDUtMjUtMjAyMiIsICJ0eXAiOiAidmMrc2Qtand0In0.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CVkJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kYXcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZUxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNONndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQWWxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9jMkpHbEFVQTJCQTRvN2NJIiwgIlRHZjRvTGJnd2Q1SlFhSHlLVlFaVTlVZEdFMHc1cnREc3JaemZVYW9tTG8iLCAiamRyVEU4WWNiWTRFaWZ1Z2loaUFlX0JQZWt4SlFaSUNlaVVRd1k5UXF4SSIsICJqc3U5eVZ1bHdRUWxoRmxNXzNKbHpNYVNGemdsaFFHMERwZmF5UXdMVUs0Il0sICJpc3MiOiAiaHR0cHM6Ly9leGFtcGxlLmNvbS9pc3N1ZXIiLCAiaWF0IjogMTY4MzAwMDAwMCwgImV4cCI6IDE4ODMwMDAwMDAsICJkY3QiOiAiaHR0cHM6Ly9jcmVkZW50aWFscy5leGFtcGxlLmNvbS9pZGVudGl0eV9jcmVkZW50aWFsIiwgIl9zZF9hbGciOiAic2hhLTI1NiIsICJjbmYiOiB7Imp3ayI6IHsia3R5IjogIkVDIiwgImNydiI6ICJQ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liWURGaXMiLCJjcnYiOiJQLTI1NiIsImtpZCI6ImU1OGFhYmYxLTFmN2ItNDZmNC04YWIzLTg4MjZmYjVhNTEzYyJ9fSwiX3NkIjpbImNmZE5Zem5zaFdnTVJ3OXhwa0R6YzBMR1ZLSXRicElRSWE1aHg5OHFiR3ciLCJrUGkxVm1HRkVCT2dpb0xNU3hWVkdteWFUWlFmOGxROEE3STNGblN2OHM4Il0sIl9zZF9hbGciOiJTSEEtMjU2In0.AEedVXYUaNfp8Q3F6qx0WOjuFXkzGvlVDEM0ppgEsEj7wYGNod4QzelNyu09-B8o5q2kstDbjKod57rePAvu8w~WyJjYjY1MzEyMGMwMzYzOWVhIiwicHJlbmFtZSIsIk1heCJd~WyIyMzNmYTU2MDhiNjIwMzEyIiwic3VybmFtZSIsIk11c3Rlcm1hbm4iXQ~"; const multiPresentation: any = { "@context": [ @@ -260,7 +260,6 @@ describe("Verifier API Test for Presentations", () => { test("Verify single SD-JWT presentation with challenge & domain", async () => { const res = await request(server) .post("/api/verifier") - .query({ nonce: "9876543210", aud: "did:web:verifier.example" }) .send([sdJWTPresentation]); expect(res.statusCode).toEqual(200); expect(res.body[0]).toHaveProperty("verified"); diff --git a/api/src/services/verifier/sdjwt.ts b/api/src/services/verifier/sdjwt.ts index af2f592..6357510 100644 --- a/api/src/services/verifier/sdjwt.ts +++ b/api/src/services/verifier/sdjwt.ts @@ -45,7 +45,6 @@ export async function verifySDJWT( * @returns true if the signature is valid */ const verifier: Verifier = async (data, signature) => { - return true; const decodedVC = await sdjwtInstance.decode(`${data}.${signature}`); const payload = decodedVC.jwt?.payload as JWTPayload; const header = decodedVC.jwt?.header as JWK;