oauth2: fix single-page-app's pass_through_matcher configuration#819
Merged
phlax merged 1 commit intoenvoyproxy:mainfrom Aug 19, 2025
Merged
oauth2: fix single-page-app's pass_through_matcher configuration#819phlax merged 1 commit intoenvoyproxy:mainfrom
phlax merged 1 commit intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Gustavo Moyano <gustavo.g.moyano@gmail.com>
Member
|
cc @zhaohuabing |
wbpcode
pushed a commit
to envoyproxy/envoy
that referenced
this pull request
Aug 26, 2025
…g filter (#40718) ### Description This PR fixes a bug introduced in PR #40228, where OAuth2 cookies were removed for requests matching the `pass_through_matcher` configuration. This broke setups with multiple OAuth2 filter instances using different `pass_through_matcher` configurations, because the first matching instance removed the OAuth2 cookies--even when a passthrough was intended--impacting subsequent filters that still needed those cookies. The changes in this PR realign the filter behavior with the documentation, which states that `pass_through_matcher` provides an interface for users to specify header matching criteria such that, when applicable, the OAuth flow is entirely skipped. When this occurs, only the `oauth_passthrough` metric is incremented; no cookies or request headers are modified, and no OAuth success is recorded. In summary, when the `pass_through_matcher` configuration matches, the filter should simply skip processing and leave the request untouched. --- **Commit Message:** oauth2: fix passthrough logic to avoid modifying request when skipping filter **Risk Level:** Low **Testing:** Unit test added and single page app test fixed by [envoyproxy/examples PR #819](envoyproxy/examples#819) **Docs Changes:** N/A **Release Notes:** Added **Platform Specific Features:** N/A --------- Signed-off-by: Gustavo Moyano <gustavo.g.moyano@gmail.com>
melginaldi
pushed a commit
to melginaldi/envoy
that referenced
this pull request
Aug 26, 2025
…g filter (envoyproxy#40718) ### Description This PR fixes a bug introduced in PR envoyproxy#40228, where OAuth2 cookies were removed for requests matching the `pass_through_matcher` configuration. This broke setups with multiple OAuth2 filter instances using different `pass_through_matcher` configurations, because the first matching instance removed the OAuth2 cookies--even when a passthrough was intended--impacting subsequent filters that still needed those cookies. The changes in this PR realign the filter behavior with the documentation, which states that `pass_through_matcher` provides an interface for users to specify header matching criteria such that, when applicable, the OAuth flow is entirely skipped. When this occurs, only the `oauth_passthrough` metric is incremented; no cookies or request headers are modified, and no OAuth success is recorded. In summary, when the `pass_through_matcher` configuration matches, the filter should simply skip processing and leave the request untouched. --- **Commit Message:** oauth2: fix passthrough logic to avoid modifying request when skipping filter **Risk Level:** Low **Testing:** Unit test added and single page app test fixed by [envoyproxy/examples PR envoyproxy#819](envoyproxy/examples#819) **Docs Changes:** N/A **Release Notes:** Added **Platform Specific Features:** N/A --------- Signed-off-by: Gustavo Moyano <gustavo.g.moyano@gmail.com> Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
wtzhang23
pushed a commit
to wtzhang23/envoy
that referenced
this pull request
Aug 27, 2025
…g filter (envoyproxy#40718) ### Description This PR fixes a bug introduced in PR envoyproxy#40228, where OAuth2 cookies were removed for requests matching the `pass_through_matcher` configuration. This broke setups with multiple OAuth2 filter instances using different `pass_through_matcher` configurations, because the first matching instance removed the OAuth2 cookies--even when a passthrough was intended--impacting subsequent filters that still needed those cookies. The changes in this PR realign the filter behavior with the documentation, which states that `pass_through_matcher` provides an interface for users to specify header matching criteria such that, when applicable, the OAuth flow is entirely skipped. When this occurs, only the `oauth_passthrough` metric is incremented; no cookies or request headers are modified, and no OAuth success is recorded. In summary, when the `pass_through_matcher` configuration matches, the filter should simply skip processing and leave the request untouched. --- **Commit Message:** oauth2: fix passthrough logic to avoid modifying request when skipping filter **Risk Level:** Low **Testing:** Unit test added and single page app test fixed by [envoyproxy/examples PR envoyproxy#819](envoyproxy/examples#819) **Docs Changes:** N/A **Release Notes:** Added **Platform Specific Features:** N/A --------- Signed-off-by: Gustavo Moyano <gustavo.g.moyano@gmail.com>
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.
Description
The changes introduced in envoyproxy/envoy PR #40228 and envoyproxy/examples PR #663 broke the passthrough functionality of the OAuth2 filter: OAuth2 cookies were removed for requests matching the
pass_through_matcherconfiguration. This affected setups with multiple OAuth2 filter instances using differentpass_through_matcherconfigurations, because the first matching instance removed the OAuth2 cookies--even when a passthrough was intended--impacting subsequent filters that still needed those cookies.This PR fixes the
pass_through_matcherconfiguration ofsingle-page-apptest, which started failing after fixing the passthrough behavior.