Skip to content

ext_authz: fixed a bug to honor filter_enabled_metadata when the filter is marked with disabled=true#41937

Merged
yanavlasov merged 1 commit intoenvoyproxy:mainfrom
agrawroh:fix-extauthz
Nov 19, 2025
Merged

ext_authz: fixed a bug to honor filter_enabled_metadata when the filter is marked with disabled=true#41937
yanavlasov merged 1 commit intoenvoyproxy:mainfrom
agrawroh:fix-extauthz

Conversation

@agrawroh
Copy link
Copy Markdown
Member

Description

This PR fixes a bug to honor filter_enabled_metadata when the filter is marked with disabled: true. The filter is now instantiated when filter_enabled_metadata is configured, allowing it to check dynamic metadata at runtime and enable itself conditionally.

Fix #41501


Commit Message: ext_authz: fixed a bug to honor filter_enabled_metadata when the filter is marked with disabled=true
Additional Description: Fixes a bug to honor filter_enabled_metadata when the filter is marked with disabled: true.
Risk Level: Low
Testing: Added Tests
Docs Changes: N/A
Release Notes: Added

…er is marked with disabled=true

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
@yanavlasov yanavlasov merged commit 04fe362 into envoyproxy:main Nov 19, 2025
25 checks passed
@adisuissa
Copy link
Copy Markdown
Contributor

adisuissa commented Nov 25, 2025

cc @envoyproxy/envoy-maintainers
I would like to bring this approach into discussion, as it may cause inconsistencies later.
IMO the internal-filter logic of whether it is enabled or not (filter_enabled_metadata) should not take precedence over the HttpFilter disabled field.
I think that keeping the hierarchy clear would make both the design and implementation much simpler.
cc @wbpcode who spent many cycles on the filter's disabled field and getting its semantics correct.

Edit:
Forgot to mention, IIUC the ExtensionWithMatcher configuration can be useful here by matching some value to decide whether to invoke the filter or not.

@agrawroh
Copy link
Copy Markdown
Member Author

cc @envoyproxy/envoy-maintainers

I would like to bring this approach into discussion, as it may cause inconsistencies later.

IMO the internal-filter logic of whether it is enabled or not (filter_enabled_metadata) should not take precedence over the HttpFilter disabled field.

I think that keeping the hierarchy clear would make both the design and implementation much simpler.

cc @wbpcode who spent many cycles on the filter's disabled field and getting its semantics correct.

Edit:

Forgot to mention, IIUC the ExtensionWithMatcher configuration can be useful here by matching some value to decide whether to invoke the filter or not.

@adisuissa Should I revert this change first? We can discuss more offline.

@adisuissa
Copy link
Copy Markdown
Contributor

@adisuissa Should I revert this change first? We can discuss more offline.

I believe that's up to a senior-maintainer to decide on this.

@ggreenway
Copy link
Copy Markdown
Member

@adisuissa @agrawroh I'm fine with however you want to proceed on this, whether it's revert or fix-forward. Whatever is easiest. Although if we're sure we don't want to keep the current behavior, and a replacement isn't ready before the next release (mid january I think), then revert would be better.

agrawroh added a commit to agrawroh/envoy that referenced this pull request Dec 4, 2025
…the filter is marked with disabled=true (envoyproxy#41937)"

This reverts commit 04fe362.
agrawroh added a commit to agrawroh/envoy that referenced this pull request Dec 4, 2025
…the filter is marked with disabled=true (envoyproxy#41937)"

This reverts commit 04fe362.

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
botengyao pushed a commit that referenced this pull request Dec 12, 2025
## Description

This PR clearly documents the limitations of using
`filter_enabled_metadata` in the ExtAuthZ filter and that it doesn't
work if the filter itself is disabled in the main filter chain or using
a per-route override. We have also provided examples using
`ExtensionWithMatcher` which should be the recommended way to invoke
filters conditionally.

The [previous attempt](#41937)
which broke some expectations is reverted.

Fix #41501

---

**Commit Message:** ext_authz: document the limitations of
filter_enabled_metadata
**Additional Description:** Add documentation for describing the
limitations around using `filter_enabled_metadata` and provide
workaround examples using `ExtensionWithMatcher`.
**Risk Level:** N/A
**Testing:** CI
**Docs Changes:** Added
**Release Notes:** N/A

---------

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
update-envoy Bot added a commit to envoyproxy/data-plane-api that referenced this pull request Dec 12, 2025
## Description

This PR clearly documents the limitations of using
`filter_enabled_metadata` in the ExtAuthZ filter and that it doesn't
work if the filter itself is disabled in the main filter chain or using
a per-route override. We have also provided examples using
`ExtensionWithMatcher` which should be the recommended way to invoke
filters conditionally.

The [previous attempt](envoyproxy/envoy#41937)
which broke some expectations is reverted.

Fix envoyproxy/envoy#41501

---

**Commit Message:** ext_authz: document the limitations of
filter_enabled_metadata
**Additional Description:** Add documentation for describing the
limitations around using `filter_enabled_metadata` and provide
workaround examples using `ExtensionWithMatcher`.
**Risk Level:** N/A
**Testing:** CI
**Docs Changes:** Added
**Release Notes:** N/A

---------

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>

Mirrored from https://github.com/envoyproxy/envoy @ 2cdf0a1e8800bc9796a237c5965a976c4372f8f3
MayorFaj pushed a commit to MayorFaj/envoy that referenced this pull request Dec 15, 2025
…proxy#42462)

## Description

This PR clearly documents the limitations of using
`filter_enabled_metadata` in the ExtAuthZ filter and that it doesn't
work if the filter itself is disabled in the main filter chain or using
a per-route override. We have also provided examples using
`ExtensionWithMatcher` which should be the recommended way to invoke
filters conditionally.

The [previous attempt](envoyproxy#41937)
which broke some expectations is reverted.

Fix envoyproxy#41501

---

**Commit Message:** ext_authz: document the limitations of
filter_enabled_metadata
**Additional Description:** Add documentation for describing the
limitations around using `filter_enabled_metadata` and provide
workaround examples using `ExtensionWithMatcher`.
**Risk Level:** N/A
**Testing:** CI
**Docs Changes:** Added
**Release Notes:** N/A

---------

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
grnmeira pushed a commit to grnmeira/envoy that referenced this pull request Mar 20, 2026
…er is marked with disabled=true (envoyproxy#41937)

## Description

This PR fixes a bug to honor ``filter_enabled_metadata`` when the filter
is marked with ``disabled: true``. The filter is now instantiated when
``filter_enabled_metadata`` is configured, allowing it to check dynamic
metadata at runtime and enable itself conditionally.

Fix envoyproxy#41501

---

**Commit Message:** ext_authz: fixed a bug to honor
filter_enabled_metadata when the filter is marked with disabled=true
**Additional Description:** Fixes a bug to honor
``filter_enabled_metadata`` when the filter is marked with ``disabled:
true``.
**Risk Level:** Low
**Testing:** Added Tests
**Docs Changes:** N/A
**Release Notes:** Added

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Signed-off-by: Gustavo <grnmeira@gmail.com>
grnmeira pushed a commit to grnmeira/envoy that referenced this pull request Mar 20, 2026
…proxy#42462)

## Description

This PR clearly documents the limitations of using
`filter_enabled_metadata` in the ExtAuthZ filter and that it doesn't
work if the filter itself is disabled in the main filter chain or using
a per-route override. We have also provided examples using
`ExtensionWithMatcher` which should be the recommended way to invoke
filters conditionally.

The [previous attempt](envoyproxy#41937)
which broke some expectations is reverted.

Fix envoyproxy#41501

---

**Commit Message:** ext_authz: document the limitations of
filter_enabled_metadata
**Additional Description:** Add documentation for describing the
limitations around using `filter_enabled_metadata` and provide
workaround examples using `ExtensionWithMatcher`.
**Risk Level:** N/A
**Testing:** CI
**Docs Changes:** Added
**Release Notes:** N/A

---------

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Signed-off-by: Gustavo <grnmeira@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ext_authz filter_enabled_metadata is not honored when metadata is set by a preceding Lua filter

4 participants