GitLab OAuth Account Map #179
Open
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.
This PR adds a mapping between two accounts: a user from an OAuth provider and a user in a gitlab instance.
The goal is to link a contributor on github.com to their corresponding account on the destination gitlab instance. By adding github as an OAuth provider, we can verify that both identities belong to the same person. When a push event comes in from github, the mapper checks whether the commit author exists as a gitlab user. If they do, the commit can be pushed to the destination repository.
To use this feature, the following environment variables must be set:
HC_ACCOUNT_MAP_TYPE="gitlab_oauth"HC_GL_OAUTH_ACCESS_TOKEN-- a personal access token created by an admin of the Gitlab instance withread_apiscope (to query the list of users on the instance)HC_GL_OAUTH_PROVIDER="github"-- have only tested this with Github so far, but I imagine that Hubcast users may want to link between two Gitlab instances.--
This has been tested on gitlab.staging.spack.io.