turbot / flowpipe

Flowpipe is a cloud scripting engine. Automation and workflow to connect your clouds to the people, systems and data that matters.
https://flowpipe.io
GNU Affero General Public License v3.0
383 stars 16 forks source link

Running `flowpipe mod install --git-url-mode ssh` fails when trying to use private repos as dependencies #121

Closed cbruno10 closed 11 months ago

cbruno10 commented 1 year ago
cbruno@M1P integration-github % flowpipe mod install --git-url-mode ssh
Error: Bad Request: could not retrieve version data from Git URL github.com/turbot/flowpipe-mod-github - ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
    Bad Request: could not retrieve version data from Git URL github.com/turbot/flowpipe-mod-slack - ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
    2 dependencies failed to install
cbruno10 commented 1 year ago

My install was failing because I was using RSA keys, which are deprecated for use in GitHub, but still work. After I switched to an ed25519 key, mod install worked with a private repo.

@vhadianto Is there any way to allow this command to work with RSA keys as well, since GitHub still allows use of them?

vhadianto commented 11 months ago

Do you want to try it again @cbruno10 ?

I've done some reading in go-git repo (the third party component that we used) it's similar to this https://github.com/go-git/go-git/issues/516 and also refer to https://github.com/MichaelMure/git-bug/issues/1109

But seems to imply that the underlying component (crypto) is the one that does this.

In an Ubuntu VM I created an RSA key and used the latest flowpipe:

victorhadianto@ubuntuarm:~$ flowpipe mod install --git-url-mode ssh

Installed 1 mod:

local
└── github.com/turbot/flowpipe-mod-github.git@v0.0.1-rc.2

This seems to work.

vhadianto commented 11 months ago

We're dropping the git-url-mode flag but the underlying component that does the Git pull remains the same (go-git).

vhadianto commented 11 months ago

Approached has changed, fall back to SSH if HTTPS fails. Added ability to use GitHub PAT.

Added option to use GitHub Token in this commit: https://github.com/turbot/pipe-fittings/commit/29c6c4c3906bfb6ae5a81068cb2022c0445785a6