File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,20 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
123
123
r .Header .Del (h )
124
124
}
125
125
126
+ // Handle X-Console-Impersonate-Groups header for multi-group impersonation
127
+ // The fetch() API doesn't support multiple headers with the same name,
128
+ // so the frontend sends a comma-separated list that we split here
129
+ if consoleGroups := r .Header .Get ("X-Console-Impersonate-Groups" ); consoleGroups != "" {
130
+ r .Header .Del ("X-Console-Impersonate-Groups" )
131
+ groups := strings .Split (consoleGroups , "," )
132
+ for _ , group := range groups {
133
+ group = strings .TrimSpace (group )
134
+ if group != "" {
135
+ r .Header .Add ("Impersonate-Group" , group )
136
+ }
137
+ }
138
+ }
139
+
126
140
// Include `system:authenticated` when impersonating groups so that basic requests that all
127
141
// users can run like self-subject access reviews work.
128
142
if len (r .Header ["Impersonate-Group" ]) > 0 {
You can’t perform that action at this time.
0 commit comments