Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.Header.Del(h)
}

// Handle X-Console-Impersonate-Groups header for multi-group impersonation
// The fetch() API doesn't support multiple headers with the same name,
// so the frontend sends a comma-separated list that we split here
if consoleGroups := r.Header.Get("X-Console-Impersonate-Groups"); consoleGroups != "" {
r.Header.Del("X-Console-Impersonate-Groups")
groups := strings.Split(consoleGroups, ",")
for _, group := range groups {
group = strings.TrimSpace(group)
if group != "" {
r.Header.Add("Impersonate-Group", group)
}
}
}

// Include `system:authenticated` when impersonating groups so that basic requests that all
// users can run like self-subject access reviews work.
if len(r.Header["Impersonate-Group"]) > 0 {
Expand Down