-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Novem supports adding ssh keys to the service for git access.
Right now this has to be done via the tui or web-app, but it's possible to do using the api. We should add a new utility function:
--add-ssh-key
That takes an optional "key_name" as input parameter (uses lowercase computer hostname as default).
It should read the key from standard in.
To create the key it needs to first check if the key name already exists in /v1/admin/keys and if it exists inform the user that the key name already exist and that they must pick a different id (supplied as an argument).
If the key does not exist, it should create the key id with a PUT to /v1/admin/keys/:keyid and then write the content of the key with a POST to /v1/admin/keys/:keyid/key.
It should then update (POST) the /v1/admin/keys/:keyid/name with a name that is the hostname of the computer and /v1/admin/keys/:keyid/summary with a short explanation ($hostname key created with novem cli vxxx)