From 66e0539c1ed32e71c3bb8917c25b126052f61e46 Mon Sep 17 00:00:00 2001 From: Maarten de Waard <maarten@greenhost.nl> Date: Wed, 19 Jul 2017 15:05:42 +0200 Subject: [PATCH] resolve discussions --- src/api/ssh_keys_delete.c | 11 +---------- src/api/ssh_keys_put.c | 17 +++-------------- src/auxiliary.c | 2 -- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/api/ssh_keys_delete.c b/src/api/ssh_keys_delete.c index 8cb97db..9c763b8 100644 --- a/src/api/ssh_keys_delete.c +++ b/src/api/ssh_keys_delete.c @@ -1,16 +1,7 @@ /** * Callback function that deletes an SSH key from the list of keys authorised * for access to the initrd. The line will be left empty, because that keeps - * the ids if SSH keys in tact for ssh_keys_get - * - * Example output: - * {"ssh-keys":{"1":"ssh-rsa AAAAB3... example@example.com", - * "2":"ssh-rsa AAAAB3...","5":"command=\"/usr/bin/cryptops-client\" ssh-rsa - * AAAAB3... cryptops-test@greenhost"}} - * - * The indices correspond to line numbers of the authorized_keys file. - * Missing indices (like 3 and 4 in the example) arise from empty lines in the - * file; those are creted when keys are deleted. + * the ids of SSH keys intact for ssh_keys_get * * @param[in] request incoming HTTP request * @param[out] response HTTP response to the request diff --git a/src/api/ssh_keys_put.c b/src/api/ssh_keys_put.c index 8e9bec0..9bf53bd 100644 --- a/src/api/ssh_keys_put.c +++ b/src/api/ssh_keys_put.c @@ -1,18 +1,7 @@ - - /** - * Callback function that deletes an SSH key from the list of keys authorised - * for access to the initrd. The line will be left empty, because that keeps - * the ids if SSH keys in tact for ssh_keys_get - * - * Example output: - * {"ssh-keys":{"1":"ssh-rsa AAAAB3... example@example.com", - * "2":"ssh-rsa AAAAB3...","5":"command=\"/usr/bin/cryptops-client\" ssh-rsa - * AAAAB3... cryptops-test@greenhost"}} - * - * The indices correspond to line numbers of the authorized_keys file. - * Missing indices (like 3 and 4 in the example) arise from empty lines in the - * file; those are creted when keys are deleted. + * Callback function that updates an SSH key in the list of keys authorised + * for access to the initrd. Needs an ID provided in the URL and a new SSH key + * provided in the request body. * * @param[in] request incoming HTTP request * @param[out] response HTTP response to the request diff --git a/src/auxiliary.c b/src/auxiliary.c index d586e45..85cc449 100644 --- a/src/auxiliary.c +++ b/src/auxiliary.c @@ -251,8 +251,6 @@ int replace_ssh_key(int id, const char * ssh_key) return -2; } - - // Initialise with any non-EOF character char ch; int line_number = 1; -- GitLab