Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix L3-iGrant/api#680: Credential Revocation using IETF Token Status … #31

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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