-
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
Add dependency for endpoints to check if lei is in request.user.institutions #102
Comments
Can't this just be a check that LEI in the path matches one of the LEIs in the access token? |
Yup, sure could. For some reason I was thinking there would be a different between what was in the token and what institutions the user was associated with based on email domain they're logging in with but that association is already built into the token. MUCH easier. Thank you. |
Closes #102 - Added verify_user_lei_relation which checks if the path lei is in the request.user.institutions list - Made the check dependent on the ENV var not being LOCAL (for ease of dev testing) - Updated the Router to use the dependency. Dependency sets the lei as optional for the /periods endpoint (which doesn't care about lei checking, all others do) - Created pytests to check dependency - Moved the two dependency functions into a routers/dependencies.py file
Need to add a dependency for the filing endpoints that checks if the request.user.institutions (which is built from the access token) contains the lei in the URL path.
If not, return a 403 FORBIDDEN
The text was updated successfully, but these errors were encountered: