SSH keys allow you to deploy their applications and to build encrypted tunnels
to the application databases (command db-tunnel
of our CLI
Tool).
Keys attributes
field | type | description |
---|---|---|
id | string | unique ID of the key |
name | string | Given name to the key |
content | string | Raw content of the SSH public key |
Example object:
{
"id" : "54dcde4a54636101231a0000",
"name" : "Office Laptop",
"content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmlEXHPj43jNzIiFbFx0NlcZpsFQZUC4paVoDf1/VXeA4P5ld5YT5O4PQEwvx/V8HzQit0sXRgUSFcKgGlAs9b0ea/nzxov8b3kc+Z5Ak1aRSkXKYE30xW9ALag9Pdf1ejzUXMY3X4bltEsyx7wV5i1hkKzQPHrH4SjhcGv+ILAg4J9KDfyqQ2QmKzVA+Esbmg3RE0IGbZIoNBxBYbNejcaw8+lX7nLsqAP8fZ+dgFP3JYsOYuTibtM5s09Gw7c3oXLrRm6F5G/Au6HYqlNYEKUYgZ2UmXox2vK1ljOZYzcOGj9kGqJ5DQgn88cVPqbA73vAYKGY6WcZf2X+3JOTct example-user@scalingo.com"
}
GET https://auth.scalingo.com/v1/keys
Return the list of all the public keys which are able to connect to the platform.
Example request
curl -H 'Accept: application/json' -H 'Content-Type: application/json' \
-H "Authorization: Bearer $BEARER_TOKEN" \
-X GET https://auth.scalingo.com/v1/keys
Returns 200 OK
{
"keys" : [
{
"id" : "54dcde4a54636101231a0000",
"name" : "Office Laptop",
"content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmlEXHPj43jNzIiFbFx0NlcZpsFQZUC4paVoDf1/VXeA4P5ld5YT5O4PQEwvx/V8HzQit0sXRgUSFcKgGlAs9b0ea/nzxov8b3kc+Z5Ak1aRSkXKYE30xW9ALag9Pdf1ejzUXMY3X4bltEsyx7wV5i1hkKzQPHrH4SjhcGv+ILAg4J9KDfyqQ2QmKzVA+Esbmg3RE0IGbZIoNBxBYbNejcaw8+lX7nLsqAP8fZ+dgFP3JYsOYuTibtM5s09Gw7c3oXLrRm6F5G/Au6HYqlNYEKUYgZ2UmXox2vK1ljOZYzcOGj9kGqJ5DQgn88cVPqbA73vAYKGY6WcZf2X+3JOTct example-user@scalingo.com"
}, {
"id" : "54dcde4a54a36131231a0001",
"name" : "Continuous Integration",
"content" : "<Public SSH Key>"
}
]
}
GET https://auth.scalingo.com/v1/keys/[:key_id]
Return a given public ssh key.
Example request
curl -H 'Accept: application/json' -H 'Content-Type: application/json' \
-H "Authorization: Bearer $BEARER_TOKEN" \
-X GET https://auth.scalingo.com/v1/keys/54dcde4a54636101231a0000
Returns 200 OK
{
"key" : {
"id" : "54dcde4a54636101231a0000",
"name" : "Office Laptop",
"content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmlEXHPj43jNzIiFbFx0NlcZpsFQZUC4paVoDf1/VXeA4P5ld5YT5O4PQEwvx/V8HzQit0sXRgUSFcKgGlAs9b0ea/nzxov8b3kc+Z5Ak1aRSkXKYE30xW9ALag9Pdf1ejzUXMY3X4bltEsyx7wV5i1hkKzQPHrH4SjhcGv+ILAg4J9KDfyqQ2QmKzVA+Esbmg3RE0IGbZIoNBxBYbNejcaw8+lX7nLsqAP8fZ+dgFP3JYsOYuTibtM5s09Gw7c3oXLrRm6F5G/Au6HYqlNYEKUYgZ2UmXox2vK1ljOZYzcOGj9kGqJ5DQgn88cVPqbA73vAYKGY6WcZf2X+3JOTct example-user@scalingo.com"
}
}
POST https://auth.scalingo.com/v1/keys
Allow a new SSH key pair to deploy applications
You can also import your SSH keys from a SCM platform like
GitHub
andGitLab
, more informations on this page.
key.name
: Name of the key you want to addkey.content
: Public SSH key content (i.e. content of ~/.ssh/id_rsa.pub
)Example request
curl -H 'Accept: application/json' -H 'Content-Type: application/json' \
-H "Authorization: Bearer $BEARER_TOKEN" \
-X POST https://auth.scalingo.com/v1/keys -d \
'{
"key" : {
"name" : "Office Laptop",
"content" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmlEXHPj43jNzIiFbFx0NlcZpsFQZUC4paVoDf1/VXeA4P5ld5YT5O4PQEwvx/V8HzQit0sXRgUSFcKgGlAs9b0ea/nzxov8b3kc+Z5Ak1aRSkXKYE30xW9ALag9Pdf1ejzUXMY3X4bltEsyx7wV5i1hkKzQPHrH4SjhcGv+ILAg4J9KDfyqQ2QmKzVA+Esbmg3RE0IGbZIoNBxBYbNejcaw8+lX7nLsqAP8fZ+dgFP3JYsOYuTibtM5s09Gw7c3oXLrRm6F5G/Au6HYqlNYEKUYgZ2UmXox2vK1ljOZYzcOGj9kGqJ5DQgn88cVPqbA73vAYKGY6WcZf2X+3JOTct example-user@scalingo.com"
}
}'
Returns 201 Created
{
"key" : {
"id" : "54dcde4a54636101231a0000",
"name" : "Office Laptop",
"content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmlEXHPj43jNzIiFbFx0NlcZpsFQZUC4paVoDf1/VXeA4P5ld5YT5O4PQEwvx/V8HzQit0sXRgUSFcKgGlAs9b0ea/nzxov8b3kc+Z5Ak1aRSkXKYE30xW9ALag9Pdf1ejzUXMY3X4bltEsyx7wV5i1hkKzQPHrH4SjhcGv+ILAg4J9KDfyqQ2QmKzVA+Esbmg3RE0IGbZIoNBxBYbNejcaw8+lX7nLsqAP8fZ+dgFP3JYsOYuTibtM5s09Gw7c3oXLrRm6F5G/Au6HYqlNYEKUYgZ2UmXox2vK1ljOZYzcOGj9kGqJ5DQgn88cVPqbA73vAYKGY6WcZf2X+3JOTct example-user@scalingo.com"
}
}
DELETE https://auth.scalingo.com/v1/keys/[:key_id]
The modification will take effect immediately, the usage of this key will result in ‘Unauthorized’ errors.
Example request
curl -H 'Accept: application/json' -H 'Content-Type: application/json' \
-H "Authorization: Bearer $BEARER_TOKEN" \
-X DELETE https://auth.scalingo.com/v1/keys/54dcde4a54636101231a0000
Returns 204 No Content