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

feat: support for scope list in JWT token for scope validation #128

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

pirm-in
Copy link
Contributor

@pirm-in pirm-in commented Nov 6, 2023

This is re-opening an older PR by xiaofei-du

Why

When validating the JWT token, the original krakend-jose only supports space-delimited scopes, e.g:

{
  ...
  "my_scopes": "scope1 scope2"
}

This PR makes krakend-jose also support scope list in JWT token , e.g:

{
  ...
  "my_scopes": ["scope1", "scope2"]
}

This makes krakend compatible with third party providers using this format.

@pirm-in pirm-in force-pushed the master branch 6 times, most recently from 23a7f3c to ed10abe Compare November 6, 2023 14:00
pirm-in and others added 2 commits November 6, 2023 15:06
before this commit, when passing the token, the scopes should be
separated by spaces, e.g: "my_scopes": "scope1 scope2", the commit
enables suporting a list of scopes when passing the token, e.g:
"my_scopes": ["scope1", "scope2"].
Original implementation by Xiaofei Du.

Co-authored-by: Xiaofei Du <[email protected]>
Co-authored-by: Pirmin Schneider <[email protected]>
@alombarte
Copy link
Member

Thank you @pirm-in !

We will review it and get back to you

@pirm-in
Copy link
Contributor Author

pirm-in commented Jan 18, 2024

Hi there, just wanted to know if there might be any news to this?
Feedback would be greatly appreciated. First of all if it has any chances of being merged at all? I am happy to implement any improvements if necessary.
Cheers
@alombarte or maybe @kpacha

@kpacha kpacha merged commit 9d87c6f into krakend:master Jan 24, 2024
2 checks passed
@kpacha
Copy link
Member

kpacha commented Jan 24, 2024

@pirm-in thanks for the contribution! We'll make a little change in the matchAll and matchAny so they use the required array directly from the parent scope instead of taking it as an argument. I think that, after blocking the PR for so long, it would not be right to ask you for that small and opinionated change.

alombarte added a commit to krakend/krakend-schema that referenced this pull request Jan 24, 2024
alombarte added a commit to krakend/krakend-schema that referenced this pull request Mar 11, 2024
* Prepare v2.6 release

* Add new JWT validator options
PRs: krakend/krakend-jose#129 and krakend/krakend-jose#128

* OpenTelemetry

* OpenTelemetry

* OpenTelemetry

* Correct usage of example_schema in OpenAPI

* Add report_headers to OTEL

* Add new properties of OpenAPI

* Add new properties of OpenAPI

* Default values for skip_pahts in OTEL

* Pre-release schema v2.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants