diff --git a/pkg/router/metrics/metrics.go b/pkg/router/metrics/metrics.go index eebda71186e5..d2256bf7c985 100644 --- a/pkg/router/metrics/metrics.go +++ b/pkg/router/metrics/metrics.go @@ -51,6 +51,7 @@ func (l Listener) handler() http.Handler { func (l Listener) authorizeHandler(protected http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + fmt.Printf("#### 1a\n") if len(l.Username) > 0 || len(l.Password) > 0 { if u, p, ok := req.BasicAuth(); ok { if u == l.Username && p == l.Password { @@ -62,14 +63,18 @@ func (l Listener) authorizeHandler(protected http.Handler) http.Handler { } } + fmt.Printf("#### 1b\n") user, ok, err := l.Authenticator.AuthenticateRequest(req) if !ok || err != nil { + fmt.Printf("#### 1c\n") // older routers will not have permission to check token access review, so treat this // as an authorization denied if so if !ok || errors.IsUnauthorized(err) { + fmt.Printf("#### 1d %v\n", err) glog.V(5).Infof("Unable to authenticate: %v", err) http.Error(w, "Unable to authenticate due to an error", http.StatusUnauthorized) } else { + fmt.Printf("#### 1e %v\n", err) glog.V(3).Infof("Unable to authenticate: %v", err) http.Error(w, "Unable to authenticate due to an error", http.StatusInternalServerError) } @@ -99,10 +104,13 @@ func (l Listener) authorizeHandler(protected http.Handler) http.Handler { scopedRecord.User = user authorized, reason, err := l.Authorizer.Authorize(scopedRecord) if authorized != authorizer.DecisionAllow || err != nil { + fmt.Printf("#### 1f\n") if !ok || errors.IsUnauthorized(err) { + fmt.Printf("#### 1g %v\n", err) glog.V(5).Infof("Unable to authorize: %v", err) http.Error(w, fmt.Sprintf("Forbidden: %s", reason), http.StatusForbidden) } else { + fmt.Printf("#### 1h %v\n", err) glog.V(3).Infof("Unable to authorize: %v", err) http.Error(w, "Unable to authorize the user due to an error", http.StatusInternalServerError) } diff --git a/test/extended/util/test.go b/test/extended/util/test.go index 19530eb96171..41f3918d3d06 100644 --- a/test/extended/util/test.go +++ b/test/extended/util/test.go @@ -260,9 +260,6 @@ var ( // these broke in the rebase, but everything else is working `should function for intra-pod communication`, `should function for node-pod communication`, - // consistent 500 errors - "should expose prometheus metrics for a route", - "should expose the profiling endpoints", // super flaky "should only deploy the last deployment",