I am trying to use the Springloops API to create a new deployment server but am having difficulty passing the key.
When I try the full key:
curl --header "Accept: application/json" --header "Content-type: application/json" \
--header "Authorization: Basic a2V2aW5AdGh*****************************Mzg1eGlrYnRUTQ==" \
--data-binary '{"name": "testDeploy1",
"role": "DEVELOPMENT",
"projectPathInRepository": "/",
"protocol": "SFTP_KEY",
"branch": "develop",
"isAutoDeployment": false,
"host": "148.251.124.123",
"port": "22",
"path": "/home/httpd/develop.example.co.uk",
"isPathAbsolute": true,
"privateKey": "-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEAm+hBiQ4W88nAG+ri0+ogfvN/ZF0NV7VTyl/+OcsWrBFZFM0A
1XMQJaQnJguWH+iHtpNvghf+QQlP+ln9ndk9W8OEGrSi75q2WWE6O53wz3+vS1Yj
ium5gFeSOuAQGRGkwqHsMI20trkNSgJAUhaqiVaG+SONRaYIDJfMO2+ZrRqy/oIB
****************************************************************
****************************************************************
... snip ...
****************************************************************
****************************************************************
rlOW7b39DrojA98xr6ltAoGAChUFYB7L5C1032DOd5QmP7rqKggugrwT4qC0Sx8C
zFeB/hDPHRPKfhE2tpJRiR6O8cOulEqoTWKNJAHspfHozv5YuZ5sCYsyQk+FpX9p
gDnWky0LTslb3np7mLH5cHwQmjTCupOVR8S9ydqtDWBaPyUlfqEl9M97eaNKS0wg
k50CgYB4aZmf3vEoIUWxwVvVhLEdJvxjQFeMjjr4aUBFglOY3sZjrFzdkEBrHNYm
Rl3zAUggdobo7UfEZpBAsUUFufaym8uPLrhVYssL1qOAvbc57i+QAabemuIgX40h
zr/dIDiWam+RafEDoLnnZhq9nhVcBa98qSFj/Yf/SBH+3NwlZg==
-----END RSA PRIVATE KEY-----"}' \
https://example.springloops.io/api/project/180346/servers
I get the response
{"success":false,"code":400,"message":"Please provide server name"}
When I do the following CURL with an obviously bogus ssh key:
curl --header "Accept: application/json" --header "Content-type: application/json" \
--header "Authorization: Basic a2V2a****************zg1eGlrYnRUTQ==" \
--data-binary '{"name": "testDeploy1",
"role": "DEVELOPMENT",
"projectPathInRepository": "/",
"protocol": "SFTP_KEY",
"branch": "develop",
"isAutoDeployment": false,
"host": "148.251.124.123",
"port": "22",
"path": "/home/httpd/develop.example.co.uk",
"isPathAbsolute": true,
"privateKey": "PrivateKeyHere"}' \
https://example.springloops.io/api/project/180346/servers
I get the response
{"success":false,"code":0,"message":"Error while connecting to the server: The key format is not a supported format"}
Which is what I would expect. If I go back to the bogus key but add a second line
curl --header "Accept: application/json" --header "Content-type: application/json" \
--header "Authorization: Basic a2V2a****************zg1eGlrYnRUTQ==" \
--data-binary '{"name": "testDeploy1",
"role": "DEVELOPMENT",
"projectPathInRepository": "/",
"protocol": "SFTP_KEY",
"branch": "develop",
"isAutoDeployment": false,
"host": "148.251.124.123",
"port": "22",
"path": "/home/httpd/develop.example.co.uk",
"isPathAbsolute": true,
"privateKey": "PrivateKeyHere
SecondLine"}' \
https://example.springloops.io/api/project/180346/servers
I get the same failed response again:
{"success":false,"code":400,"message":"Please provide server name"}
So it appears to be something with the multi-line parameter in the json.
Using RequestBin, It appears that the data is being passed OK - it is being received as
{"name": "testDeploy1",
"role": "DEVELOPMENT",
"projectPathInRepository": "/",
"protocol": "SFTP_KEY",
"branch": "develop",
"isAutoDeployment": false,
"host": "148.251.124.123",
"port": "22",
"path": "/home/httpd/develop.example.co.uk",
"isPathAbsolute": true,
"privateKey": "-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEAm+hBiQ4W88nAG+ri0+ogfvN/ZF0NV7VTyl/+OcsWrBFZFM0A
1XMQJaQnJguWH+iHtpNvghf+QQlP+ln9ndk9W8OEGrSi75q2WWE6O53wz3+vS1Yj
ium5gFeSOuAQGRGkwqHsMI20trkNSgJAUhaqiVaG+SONRaYIDJfMO2+ZrRqy/oIB
****************************************************************
****************************************************************
****************************************************************
****************************************************************
rlOW7b39DrojA98xr6ltAoGAChUFYB7L5C1032DOd5QmP7rqKggugrwT4qC0Sx8C
zFeB/hDPHRPKfhE2tpJRiR6O8cOulEqoTWKNJAHspfHozv5YuZ5sCYsyQk+FpX9p
gDnWky0LTslb3np7mLH5cHwQmjTCupOVR8S9ydqtDWBaPyUlfqEl9M97eaNKS0wg
k50CgYB4aZmf3vEoIUWxwVvVhLEdJvxjQFeMjjr4aUBFglOY3sZjrFzdkEBrHNYm
Rl3zAUggdobo7UfEZpBAsUUFufaym8uPLrhVYssL1qOAvbc57i+QAabemuIgX40h
zr/dIDiWam+RafEDoLnnZhq9nhVcBa98qSFj/Yf/SBH+3NwlZg==
-----END RSA PRIVATE KEY-----"}
Has anybody had any success with this and can shed some light on it?