From 9c6083df02b7e1c761df306be1efad6857442e32 Mon Sep 17 00:00:00 2001 From: Albin Antony Date: Wed, 21 Aug 2024 17:34:40 +0530 Subject: [PATCH] Fix L3-iGrant/api#566: Remove the following fields from credentialMetadata if present --- sdjwt/sdjwt.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sdjwt/sdjwt.py b/sdjwt/sdjwt.py index 8cddc05..40906e0 100644 --- a/sdjwt/sdjwt.py +++ b/sdjwt/sdjwt.py @@ -508,6 +508,13 @@ def iterate_mapping(obj, path): if terms_of_use: vc["termsOfUse"] = terms_of_use if credential_metadata: + credential_metadata.pop("issuanceDate","") + credential_metadata.pop("expirationDate","") + credential_metadata.pop("credentialSchema",[]) + credential_metadata.pop("credentialStatus",{}) + credential_metadata.pop("credentialSubject",{}) + credential_metadata.pop("type",[]) + vc.update(credential_metadata) jwt_credential = create_jwt( @@ -618,6 +625,13 @@ def iterate_mapping(obj, path): if terms_of_use: vc["termsOfUse"] = terms_of_use if credential_metadata: + credential_metadata.pop("issuanceDate","") + credential_metadata.pop("expirationDate","") + credential_metadata.pop("credentialSchema",[]) + credential_metadata.pop("credentialStatus",{}) + credential_metadata.pop("credentialSubject",{}) + credential_metadata.pop("type",[]) + vc.update(credential_metadata) jwt_credential = create_jwt(