Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
API: authorization api for jwt claims #4009
API: authorization api for jwt claims #4009
Changes from 22 commits
fedc86d
ea79829
83d62bc
af11c2f
b078cc4
b95c868
2665e11
fbea186
832f525
e30f1db
5e26c82
22b0f9d
c05cc70
89fb544
4cc1ca8
7882e17
1ce13d6
b00cf0f
6d7aa9d
1affa9b
ea39225
20536be
66e2f9c
41fc238
e43f31a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may have better names for the field
JWT
and typeJWTPrincipal
:-) @arkodg @missBergThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to specify the Matcher instead of the ClaimValueType? I think that would bring more flexibility.
i.e.
If necessary for a certain Matcher we could specify different properties
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @denniskniep In theory, we could make this API as flexible as the Envoy RBAC API, but I would like to make this API simpler and easier to understand as it's a user-facing API.
I believe the normal use cases for JWT claim based authorization is that we just compare wether the claims equal with any of the specified values (equalsAny). I can't think of any use cases for a substring matching.
Scope comparison is a bit different, all specified scopes must exist in the JWT. It's handled in a dedicated API field.
For the
not
use case, it can be accomplished with aAllow
default action and aDeny
rule:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer using string for bool as "true"/"false" and integer if we need these types in the future. Any is too flexible, as it can represent nested structures besides simple types, which we won't use.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.