-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconcile ClientCreator and TransportManager #33
Comments
So I think we could consolidate on ClientCreator and pass github.client arounds as needed. On the other hand github.client is a github V3 (REST client) and some of our code is using GitHub V4 (GraphQL). Seems a bit weird to obtain a V4 client from a V3 client. |
It looks like Palantir's clientcreator adds some functionality for setting up middleware. |
Palantir's ClientCreator takes an InstallationID to create a client. We have the helper function Line 17 in aae0be5
TransportManager.Get Line 104 in aae0be5
Provides a convenient wrapper to get the InstallD for a given repository and then return the client for it. |
The code base has started using two different mechanisms for handling auth credentials.
Palantir's Client Creator
Transport Manager
ClientCreator caches clients for different repositories
TransportManager caches different http transports from which clients can then be created.
You can extract the transport from the client's returned by ClientCreator e.g.
https://github.com/google/go-github/blob/dff9dcc41c9c60c776df318d0938c1ad3dc2d2e4/github/github.go#L218
TransportManager is using
https://github.com/bradleyfalzon/ghinstallation to handle authenticating as a GitHubApp.
How does ClientCreator handle this?
Looks like its using ghinstallation as well
https://github.com/palantir/go-githubapp/blob/6c26ee49f52ddf0a2485d1c5f666b3dfda9ec8c1/githubapp/client_creator.go#L355
The text was updated successfully, but these errors were encountered: