Skip to content

fix(wolf-rbac): clear upstream identity headers when auth response omits userInfo#13696

Open
shreemaan-abhishek wants to merge 1 commit into
apache:masterfrom
shreemaan-abhishek:wolf-rbac-clear-identity-headers
Open

fix(wolf-rbac): clear upstream identity headers when auth response omits userInfo#13696
shreemaan-abhishek wants to merge 1 commit into
apache:masterfrom
shreemaan-abhishek:wolf-rbac-clear-identity-headers

Conversation

@shreemaan-abhishek

@shreemaan-abhishek shreemaan-abhishek commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

The wolf-rbac plugin injects X-UserId / X-Username / X-Nickname upstream headers from the auth server's userInfo, but only inside the if type(res.userInfo) == 'table' guard. When the access-check backend authorizes a request (HTTP 200) without returning userInfo, that block is skipped and any client-supplied X-UserId / X-Username / X-Nickname headers reach the upstream unchanged.

This aligns wolf-rbac with the other auth plugins (forward-auth, opa, openid-connect, dingtalk-auth, feishu-auth), which already clear these client-supplied identity headers unconditionally before applying the auth response. The plugin now drops the three headers before the userInfo gate, so the happy path still overwrites them from userInfo and the no-userInfo path no longer forwards client values.

Which issue(s) this PR fixes:

Fixes #

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change (no user-facing config or documented behavior changes)
  • I have verified that this change is backward compatible

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants