-
Notifications
You must be signed in to change notification settings - Fork 0
/
authentication.json
270 lines (270 loc) · 10.4 KB
/
authentication.json
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
260
261
262
263
264
265
266
267
268
269
270
{
"openapi": "3.0.3",
"info": {
"title": "Authentication API",
"version": "1.0.0",
"description": "The API definition of the authentication-related API-calls.\n"
},
"paths": {
"/users": {
"get": {
"summary": "get multiple users",
"description": "List all users. Response is authentication restricted and only users that requesting user can view is returned.",
"responses": {
"200": {
"description": "OK: List of users the user have view permission to.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
}
}
},
"/users/{id}": {
"get": {
"summary": "get single user",
"description": "Returns a single user based on {id}. Response is authentication restricted.",
"parameters": [
{
"in": "path",
"name": "id",
"description": "Id of user",
"required": true,
"schema": {
"$ref": "#/components/schemas/User/properties/id"
}
}
],
"responses": {
"200": {
"description": "OK: User data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"400": {
"description": "BAD REQUEST: Something is wrong with the way you specified the request. See error message for details.",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
},
"401": {
"description": "UNAUTHORIZED: You do not have access to this recourse (credentials are missing or you do not have permission).",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
},
"404": {
"description": "NO CONTENT: No user found with id={id}.",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
}
}
}
},
"/groups": {
"get": {
"summary": "get multiple groups",
"description": "List all groups. Response is authentication restricted and only groups that requesting user can view is returned.",
"responses": {
"200": {
"description": "OK: List of groups the user have view permission to.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Group"
}
}
}
}
}
}
}
},
"/groups/{id}": {
"get": {
"summary": "get single group",
"description": "Returns a single group based on {id}. Response is authentication restricted.",
"parameters": [
{
"in": "path",
"name": "id",
"description": "Id of group",
"required": true,
"schema": {
"$ref": "#/components/schemas/Group/properties/id"
}
}
],
"responses": {
"200": {
"description": "OK: Group data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Group"
}
}
}
},
"400": {
"description": "BAD REQUEST: Something is wrong with the way you specified the request. See error message for details.",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
},
"401": {
"description": "UNAUTHORIZED: You do not have access to this recourse (credentials are missing or you do not have permission).",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
},
"404": {
"description": "NO CONTENT: No group found with id={id}.",
"content": {
"application/json": {
"schema": {
"$ref": "general.json#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true,
"example": 42
},
"detail_url": {
"type": "string",
"readOnly": true,
"example": "https://f.kth.se/api/users/42/"
},
"user_type": {
"type": "string",
"example": "Admin"
},
"last_login": {
"type": "string",
"example": "2021-02-25T15:38:09.562989+01:00"
},
"username": {
"type": "string",
"example": "admin"
},
"first_name": {
"type": "string",
"example": "Jane"
},
"last_name": {
"type": "string",
"example": "Doe"
},
"date_joined": {
"type": "string",
"example": "2021-02-25T05:16:07.948842+01:00"
},
"is_active": {
"type": "boolean",
"example": true
},
"kth_id": {
"type": "string",
"example": "janedoe"
},
"year": {
"type": "string",
"example": "F-17"
},
"image": {
"$ref": "general.json#/components/schemas/Image"
},
"language": {
"type": "string",
"example": "sv"
},
"groups": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Group"
}
}
}
},
"Group": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1,
"readOnly": true,
"example": 1
},
"detail_url": {
"type": "string",
"readOnly": true,
"example": "https://f.kth.se/api/groups/1/"
},
"group_type": {
"type": "string",
"example": "Nämnd"
},
"name": {
"type": "string",
"example": "F.dev"
},
"description": {
"type": "string",
"example": "Vi skriver kod."
},
"image": {
"$ref": "general.json#/components/schemas/Image"
}
}
}
}
}
}