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

Fixed an NPE on null map and list claims #417

Merged
merged 1 commit into from
Apr 23, 2020
Merged

Fixed an NPE on null map and list claims #417

merged 1 commit into from
Apr 23, 2020

Conversation

DanilaVaratyntsev
Copy link

Changes

Added a null-check before map and list validation in withClaim methods to support the same behavior, like other withClaim methods (remove a claim on a not-null key but null value)

References

#416

Testing

  • Added unit tests for null list and map claims
  • Built library locally, imported it to the testing project and run the following code
String jwt = JWT.create()
    .withClaim("mapClaim", (Map<String, ?>) null)
    .withClaim("listClaim", (List<String>) null)
    .sign(Algorithm.HMAC256("secret"));

Checklist

@DanilaVaratyntsev DanilaVaratyntsev requested a review from a team April 23, 2020 08:18
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for taking care of that 🥇

@lbalmaceda lbalmaceda added this to the v3-Next milestone Apr 23, 2020
@lbalmaceda lbalmaceda merged commit a81f307 into auth0:master Apr 23, 2020
@DanilaVaratyntsev DanilaVaratyntsev deleted the 416-NPE-when-trying-to-add-null-Map-or-List-claims branch April 24, 2020 13:58
@jimmyjames jimmyjames modified the milestones: v3-Next, 3.10.3 Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants