Skip to content

Commit

Permalink
Fix L3-iGrant/api#479: Ability to customise metadata during issuance
Browse files Browse the repository at this point in the history
  • Loading branch information
albinpa authored and georgepadayatti committed Oct 22, 2024
1 parent 9bb1f14 commit 3649008
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdjwt/sdjwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def create_w3c_vc_jwt_with_disclosure_mapping(
credential_status: typing.Optional[dict] = None,
terms_of_use: typing.Optional[typing.Union[dict, typing.List[dict]]] = None,
disclosure_mapping: typing.Optional[dict] = None,
credential_metadata: typing.Optional[dict] = None,
) -> str:
expiry_in_seconds = 2592000
issuance_epoch, issuance_8601 = (
Expand Down Expand Up @@ -506,6 +507,8 @@ def iterate_mapping(obj, path):
vc["credentialStatus"] = credential_status
if terms_of_use:
vc["termsOfUse"] = terms_of_use
if credential_metadata:
vc.update(credential_metadata)

jwt_credential = create_jwt(
vc=vc,
Expand Down Expand Up @@ -540,6 +543,7 @@ def create_w3c_vc_jwt_with_disclosure_mapping_v2(
terms_of_use: typing.Optional[typing.Union[dict, typing.List[dict]]] = None,
disclosure_mapping: typing.Optional[dict] = None,
expiry_in_seconds: typing.Optional[int] = None,
credential_metadata: typing.Optional[dict] = None,
) -> str:
if not expiry_in_seconds:
expiry_in_seconds = 2592000
Expand Down Expand Up @@ -613,6 +617,8 @@ def iterate_mapping(obj, path):
vc["credentialStatus"] = credential_status
if terms_of_use:
vc["termsOfUse"] = terms_of_use
if credential_metadata:
vc.update(credential_metadata)

jwt_credential = create_jwt(
vc=vc,
Expand Down

0 comments on commit 3649008

Please sign in to comment.