mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
* use libopenapi OpenAPI generator Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * added a handler for v1alpha1/peers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * wire up request validator Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * wired up spec-based validation Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use sync validation; set base url to v1alpha1 Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * moved stuff around, extracted runtime libopenapu deps into runtime_tooling Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * testing /peers path params Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fixed tests Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * added user schemas and paths Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use api validation in tests Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * post-merge fixes Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * deleted tmp command used to test validator integration Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * require request body in post/put requests in order to force validation Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * making linter happy Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * switch to api/v1alpha1 Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * go mod tidy Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * keep the original order of middleware: metrics, cors, then auth Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * return 422 on validation errors Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * more cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * v1alpha1 spec cleanups Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * no need for a double-pointer Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * more linter fixes Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * removed more double pointers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * use di to inject api_v0 and api_v1 http routers Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * do not re-add middleware on repeated call to ApiHandler Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * calling ApiRouter() now also calls ApiV1Router() Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> --------- Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
130 lines
4.0 KiB
YAML
130 lines
4.0 KiB
YAML
UsersPath:
|
|
get:
|
|
summary: List all Users
|
|
description: Returns a list of all users
|
|
tags: [ Users ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: query
|
|
name: service_user
|
|
schema:
|
|
type: boolean
|
|
description: Filters users and returns either regular users or service users
|
|
responses:
|
|
'200':
|
|
description: A JSON array of Users
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: './user_components.yaml#/components/schemas/User'
|
|
'400':
|
|
"$ref": "../openapi.yaml#/components/responses/bad_request"
|
|
'401':
|
|
"$ref": "../openapi.yaml#/components/responses/requires_authentication"
|
|
'403':
|
|
"$ref": "../openapi.yaml#/components/responses/forbidden"
|
|
'422':
|
|
"$ref": "../openapi.yaml#/components/responses/unprocessable"
|
|
'500':
|
|
"$ref": "../openapi.yaml#/components/responses/internal_error"
|
|
post:
|
|
summary: Create a User
|
|
description: Creates a new service user or sends an invite to a regular user
|
|
tags: [ Users ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
requestBody:
|
|
description: User invite information
|
|
required: true
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: './user_components.yaml#/components/schemas/UserCreateRequest'
|
|
responses:
|
|
'200':
|
|
description: A User object
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: './user_components.yaml#/components/schemas/User'
|
|
'400':
|
|
"$ref": "../openapi.yaml#/components/responses/bad_request"
|
|
'401':
|
|
"$ref": "../openapi.yaml#/components/responses/requires_authentication"
|
|
'403':
|
|
"$ref": "../openapi.yaml#/components/responses/forbidden"
|
|
'422':
|
|
"$ref": "../openapi.yaml#/components/responses/unprocessable"
|
|
'500':
|
|
"$ref": "../openapi.yaml#/components/responses/internal_error"
|
|
UserPath:
|
|
put:
|
|
summary: Update a User
|
|
description: Update information about a User
|
|
tags: [ Users ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The unique identifier of a user
|
|
requestBody:
|
|
description: User update
|
|
required: true
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: './user_components.yaml#/components/schemas/UserRequest'
|
|
responses:
|
|
'200':
|
|
description: A User object
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: './user_components.yaml#/components/schemas/User'
|
|
'400':
|
|
"$ref": "../openapi.yaml#/components/responses/bad_request"
|
|
'401':
|
|
"$ref": "../openapi.yaml#/components/responses/requires_authentication"
|
|
'403':
|
|
"$ref": "../openapi.yaml#/components/responses/forbidden"
|
|
'422':
|
|
"$ref": "../openapi.yaml#/components/responses/unprocessable"
|
|
'500':
|
|
"$ref": "../openapi.yaml#/components/responses/internal_error"
|
|
delete:
|
|
summary: Delete a User
|
|
description: This method removes a user from accessing the system. For this leaves the IDP user intact unless the `--user-delete-from-idp` is passed to management startup.
|
|
tags: [ Users ]
|
|
security:
|
|
- BearerAuth: [ ]
|
|
- TokenAuth: [ ]
|
|
parameters:
|
|
- in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: The unique identifier of a user
|
|
responses:
|
|
'200':
|
|
description: Delete status code
|
|
content: { }
|
|
'400':
|
|
"$ref": "../openapi.yaml#/components/responses/bad_request"
|
|
'401':
|
|
"$ref": "../openapi.yaml#/components/responses/requires_authentication"
|
|
'403':
|
|
"$ref": "../openapi.yaml#/components/responses/forbidden"
|
|
'500':
|
|
"$ref": "../openapi.yaml#/components/responses/internal_error"
|