-
Notifications
You must be signed in to change notification settings - Fork 1
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
Firebase auth branch #11
base: main
Are you sure you want to change the base?
Conversation
def role_based_access_control(allowed_roles: List[str]): | ||
def middleware_decorator(endpoint: Callable): | ||
async def wrapper(request: Request, *args, **kwargs): | ||
roles = getattr(request.state, "user_roles", []) |
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.
it's much much safer to get a user's roles from firebase or the db ourselves using the methods in the auth service, instead of sending it in the request
imagine someone malicious adding in roles to their requests that they don't have access to, which would let them access other roles that they haven't been assigned to in the db
Notion ticket link
Ticket Name
Implementation description
Steps to test
What should reviewers focus on?
Checklist