Skip to content

Add ability to verify claim presence#442

Merged
jimmyjames merged 5 commits intomasterfrom
presence-check
Sep 24, 2020
Merged

Add ability to verify claim presence#442
jimmyjames merged 5 commits intomasterfrom
presence-check

Conversation

@jimmyjames
Copy link
Copy Markdown
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.

2 participants