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

fix(security): Access-Control-Allow-Credentials is all CORS requests #4669

Merged
merged 1 commit into from
Sep 6, 2023
Merged

fix(security): Access-Control-Allow-Credentials is all CORS requests #4669

merged 1 commit into from
Sep 6, 2023

Conversation

bnevis-i
Copy link
Collaborator

@bnevis-i bnevis-i commented Sep 5, 2023

Access-Control-Allow-Credentials must be sent for non-preflight requests as well. Note that this PR has TAF approval to send extra headers in order to avoid complicated boolean logic in the nginx rules.

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

TAF team will be testing: #4648

New Dependency Instructions (If applicable)

@bnevis-i
Copy link
Collaborator Author

bnevis-i commented Sep 5, 2023

Note to reviewers. The diff is showing more deltas than there actually are. This PR is just pulling 3 CORS headers forward into a section that does not depend on the HTTP verb.

@codecov-commenter
Copy link

Codecov Report

Merging #4669 (ac12ea4) into main (8274911) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main    #4669   +/-   ##
=======================================
  Coverage   41.84%   41.84%           
=======================================
  Files         105      105           
  Lines        9723     9723           
=======================================
  Hits         4069     4069           
  Misses       5308     5308           
  Partials      346      346           

lenny-goodell
lenny-goodell previously approved these changes Sep 5, 2023
Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bnevis-i bnevis-i marked this pull request as draft September 5, 2023 21:12
@bnevis-i
Copy link
Collaborator Author

bnevis-i commented Sep 5, 2023

Moved to draft state. Somehow, even through the directives are there, they are not "taking".

…ests

Signed-off-by: Bryon Nevis <bryon.nevis@intel.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
5.1% 5.1% Duplication

@bnevis-i bnevis-i marked this pull request as ready for review September 5, 2023 21:38
@bnevis-i
Copy link
Collaborator Author

bnevis-i commented Sep 5, 2023

Ready for review again. Lesson learned.
https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx

If you use add_header in a block, it forgets about the containing block's add_header directives :-(

Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bnevis-i bnevis-i merged commit 2bac5d1 into edgexfoundry:main Sep 6, 2023
@bnevis-i bnevis-i deleted the cors-header-tweak branch September 6, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants