added GET /user route
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
Id:
|
||||
type: string
|
||||
example: 5ea0450ed851c30a90e70894
|
||||
_Id:
|
||||
properties:
|
||||
_id:
|
||||
|
117
oas/user.yaml
117
oas/user.yaml
@ -1,6 +1,6 @@
|
||||
/users:
|
||||
get:
|
||||
summary: TODO lists all users
|
||||
summary: lists all users
|
||||
description: 'Auth: basic, levels: admin'
|
||||
tags:
|
||||
- /user
|
||||
@ -21,12 +21,10 @@
|
||||
$ref: 'oas.yaml#/components/responses/403'
|
||||
500:
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
/user/{name}:
|
||||
parameters:
|
||||
- $ref: 'oas.yaml#/components/parameters/Name'
|
||||
/user:
|
||||
get:
|
||||
summary: TODO list user details
|
||||
description: 'Auth: basic, levels: read, write, maintain, dev get their own information without a name property specified, level: admin can get any user using the name parameter'
|
||||
summary: list own user details
|
||||
description: 'Auth: basic, levels: read, write, maintain, admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
@ -37,9 +35,7 @@
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
400:
|
||||
$ref: 'oas.yaml#/components/responses/400'
|
||||
401:
|
||||
@ -52,7 +48,98 @@
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
put:
|
||||
summary: TODO change user details
|
||||
description: 'Auth: basic, levels: read, write, maintain, dev can change their own information (except level) without a name property specified, level: admin can change any user using the name parameter'
|
||||
description: 'Auth: basic, levels: read, write, maintain, admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
- BasicAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: 'oas.yaml#/components/schemas/_Id'
|
||||
- $ref: 'oas.yaml#/components/schemas/UserName'
|
||||
- $ref: 'oas.yaml#/components/schemas/Email'
|
||||
properties:
|
||||
pass:
|
||||
type: string
|
||||
writeOnly: true
|
||||
example: Abc123!#
|
||||
location:
|
||||
type: string
|
||||
example: Rng
|
||||
device_name:
|
||||
type: string
|
||||
example: Alpha II
|
||||
responses:
|
||||
200:
|
||||
description: user details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
400:
|
||||
$ref: 'oas.yaml#/components/responses/400'
|
||||
401:
|
||||
$ref: 'oas.yaml#/components/responses/401'
|
||||
403:
|
||||
$ref: 'oas.yaml#/components/responses/403'
|
||||
404:
|
||||
$ref: 'oas.yaml#/components/responses/404'
|
||||
500:
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
delete:
|
||||
summary: TODO delete user
|
||||
description: 'Auth: basic, levels: read, write, maintain, admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
- BasicAuth: []
|
||||
responses:
|
||||
200:
|
||||
$ref: 'oas.yaml#/components/responses/Ok'
|
||||
400:
|
||||
$ref: 'oas.yaml#/components/responses/400'
|
||||
401:
|
||||
$ref: 'oas.yaml#/components/responses/401'
|
||||
403:
|
||||
$ref: 'oas.yaml#/components/responses/403'
|
||||
404:
|
||||
$ref: 'oas.yaml#/components/responses/404'
|
||||
500:
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
/user/{name}:
|
||||
parameters:
|
||||
- $ref: 'oas.yaml#/components/parameters/Name'
|
||||
get:
|
||||
summary: list user details
|
||||
description: 'Auth: basic, levels: admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
- BasicAuth: []
|
||||
responses:
|
||||
200:
|
||||
description: user details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
400:
|
||||
$ref: 'oas.yaml#/components/responses/400'
|
||||
401:
|
||||
$ref: 'oas.yaml#/components/responses/401'
|
||||
403:
|
||||
$ref: 'oas.yaml#/components/responses/403'
|
||||
404:
|
||||
$ref: 'oas.yaml#/components/responses/404'
|
||||
500:
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
put:
|
||||
summary: TODO change user details
|
||||
description: 'Auth: basic, levels: admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
@ -69,9 +156,7 @@
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
$ref: 'oas.yaml#/components/schemas/User'
|
||||
400:
|
||||
$ref: 'oas.yaml#/components/responses/400'
|
||||
401:
|
||||
@ -84,7 +169,7 @@
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
delete:
|
||||
summary: TODO delete user
|
||||
description: 'Auth: basic, levels: read, write, maintain, dev can delete their own account, level: admin can delete any user using the name parameter'
|
||||
description: 'Auth: basic, levels: admin'
|
||||
tags:
|
||||
- /user
|
||||
security:
|
||||
@ -123,7 +208,7 @@
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
/user/new:
|
||||
post:
|
||||
summary: TODO add new user
|
||||
summary: add new user
|
||||
description: 'Auth: basic, levels: admin'
|
||||
tags:
|
||||
- /user
|
||||
@ -160,7 +245,7 @@
|
||||
$ref: 'oas.yaml#/components/responses/500'
|
||||
/user/passreset:
|
||||
post:
|
||||
summary: TODO reset password and send mail to restore
|
||||
summary: reset password and send mail to restore
|
||||
description: 'Auth: none'
|
||||
tags:
|
||||
- /user
|
||||
|
Reference in New Issue
Block a user