-
Notifications
You must be signed in to change notification settings - Fork 63
Update batch API endpoint, openapi documentation and add batch test #567
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
base: develop
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 21623346096Details
💛 - Coveralls |
MarcelGeo
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.
Nice 🎉
-
we need to double check if 404 is ok if you have empty projects list or return error: 404
-
check
def get_projects_by_uuids(uuids)method inproject_api_controller.pyif everything with permissions is ok here
harminius
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.
Very good job!
I think two things need to be discussed (to fulfill clients' requirements):
1, Shall all (valid) uuids coming from the request be part of the response or can we skip them as suggested here?
2, Do we need to differentiate between 404 and 403 here with the expose flag? I tend to make things easier by keeping only 404 error.
|
@xkello Although your approach returns a correct response, I think we need to slightly change the approach. |
harminius
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.
Great job, we're almost there! 👍
I have only one major comment.
I have doubts about the usefulness of require_project_by_many_uuids(). At least it should return a list of projects, and the rest (by_id dict creation) should be done in the controller. However, since this function needs to list even removed projects, it doesn't seem reusable.
The idea of the help function is that it can be used in a different use case, while this function is designed for this specific usecase.
server/mergin/sync/permissions.py
Outdated
|
|
||
| if not permission.check(project, current_user): | ||
| # logged in - NO, have acccess - NONE, public project - NO | ||
| if current_user.is_anonymous and not project.public: |
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.
does not project.public condition makes sense?
if the project is public, the if permission check above will be True..
harminius
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.
The last concern is about logged out users not able to list their projects
Otherwise 💚
| data = ProjectSchemaV2(many=True).dump(result) | ||
| return jsonify(projects=data, count=total, page=page, per_page=per_page), 200 | ||
|
|
||
| @auth_required |
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 think we don't want this, best to check with @varmar05
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.
Yes I too believe so. Since anonymous users can also view public projects. But lets wait for reply from Martin
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.
yes, let's remove it - those getters for projects do not have auth decorator due to public projects
Work on ticket: https://github.com/MerginMaps/server-private/issues/3181
-from parent: https://github.com/MerginMaps/product/issues/86