router: add filter_state internal redirect predicate#45904
Open
juanmolle wants to merge 3 commits into
Open
Conversation
Adds the envoy.internal_redirect_predicates.filter_state predicate, which decides whether to follow an internal redirect by comparing a filter state string object (set earlier in the request by another filter) against a configured value: allow_value follows only on a match, deny_value follows unless it matches, and allow_if_absent controls behavior when the object is missing (default: do not follow). No change for existing configs; the predicate has effect only when added to an InternalRedirectPolicy. Uses a raw string with a required oneof allow_value / deny_value rather than a StringMatcher, because the predicate factory does not receive a CommonFactoryContext (needed by StringMatcher for regex/custom). This stays additively upgradeable to a StringMatcher option later without an API break. Signed-off-by: Juan Manuel Olle <jolle@salesforce.com>
Signed-off-by: Juan Manuel Olle <jolle@salesforce.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
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:
router: add
filter_stateinternal redirect predicateAdds the
envoy.internal_redirect_predicates.filter_statepredicate, which decideswhether to follow an internal redirect by comparing a filter state string object (set
earlier in the request by another filter) against a configured value:
allow_valuefollows only on a match,
deny_valuefollows unless it matches, andallow_if_absentcontrols behavior when the object is missing (default: do not follow). No change for
existing configs; the predicate has effect only when added to an
InternalRedirectPolicy.Additional Description:
Uses a raw string with a required
oneof allow_value / deny_valuerather than aStringMatcher, because the predicate factory does not receive aCommonFactoryContext(needed by
StringMatcherfor regex/custom). This stays additively upgradeable to aStringMatcheroption later without an API break.Risk Level: Low — self-contained extension, inert unless explicitly configured.
Testing: Unit tests for factory registration and allow/deny/absent behavior. Built
//source/exe:envoy-staticand confirmed the extension registers.Docs Changes: Added the predicate to the internal redirect section of
http_connection_management.rst; API reference generated from the proto comments.Release Notes: Added
changelogs/current/new_features/router__added-filter-state-internal-redirect-predicate.rst.Platform Specific Features: N/A
[Generative AI usage disclosure: Generative AI (Claude) was used to assist with this change;
I have reviewed and understand all of the code.]