-
-
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
Restrict file download #8241
Comments
Thanks for opening this issue!
|
hey can you assign this issue to me I would like to work upon this |
@Jaya-sys sure, if you are working on this, please open a PR and link it to this issue, so everyone can see that there is active development going on. (We don't use the "assign" feature on GitHub) |
How would this work? The files are served via a GET call, and browsers/clients do not pass in auth/cookies inline (such as via an Would we need some sort of presigned URL algorithm similar to what exists in parse-community/parse-server-s3-adapter#117 |
I think the Parse SDK would need to pass a session token in the header for file requests, just like with any other request. So this is a multi-part issue. One is the PR on Parse Server side; the other is a PR in each of the Parse SDKs. The Parse SDKs can always send the session token in the header, and Parse Server can ignore it, or require it, depending on the setting. This may not be applicable for every use case. For example, if a browser requests image files because they are embedded via an I remember discussing this exact point previously, unfortunately I can't find where. |
Yes sure |
I found the other related discussions:
Reading through them again, I think one conclusion is that there are 3 features we can implement, each one being independent, i.e. they can exist in parallel and don't replace one another:
The features are in order of difficulty, I guess triggers (#6572) would be the easiest to implement. |
New Feature / Enhancement Checklist
Current Limitation
(I think we discussed this issue already somewhere, but can't find where)
It is currently possible to download a file without being authenticated. Downloading a file should have similar restrictions to uploading a file. For example, it should be configurable that a file download is only available to authenticated users.
As long as file download is enabled for public (without auth required), a service could be misused as a file hosting service. For example, a user can create an account, upload a file as authenticated user, and then distribute the file download URL freely in public forums. Anyone would then be able to download the file. While it would be technically still possible to do that even if file download is restricted to authenticated users, it wouldn't be as easy as it is now.
Related:
Parse.Cloud.afterFind(Parse.File)
#7927Feature / Enhancement Description
Add new Parse Server config options (similar to the file upload options) to restrict file download to:
For example:
Limitation: If the Parse Server file adapter is configured to send a direct URL (e.g. to the AWS S3 resource), then the developer has to implement their own mechanism to prevent that (e.g. via expiring download links which is already supported in the Parse Server S3 file adapter).
Example Use Case
n/a
Alternatives / Workarounds
Unknown whether there is a current workaround for that, maybe via triggers?
The text was updated successfully, but these errors were encountered: