-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support for regex pattern in DefaultJWTClaimMapper permission parser #7574
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
Support for regex pattern in DefaultJWTClaimMapper permission parser #7574
Conversation
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.
Looks good. Just one comment on naming.
common/config/config.go
Outdated
@@ -577,6 +577,7 @@ type ( | |||
// Signing key provider for validating JWT tokens | |||
JWTKeyProvider JWTKeyProvider `yaml:"jwtKeyProvider"` | |||
PermissionsClaimName string `yaml:"permissionsClaimName"` | |||
PermissionsPattern string `yaml:"permissionsPattern"` |
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.
nit: consider calling this PermissionsRegex
to clearly indicate what the contents should be and update the naming throughout.
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.
@captainbeardo Thank you, done.
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.
LGTM. Could you also open a PR to document this in our documentation repo: https://github.com/temporalio/documentation/blob/main/docs/production-deployment/self-hosted-guide/security.mdx#default-jwt-claimmapper?
@bergundy, will do that! Thanks, appreciate the support! |
What changed?
Added support for parsing permissions from JWT claim using regular expression
Why?
Default JWT Claim Mapper expects permission in form
namespace:role
. If it's not possible to configure JWT issuer to follownamespace:role
permissionsPattern can be set to regular expression with named groups to parse permission. More details in issue gh-7560How did you test it?
Potential risks
This change is only activated if new configuration is provided
Documentation
WIP
Is hotfix candidate?
No