From 2a7e83457afe1c21bf5564df9423a1c3c8df3acf Mon Sep 17 00:00:00 2001 From: Daan Rosendal Date: Fri, 1 Dec 2023 16:12:03 +0100 Subject: [PATCH] feat(openapi): create endpoints to get sharing users (#429) Adds two endpoints: - fetch who shared workflows with the user - fetch who the user shared workflows with Closes reanahub/reana-server#648 and reanahub/reana-server#649 --- .../openapi_specifications/reana_server.json | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/reana_commons/openapi_specifications/reana_server.json b/reana_commons/openapi_specifications/reana_server.json index 79658d7c..cbd02a41 100644 --- a/reana_commons/openapi_specifications/reana_server.json +++ b/reana_commons/openapi_specifications/reana_server.json @@ -1242,6 +1242,216 @@ "summary": "Requests a new access token for the authenticated user." } }, + "/api/users/shared-with-you": { + "get": { + "description": "This resource provides information about users that shared workflow(s) with the authenticated user.", + "operationId": "get_users_shared_with_you", + "parameters": [ + { + "description": "API access_token of user.", + "in": "query", + "name": "access_token", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Users that shared workflow(s) with the authenticated user.", + "examples": { + "application/json": { + "users_shared_with_you": [ + { + "email": "john.doe@example.org", + "full_name": "John Doe", + "username": "jdoe" + } + ] + } + }, + "schema": { + "properties": { + "users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "full_name": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "401": { + "description": "Error message indicating that the uses is not authenticated.", + "examples": { + "application/json": { + "message": "User not logged in" + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "403": { + "description": "Request failed. User token not valid.", + "examples": { + "application/json": { + "message": "Token is not valid." + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "500": { + "description": "Request failed. Internal server error.", + "examples": { + "application/json": { + "message": "Internal server error." + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "summary": "Gets users that shared workflow(s) with the authenticated user." + } + }, + "/api/users/you-shared-with": { + "get": { + "description": "This resource provides information about users that the authenticated user shared workflow(s) with.", + "operationId": "get_users_you_shared_with", + "parameters": [ + { + "description": "API access_token of user.", + "in": "query", + "name": "access_token", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Users that the authenticated user shared workflow(s) with.", + "examples": { + "application/json": { + "users_you_shared_with": [ + { + "email": "john.doe@example.org", + "full_name": "John Doe", + "username": "jdoe" + } + ] + } + }, + "schema": { + "properties": { + "users": { + "items": { + "properties": { + "email": { + "type": "string" + }, + "full_name": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "401": { + "description": "Error message indicating that the uses is not authenticated.", + "examples": { + "application/json": { + "message": "User not logged in" + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "403": { + "description": "Request failed. User token not valid.", + "examples": { + "application/json": { + "message": "Token is not valid." + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "500": { + "description": "Request failed. Internal server error.", + "examples": { + "application/json": { + "message": "Internal server error." + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "summary": "Gets users that the authenticated user shared workflow(s) with." + } + }, "/api/workflows": { "get": { "description": "This resource return all current workflows in JSON format.",