Skip to content

Conversation

@DamianSawicki
Copy link

This is a fix of #3861 in GEP-1767. It specifies that wildcards are not allowed in CORS response headers (Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers, and Access-Control-Expose-Headers) when the request is credentialed (rather than when the allowCredentials config field is true).

What type of PR is this?

/kind gep

What this PR does / why we need it:

It fixes an Issue (see below).

Which issue(s) this PR fixes:

Fixes #3861

Does this PR introduce a user-facing change?:

NONE 
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/gep PRs related to Gateway Enhancement Proposal(GEP) labels Nov 26, 2025
@k8s-ci-robot k8s-ci-robot requested a review from arkodg November 26, 2025 16:26
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 26, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 26, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @DamianSawicki!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 26, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @DamianSawicki. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@DamianSawicki DamianSawicki force-pushed the rectifyCORSCredentials branch 6 times, most recently from 74f0e18 to e4200a6 Compare November 26, 2025 16:38
This is a fix to GEP-1767. It specifies that wildcards are not allowed in CORS response headers when the request is credentialed (rather than when the allowCredentials config field is true). The corresponding GitHub Issue is kubernetes-sigs#3861. Signed-off-by: Damian Sawicki <dsawicki@google.com>
@DamianSawicki DamianSawicki changed the title Rectify credentialed requests vs allowCredentials Wildcards are forbidden in CORS response headers to credentialed requests rather than with allowCredentials: True Nov 26, 2025
@DamianSawicki
Copy link
Author

/cc @rikatz
/cc @shaneutt

@DamianSawicki DamianSawicki marked this pull request as ready for review November 26, 2025 16:47
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 26, 2025
@rikatz
Copy link
Member

rikatz commented Nov 27, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 27, 2025
@DamianSawicki
Copy link
Author

@EyalPazz Since you reviewed #3861, could you possibly have a look at the current PR resolving it?

@EyalPazz
Copy link
Member

EyalPazz commented Dec 4, 2025

Of course, i'll take a look today

@EyalPazz
Copy link
Member

EyalPazz commented Dec 4, 2025

Looks Good!

The Gateway behavior on the reception of a credentialed request despite allowCredentials being false is not preciesly specified, so when considering responses to credentialed requests let us assume that allowCredentials is true. Signed-off-by: Damian Sawicki <dsawicki@google.com>
Replace "Cookie: pageAccess=2" with "Cookie: foo=bar" to avoid confusion. Signed-off-by: Damian Sawicki <dsawicki@google.com>
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @DamianSawicki!

//
// The `Access-Control-Allow-Origin` response header can only use `*`
// wildcard as value when the `AllowCredentials` field is false.
// Conversely, if the request `Origin` matches one of the configured
Copy link
Member

Choose a reason for hiding this comment

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

Are you planning to update the corresponding go types in this PR or save that for a follow up?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @robscott, thanks for review! I've just updated the Go struct, and this gave me an idea how to adjust the wording in the GEP. PTAL.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2025
DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DamianSawicki, robscott

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 15, 2025
DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
@DamianSawicki
Copy link
Author

/retest

DamianSawicki added a commit to DamianSawicki/gateway-api that referenced this pull request Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 15, 2025
This updates the Go struct in accordance with the GEP changes from kubernetes-sigs#4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
@k8s-ci-robot
Copy link
Contributor

@DamianSawicki: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gateway-api-verify 0650d7a link true /test pull-gateway-api-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/gep PRs related to Gateway Enhancement Proposal(GEP) ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

5 participants