Skip to content

Commit

Permalink
Fix L3-iGrant/api#680: Credential Revocation using IETF Token Status …
Browse files Browse the repository at this point in the history
…List
  • Loading branch information
albinpa authored and georgepadayatti committed Nov 6, 2024
1 parent f83c744 commit a5e53b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sdjwt/sdjwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def create_jwt(
vc: typing.Union[dict, None] = None,
iat: typing.Union[int, None] = None,
exp: typing.Union[int, None] = None,
status: typing.Optional[dict] = None,
**kwargs,
) -> str:
assert key is not None, "Key must be provided"
Expand All @@ -63,6 +64,8 @@ def create_jwt(
}
if vc:
claims["vc"] = vc
if status:
claims["status"] = status
token = jwt.JWT(header=header, claims=claims)
token.make_signed_token(key)

Expand Down Expand Up @@ -551,6 +554,7 @@ def create_w3c_vc_jwt_with_disclosure_mapping_v2(
disclosure_mapping: typing.Optional[dict] = None,
expiry_in_seconds: typing.Optional[int] = None,
credential_metadata: typing.Optional[dict] = None,
status: typing.Optional[dict] = None,
) -> str:
if not expiry_in_seconds:
expiry_in_seconds = 2592000
Expand Down Expand Up @@ -643,6 +647,7 @@ def iterate_mapping(obj, path):
key=key,
iat=issuance_epoch,
exp=expiration_epoch,
status=status,
)
sd_disclosures = ""
if disclosure_mapping:
Expand Down Expand Up @@ -754,6 +759,7 @@ def create_vc_sd_jwt(
credential_subject: dict,
disclosure_mapping: typing.Optional[dict] = None,
expiry_in_seconds: typing.Optional[int] = None,
credential_status: typing.Optional[dict] = None,
) -> str:
if not expiry_in_seconds:
expiry_in_seconds = 2592000
Expand Down Expand Up @@ -820,6 +826,7 @@ def iterate_mapping(obj, path):
iat=issuance_epoch,
exp=expiration_epoch,
vct=vct,
status=credential_status,
**_credentialSubject,
)
sd_disclosures = ""
Expand Down

0 comments on commit a5e53b9

Please sign in to comment.