Skip to content

Restrict file download #8241

@mtrezza

Description

@mtrezza

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:

Feature / Enhancement Description

Add new Parse Server config options (similar to the file upload options) to restrict file download to:

  • public
  • anonymous user
  • authenticated user

For example:

fileDownload: {
    enableForPublic: false,
    enableForAnonymousUser: false,
    enableForAuthenticatedUser: true,
},

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions