Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.
SSH API
Source: daemon/proto/hostcraft/v1/ssh.proto
SSHService
Section titled “SSHService”SSHService manages an account's SFTP access and authorized keys. REST: /api/v1/accounts/{account_id}/ssh-keys and /ssh-access.
| Method | REST route | Permission | Streaming |
|---|---|---|---|
GetSSHState |
GET /api/v1/accounts/{account_id}/ssh-keys |
SSHKeyRead |
unary |
AddSSHKey |
POST /api/v1/accounts/{account_id}/ssh-keys |
SSHKeyCreate |
unary |
ImportSSHKeys |
POST /api/v1/accounts/{account_id}/ssh-keys/import |
SSHKeyCreate |
unary |
RemoveSSHKey |
DELETE /api/v1/accounts/{account_id}/ssh-keys/{fingerprint} |
SSHKeyDelete |
unary |
SetSSHAccess |
PATCH /api/v1/accounts/{account_id}/ssh-access |
SSHAccessUpdate |
unary |
GetSSHState
Section titled “GetSSHState”/hostcraft.v1.SSHService/GetSSHState
- Request: GetSSHStateRequest
- Response: SSHState
AddSSHKey
Section titled “AddSSHKey”/hostcraft.v1.SSHService/AddSSHKey
- Request: AddSSHKeyRequest
- Response: SSHState
ImportSSHKeys
Section titled “ImportSSHKeys”ImportSSHKeys adds every valid key from an authorized_keys file.
/hostcraft.v1.SSHService/ImportSSHKeys
- Request: ImportSSHKeysRequest
- Response: SSHState
RemoveSSHKey
Section titled “RemoveSSHKey”/hostcraft.v1.SSHService/RemoveSSHKey
- Request: RemoveSSHKeyRequest
- Response: Empty
SetSSHAccess
Section titled “SetSSHAccess”/hostcraft.v1.SSHService/SetSSHAccess
- Request: SetSSHAccessRequest
- Response: SSHState
Messages
Section titled “Messages”AddSSHKeyRequest
Section titled “AddSSHKeyRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
public_key |
string |
2 | - |
Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.
No fields.
GetSSHStateRequest
Section titled “GetSSHStateRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
ImportSSHKeysRequest
Section titled “ImportSSHKeysRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
authorized_keys |
string |
2 | - |
RemoveSSHKeyRequest
Section titled “RemoveSSHKeyRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
fingerprint |
string |
2 | - |
SSHAccess
Section titled “SSHAccess”| Field | Type | Number | Description |
|---|---|---|---|
managed |
bool |
1 | - |
enabled |
bool |
2 | - |
suspended |
bool |
3 | - |
username |
string |
4 | - |
host |
string |
5 | - |
port |
int64 |
6 | - |
mode |
string |
7 | sftp |
SSHKey
Section titled “SSHKey”| Field | Type | Number | Description |
|---|---|---|---|
fingerprint |
string |
1 | - |
sha256 |
string |
2 | - |
type |
string |
3 | - |
comment |
string |
4 | - |
public_key |
string |
5 | - |
added_at |
google.protobuf.Timestamp |
6 | - |
SSHState
Section titled “SSHState”SSHState is the account's keys and access; ImportSSHKeys also reports how many keys were added and which lines were invalid.
| Field | Type | Number | Description |
|---|---|---|---|
keys |
repeated SSHKey |
1 | - |
access |
SSHAccess |
2 | - |
added |
int64 |
3 | - |
invalid |
int64 |
4 | lines that were not valid keys |
SetSSHAccessRequest
Section titled “SetSSHAccessRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
enabled |
optional bool |
2 | - |