-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement Route Protection through JWT #41
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
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
chalicelib/decorators.py
Outdated
| Args: | ||
| blueprint (object): The Chalice Blueprint object, providing access to the current request. | ||
| role (list[str]): The required role for authorization. |
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.
should 'role' in the args description be plural ?
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 did not know decorator functions was a thing ... very cool and useful 👍
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.
should be roles 🥲
| )["Parameter"]["Value"] | ||
| decoded = jwt.decode(token, auth_secret, algorithms=["HS256"]) | ||
| print(roles) | ||
| # TODO: if decoded role is not part of given, reject auth |
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.
omg i thought i was being silly bc i couldn't figure out where u were actually doing something with the roles but looks like it's a to-do. i'm assuming you're probably going to finish this up and i'll do another review (to my ability) when u r done ?
What does this PR do?
Type of change
Tests Performed
Screenshots
Additional Comments