From 4f5bf4b52b57cd03d947d2f953824af98b480d14 Mon Sep 17 00:00:00 2001 From: Suyeon Jung Date: Wed, 2 Oct 2024 19:43:32 +0900 Subject: [PATCH 1/2] chore(docs): Update auth-server swagger v3.10.0, v3.11.0 Signed-off-by: Suyeon Jung --- chaoscenter/authentication/api/docs/docs.go | 119 ++ .../authentication/api/docs/swagger.json | 119 ++ .../authentication/api/docs/swagger.yaml | 78 + mkdocs/docs/auth/v3.10.0/auth-api.json | 1463 ++++++++++++++++ mkdocs/docs/auth/v3.11.0/auth-api.json | 1469 +++++++++++++++++ 5 files changed, 3248 insertions(+) create mode 100644 mkdocs/docs/auth/v3.10.0/auth-api.json create mode 100644 mkdocs/docs/auth/v3.11.0/auth-api.json diff --git a/chaoscenter/authentication/api/docs/docs.go b/chaoscenter/authentication/api/docs/docs.go index 73c8be438cc..69639fb0627 100644 --- a/chaoscenter/authentication/api/docs/docs.go +++ b/chaoscenter/authentication/api/docs/docs.go @@ -229,6 +229,40 @@ const docTemplate = `{ } } }, + "/delete_project/{project_id}": { + "post": { + "description": "Delete a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/dex/callback": { "get": { "description": "DexRouter creates all the required routes for OAuth purposes. .", @@ -364,6 +398,44 @@ const docTemplate = `{ } } }, + "/get_project_owners/:project_id/:state": { + "get": { + "description": "Return list of active project owners.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project Owners.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/get_project_role/:project_id": { "get": { "description": "Return role of a project.", @@ -628,6 +700,12 @@ const docTemplate = `{ }, "400": { "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserDeactivated" + } + }, + "401": { + "description": "Unauthorized", "schema": { "$ref": "#/definitions/response.ErrInvalidCredentials" } @@ -1023,6 +1101,47 @@ const docTemplate = `{ } } }, + "/update_member_role": { + "post": { + "description": "Return updated member role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update member role.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/update_project_name": { "post": { "description": "Return updated project name.", diff --git a/chaoscenter/authentication/api/docs/swagger.json b/chaoscenter/authentication/api/docs/swagger.json index 189ff56e185..fb06eec5745 100644 --- a/chaoscenter/authentication/api/docs/swagger.json +++ b/chaoscenter/authentication/api/docs/swagger.json @@ -219,6 +219,40 @@ } } }, + "/delete_project/{project_id}": { + "post": { + "description": "Delete a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/dex/callback": { "get": { "description": "DexRouter creates all the required routes for OAuth purposes. .", @@ -354,6 +388,44 @@ } } }, + "/get_project_owners/:project_id/:state": { + "get": { + "description": "Return list of active project owners.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project Owners.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/get_project_role/:project_id": { "get": { "description": "Return role of a project.", @@ -618,6 +690,12 @@ }, "400": { "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserDeactivated" + } + }, + "401": { + "description": "Unauthorized", "schema": { "$ref": "#/definitions/response.ErrInvalidCredentials" } @@ -1013,6 +1091,47 @@ } } }, + "/update_member_role": { + "post": { + "description": "Return updated member role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update member role.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/update_project_name": { "post": { "description": "Return updated project name.", diff --git a/chaoscenter/authentication/api/docs/swagger.yaml b/chaoscenter/authentication/api/docs/swagger.yaml index 5c39198b409..9ed6d9ec1b3 100644 --- a/chaoscenter/authentication/api/docs/swagger.yaml +++ b/chaoscenter/authentication/api/docs/swagger.yaml @@ -318,6 +318,28 @@ paths: summary: Decline invitation. tags: - ProjectRouter + /delete_project/{project_id}: + post: + consumes: + - application/json + description: Delete a project. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.ErrProjectNotFound' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrServerError' + tags: + - ProjectRouter /dex/callback: get: consumes: @@ -406,6 +428,31 @@ paths: summary: Get active project members. tags: - ProjectRouter + /get_project_owners/:project_id/:state: + get: + consumes: + - application/json + description: Return list of active project owners. + parameters: + - description: State + in: path + name: state + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrServerError' + summary: Get active project Owners. + tags: + - ProjectRouter /get_project_role/:project_id: get: consumes: @@ -579,6 +626,10 @@ paths: $ref: '#/definitions/response.LoginResponse' "400": description: Bad Request + schema: + $ref: '#/definitions/response.ErrUserDeactivated' + "401": + description: Unauthorized schema: $ref: '#/definitions/response.ErrInvalidCredentials' "500": @@ -836,6 +887,33 @@ paths: $ref: '#/definitions/response.ErrUnauthorized' tags: - UserRouter + /update_member_role: + post: + consumes: + - application/json + description: Return updated member role. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.ErrInvalidRequest' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/response.ErrUnauthorized' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrServerError' + summary: Update member role. + tags: + - ProjectRouter /update_project_name: post: consumes: diff --git a/mkdocs/docs/auth/v3.10.0/auth-api.json b/mkdocs/docs/auth/v3.10.0/auth-api.json new file mode 100644 index 00000000000..5c4e935e098 --- /dev/null +++ b/mkdocs/docs/auth/v3.10.0/auth-api.json @@ -0,0 +1,1463 @@ +{ + "swagger": "2.0", + "host": "localhost:3000", + "schemes": [ + "https", + "http" + ], + "info": { + "title": "Litmus Portal Authentication API", + "version": "3.10.0", + "description": "Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like:\n
  • Update Profile
  • \n
  • Change Password
  • \n
  • Reset Password
  • \n
  • Create new users etc.
  • \n" + }, + "paths": { + "/accept_invitation": { + "post": { + "description": "Accept inviation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Accept invitaion.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/capabilities": { + "get": { + "description": "Returns capabilities that can be leveraged by frontend services to toggle certain features.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CapabilitiesRouter" + ], + "summary": "Get capabilities of Auth Server.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.CapabilitiesResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_project": { + "post": { + "description": "Create a new project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Create project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_token": { + "post": { + "description": "Creates a new api token for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.NewApiToken" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_user": { + "post": { + "description": "Create new user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidEmail" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUserExists" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/decline_invitation": { + "post": { + "description": "Deecline invitation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Decline invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/delete_project/{project_id}": { + "post": { + "description": "Delete a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/dex/callback": { + "get": { + "description": "DexRouter creates all the required routes for OAuth purposes. .", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "DexRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/dex/login": { + "get": { + "description": "DexRouter creates all the required routes for OAuth purposes. .", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "DexRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_owner_projects": { + "get": { + "description": "Return owner of projects.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get projects owner.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_members/:project_id/:state": { + "get": { + "description": "Return list of active project members.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project members.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_owners/:project_id/:state": { + "get": { + "description": "Return list of active project owners.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project Owners.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_role/:project_id": { + "get": { + "description": "Return role of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get project Role.", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_projects_stats": { + "get": { + "description": "Return stats of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get stats of a project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_user/:uid": { + "get": { + "description": "Get user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + } + } + } + }, + "/invite_users/:project_id": { + "get": { + "description": "Invite users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/leave_project": { + "post": { + "description": "Leave project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Leave project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/list_invitations_with_filters/:invitation_state": { + "get": { + "description": "Return list of invitations.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "List invitations.", + "parameters": [ + { + "type": "string", + "description": "Invitation State", + "name": "invitation_state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/list_projects": { + "get": { + "description": "Return stats of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get stats of a project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/login": { + "post": { + "description": "User Login.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.LoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidCredentials" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/logout": { + "post": { + "description": "Revokes the token passed in the Authorization header.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/readiness": { + "get": { + "description": "Return list of tags.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "MiscRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/remove_invitation": { + "post": { + "description": "Remove invitation of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Remove invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "obejct" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/remove_token": { + "post": { + "description": "Delete api token for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/reset/password": { + "post": { + "description": "Reset user password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrStrictPasswordPolicyViolation" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/send_invitation": { + "post": { + "description": "Send invitation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Send invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/status": { + "get": { + "description": "Status will request users list and return, if successful, an http code 200.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "MiscRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/token/:uid": { + "post": { + "description": "Returns all the api tokens for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.ApiTokenResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update/details": { + "post": { + "description": "Update users details.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrStrictUsernamePolicyViolation" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update/password": { + "post": { + "description": "Update user password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrOldPassword" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrInvalidCredentials" + } + } + } + } + }, + "/update/state": { + "post": { + "description": "Updates the user state.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + } + } + } + }, + "/update_member_role": { + "post": { + "description": "Return updated member role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update member role.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update_project_name": { + "post": { + "description": "Return updated project name.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update project name.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/users": { + "get": { + "description": "Fetch users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + } + }, + "definitions": { + "response.ApiTokenResponse": { + "type": "object", + "properties": { + "createdAt": { + "type": "integer" + }, + "expiresAt": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "token": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "response.CapabilitiesResponse": { + "type": "object", + "properties": { + "dex": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, + "response.ErrInvalidCredentials": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "Invalid Credentials" + } + } + }, + "response.ErrInvalidEmail": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "Email address is invalid" + } + } + }, + "response.ErrInvalidRequest": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed" + } + } + }, + "response.ErrInvalidRole": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "Role is invalid" + } + } + }, + "response.ErrOldPassword": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "The old and new passwords can't be same" + } + } + }, + "response.ErrProjectNotFound": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "This project does not exist" + } + } + }, + "response.ErrServerError": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 500 + }, + "message": { + "type": "string", + "example": "The authorization server encountered an unexpected condition that prevented it from fulfilling the request" + } + } + }, + "response.ErrStrictPasswordPolicyViolation": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "Please ensure the password is atleast 8 characters and atmost 16 characters long and has atleast 1 digit, 1 lowercase alphabet, 1 uppercase alphabet and 1 special character" + } + } + }, + "response.ErrStrictUsernamePolicyViolation": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "The username should be atleast 3 characters long and atmost 16 characters long." + } + } + }, + "response.ErrUnauthorized": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "The user does not have requested authorization to access this resource" + } + } + }, + "response.ErrUserDeactivated": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "your account has been deactivated" + } + } + }, + "response.ErrUserExists": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "This username is already assigned to another user" + } + } + }, + "response.ErrUserNotFound": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "user does not exist" + } + } + }, + "response.LoginResponse": { + "type": "object" + }, + "response.MessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "response.NewApiToken": { + "type": "object" + }, + "response.Response": { + "type": "object", + "properties": { + "response": { + "type": "string" + } + } + }, + "response.UserResponse": { + "type": "object", + "properties": { + "deactivatedAt": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "role": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "username": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/mkdocs/docs/auth/v3.11.0/auth-api.json b/mkdocs/docs/auth/v3.11.0/auth-api.json new file mode 100644 index 00000000000..f2ddeec5f8e --- /dev/null +++ b/mkdocs/docs/auth/v3.11.0/auth-api.json @@ -0,0 +1,1469 @@ +{ + "swagger": "2.0", + "host": "localhost:3000", + "schemes": [ + "https", + "http" + ], + "info": { + "title": "Litmus Portal Authentication API", + "version": "3.11.0", + "description": "Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like:\n
  • Update Profile
  • \n
  • Change Password
  • \n
  • Reset Password
  • \n
  • Create new users etc.
  • \n" + }, + "paths": { + "/accept_invitation": { + "post": { + "description": "Accept inviation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Accept invitaion.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/capabilities": { + "get": { + "description": "Returns capabilities that can be leveraged by frontend services to toggle certain features.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CapabilitiesRouter" + ], + "summary": "Get capabilities of Auth Server.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.CapabilitiesResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_project": { + "post": { + "description": "Create a new project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Create project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_token": { + "post": { + "description": "Creates a new api token for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.NewApiToken" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/create_user": { + "post": { + "description": "Create new user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidEmail" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUserExists" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/decline_invitation": { + "post": { + "description": "Deecline invitation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Decline invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/delete_project/{project_id}": { + "post": { + "description": "Delete a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/dex/callback": { + "get": { + "description": "DexRouter creates all the required routes for OAuth purposes. .", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "DexRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/dex/login": { + "get": { + "description": "DexRouter creates all the required routes for OAuth purposes. .", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "DexRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_owner_projects": { + "get": { + "description": "Return owner of projects.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get projects owner.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_members/:project_id/:state": { + "get": { + "description": "Return list of active project members.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project members.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_owners/:project_id/:state": { + "get": { + "description": "Return list of active project owners.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get active project Owners.", + "parameters": [ + { + "type": "string", + "description": "State", + "name": "state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_project_role/:project_id": { + "get": { + "description": "Return role of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get project Role.", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrProjectNotFound" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_projects_stats": { + "get": { + "description": "Return stats of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get stats of a project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/get_user/:uid": { + "get": { + "description": "Get user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + } + } + } + }, + "/invite_users/:project_id": { + "get": { + "description": "Invite users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/leave_project": { + "post": { + "description": "Leave project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Leave project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/list_invitations_with_filters/:invitation_state": { + "get": { + "description": "Return list of invitations.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "List invitations.", + "parameters": [ + { + "type": "string", + "description": "Invitation State", + "name": "invitation_state", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/list_projects": { + "get": { + "description": "Return stats of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Get stats of a project.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/login": { + "post": { + "description": "User Login.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.LoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserDeactivated" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrInvalidCredentials" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/logout": { + "post": { + "description": "Revokes the token passed in the Authorization header.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/readiness": { + "get": { + "description": "Return list of tags.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "MiscRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/remove_invitation": { + "post": { + "description": "Remove invitation of a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Remove invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "obejct" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/remove_token": { + "post": { + "description": "Delete api token for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/reset/password": { + "post": { + "description": "Reset user password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrStrictPasswordPolicyViolation" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/send_invitation": { + "post": { + "description": "Send invitation to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Send invitation.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrUserNotFound" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/status": { + "get": { + "description": "Status will request users list and return, if successful, an http code 200.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "MiscRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/token/:uid": { + "post": { + "description": "Returns all the api tokens for the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.ApiTokenResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update/details": { + "post": { + "description": "Update users details.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrStrictUsernamePolicyViolation" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update/password": { + "post": { + "description": "Update user password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrOldPassword" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrInvalidCredentials" + } + } + } + } + }, + "/update/state": { + "post": { + "description": "Updates the user state.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.MessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + } + } + } + }, + "/update_member_role": { + "post": { + "description": "Return updated member role.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update member role.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/update_project_name": { + "post": { + "description": "Return updated project name.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ProjectRouter" + ], + "summary": "Update project name.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.ErrInvalidRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, + "/users": { + "get": { + "description": "Fetch users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserRouter" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.UserResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.ErrUnauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + } + }, + "definitions": { + "response.ApiTokenResponse": { + "type": "object", + "properties": { + "createdAt": { + "type": "integer" + }, + "expiresAt": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "token": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + }, + "response.CapabilitiesResponse": { + "type": "object", + "properties": { + "dex": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, + "response.ErrInvalidCredentials": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "Invalid Credentials" + } + } + }, + "response.ErrInvalidEmail": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "Email address is invalid" + } + } + }, + "response.ErrInvalidRequest": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed" + } + } + }, + "response.ErrInvalidRole": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "Role is invalid" + } + } + }, + "response.ErrOldPassword": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "The old and new passwords can't be same" + } + } + }, + "response.ErrProjectNotFound": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "This project does not exist" + } + } + }, + "response.ErrServerError": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 500 + }, + "message": { + "type": "string", + "example": "The authorization server encountered an unexpected condition that prevented it from fulfilling the request" + } + } + }, + "response.ErrStrictPasswordPolicyViolation": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "Please ensure the password is atleast 8 characters and atmost 16 characters long and has atleast 1 digit, 1 lowercase alphabet, 1 uppercase alphabet and 1 special character" + } + } + }, + "response.ErrStrictUsernamePolicyViolation": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "The username should be atleast 3 characters long and atmost 16 characters long." + } + } + }, + "response.ErrUnauthorized": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "The user does not have requested authorization to access this resource" + } + } + }, + "response.ErrUserDeactivated": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "your account has been deactivated" + } + } + }, + "response.ErrUserExists": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 401 + }, + "message": { + "type": "string", + "example": "This username is already assigned to another user" + } + } + }, + "response.ErrUserNotFound": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 400 + }, + "message": { + "type": "string", + "example": "user does not exist" + } + } + }, + "response.LoginResponse": { + "type": "object" + }, + "response.MessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "response.NewApiToken": { + "type": "object" + }, + "response.Response": { + "type": "object", + "properties": { + "response": { + "type": "string" + } + } + }, + "response.UserResponse": { + "type": "object", + "properties": { + "deactivatedAt": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "role": { + "type": "string" + }, + "userID": { + "type": "string" + }, + "username": { + "type": "string" + } + } + } + } +} \ No newline at end of file From 8edec5dbe262623f71fcbcd0355a2d4990400c7b Mon Sep 17 00:00:00 2001 From: Suyeon Jung Date: Wed, 2 Oct 2024 20:14:59 +0900 Subject: [PATCH 2/2] chore(docs): Update auth-server api docs v3.11.0 Signed-off-by: Suyeon Jung --- mkdocs/docs/auth/v3.11.0/api.html | 647 +++++++++++++++++++++++++ mkdocs/docs/auth/v3.11.0/auth-api.json | 7 +- 2 files changed, 653 insertions(+), 1 deletion(-) create mode 100644 mkdocs/docs/auth/v3.11.0/api.html diff --git a/mkdocs/docs/auth/v3.11.0/api.html b/mkdocs/docs/auth/v3.11.0/api.html new file mode 100644 index 00000000000..6c2822c48ee --- /dev/null +++ b/mkdocs/docs/auth/v3.11.0/api.html @@ -0,0 +1,647 @@ + + + + + + Litmus Portal Authentication API + + + + + + + + + +

    Litmus Portal Authentication API (3.11.0)

    Download OpenAPI specification:Download

    Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like: +

  • Update Profile
  • +
  • Change Password
  • +
  • Reset Password
  • +
  • Create new users etc.
  • +

    ProjectRouter

    Accept invitaion.

    Accept inviation to a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Create project.

    Create a new project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Decline invitation.

    Deecline invitation to a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Delete a project.

    Delete a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get projects owner.

    Return owner of projects.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get active project members.

    Return list of active project members.

    +
    path Parameters
    state
    required
    string

    State

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get active project Owners.

    Return list of active project owners.

    +
    path Parameters
    state
    required
    string

    State

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get project Role.

    Return role of a project.

    +
    path Parameters
    project_id
    required
    integer

    Project ID

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get stats of a project.

    Return stats of a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Leave project.

    Leave project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    List invitations.

    Return list of invitations.

    +
    path Parameters
    invitation_state
    required
    string

    Invitation State

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Get stats of a project.

    Return stats of a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Remove invitation.

    Remove invitation of a project.

    +

    Responses

    Response samples

    Content type
    application/json
    null

    Send invitation.

    Send invitation to a project.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Update member role.

    Return updated member role.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Update project name.

    Return updated project name.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    CapabilitiesRouter

    Get capabilities of Auth Server.

    Returns capabilities that can be leveraged by frontend services to toggle certain features.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "dex": {
      }
    }

    UserRouter

    Creates a new api token for the user.

    Creates a new api token for the user.

    +

    Responses

    Response samples

    Content type
    application/json
    { }

    Create new user.

    Create new user.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "deactivatedAt": 0,
    • "email": "string",
    • "name": "string",
    • "password": "string",
    • "role": "string",
    • "userID": "string",
    • "username": "string"
    }

    Get user.

    Get user.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "deactivatedAt": 0,
    • "email": "string",
    • "name": "string",
    • "password": "string",
    • "role": "string",
    • "userID": "string",
    • "username": "string"
    }

    Invite users.

    Invite users.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "deactivatedAt": 0,
    • "email": "string",
    • "name": "string",
    • "password": "string",
    • "role": "string",
    • "userID": "string",
    • "username": "string"
    }

    User Login.

    User Login.

    +

    Responses

    Response samples

    Content type
    application/json
    { }

    Revokes the token passed in the Authorization head

    Revokes the token passed in the Authorization header.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Delete api token for the user.

    Delete api token for the user.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Reset user password.

    Reset user password.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Returns all the api tokens for the user.

    Returns all the api tokens for the user.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "createdAt": 0,
    • "expiresAt": 0,
    • "name": "string",
    • "token": "string",
    • "userID": "string"
    }

    Update users details.

    Update users details.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Update user password.

    Update user password.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Updates the user state.

    Updates the user state.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string"
    }

    Fetch users.

    Fetch users.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "deactivatedAt": 0,
    • "email": "string",
    • "name": "string",
    • "password": "string",
    • "role": "string",
    • "userID": "string",
    • "username": "string"
    }

    DexRouter

    DexRouter creates all the required routes for OAut

    DexRouter creates all the required routes for OAuth purposes. .

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    DexRouter creates all the required routes for OAut

    DexRouter creates all the required routes for OAuth purposes. .

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    MiscRouter

    Return list of tags.

    Return list of tags.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }

    Status will request users list and return, if succ

    Status will request users list and return, if successful, an http code 200.

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "response": "string"
    }
    + + + + diff --git a/mkdocs/docs/auth/v3.11.0/auth-api.json b/mkdocs/docs/auth/v3.11.0/auth-api.json index f2ddeec5f8e..d63aa5be574 100644 --- a/mkdocs/docs/auth/v3.11.0/auth-api.json +++ b/mkdocs/docs/auth/v3.11.0/auth-api.json @@ -8,7 +8,12 @@ "info": { "title": "Litmus Portal Authentication API", "version": "3.11.0", - "description": "Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like:\n
  • Update Profile
  • \n
  • Change Password
  • \n
  • Reset Password
  • \n
  • Create new users etc.
  • \n" + "description": "Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like:\n
  • Update Profile
  • \n
  • Change Password
  • \n
  • Reset Password
  • \n
  • Create new users etc.
  • \n", + "x-logo": { + "url": "https://avatars.githubusercontent.com/u/49853472?s=200&v=4", + "backgroundColor": "#FFFFFF", + "altText": "litmus logo" + } }, "paths": { "/accept_invitation": {