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

feat(translator): early request header modifier #4004

Merged
merged 14 commits into from
Aug 14, 2024

Conversation

guydc
Copy link
Contributor

@guydc guydc commented Aug 5, 2024

What type of PR is this?

What this PR does / why we need it:
Adds support for early request header mutation in client traffic policy
Which issue(s) this PR fixes:
Fixes #3978

Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc guydc requested a review from a team as a code owner August 5, 2024 20:33
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 92.70073% with 10 lines in your changes missing coverage. Please review.

Project coverage is 67.90%. Comparing base (a555a96) to head (3370aea).
Report is 1 commits behind head on main.

Files Patch % Lines
internal/gatewayapi/clienttrafficpolicy.go 88.09% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main    #4004       +/-   ##
=========================================
+ Coverage      0   67.90%   +67.90%     
=========================================
  Files         0      187      +187     
  Lines         0    23022    +23022     
=========================================
+ Hits          0    15633    +15633     
- Misses        0     6276     +6276     
- Partials      0     1113     +1113     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guydc guydc marked this pull request as draft August 5, 2024 22:25
Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc guydc marked this pull request as ready for review August 6, 2024 11:29
@guydc
Copy link
Contributor Author

guydc commented Aug 6, 2024

/retest

continue
}
// Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names
if strings.Contains(string(addHeader.Name), "/") || strings.Contains(string(addHeader.Name), ":") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use strings.ContainsAny instead?

continue
}
// Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names
if strings.Contains(string(setHeader.Name), "/") || strings.Contains(string(setHeader.Name), ":") {
Copy link
Contributor

Choose a reason for hiding this comment

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

ContainsAny instead of multiple Contains here as well.

// routing, tracing and built-in header manipulation.
//
// +optional
EarlyRequestHeaderModifier *gwapiv1.HTTPHeaderFilter `json:"earlyRequestHeaderModifier,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

thoughts on earlyRequestHeaders ?

guydc added 6 commits August 13, 2024 16:11
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc
Copy link
Contributor Author

guydc commented Aug 14, 2024

/retest

@guydc guydc requested a review from arkodg August 14, 2024 21:04
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@arkodg arkodg merged commit 8be7e69 into envoyproxy:main Aug 14, 2024
26 of 27 checks passed
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.

Support early header mutation
3 participants