Skip to content

Commit

Permalink
Update json-path to version 2.8.0 - introduces a breaking change in h…
Browse files Browse the repository at this point in the history
…ow `oauth.custom.claim.check` queries using `== null` or `!= null` are handled

Signed-off-by: Marko Strukelj <[email protected]>
  • Loading branch information
mstruk committed Jun 28, 2023
1 parent 2cf1d5a commit b4d8ae5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Release Notes
=============

0.13.0
------

### Fixed json-path handling of null

This change introduces a backwards incompatible change in how queries using `equals` or `not equals` comparison to `null` are handled.

Previously the query `"@.missing == null"` where JWT token claim called `missing` was not present in the token would evaluate to `false`.
Similarly the query `"@.missing != null"` would evaluate to `true`.

Such behavior is clearly non-intuitive, and was recognised as a bug and fixed in the [json-path](https://github.com/json-path/jsonpath) library.

By bumping the version of `json-path` to `2.8.0` the behaviour is now fixed. The query `"@.missing == null"` evaluates to `true`, and
`"@.missing != null"` evaluates to `false`.

The documentation in [README.md](README.md#custom-claim-checking) has always contained a note that one should not use `null` comparison in the queries.
Those who followed that rule will not be affected.

0.12.0
------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public class CustomCheckTest {
"@.custom == 'custom-value' && @.exp > 1000", "false",
"@.custom == 'custom-value' || @.exp > 1000", "true",
"(@.custom == 'custom-value' || @.custom == 'custom-value2')", "true",
"@.missing == null", "false",
"@.missing != null", "true",
"@.missing == null", "true",
"@.missing != null", "false",
"@.missing", "false",
"[email protected]", "true",
"@.custom", "true",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<kafka.version>3.4.0</kafka.version>
<jackson.version>2.13.4</jackson.version>
<jackson.databind.version>2.13.4.2</jackson.databind.version>
<jsonpath.version>2.6.0</jsonpath.version>
<jsonpath.version>2.8.0</jsonpath.version>
<junit.version>4.13.2</junit.version>
<slf4j.version>1.7.36</slf4j.version>
<mockito.version>3.12.4</mockito.version>
Expand Down

0 comments on commit b4d8ae5

Please sign in to comment.