-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.26] Backport Extractor Regex Replace Functionality (#315)
* Add regex replace functionality to transformation filter extractors [Revised] (#309) * Add regex replace functionality to transformation filter extractors (#301) * initial extractor implementation of replace functionality * minor changes, testing against mergeExtractorsToBody and extraction callback * add changelog entry * update API to use new mode selector update transformation_filter proto * minor updates to comments in transformation_filter.proto * remove existing references to no-longer-existing replace_all setting * update replacement_text_ to a std::optional<std::string> * remove duplicate mode enum * update comment indicating that subgroup should never exceed regex_result size * add AttemptReplaceFromNoMatchNonNilSubgroup test * prevent string reallocation * remove unnecessary if block + variable in replaceAllValues * clean up new tests * inline replacement_text in inja_transformer_test.cc * more test cleanup * update function signatures, remove replaced_value_ * support dynamic metadata as extractor input * update changelog location * add API changes to go with 3175ca9 * revert support for dynamic metadata as an extractor input 3175ca9 and e2668be * refactor calls to extract/replace * rename replace to extractDestructive, add breaks to switch statement * update data types to match updated function signatures in inja_transformer_test.cc * respond to review comments * update changelog location * update changelog location * separate destructive extractors and non-destructive extractors * fix match_not_null edge case * update inline documentation for new proto field * add test demonstrating use of format specifiers * update REPLACE_ALL mode to return input on no match * return input on no match in single replace case * update changelog location
- Loading branch information
1 parent
0bae991
commit 52b93ad
Showing
7 changed files
with
832 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
changelog: | ||
- type: NEW_FEATURE | ||
resolvesIssue: false | ||
issueLink: https://github.com/solo-io/gloo/issues/8706 | ||
description: > | ||
Update transformation filter extractors to support regex | ||
replace/replace all operations on extracted values. |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.