cel: add support for re-evaluating CEL expression on response path #40899
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:
cel: add support for re-evaluating CEL expression on response path
Additional Description:
Changes the CEL expression data input to return
MoreDataMightBeAvailableif any of request_headers, response_headers, or response_trailers is not available at the time of evaluation.Re-evaluates CEL expression iff the response data was attempted to be read during the first (request phase) evaluation AND the expression result was no-match.
If the expression was a match, (aiui) the matcher will not call the CEL matcher's match function again.
If the expression was not a match and the response data was NOT evaluated in the CEL expression, then the no-match result is cached for the next filter callback. The matcher will re-invoke the CEL matcher's match function, but the match function will just return the cached result.
Risk Level: medium. Modification of existing work-in-progress filter.
Testing: Unit tested in test/extensions/matching/input_matchers/cel_matcher/cel_matcher_test.cc, manual end-to-end testing done.
Docs Changes: None.
Release Notes: Added note to current release notes.
Platform Specific Features:
Runtime guard: None.