From bf8865a93ebf7b1f3150da815137e2b945e3e8ec Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Tue, 16 Jan 2024 16:50:30 +0700 Subject: [PATCH] feat: ldp issuance Signed-off-by: Timo Glastra --- packages/issuer/lib/VcIssuer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/issuer/lib/VcIssuer.ts b/packages/issuer/lib/VcIssuer.ts index a2447deb..c1df49c3 100644 --- a/packages/issuer/lib/VcIssuer.ts +++ b/packages/issuer/lib/VcIssuer.ts @@ -418,8 +418,10 @@ export class VcIssuer { }) { let preAuthorizedCode: string | undefined let issuerState: string | undefined + + const supportedIssuanceFormats = ['jwt_vc_json', 'jwt_vc_json-ld', 'vc+sd-jwt', 'ldp_vc'] try { - if (credentialRequest.format !== 'jwt_vc_json' && credentialRequest.format !== 'jwt_vc_json-ld' && credentialRequest.format !== 'vc+sd-jwt') { + if (!supportedIssuanceFormats.includes(credentialRequest.format)) { throw Error(`Format ${credentialRequest.format} not supported yet`) } else if (typeof this._jwtVerifyCallback !== 'function' && typeof jwtVerifyCallback !== 'function') { throw new Error(JWT_VERIFY_CONFIG_ERROR)