-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Feature] Add file upload policy #4822
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4822 +/- ##
==========================================
- Coverage 92.72% 92.71% -0.02%
==========================================
Files 119 119
Lines 8688 8697 +9
==========================================
+ Hits 8056 8063 +7
- Misses 632 634 +2
Continue to review full report at Codecov.
|
Thanks for the PR. Quick question, why would you want to prevent master key to upload files in the first place? I don't believe there is any limitations as such in the platform, so that's inconsistent with what one would be expecting.
Which is really not ideal as iOS and android apps may not be updated and it is not acceptable to break the usage for existing users in the wild. |
For my personal use, I don't find especially useful to prevent master to upload files but I wanted to keep the possibility as there is already a Concerning iOS, Android or any other client, it does not break anything since by default, if I think that it is critical to allow developers to disable anonymous file uploads. |
And that's quite a big issue. For the
So let's not implement it, less code == better code
It's not that critical as you've seen, this project has been out for a few years and not picked up, so it'S down below in the priorities, file uploads is not really a big deal compared to database DdoS which can be very easily achievable ;) |
In summary, let's:
|
It's not only about DDOS. Another big issue is that kind of situation:
Now, what can we do with this file?
If I'm not wrong, the old Parse had a feature to delete files not referenced in any DB row, which was very useful. A potential solution would be to use cloud functions to pass files in base64 when validation is required and let the server create files but I don't know about performance compared to sending files with the /files API, especially for bigger files.
I agree
Also agree for both. |
Yes and if that’s the feature you want, it’s not those changes that will help.
That’s pretty much the case for any class that let users create the object. For me this is a non issue as at best what will be attempted will give a false sense of security. If the issue is the files cleanup, then writing a cleaner is the solution. Requiring authentication is not the solution |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Related to this issue
#2484
This PR allows developers to specify permissions for file creation.
A new key
fileCreationPolicy
can be added in the Parse configuration.readonly
to prevent anyone including master to create new files.master
to only allow master to create filesuser
to allow master and users to create files.By default, anonymous users are allowed to create new files.
If the PR is approved, litttle changes will be required in the client library to pass the session token when peforming file.save().
Integration tests with authenticated users were tested with the REST API to pass the session token.