feat: add GitHub Apps authentication support - #484
Open
skroll wants to merge 1 commit into
Open
Conversation
|
|
skroll
force-pushed
the
feat/github-app-auth
branch
from
August 25, 2026 13:55
d5a2175 to
af33826
Compare
Enable the git resource to authenticate as a GitHub App in situations where the CI does not act as a user, but as a GitHub App installation.
skroll
force-pushed
the
feat/github-app-auth
branch
from
August 25, 2026 13:58
af33826 to
f74aec1
Compare
Member
|
Thanks for the PR! I've put it into my PR backlog. Got a lot on my plate so might be a while until I review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add GitHub Apps authentication support for situations where Concourse is not acting on behalf of a user, but on behalf of a GitHub App installation. GitHub Apps are a way for a non-user to be able to interact with a GitHub or GitHub Enterprise server. In particular, this is useful for Enterprise deployments where all human users are authenticated by SSO, and creating a machine user is not possible, or not permissible.
Inspiration for this work is from PR #459, which seems to have been abandoned.
Changes
setup_github_app_credentialsand supporting functions, which handles setting a git credential helper for the specified endpoint, using a generated JWT exchanged for an app installation access token.Features
githubproxy.fjygbaifeng.eu.organd non-githubproxy.fjygbaifeng.eu.orgrepositories, automatically deriving the API endpoint from thesource.uri, such as instances when GitHub Enterprise is hosted on theghe.comdomain.Notes
This functionality is useful for me since our company deployment of GitHub enterprise has all users authenticated via SSO, and so creating a bot user is not possible. Our current implementation has a Concourse job running every 5 minutes that generates access tokens and then updates our Vault instance with the tokens, however this means every team has the same credentials for the most part, and I reducing their scope without ballooning our access token job would be beneficial.
I know this one is a hefty change, and I did my best to make the new functions as logical as possible. I made sure the 2
curlcalls are wrapped in a function, so they can be mocked out in the test suite. The biggest change here is the unit test code, since I did everything I could to make sure that the code behaves as it should, and handle the edge cases.Any and all suggestions would be welcome, I'm willing to make any adjustments.