Skip to content

NET-6821 Disable Terminating Gateway Auto Host Header Rewrite#20802

Merged
sarahalsmiller merged 6 commits intomainfrom
NET-6821-Host-Header-Rewrite
Mar 12, 2024
Merged

NET-6821 Disable Terminating Gateway Auto Host Header Rewrite#20802
sarahalsmiller merged 6 commits intomainfrom
NET-6821-Host-Header-Rewrite

Conversation

@sarahalsmiller
Copy link
Member

@sarahalsmiller sarahalsmiller commented Mar 6, 2024

Description

  • Exposing configuration to allow users of the terminating gateway to turn off host header rewrites at the service level

Testing & Reproduction steps

  • build local consul
  • apply the following terminating gateway
Kind = "terminating-gateway"
Name = "test-gateway"
Services = [
 {
   Name = "default-behavior"
 },
 {
   Name = "default-behavior-1"
   DisableAutoHostRewrite = true
 }
]

Observe the generated XDS and note that the default behavior is to auto host rewrite, but not when DisableAutoHostRewrite is set to true.

Links

PR Checklist

  • [ X ] updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@sarahalsmiller sarahalsmiller requested a review from a team as a code owner March 6, 2024 22:04
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/envoy/xds Related to Envoy support labels Mar 6, 2024
@blake blake linked an issue Mar 6, 2024 that may be closed by this pull request
@sarahalsmiller sarahalsmiller requested a review from a team as a code owner March 7, 2024 17:03
CAFile: svc.CAFile,
SNI: svc.SNI,
ServiceKind: kind,
AutoHostRewrite: !svc.DisableAutoHostRewrite,
Copy link
Member Author

Choose a reason for hiding this comment

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

My logic here is that by making this a flag you have to set to true it won't change any existing behavior in existing terminating gateway setups.

Copy link
Contributor

@boruszak boruszak left a comment

Choose a reason for hiding this comment

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

I reviewed the edits to terminating-gateway.mdx and left one suggestion.

Approving on behalf of consul-docs.

@david-yu
Copy link
Contributor

david-yu commented Mar 8, 2024

@sarahalsmiller Will an accompanying PR to update CRDs also follow? Looking forward this PR being merged!

@sarahalsmiller
Copy link
Member Author

@sarahalsmiller Will an accompanying PR to update CRDs also follow? Looking forward this PR being merged!

Yes it will. In my experience its just easier to wait until the original PR merges into core so you don't accidentally point the go.mod file at a commit that doesn't exist in main.

@sarahalsmiller sarahalsmiller force-pushed the NET-6821-Host-Header-Rewrite branch from c86b043 to 4abaa66 Compare March 8, 2024 20:55
Copy link
Contributor

@missylbytes missylbytes left a comment

Choose a reason for hiding this comment

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

LGTM when all tests pass

@sarahalsmiller sarahalsmiller force-pushed the NET-6821-Host-Header-Rewrite branch from b46aa0e to 11e4a74 Compare March 12, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme/api Relating to the HTTP API interface theme/envoy/xds Related to Envoy support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host header autorewrite on terminating-gateway breaks some http flows

4 participants