You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "likyh (via GitHub)" <gi...@apache.org> on 2023/02/17 04:00:49 UTC

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #4435: feat: bamboo connection

likyh commented on code in PR #4435:
URL: https://github.com/apache/incubator-devlake/pull/4435#discussion_r1109280252


##########
backend/plugins/bamboo/models/connection.go:
##########
@@ -40,51 +40,45 @@ type BambooConn struct {
 	api.AccessToken `mapstructure:",squash"`
 }
 
-// this function is used to rewrite the same function of AccessToken
-func (conn *BambooConn) SetupAuthentication(request *http.Request) errors.Error {
-	request.Header.Set("Authorization", fmt.Sprintf("Bearer %v", conn.Token))
-	return nil
-}
-
 // PrepareApiClient test api and set the IsPrivateToken,version,UserId and so on.
 func (conn *BambooConn) PrepareApiClient(apiClient apihelperabstract.ApiClientAbstract) errors.Error {
 	header := http.Header{}
 	header.Set("Authorization", fmt.Sprintf("Bearer %v", conn.Token))
 
 	res, err := apiClient.Get("", nil, header)
 	if err != nil {
-		return errors.HttpStatus(500).New(fmt.Sprintf("Get failed %s", err.Error()))
+		return errors.HttpStatus(400).New(fmt.Sprintf("Get failed %s", err.Error()))

Review Comment:
    errors.BadInput.New ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org