-
Notifications
You must be signed in to change notification settings - Fork 27
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
🐛 Only allow to search *owned* files in storage search endpoint #5772
🐛 Only allow to search *owned* files in storage search endpoint #5772
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5772 +/- ##
=========================================
- Coverage 84.5% 67.6% -17.0%
=========================================
Files 10 666 +656
Lines 214 32725 +32511
Branches 25 205 +180
=========================================
+ Hits 181 22133 +21952
- Misses 23 10540 +10517
- Partials 10 52 +42
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks a lot for checking. But tbh I don't really understand the solution. Here you are changing the logic in order to improve performance. But actually write access is a completely different thing than read access.
As far as I remember, @pcrespov made the "file access rights" actually reads the projects access rights which are a JSON column.
So that means that a project that is shared with READ access rights means that the files are also readable. If the project is shared with WRITE access rights, then you have also WRITE access to the files. Therefore I am not sure your change makes sense.
Now the projects access rights are a JSON column, which is for sure not efficient. Maybe we should discuss that also together with @matusdrobuliak66 as we talked about moving the JSON column to its own table, which could also vastly improve that speed.
But a change like that might have large implications here.
I see your point. The reason I think it probably makes sense to change to write access here is that files which are accessed through the api-server are (or at least that's what I believe) uploaded via the api-server. Meaning the user has write access to them anyway. But I am not 💯 if this is correct, so that's why I asked the question above. |
It also makes sense to me. |
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.
thx
services/api-server/src/simcore_service_api_server/api/routes/files.py
Outdated
Show resolved
Hide resolved
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.
Reviewed in person
@pcrespov @sanderegg I rerequest reviews because I now changed this PR to also contain changes to storage |
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 nice. Consider my comments regarding adding the assertion and/or the test
Quality Gate passedIssues Measures |
What do these changes do?
access_rights
query parameter from the endpointand instead introduce the compulsory query parameter
kind
which must equalowned
to clearly indicate to the user (of storage) that only owned files are searched using this endpoint.Related issue/s
How to test
Dev-ops checklist