-
Notifications
You must be signed in to change notification settings - Fork 4
add scope validation in validate_token method #68
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
Conversation
scalekit/client.py
Outdated
raise exp | ||
|
||
def validate_access_token_and_get_claims(self, token: str, options: Optional[Dict] = None, audience = None) -> Dict[str, Any]: | ||
def validate_access_token_and_get_claims(self, token: str, options: Optional[TokenValidationOptions] = None) -> Dict[str, Any]: |
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.
We have removed audience parameter from the params. Would it be ok as it would break for any customers already using this method.
scalekit/client.py
Outdated
if options.issuer: | ||
jwt_options["issuer"] = options.issuer | ||
if options.audience: | ||
audience = options.audience[0] if len(options.audience) == 1 else options.audience |
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.
This logic needs to be refined.
We are converting audience to str if len(options.audience) == 1 or else we pas the list itself. Why is the conversion required of len = 1 as well?
Secondly, if user has provided audience separately in params, then we should take that as well in consideration and put it in options block itself and send only options block to jwt.decode()
No description provided.