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

feature: [0.16.0] support for private plugins ASDF_GIT_USERNAME and ASDF_GIT_PASSWORD #1882

Open
m4rii0 opened this issue Feb 4, 2025 · 2 comments

Comments

@m4rii0
Copy link

m4rii0 commented Feb 4, 2025

Is your feature request related to a problem? Please describe

Before 0.16.0 (Go migration), the tool supported the installation of private plugins (hosted in a private repository), and the git client had access to it.

➜ asdf plugin add myplugin https://github.com/my-org/my-asdf-plugin
unable to clone plugin: authentication required: Repository not found.

With the migration to Go, relying on the go-git library, this feature is no longer working, since the tool is internally doing a PlainClone

_, err := git.PlainClone(r.Directory, false, &options)

and before that, with the bash implementation, the git client was relying on the .gitconfiguration file, whether you have the authentication in a git credential helper or any other sort of configuration.

Describe the proposed solution

While the go-git library does have support for authenticated calls to GitHub repositories with SSH and basic authentication (see examples folder), asdf should adapt to each case and call the go-git API differently.

While having support for loading the user's .gitconfig folder in the go-git library would be the best solution, there is no support for that, and for the git credential helpers too as they are opened to receive contributions now, see go-git/go-git#1420.

So I suggest having ASDF_GIT_USERNAME and ASDF_GIT_PASSWORD env variables, if they are present, send those credentials during the asdf plugin add and asdf plugin update commands.

Describe similar asdf features and why they are not sufficient

n/a

Describe other workarounds you've considered

I have not found any other workaround for making the plugin repository public, which is not an option right now.

@Stratus3D
Copy link
Member

Hi @m4rii0 , thanks for the detailed feature request! I'm wondering if maybe asdf should abandon go-git and use the installed git CLI client. That would allow individual users to configure their git client as needed and asdf would just use the same client. I've not tried this yet, but I think I could make any work. Any reason I should not try this? This would make version 0.16.0 work the same as 0.15.0 in this regard.

@m4rii0
Copy link
Author

m4rii0 commented Feb 4, 2025

@Stratus3D absolutely, it would work as long as the env variables that are in the shell configuration files are present while invoking the git command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants