token cache config

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-04-13 14:24:01 +08:00
parent 17013d3519
commit 3ce4a0d77c
8 changed files with 326 additions and 15 deletions

View File

@@ -42,9 +42,6 @@ func WithAuthentication(handler http.Handler, auth authenticator.Request) http.H
return
}
// authorization header is not required anymore in case of a successful authentication.
req.Header.Del("Authorization")
req = req.WithContext(request.WithUser(req.Context(), resp.User))
handler.ServeHTTP(w, req)
})

View File

@@ -33,6 +33,9 @@ func WithKubeAPIServer(handler http.Handler, config *rest.Config, failed proxy.E
s.Host = kubernetes.Host
s.Scheme = kubernetes.Scheme
// Do not cover k8s client authorization header
req.Header.Del("Authorization")
httpProxy := proxy.NewUpgradeAwareHandler(&s, defaultTransport, true, false, failed)
httpProxy.ServeHTTP(w, req)
return