fix(dingtalk-auth): clear client-supplied X-Userinfo before authentication#13491
Merged
shreemaan-abhishek merged 1 commit intoJun 10, 2026
Conversation
…ation The dingtalk-auth plugin populates the X-Userinfo request header from the verified session, but only when set_userinfo_header is true. When it is false, a client-supplied X-Userinfo was left untouched and forwarded to the upstream. Clear the header unconditionally at the start of the rewrite phase, matching the sibling feishu-auth plugin, so the upstream only ever sees an X-Userinfo set by APISIX. Adds a regression test.
membphis
approved these changes
Jun 10, 2026
nic-6443
approved these changes
Jun 10, 2026
AlinsRan
approved these changes
Jun 10, 2026
wistefan
pushed a commit
to wistefan/apisix
that referenced
this pull request
Jun 16, 2026
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
dingtalk-authplugin sets theX-Userinforequest header from theverified session, but only when
set_userinfo_headeristrue. When it isfalse, a client-suppliedX-Userinfoheader was left untouched andforwarded to the upstream as-is.
This aligns
dingtalk-authwith the siblingfeishu-authplugin, whichalready clears
X-Userinfounconditionally at the start of itsrewritephase. The header is now always cleared first, so the upstream only ever
receives an
X-Userinfovalue set by APISIX (or none, whenset_userinfo_headerisfalse).A regression test is added covering both
set_userinfo_headersettings.Which issue(s) this PR fixes:
Fixes #
Checklist