stormcat24 / protodep

Collect necessary .proto files (Protocol Buffers IDL) and manage dependencies
Apache License 2.0
303 stars 57 forks source link

Cloning via HTTPS fails with 'ssh: handshake failed' #45

Closed n0v1 closed 3 years ago

n0v1 commented 4 years ago

I'm not sure whether I'm interpreting the code right, but it looks like protodep would support cloning of public repositories via HTTPS when it does not find a private ssh key in the users home directory. So I renamed id_rsa to id_rsa.bak and tried it with the following protodep.toml:

proto_outdir = "./protodeps"

[[dependencies]]
  target = "github.com/googleapis/api-common-protos"
  branch = "master"
  revision = "fd62e4d97ca6829b9166ae86bc6429574ff4e5db"
  path = "google/api"

Running protodep up --force then fails with this output:

[INFO] force update = true
[INFO] cleanup cache = false
[INFO] identity file = id_rsa
[INFO] use HTTP/HTTPS protocol
[INFO] Getting github.com/googleapis/api-common-protos ��Error: fetch repository is failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey] no supported methods remain

As I side note, I think it would make sense to allow to explicitely specify the desired protocol in protodep.toml. E.g. like this:

[[dependencies]]
  target = "https://github.com/googleapis/api-common-protos"

[[dependencies]]
  target = "ssh://github.com/googleapis/api-common-protos"
ackintosh commented 4 years ago

[[dependencies]] target = "https://github.com/googleapis/api-common-protos"

That seems good but I think that's little hard to implement because which AuthProvider we use is determined here.

I would suggest a CLI flag to clone dependencies via HTTPS instead:

$ protodep up --use-https
$ protodep up -u
stormcat24 commented 3 years ago

@n0v1 @ackintosh

I'm sorry to have kept you waiting. This feature was released as 0.1.0. 🙏

ackintosh commented 3 years ago

Thanks for the release. ✨

n0v1 commented 3 years ago

Thank you @stormcat24! Much appreciated!