Repository navigation
CORS conformance fixes regarding credentials and wildcards - #4542
Conversation
|
Hi @DamianSawicki. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/assign @rikatz |
|
/ok-to-test |
|
/cc @snorwin |
|
/retest |
|
/remove-lgtm |
Preflight requests cannot be credentialed as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#preflight_requests_and_credentials so we remove the `Authorization` header from the test preflight request while adding a comment that it may be included in the subsequent actual request. Signed-off-by: Damian Sawicki <dsawicki@google.com>
3bc7033 to
f2c9c12
Compare
The test case required the Origin to be echoed in `access-control-allow-origin`, while in fact also the Method should be echoed in `access-control-allow-methods` for a credentialed request as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#credentialed_requests_and_wildcards This is now fixed. Signed-off-by: Damian Sawicki <dsawicki@google.com>
For test symmetry, we allow a wildcard as the value of access-control-allow-headers, where it is allowed as the value of access-control-allow-origin and access-control-allow-methods. Signed-off-by: Damian Sawicki <dsawicki@google.com>
For simple credentialed requests, the new test cases verify echoing the Origin in the Access-Control-Allow-Origin header and setting or omitting the Access-Control-Allow-Credentials header depending on the config. Signed-off-by: Damian Sawicki <dsawicki@google.com>
e147c7f to
ff0af4a
Compare
snorwin
left a comment
There was a problem hiding this comment.
/lgtm
I successfully verified the tests with the Airlock Microgateway.
|
Thanks @DamianSawicki! /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DamianSawicki, robscott, snorwin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-1.5 |
|
@robscott: new pull request created: #4547 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…s-sigs#4542) * CORS preflight requests cannot contain credentials Preflight requests cannot be credentialed as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#preflight_requests_and_credentials so we remove the `Authorization` header from the test preflight request while adding a comment that it may be included in the subsequent actual request. Signed-off-by: Damian Sawicki <dsawicki@google.com> * Require also methods to be echoed with credentials The test case required the Origin to be echoed in `access-control-allow-origin`, while in fact also the Method should be echoed in `access-control-allow-methods` for a credentialed request as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#credentialed_requests_and_wildcards This is now fixed. Signed-off-by: Damian Sawicki <dsawicki@google.com> * Allow wildcards in access-control-allow-headers For test symmetry, we allow a wildcard as the value of access-control-allow-headers, where it is allowed as the value of access-control-allow-origin and access-control-allow-methods. Signed-off-by: Damian Sawicki <dsawicki@google.com> * Add test cases for simple credentialed requests For simple credentialed requests, the new test cases verify echoing the Origin in the Access-Control-Allow-Origin header and setting or omitting the Access-Control-Allow-Credentials header depending on the config. Signed-off-by: Damian Sawicki <dsawicki@google.com> --------- Signed-off-by: Damian Sawicki <dsawicki@google.com>
What type of PR is this?
/kind test
/area conformance-test
What this PR does / why we need it:
access-control-allow-origin, but not inaccess-control-allow-methods. Now, both are covered.access-control-allow-originandaccess-control-allow-methods, but not inaccess-control-allow-headers. Now, wildcards are allowed in all three.More details can be found in the corresponding commit descriptions.
Which issue(s) this PR fixes:
Does this PR introduce a user-facing change?: