Skip to content

router: add filter_state internal redirect predicate#45904

Open
juanmolle wants to merge 3 commits into
envoyproxy:mainfrom
juanmolle:internal-redirect-filter-state-predicate
Open

router: add filter_state internal redirect predicate#45904
juanmolle wants to merge 3 commits into
envoyproxy:mainfrom
juanmolle:internal-redirect-filter-state-predicate

Conversation

@juanmolle

Copy link
Copy Markdown
Contributor

Commit Message:
router: add filter_state internal redirect predicate

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.

Additional Description:
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.

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-static and 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.]

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>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #45904 was opened by juanmolle.

see: more, trace.

Signed-off-by: Juan Manuel Olle <jolle@salesforce.com>
Signed-off-by: Juan Manuel Olle <jolle@salesforce.com>
@juanmolle juanmolle marked this pull request as ready for review June 30, 2026 22:00
@juanmolle juanmolle requested a review from botengyao as a code owner June 30, 2026 22:00
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #45904 was ready_for_review by juanmolle.

see: more, trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants