navapbc / wic-participant-recertification-portal

https://navapbc.github.io/wic-participant-recertification-portal/
Apache License 2.0
0 stars 1 forks source link

[PRP-334] Add CORS policy to doc upload s3 bucket #90

Closed rocketnova closed 1 year ago

rocketnova commented 1 year ago

Ticket

https://wicmtdp.atlassian.net/browse/PRP-334

Changes

What was added, updated, or removed in this PR.

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

Because we are re-architecting doc upload to upload documents on the client-side in https://wicmtdp.atlassian.net/browse/PRP-332, we need to update our s3 bucket CORS policy to allow the participant site to PUT files into the S3 bucket

Testing

Screenshots, GIF demos, code examples or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

This terraform change has been applied to the dev environment and the WIP for #89 has also been deployed to the dev environment. A successful upload looks like this:

Screenshot 2023-05-03 at 8 58 48 PM

Test by:

  1. Walking through the PRP until you get to upload in the dev environment
  2. Upload a file
  3. The file preview should work
  4. [Bonus] Check that the file has been uploaded to the dev s3 bucket
github-actions[bot] commented 1 year ago

Chromatic_Build : Link to latest build in Chromatic 🌈 Link to storybook build in Chromatic

aplybeah commented 1 year ago

Screen Shot 2023-05-04 at 9 50 57 AM Trying to upload a document yields this in the dev environment, will attempt again @rocketnova

rocketnova commented 1 year ago

Screen Shot 2023-05-04 at 9 50 57 AM Trying to upload a document yields this in the dev environment, will attempt again @rocketnova

Oh good catch. My browser is set to auto-upgrade HTTP requests to HTTPS, so that got around this. I think making these requests as HTTPS will be a change that @microwavenby will make to their WIP code (the goal of yesterday was to get it functioning - there's still more finalizing to do).

@aplybeah If you turn on the HTTPS mode setting in your browser, does the upload work successfully?

aplybeah commented 1 year ago

@rocketnova I enabled the HTTPS mode in my browser (Chrome and Safari) and it didn't make a difference

rocketnova commented 1 year ago

@rocketnova I enabled the HTTPS mode in my browser (Chrome and Safari) and it didn't make a difference

@aplybeah This was a good catch. Sasha and I did a bunch more work to identify this issue and address it in #93