Skip to content
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

Support arbitrary policy enforcement in REST endpoints #204

Open
zachmullen opened this issue Feb 3, 2021 · 0 comments
Open

Support arbitrary policy enforcement in REST endpoints #204

zachmullen opened this issue Feb 3, 2021 · 0 comments

Comments

@zachmullen
Copy link
Contributor

Currently, anyone can upload any amount and size of file via S3FF; there is no way to enforce policies on who can access the REST endpoints for uploading and under what conditions. @brianhelba and I brainstormed a couple of ideas to address this:

  1. Allow a downstream-defined permission_class to be set on the S3FF endpoints. Assuming that a permission class is capable of inspecting request parameters, a custom class could be used to enforce the presence of and validate a signed value representing pre-validation of an upload. It's probably sufficient (and maybe more straightforward) to just put this on the initialization endpoint, since I think it's impossible to use the other endpoints without doing a successful initialization.
  2. A field could be added to UploadInitializationRequestSerializer that could be an opaque string, which could contain such a signature. E.g. state = serializers.CharField(required=False). We would turn on sending of the prepare signal, and pass that state value to signal handlers, who could then perform validation and raise an exception if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant