-
Notifications
You must be signed in to change notification settings - Fork 0
/
users-api.yaml
259 lines (259 loc) · 6.27 KB
/
users-api.yaml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
---
openapi: 3.0.1
info:
title: User API - M1IF13
description: API built and used for the M1IF13 courses
version: '1.0'
servers:
- url: http://localhost:8080/v3/a
description: Generated server url
paths:
"/login":
post:
tags:
- operation-controller
summary: Login
description: Log a user
operationId: login
parameters:
- name: login
in: query
description: The login of the user
required: true
schema:
type: string
- name: password
in: query
description: The password of the user
required: true
schema:
type: string
- name: Origin
in: header
description: Origin of the request
required: true
schema:
type: string
responses:
'204':
description: logged
'400':
description: JWT Error
'401':
description: Password incorrect
'404':
description: User not found
"/authenticate":
get:
tags:
- operation-controller
summary: Authenticate
description: Verify the authentification of the user
operationId: authenticate
parameters:
- name: token
in: query
description: JWT of the token
required: true
schema:
type: string
- name: origin
in: header
description: Origin of the request
required: true
schema:
type: string
responses:
'204':
description: Authenticate
'400':
description: JWT Error
'401':
description: Not authenticate
"/logout":
delete:
tags:
- operation-controller
summary: Logout
description: Log out a user by his JWT
operationId: logout
parameters:
- name: token
in: query
description: The JWT of the user you want to disconnect
required: true
schema:
type: string
- name: origin
in: header
description: Origin of the request
required: true
schema:
type: string
responses:
'204':
description: Logged out
'400':
description: JWT Error
"/users":
get:
tags:
- user-rest-controller
summary: Get Users
description: Return a list of user's login
operationId: getUsers
parameters:
- name: host
in: header
description: The host uri
required: true
schema:
type: string
responses:
'200':
description: A list of users
content:
application/json:
schema:
uniqueItems: true
type: array
items:
type: string
application/xml:
schema:
uniqueItems: true
type: array
items:
type: string
'204':
description: There is no user
content:
application/json:
schema:
uniqueItems: true
type: array
items:
type: string
application/xml:
schema:
uniqueItems: true
type: array
items:
type: string
post:
tags:
- user-rest-controller
summary: Post a User
description: Add a user to the list
operationId: postUsers
parameters:
- name: login
in: query
description: The login of the user
required: true
schema:
type: string
- name: password
in: query
description: The password of the user
required: true
schema:
type: string
responses:
'201':
description: The user has been created
'400':
description: Login or password blank
"/users/{userId}":
get:
tags:
- user-rest-controller
summary: Get a User
description: Return a user by his login
operationId: getUser
parameters:
- name: userId
in: path
description: The login of the user you need to fetch
required: true
schema:
type: string
responses:
'200':
description: The user
content:
application/json:
schema:
"$ref": "#/components/schemas/User"
application/xml:
schema:
"$ref": "#/components/schemas/User"
'404':
description: User not found
content:
application/json:
schema:
"$ref": "#/components/schemas/User"
application/xml:
schema:
"$ref": "#/components/schemas/User"
put:
tags:
- user-rest-controller
summary: Update a User
description: Update a user by his login
operationId: putUser
parameters:
- name: userId
in: path
description: The login of the user you want to update
required: true
schema:
type: string
- name: login
in: query
description: The new login of the user
required: true
schema:
type: string
- name: password
in: query
description: The new password of the user
required: true
schema:
type: string
responses:
'200':
description: The user has been updated
'201':
description: The user has been created
'400':
description: Login or password blank
delete:
tags:
- user-rest-controller
summary: Delete a User
description: Delete a user by his login
operationId: deleteUser
parameters:
- name: userId
in: path
description: The user you want to delete
required: true
schema:
type: string
responses:
'200':
description: The user has been deleted
components:
schemas:
User:
type: object
properties:
login:
type: string
password:
type: string
writeOnly: true
connected:
type: boolean