request devops api with auth info

This commit is contained in:
runzexia
2019-04-28 14:24:36 +08:00
committed by zryfish
parent 57f3eed28c
commit 8268c969ba

View File

@@ -130,7 +130,9 @@ func (h Auth) InjectContext(req *http.Request, token *jwt.Token) (*http.Request,
} }
// hard code, support jenkins auth plugin // 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) req.SetBasicAuth(username, token.Raw)
} }