Use credentials store instead of extraheader #1754
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.
Since git's
extraheader
does not support different tokens and has some issue with multiple headers, this PR changes the behavior to usecredential.*.helper
.My use case is cloning a repository which has a lot of private submodules from different organizations. Instead of creating a machine user that has access to all organizations I want to use a Github App for that. However, each Github App installation can only see the repositories of its own organization. With multiple organizations, multiple app installations are required, each using a different token.
My solution sets
credential.helper
tostore
and creates a temporary file to which the credentials are written. This option replaces the use ofextraheader
and results in only one authentication header per request.Additionally, a new option is provided to specify a custom credential helper via
custom-credential-helper
. This setting sets a custom command as git credential helper and can be anything. The settinguseHttpPath
to match against the path of a URL is set to true and the original credential store is used as fallback helper. However, it might be desirable to disable the default helper altogether.Should
fix #162
fix #415
I am open for suggestions.