reactive-interaction-gateway icon indicating copy to clipboard operation
reactive-interaction-gateway copied to clipboard

Added support for array of values in JWT claims in auto-subscription

Open patrickmedina opened this issue 2 years ago • 1 comments

Description

Attempting to fix issue #381 @kevinbader

This change checks for the claims value type. If the JWT claim value from the json_pointer is an array of strings(E.g. {Roles: ["Administrator", "User"]}), it will construct a subscription with multiple entries(E.g. {...,"oneOf":[{"userType":"Administrator"},{"userType":"User"}]}],...}).

Closes #381

patrickmedina avatar Jul 13 '21 13:07 patrickmedina

Nice work! Even though JSON pointer for some reason has no way of pointing to any value within an array rather than the array itself, I think this is a good, pragmatic solution. What left to do before merging this:

  • fixing the linting error (see pipeline run)
  • fixing the existing tests
  • adding a new test for this to /lib/rig/subscriptions/parser/jwt_test.exs
  • adding an entry to the CHANGELOG.md file

Could you please add that to this PR?

kevinbader avatar Jul 15 '21 09:07 kevinbader