The GitLab client package, extsvc/gitlab, has two types, ClientProvider and Client. The former produces the latter, and the latter is associated with a specific user identity. The authz/gitlab package relies on the latter to compute permissions for a given user.
Meanwhile, the GitHub client package, extsvc/github, has only a Client type, which has a "base" token. Certain methods of Client allow specifying an override access token. These methods are used by the authz/github package to compute permissions for a given user. There are two issues with the GitHub client package:
Client methods support the override user token, meaning inconsistency in the API.We should update extsvc/github to use the ClientProvider + Client pattern used in extsvc/gitlab.
Additionally we should probably look into using https://github.com/google/go-github again.
Does anyone recall the rational for not using go-github?
It didn鈥檛 support GraphQL at the time and it was overkill for the 1 API request we needed. I have no opinion or knowledge about whether it鈥檚 a good choice now.
Beyang edit: recommended GraphQL client is https://github.com/shurcooL/githubv4
I don't think this is super relevant anymore, so closing.
Most helpful comment
It didn鈥檛 support GraphQL at the time and it was overkill for the 1 API request we needed. I have no opinion or knowledge about whether it鈥檚 a good choice now.
Beyang edit: recommended GraphQL client is https://github.com/shurcooL/githubv4