From 793890c96f2c614829d3ffac02be684a40b6ad11 Mon Sep 17 00:00:00 2001 From: Dustin Collins Date: Fri, 22 Jan 2016 17:07:17 -0500 Subject: [PATCH] Pubkeys show and delete routes --- src/api.md | 4 ++-- src/pubkeys.add.md | 2 +- src/pubkeys.delete.md | 32 ++++++++++++++++++++++++++++++++ src/pubkeys.show.md | 28 ++++++++++++++++++++++++++++ transactions-4.5.txt | 3 +++ 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 src/pubkeys.delete.md create mode 100644 src/pubkeys.show.md diff --git a/src/api.md b/src/api.md index d436f8d..b5e0aba 100644 --- a/src/api.md +++ b/src/api.md @@ -99,10 +99,10 @@ Only members of the group `pubkeys-1.0/key-managers` can manage public keys. :[pubkeys.add](pubkeys.add.md) - + # Group Group A `group` represents a collection of users or groups. It is a `role` and a collection of `roles`, in RBAC terms. diff --git a/src/pubkeys.add.md b/src/pubkeys.add.md index f5651e4..4d84450 100644 --- a/src/pubkeys.add.md +++ b/src/pubkeys.add.md @@ -1,6 +1,6 @@ ## Add [/api/pubkeys/{login}] -### Add a public key for a user [POST] +### Add a key for a user [POST] Adds a new public key for an existing user. Multiple keys can be uploaded per user. diff --git a/src/pubkeys.delete.md b/src/pubkeys.delete.md new file mode 100644 index 0000000..7a899db --- /dev/null +++ b/src/pubkeys.delete.md @@ -0,0 +1,32 @@ +## Delete [/api/pubkeys/{login}/{key_name}] + +### Delete a key for a user [DELETE] + +Removes a public key for a specified user. +`key_name` is the comment placed at the end of the public key, usually +an email address. + +--- + +:[conjur_auth_header_table](partials/conjur_auth_header_table.md) + +**Request Body** + +The public key to add should be the entire request body. + +**Response** + +|Code|Description| +|----|-----------| +|204|Public key deleted for user| +|403|Permission denied| +|404|User or key not found| + ++ Parameters + + login: alice (string) - The user's login name + + key_name: alice@bigcorp.com (string) - Comment at end of SSH key to remove + ++ Request + :[conjur_auth_header_code](partials/conjur_auth_header_code.md) + ++ Response 204 diff --git a/src/pubkeys.show.md b/src/pubkeys.show.md new file mode 100644 index 0000000..2f3df6b --- /dev/null +++ b/src/pubkeys.show.md @@ -0,0 +1,28 @@ +## Show [/api/pubkeys/{login}/] + +### Show keys for a user [GET] + +Lists all public keys uploaded for a specific user. + +--- + +:[conjur_auth_header_table](partials/conjur_auth_header_table.md) + +**Response** + +|Code|Description| +|----|-----------| +|200|Public key list returned| +|403|Permission denied| + ++ Parameters + + login: alice (string) - The user's login name + ++ Request + :[conjur_auth_header_code](partials/conjur_auth_header_code.md) + ++ Response 200 (text/html;charset=utf-8) + + ``` + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFDhYPIMHAqlQghhdmEa98UrfK9HBX8AaW4aSj5sVwigy7wFMs9yjPfK/mGOV5T5g5TuSe8EQfRfX4Mp6yv40ta4ETAJti7cjoh8KwkxnKPUQmhkgWmTJRfwUwYq12yzmqFp7nZ6JNfng39TvD+L6McpFgC+O7O3IeGBHSz8PB6QE7TbvICSbOPU43d1MQpsvtbgIAM6rTC44JAPor9YoHSne1dsaNCsu4xFUXROJpD2V6eSRHw8tpN6vzxgym5ZDRMCWPhhN82xmEwPFt6qi6nN5ky0qTzPtJhsTu0dPjyJbgLfyFOu/iPTPHi9oWXuMJpwry9cMTG/wcAR8JG5lJ alice@bigcorp.com + ``` diff --git a/transactions-4.5.txt b/transactions-4.5.txt index 1fd0e46..0af686b 100644 --- a/transactions-4.5.txt +++ b/transactions-4.5.txt @@ -12,6 +12,9 @@ User > Update > Update a user record User > List/Search > List or search for users User > Search by UID > Search for users by UID number User > Show > Retrieve a user's record +Pubkeys > Add > Add a key for a user +Pubkeys > Show > Show keys for a user +Pubkeys > Delete > Delete a key for a user Group > Create > Create a new group Group > Update > Update a group record Group > List/Search > List or search for groups