You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "mappjzc (via GitHub)" <gi...@apache.org> on 2023/03/23 16:15:29 UTC

[GitHub] [incubator-devlake] mappjzc opened a new pull request, #4759: Gitlab token check

mappjzc opened a new pull request, #4759:
URL: https://github.com/apache/incubator-devlake/pull/4759

   ### Summary
   Add token permission check for connection test.
   
   
   ### Screenshots
   ![image](https://user-images.githubusercontent.com/2921251/227266450-eed6af40-4037-42ce-bfa5-6b29be62925c.png)
   
   


-- 
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


[GitHub] [incubator-devlake] abeizn merged pull request #4759: Gitlab token check

Posted by "abeizn (via GitHub)" <gi...@apache.org>.
abeizn merged PR #4759:
URL: https://github.com/apache/incubator-devlake/pull/4759


-- 
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


[GitHub] [incubator-devlake] abeizn commented on a diff in pull request #4759: Gitlab token check

Posted by "abeizn (via GitHub)" <gi...@apache.org>.
abeizn commented on code in PR #4759:
URL: https://github.com/apache/incubator-devlake/pull/4759#discussion_r1147370210


##########
backend/plugins/gitlab/api/connection.go:
##########
@@ -49,11 +51,24 @@ func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
 		return nil, err
 	}
 
-	_, err = api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
+	apiClient, err := api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
 	if err != nil {
 		return nil, err
 	}
 
+	// check API/read_api permissions

Review Comment:
   https://devlake.apache.org/docs/next/Configuration/GitLab
   ![image](https://user-images.githubusercontent.com/101256042/227492016-191f061a-51c8-4e52-8934-b799fd254e09.png)
   
   Does this also verify read_user and read_repository  permission?



-- 
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


[GitHub] [incubator-devlake] mappjzc commented on a diff in pull request #4759: Gitlab token check

Posted by "mappjzc (via GitHub)" <gi...@apache.org>.
mappjzc commented on code in PR #4759:
URL: https://github.com/apache/incubator-devlake/pull/4759#discussion_r1147388391


##########
backend/plugins/gitlab/api/connection.go:
##########
@@ -49,11 +51,24 @@ func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
 		return nil, err
 	}
 
-	_, err = api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
+	apiClient, err := api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
 	if err != nil {
 		return nil, err
 	}
 
+	// check API/read_api permissions

Review Comment:
   I have tried it on my GitLab.
   read_user + read_repository is not enough.
   read_api can work success.



-- 
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


[GitHub] [incubator-devlake] abeizn commented on a diff in pull request #4759: Gitlab token check

Posted by "abeizn (via GitHub)" <gi...@apache.org>.
abeizn commented on code in PR #4759:
URL: https://github.com/apache/incubator-devlake/pull/4759#discussion_r1147424176


##########
backend/plugins/gitlab/api/connection.go:
##########
@@ -49,11 +51,24 @@ func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
 		return nil, err
 	}
 
-	_, err = api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
+	apiClient, err := api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
 	if err != nil {
 		return nil, err
 	}
 
+	// check API/read_api permissions

Review Comment:
   you are right, the docs need to update



-- 
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