-
Notifications
You must be signed in to change notification settings - Fork 6
add metadata auth framework. #359
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
|
Need to be updated after #354 gets merged |
|
Will update once that is merged. |
# Conflicts: # backend/app/deps/authorization_deps.py # backend/app/routers/authorization.py
max-zilla
left a comment
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.
a couple comments for clarification
backend/app/routers/authorization.py
Outdated
| async def get_metadata_role( | ||
| metadata_id: str, | ||
| current_user=Depends(get_current_username), | ||
| role: RoleType = Depends(get_role_by_file), |
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 this be get_role_by_metadata?
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.
fixed.
| async for md in db["metadata"].find(query): | ||
| md_out = MetadataOut.from_mongo(md) | ||
| resource_type = md_out.resource.collection | ||
| resource_id = md_out.resource.resource_id |
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.
are these used?
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.
removed
* adding wrapper for metadata authorization * formatting * using pyobjectid not str * merge,adding for metadata * formatting * small fixes based on max's comments * formatting
* tests * skeleton code * codegen * connect to get role endpoint in redux * add role chip * add to file; but need to investigate why backend file doesn't work * implement some basic role * break action menu into owner, editor, upload * add 403 page * still falls to not found * add metadata auth framework. (#359) * adding wrapper for metadata authorization * formatting * using pyobjectid not str * merge,adding for metadata * formatting * small fixes based on max's comments * formatting * adding restart unless stopped for this container (#341) * Implement FileAuthorization dependency (#385) * add FileAuthorization dependency * formatting * adjust permissions to uploader for a couple routes --------- Co-authored-by: toddn <[email protected]> * codgen * write auth wrapper pattern * fix file role * temp fix for 403 * add protection on file menu * add protection on file * remove extraneous role filter on user roles --------- Co-authored-by: Todd Nicholson <[email protected]> Co-authored-by: Max Burnette <[email protected]> Co-authored-by: toddn <[email protected]>
Modeled after Max's pull request. Checks authorization of metadata based on either file or dataset.