-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.yaml
More file actions
138 lines (127 loc) · 3.92 KB
/
openapi.yaml
File metadata and controls
138 lines (127 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
openapi: 3.0.3
info:
title: Simple Auth Service
description: |-
Simple Authentification Service
- [The Simple Authentification Service repository](https://github.com/ateachment/to-do)
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.3
externalDocs:
description: https://mo6273.schule.hessen.de
url: https://mo6273.schule.hessen.de
servers:
[
{
url: 'https://localhost:5000/auth/',
description: 'Local server'
}
]
tags:
- name: user
description: Operations about user
- name: roles
description: Operations about roles (autorization)
paths:
/user/login:
post:
tags:
- user
summary: Logs user into the system
description: ''
operationId: loginUser
requestBody:
description: Logs user into the system
content:
application/json:
schema:
$ref: '#/components/schemas/User'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
'200':
description: Login sucessful
content:
application/json:
schema:
$ref: '#/components/schemas/ValidToken'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ValidToken'
'403':
description: Invalid username/password supplied
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidToken'
/user/{token}:
delete:
tags:
- user
summary: Logs out current logged in user
description: ''
operationId: logoutUser
parameters:
- name: token
in: path
description: Token that has to be deleted
required: true
schema:
$ref: '#/components/schemas/Token'
responses:
'200':
description: Logout sucessful
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidToken'
components:
schemas:
Token:
type: string
example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzA0NDE4MDMsInJvbGVJRHMiOlsxLDJdfQ.967Mucl7Xrlm_bf33Sh0sq0EzRToZkzsWy5QdvDQU0_JCIkgf1TuC0muKG-ThxihJ-ewMkSvh3u94yDs-RWDMCVavPfLbmdLRJCu6lChI8gVcdR__U61zRBP6cszSFPFK8pJTqs7oe_t6z-HzDMEyxNBwF4bmPuEqXySVETg3lqn8QOb5DNa7056EPWvjUfuKUsPIKfvr_LESMzFXZrnSyNtzQPrSeFYTeynJdl-q1_l9JlqOTiQvqmWbUjyoj8swdJ7brKLuVUzL3yXLV7vBRWhUDLUHzyYlySnZxPrDS_oUpUF8MDOJ9z-WV5d-utDocPmMhMrwP05vXqTYmBGdg
User:
type: object
properties:
username:
type: string
example: testUser
password:
type: string
example: testPwd
ValidToken:
type: object
properties:
token:
type: string
example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzA0NDE4MDMsInJvbGVJRHMiOlsxLDJdfQ.967Mucl7Xrlm_bf33Sh0sq0EzRToZkzsWy5QdvDQU0_JCIkgf1TuC0muKG-ThxihJ-ewMkSvh3u94yDs-RWDMCVavPfLbmdLRJCu6lChI8gVcdR__U61zRBP6cszSFPFK8pJTqs7oe_t6z-HzDMEyxNBwF4bmPuEqXySVETg3lqn8QOb5DNa7056EPWvjUfuKUsPIKfvr_LESMzFXZrnSyNtzQPrSeFYTeynJdl-q1_l9JlqOTiQvqmWbUjyoj8swdJ7brKLuVUzL3yXLV7vBRWhUDLUHzyYlySnZxPrDS_oUpUF8MDOJ9z-WV5d-utDocPmMhMrwP05vXqTYmBGdg
InvalidToken:
type: object
properties:
token:
type: string
example: -1
ValidRoleIDs:
type: object
properties:
roleIDs:
type: string
example: [1, 2]
InvalidRoleIDs:
type: object
properties:
roleIDs:
type: string
example: -1
requestBodies:
UserArray:
description: List of user object
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'