ip-tagging filter: add support for an optional ip-tag-header field #36434
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change adds support for specifying an optional header to ip-tagging filter instead of the default header that it uses (
x-envoy-ip-tags
).example
Why
Currently, the ip-tagging filter always writes its output into the
x-envoy-ip-tags
header. When this filter is used for more than one purpose in the same filter chain which we do at Slack in our production environment, we do need to take care of cleaning up the header in between which has been proven a bit tricky sometimes. Leaking the values in between the filter chain is bad so we try to avoid that.We would like this to be configurable. This way we can use the optional header instead of trying the use the same header however many times the same filter is used on the same filter chain in a listener.
Risk Level
this is a new feature, doesn't affect the existing functionality so guessing low but open to changing if I'm wrong.
Testing
added test
Docs Changes: For some reason (sorry), I can't find where to do this, would appreciate some help :/. I believe I need to change file that generates this: https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ip_tagging/v3/ip_tagging.proto#extensions-filters-http-ip-tagging-v3-iptagging
Co-authored-by: Ariane van der Steldt [email protected]
Signed-off-by: Radha Kumari [email protected]