support access tokens using github apps #1015
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
relates and maybe closes #418
This implementation uses ghinstallation as suggested by go-github.
When
gh-app-integration-id
andgh-app-private-key-path
are present the ghinstallation Transport will be used as wrapper for http calls. The event parser needs access to the (originally in go-oauth called TokenSource) to retrieve an access token for cloning the repository for example. Read more: https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installationThis is more of an example and proof of concept. Tested it so far a little bit locally. Feedback would be much appreciated!
Todo:
Some clarification on wording: The App Integration equals the App ID. This points to the Github App. The Installation ID points to the installation within the Github Account or Organization. This setup will only support already authorized installations and requires the Installation ID (once App is authorized) to be present.