shreemaan-abhishek opened a new pull request, #14096:
URL: https://github.com/apache/apisix/pull/14096

   ### Description
   
   Two plugins write a configured header for the upstream, but each has a path 
where the request continues without that write, so a value the client sent 
under the same name reaches the upstream unchanged:
   
   - `jwe-decrypt` with `strict: false`: when the request has no token, 
`rewrite` returns before `forward_header` is set.
   - `forward-auth` with `allow_degradation: true`: when the auth service is 
unavailable, `access` returns before the `upstream_headers` loop runs.
   
   Changes:
   
   - `jwe-decrypt` clears `forward_header` right after reading the token, so 
only the decrypted plaintext is ever forwarded under that name.
   - `forward-auth` clears each of `upstream_headers` on the degradation path, 
matching what the normal path already does for headers missing from the auth 
response.
   - Tests for both paths (`t/plugin/jwe-decrypt.t` TEST 38-39, 
`t/plugin/forward-auth3.t` TEST 3-4).
   - `forward_header` and `upstream_headers` docs (en/zh) note that 
client-supplied values are removed.
   
   Behavior change: a client that sends `forward_header` on a `strict: false` 
route without a token, or one of `upstream_headers` while the auth service is 
down with `allow_degradation`, no longer has that header passed to the upstream.
   
   #### Which issue(s) this PR fixes:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   -->
   Fixes #
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to