header-to-metadata: add support for regex substitutions#11698
Merged
htuch merged 23 commits intoenvoyproxy:masterfrom Jun 26, 2020
Merged
header-to-metadata: add support for regex substitutions#11698htuch merged 23 commits intoenvoyproxy:masterfrom
htuch merged 23 commits intoenvoyproxy:masterfrom
Conversation
Currently, the header-to-metadata filter supports adding a header's value to a metadata key. This extends this to support performing a regex match & substitution before the value is added as metadata. The use-case we have is extracting parts of a the :path header and using those as metadata for routing decisions via the subset LB. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
added 4 commits
June 22, 2020 16:26
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Convert non covered code into asserts (which is really what they were in the first place). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Member
Author
|
This failure looks unrelated: |
snowp
suggested changes
Jun 23, 2020
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
docs/root/configuration/http/http_filters/header_to_metadata_filter.rst
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
added 6 commits
June 23, 2020 12:22
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
htuch
reviewed
Jun 24, 2020
Member
htuch
left a comment
There was a problem hiding this comment.
API looks good, just a couple of nits.
api/envoy/extensions/filters/http/header_to_metadata/v3/header_to_metadata.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/header_to_metadata/v3/header_to_metadata.proto
Outdated
Show resolved
Hide resolved
* annotate oneof migration * link to fields that aren't in the same msg Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
snowp
suggested changes
Jun 24, 2020
Contributor
snowp
left a comment
There was a problem hiding this comment.
Just some nitty stuff, otherwise LGTM
docs/root/configuration/http/http_filters/header_to_metadata_filter.rst
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Show resolved
Hide resolved
added 2 commits
June 24, 2020 17:38
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
zuercher
reviewed
Jun 24, 2020
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Show resolved
Hide resolved
Our docs said this wasn't allowed and during runtime we'd skip empty values; let's reject them during config time (so that the new ASSERT() which replaced the empty value check doesn't trigger a crash on debug builds). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Member
|
/lgtm api |
Member
Author
|
Failure is related to admission control integration test: cc: @tonya11en |
Member
|
I'm looking into the admission control test failures. Thanks for the heads-up. |
zuercher
reviewed
Jun 25, 2020
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Show resolved
Hide resolved
source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.cc
Outdated
Show resolved
Hide resolved
added 4 commits
June 25, 2020 17:15
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Contributor
|
Needs @envoyproxy/api-shepherds approval |
Member
|
/lgtm api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit Message:
Currently, the header-to-metadata filter supports adding
a header's value to a metadata key. This extends this to
support performing a regex match & substitution before
the value is added as metadata.
Additional Description:
The use-case we have is extracting parts of a the :path
header and using those as metadata for routing decisions
via the subset LB.
Risk Level: Low
Testing: Unit tests.
Docs Changes: adding in a bit.
Release Notes: added.
Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com