chg: extend openapi spec
parent
ce1a51cc39
commit
71072f60eb
|
@ -3,8 +3,7 @@ info:
|
||||||
version: 1.3.0
|
version: 1.3.0
|
||||||
title: Cerebrate Project API
|
title: Cerebrate Project API
|
||||||
description: |
|
description: |
|
||||||
|
Cerebrate is an open-source platform meant to act as a trusted contact information provider and interconnection orchestrator for other security tools.
|
||||||
TODO: markdown description
|
|
||||||
|
|
||||||
servers:
|
servers:
|
||||||
- url: https://cerebrate.local
|
- url: https://cerebrate.local
|
||||||
|
@ -22,7 +21,7 @@ paths:
|
||||||
- Users
|
- Users
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/components/responses/GetUsersResponse"
|
$ref: "#/components/responses/UserListResponse"
|
||||||
"403":
|
"403":
|
||||||
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
"405":
|
"405":
|
||||||
|
@ -38,9 +37,11 @@ paths:
|
||||||
- Users
|
- Users
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/components/responses/GetUserResponse"
|
$ref: "#/components/responses/UserResponse"
|
||||||
"403":
|
"403":
|
||||||
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
default:
|
default:
|
||||||
$ref: "#/components/responses/ApiErrorResponse"
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
@ -54,9 +55,85 @@ paths:
|
||||||
- $ref: "#/components/parameters/userId"
|
- $ref: "#/components/parameters/userId"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/components/responses/GetUserResponse"
|
$ref: "#/components/responses/UserResponse"
|
||||||
"403":
|
"403":
|
||||||
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
|
default:
|
||||||
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
/api/v1/users/add:
|
||||||
|
post:
|
||||||
|
summary: "Add user"
|
||||||
|
operationId: addUser
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
requestBody:
|
||||||
|
$ref: "#/components/requestBodies/AddUserRequest"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/components/responses/UserResponse"
|
||||||
|
"403":
|
||||||
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
|
default:
|
||||||
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
/api/v1/users/edit:
|
||||||
|
put:
|
||||||
|
summary: "Edit current user"
|
||||||
|
operationId: editUser
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
requestBody:
|
||||||
|
$ref: "#/components/requestBodies/EditUserRequest"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/components/responses/UserResponse"
|
||||||
|
"403":
|
||||||
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
|
default:
|
||||||
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
/api/v1/users/edit/{userId}:
|
||||||
|
put:
|
||||||
|
summary: "Edit current user"
|
||||||
|
operationId: editUserById
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/userId"
|
||||||
|
requestBody:
|
||||||
|
$ref: "#/components/requestBodies/EditUserRequest"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/components/responses/UserResponse"
|
||||||
|
"403":
|
||||||
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
|
default:
|
||||||
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
/api/v1/users/delete/{userId}:
|
||||||
|
delete:
|
||||||
|
summary: "Delete user by ID"
|
||||||
|
operationId: deleteUserById
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/userId"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/components/responses/UserResponse"
|
||||||
|
"403":
|
||||||
|
$ref: "#/components/responses/UnauthorizedApiErrorResponse"
|
||||||
|
"405":
|
||||||
|
$ref: "#/components/responses/MethodNotAllowedApiErrorResponse"
|
||||||
default:
|
default:
|
||||||
$ref: "#/components/responses/ApiErrorResponse"
|
$ref: "#/components/responses/ApiErrorResponse"
|
||||||
|
|
||||||
|
@ -224,19 +301,58 @@ components:
|
||||||
|
|
||||||
Authorization: YOUR_API_KEY
|
Authorization: YOUR_API_KEY
|
||||||
|
|
||||||
# requestBodies:
|
requestBodies:
|
||||||
|
AddUserRequest:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
individual_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
organisation_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
role_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
disabled:
|
||||||
|
type: boolean
|
||||||
|
username:
|
||||||
|
$ref: "#/components/schemas/Username"
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
EditUserRequest:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
individual_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
organisation_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
role_id:
|
||||||
|
$ref: "#/components/schemas/ID"
|
||||||
|
disabled:
|
||||||
|
type: boolean
|
||||||
|
username:
|
||||||
|
$ref: "#/components/schemas/Username"
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
|
||||||
responses:
|
responses:
|
||||||
# User
|
# User
|
||||||
GetUserResponse:
|
UserResponse:
|
||||||
description: "User response"
|
description: "User response"
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/User"
|
$ref: "#/components/schemas/User"
|
||||||
|
|
||||||
GetUsersResponse:
|
UserListResponse:
|
||||||
description: "User response"
|
description: "Users list response"
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|
Loading…
Reference in New Issue