From e81a4e2c6e68ebc0ed2871deb4c20c5348effb9c Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Wed, 9 Sep 2020 12:00:04 -0700 Subject: [PATCH] Allow service account auth to work with Transport/WrapTransport set --- pkg/proxy/proxy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 94f97919..e07cb5cf 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -33,8 +33,7 @@ func ImpersonatingHandler(prefix string, cfg *rest.Config) http.Handler { func setupUserAuth(req *http.Request, user user.Info, cfg *rest.Config) *rest.Config { for _, group := range user.GetGroups() { - if group == "system:unauthenticated" && strings.HasPrefix(req.Header.Get("Authorization"), "Bearer ") && - cfg.Transport == nil && cfg.WrapTransport == nil { + if group == "system:unauthenticated" && strings.HasPrefix(req.Header.Get("Authorization"), "Bearer ") { cfg := rest.CopyConfig(cfg) cfg.Username = "" cfg.Password = ""