klesh commented on PR #5077:
URL: 
https://github.com/apache/incubator-devlake/pull/5077#issuecomment-1534357158

   Hi, @mkmarek , Thank you so much for the contribution.
   Can you also provide the `permissions` required for the Github App so I can 
test it locally?
   
   The current implementation uses `if` in many places for the `MultiAuth` to 
work which is not ideal IMO,
   Ideally, the only file that we need to modify would be 
`backend/plugins/github/models/connection.go` and other dirs/files like 
`backend/plugins/github/api` and `backend/plugins/github/impl` should be left 
intact.
    
   Would you mind taking a look at `jira` implementation`? 
https://github.com/apache/incubator-devlake/blob/main/backend/plugins/jira/models/connection.go#L42
   The idea is to delegate authentication via the `MultiAuth` struct and 
isolate the authentication from other places.
   
   To my understanding, the Github App Authentication works pretty much like 
the `feishu` plugin, I suggest we do it like this:
   1. Alias the `helper.AppKey` as ` GithubAppKey` and implement the 
`GithubAppKey.SetupAuthentication` for each request and/or 
`GithubConnection.PrepareApiClient` if some kind of global initialization is 
required. (ps: an `if` is needed here or maybe we could delegate the logic to 
the  `Authenticator` level as well, it is an open subject that we can discuss)
   2. Embed the `helper.MultiAuth` and `GithubAppKey` into `GithubConn` just 
like how `jira` did it.
   3. Revert the changes to the `api` and the `impl` folders.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to