From 8268c969baf4a58b97289103f7507023c819a06d Mon Sep 17 00:00:00 2001 From: runzexia Date: Sun, 28 Apr 2019 14:24:36 +0800 Subject: [PATCH] request devops api with auth info --- pkg/apigateway/caddy-plugin/authenticate/authenticate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/apigateway/caddy-plugin/authenticate/authenticate.go b/pkg/apigateway/caddy-plugin/authenticate/authenticate.go index 985759de6..03a160627 100644 --- a/pkg/apigateway/caddy-plugin/authenticate/authenticate.go +++ b/pkg/apigateway/caddy-plugin/authenticate/authenticate.go @@ -130,7 +130,9 @@ func (h Auth) InjectContext(req *http.Request, token *jwt.Token) (*http.Request, } // hard code, support jenkins auth plugin - if httpserver.Path(req.URL.Path).Matches("/kapis/jenkins.kubesphere.io") || httpserver.Path(req.URL.Path).Matches("job") { + if httpserver.Path(req.URL.Path).Matches("/kapis/jenkins.kubesphere.io") || + httpserver.Path(req.URL.Path).Matches("job") || + httpserver.Path(req.URL.Path).Matches("/kapi/devops.kubesphere.io/v1alpha2") { req.SetBasicAuth(username, token.Raw) }