0

I'm trying to use the Stash REST API. We use SSH to authenticate.

curl -X GET -u me@example.com: --key ~/.ssh/id_rsa \
  'https://stash.corp.netflix.com/rest/api/1.0/projects/MY_PROJ/repos/MY_REPO/commits'

is returning:

{"errors":[{"context":null,"message":"Authentication failed. Please check your credentials and try again.","exceptionName":null}]}

and

curl -X GET -u me@example.com: --key ~/.ssh/id_rsa \
  'ssh://stash.corp.netflix.com/rest/api/1.0/projects/MY_PROJ/repos/MY_REPO/commits'

is erroring with:

curl: (1) Protocol ssh not supported or disabled in libcurl

What is the right incantation to use Stash's REST API with SSH authentication?

Noel Yap
  • 18,822
  • 21
  • 92
  • 144
  • 2
    REST is a technique for using the http protocol. How would it even work through a raw ssh connection? – Kenster Sep 10 '15 at 17:24

2 Answers2

3

Per Kenster's comment, the only way to access the REST API is via HTTP(S). SSH only provides access to the git hosting layer.

You can use Basic auth or OAuth to access REST.

Rog
  • 4,075
  • 2
  • 24
  • 35
0

This work with using ~/.netrc file with the ff format :

machine example.com
login daniel
password qwerty

refer to : https://ec.haxx.se/usingcurl/usingcurl-netrc

japzio
  • 11
  • 4