ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.9k stars 3.4k forks source link

Add a size limit to credential field file uploads #8083

Open mabashian opened 4 years ago

mabashian commented 4 years ago
ISSUE TYPE
SUMMARY

https://github.com/ansible/awx/pull/7960 will add the ability to upload key files to some credential form fields. Right now there is no upper limit on the size of the upload which can cause the UI to freeze if the file is quite large. The files uploaded to this form should be quite small. If we select a sufficiently large upper limit I would hope that users would not run in to it for legitimate uploads.

Here are the dropzone props: https://react-dropzone.js.org/#!/Dropzone

Here's are the PF component props: http://patternfly-react.surge.sh/documentation/react/components/fileupload#props

In this case we'd want to add dropzoneProps as a prop on the PF component and include the maxSize argument.

Marking this as blocked until #7960 merges.

nixocio commented 3 years ago

Since https://github.com/ansible/awx/pull/7960 was merged this issue is no longer blocked.

mabashian commented 3 years ago

@nixocio you still working on this one?

nixocio commented 3 years ago

A few notes to be explore by the person working on this issue.

We can add new prop dropzoneProps to FileUpload inside CredentialInput.

        dropzoneProps={{
          maxSize: 512,
          onDropRejected: handleIsRejected,
        }}

We will need to address how handleIsRejected sets /passes the error from the CredentialInput to CredentialField.

nixocio commented 3 years ago

@nixocio you still working on this one?

I unassigned myself from this issue for the time being.