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

Fixes issue #176. Added VerifiableCredentialJwt to support verifyAndP… #216

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

grahnj
Copy link

@grahnj grahnj commented Feb 3, 2024

Refactored VerifiableCredential

Overview

Refactored VerifiableCredential to prevent misuse of parseJwt() which could cause bad actors to submit unverified JWT tokens

Description

Added VerifiableCredentialJwt and a verifyAndParse() function to handle the issues outlined in #176. Additionally, sign() now returns a VerifiableCredentialJwt instead of a String as the only public facing mechanism to enable parseJwt() (via verifyAndPublish()).

How Has This Been Tested?

Existing tests have been refactored to align with these changes. New test class was created (VerifiableCredentialJwtTest) and new test was added to check that verifyAndParse() would work successfully when passed a valid token String. Negative scenarios still test the individual methods directly.

  • verifyAndParse verifies and parses valid jwt - Validates that a token is parsed as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update VerifiableCredential API
1 participant