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

Support Basic Auth authentication for generic Git provider #590

Open
talpa-robin opened this issue Nov 26, 2024 · 3 comments
Open

Support Basic Auth authentication for generic Git provider #590

talpa-robin opened this issue Nov 26, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@talpa-robin
Copy link

Is your feature request related to a problem? Please describe.
We have created our own Powerpipe Mod in a private GitLab repository. Unfortunately it seems like right now authentication to mod repositories (when installing via Powerpipe) only supports the way how GitHub does it (https://github.com/turbot/pipe-fittings/blob/d7decaf1e82d8538970cc7d7821d5a8f1c3994d4/modinstaller/git.go#L86-L104), i.e. with the token as username or token as password and "x-access-token" as the username.

Describe the solution you'd like
I'd like a way where I'm able to define the basic auth credentials freely, so that I can make GitLab authentication work. In GitLab for example the username is "gitlab-ci-token" and the password is a token provided via $CI_JOB_TOKEN. Bonus points for being able to configure the credentials for each host, similar to how .git-credentials does it (https://git-scm.com/docs/gitcredentials).

Describe alternatives you've considered
I've tried using this style of repo HTTPS urls https://username:[email protected], it didn't work (I guess URL parsing fails). I've tried setting credentials via the .git-credentials file $HOME and hoped that the used git SDK would implicitly look for credentials there - unfortunately not. My fallback scenario now was doing a git clone beforehand and then pointing Powerpipe to the local folder, which is not optimal.

@talpa-robin talpa-robin added the enhancement New feature or request label Nov 26, 2024
@pskrbasu
Copy link
Collaborator

Hey @talpa-robin, thanks for raising this issue. This would be a great enhancement, but currently, we don't have plans to support this yet. But surely, this would be a great addition. If you're interested in working on it, please go ahead (we love user contributions).

@talpa-robin
Copy link
Author

Hey @pskrbasu, sure, could try that. Doesn't seem to be too complicated (at least supporting basic auth in the GitUrl). It seems to be a change in the https://github.com/turbot/pipe-fittings/blob/develop/modinstaller though. Any documentation of advice on how to test changes to the pipe-fitting directly with powerpipe?

@pskrbasu
Copy link
Collaborator

@talpa-robin Apologies for the delay(I was out on vacation). Please take a look at the Developing section. You will need to add a replace in your powerpipe go.mod file that directs it to your local pipe-fittings repo changes, to test the local pipe-fitings changes.

Let me know if you need any other help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants