Skip to content
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

Use credentials store instead of extraheader #1754

Closed
wants to merge 1 commit into from

Conversation

lehmanju
Copy link

@lehmanju lehmanju commented May 27, 2024

Since git's extraheader does not support different tokens and has some issue with multiple headers, this PR changes the behavior to use credential.*.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 to store and creates a temporary file to which the credentials are written. This option replaces the use of extraheader 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 setting useHttpPath 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.

@lehmanju lehmanju requested a review from a team as a code owner May 27, 2024 18:13
Copy link

@Mapuppy09 Mapuppy09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok , approve changes

@lehmanju lehmanju marked this pull request as draft May 30, 2024 08:34
@lehmanju lehmanju marked this pull request as ready for review June 10, 2024 16:18
@lehmanju
Copy link
Author

This is now ready for a first review. I will cleanup the history afterwards.

@lehmanju
Copy link
Author

@ericsciple sorry for tagging, but I believe the majority of the code has been written by you. Would you care for a review?

@lehmanju lehmanju closed this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants