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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickmedina
Copy link

@patrickmedina patrickmedina commented Jul 13, 2021

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

@kevinbader kevinbader self-assigned this Jul 15, 2021
@kevinbader kevinbader added this to the 3.0.0 milestone Jul 15, 2021
@kevinbader
Copy link
Contributor

kevinbader commented Jul 15, 2021

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?

@mmacai mmacai modified the milestones: 3.0.0, 3.1.0 Jul 27, 2022
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.

Automatic subscription via JWT claims doesn't support array of strings as values
4 participants