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

Add ability to verify claim presence #442

Merged
merged 5 commits into from
Sep 24, 2020
Merged

Add ability to verify claim presence #442

merged 5 commits into from
Sep 24, 2020

Conversation

jimmyjames
Copy link
Contributor

Changes

As raised in #360, we should provide the ability to verify a claim's presence, regardless of value.

This change adds a new Verification method, withClaimPresence(String name). It will throw an InvalidClaimException if the JWT does not contain the specified claim.

This change does not add the ability to verify a claim is present and of a specific type. That may be a feature we wish to add at some point, but we'd need to consider how best to surface that without exposing any of Jackson's node types. Such a change wouldn't impact the new method added in this PR, so we can still provide value here with the new presence check method.

References

#360

Testing

  • This change adds test coverage
  • This change has been tested on the latest version of Java or why not

Checklist

@jimmyjames jimmyjames added CH: Added medium This PR may require moderate effort to action, or contains many changes to review labels Sep 22, 2020
@jimmyjames jimmyjames added this to the v3-Next milestone Sep 22, 2020
@jimmyjames jimmyjames requested a review from a team September 22, 2020 13:56
lbalmaceda
lbalmaceda previously approved these changes Sep 24, 2020
@jimmyjames jimmyjames merged commit 84c2258 into master Sep 24, 2020
@jimmyjames jimmyjames deleted the presence-check branch September 25, 2020 17:48
@jimmyjames jimmyjames modified the milestones: v3-Next, 3.11.0 Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Added medium This PR may require moderate effort to action, or contains many changes to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants