From f6ab0a73415e78c5394304958f3729b19a1a1e7c Mon Sep 17 00:00:00 2001 From: kostas-kou Date: Mon, 14 Oct 2024 17:40:52 +0200 Subject: [PATCH] Update api readme --- sda/cmd/api/api.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sda/cmd/api/api.md b/sda/cmd/api/api.md index 80854d83a..45f7dee6d 100644 --- a/sda/cmd/api/api.md +++ b/sda/cmd/api/api.md @@ -119,6 +119,24 @@ Admin endpoints are only available to a set of whitelisted users specified in th - `401` Token user is not in the list of admins. - `500` Internal error due to DB failure. +- `/key/hashed` + - accepts `POST` requests with the hex hash of the key and its description + - registers the key hash in the database. + + - Error codes + - `200` Query execute ok. + - `400` Error due to bad payload. + - `401` Token user is not in the list of admins. + - `409` Key hash already exists in the database. + - `500` Internal error due to DB failures. + + Example: + + ```bash + curl -H "Authorization: Bearer $token" -H "Content-Type: application/json" -X POST -d '{"hash": "key-hex-hash", "description": "this is the key description"}' https://HOSTNAME/kes/hashed + ``` + + #### Configure Admin users The users that should have administrative access can be set in two ways: