mirror of
https://github.com/rancher/steve.git
synced 2025-06-22 13:07:27 +00:00
Allow service account auth to work with Transport/WrapTransport set
This commit is contained in:
parent
1b98deb6c9
commit
e81a4e2c6e
@ -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 = ""
|
||||
|
Loading…
Reference in New Issue
Block a user