Repository navigation
Expand file tree
/
Copy pathmod-users-bl.raml
More file actions
346 lines (342 loc) · 10.4 KB
/
Copy pathmod-users-bl.raml
File metadata and controls
346 lines (342 loc) · 10.4 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
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
#%RAML 1.0
title: Mod-Users BL
version: v6.1
baseUri: http://github.com/org/folio/mod-users-bl
documentation:
- title: Business Logic Users API
content: A front end for mod-users and mod-permissions
types:
compositeUser: !include compositeUser.json
compositeUserListObject: !include compositeUserListObject.json
loginCredentials: !include loginCredentials.json
userdata.json: !include userdata.json
usergroup.json: !include usergroup.json
permissionUser.json: !include permissionUser.json
proxyfor.json: !include proxyfor.json
tokenExpiration: !include tokenExpiration.json
identifier: !include identifier.json
errors: !include raml-util/schemas/errors.schema
updateCredentials: !include updateCredentials.json
generateLinkRequest: !include generateLinkRequest.json
generateLinkResponse: !include generateLinkResponse.json
configurations: !include configurations.json
passwordResetAction: !include passwordResetAction.json
passwordReset: !include passwordReset.json
notification : !include notification.json
openTransactions: !include openTransactions.json
traits:
orderable: !include raml-util/traits/orderable.raml
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
language: !include raml-util/traits/language.raml
validate: !include raml-util/traits/validation.raml
includeable: !include raml-util/traits/includes.raml
permissionsExpandable:
queryParameters:
expandPermissions:
description:
Whether or not to expand permissions listings
type: boolean
required: false
default: false
resourceTypes:
compositeUserResource:
get:
description: "Get a user by <<typeName>>"
is: [
includeable,
permissionsExpandable
]
responses:
200:
body:
application/json:
type: compositeUser
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
403:
description: "Access denied"
body:
text/plain:
example: "Access denied"
404:
description: "User not found"
body:
text/plain:
example: "User not found"
422:
description: "Unprocessable Entity"
body:
application/json:
type: errors
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
compositeForgottenResource:
post:
description: called when a user has forgotten <<resourceTypeName>>
body:
application/json:
type: identifier
responses:
204:
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
422:
description: "Unprocessable Entity"
body:
application/json:
type: errors
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
compositeOpenTransactionsResource:
get:
description: "Check if user has any open transactions, and if so, how many. Identify user by <<typeName>>"
responses:
200:
body:
application/json:
type: openTransactions
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
404:
description: "User not found"
body:
text/plain:
example: "User not found"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/bl-users:
get:
description: Get a number of user (and possibly related) records based on criteria in the user and related modules
is: [
searchable: {description: "", example: "active=true"},
pageable,
includeable
]
responses:
200:
body:
application/json:
type: compositeUserListObject
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
403:
description: "Access denied"
body:
text/plain:
example: "Access denied"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/by-id:
/{id}:
type: { compositeUserResource: { "typeName" : "id" } }
delete:
description: "Delete a user by id"
responses:
204:
description: "User deleted successfully"
404:
description: "User with a given ID not found"
body:
text/plain:
409:
description: "Conflict, e.g. user cannot be deleted as there are open transactions"
body:
application/json:
type: openTransactions
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
text/plain:
example: "Internal server error, contact administrator"
/open-transactions:
type: { compositeOpenTransactionsResource: { "typeName" : "id" } }
/by-username:
/{username}:
type: { compositeUserResource: { "typeName" : "username"} }
is: [includeable]
/open-transactions:
type: { compositeOpenTransactionsResource: { "typeName" : "username" } }
/_self:
type: { compositeUserResource: { "typeName" : "self reference" } }
/login:
post:
description: Allow a new user to login and return an authtoken, along with a composite user record. Deprecated and will be removed in a future release. Please use /login-with-expiry.
is: [permissionsExpandable, includeable]
headers:
User-Agent:
X-Forwarded-For:
body:
application/json:
type: loginCredentials
responses:
201:
body:
application/json:
type: compositeUser
headers:
x-okapi-token:
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
422:
description: "Unprocessable Entity"
body:
application/json:
type: errors
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/login-with-expiry:
post:
description: |
Allow a new user to login and return two cookies, one containing the user's refresh token
and one containing an access token. Both tokens have an expiration. The expiration time
for each is contained in the composite user token expiration property. If you don't need
the data in the composite user you should call the /authn/login-with-expiry API instead.
is: [permissionsExpandable, includeable]
headers:
User-Agent:
X-Forwarded-For:
body:
application/json:
schema: loginCredentials
responses:
201:
description: |
Returns a CompositeUser object in addition to two Set-Cookie headers, one containing
the refresh token and one containing the access token. Note that the Set-Cookie headers are
set in BLUsersAPI.java using the raw response object rather than through RMB code-generation.
This is because RMB code generation doesn't let us do multiple headers with the same name,
which we need to do here.
body:
application/json:
schema: compositeUser
400:
description: "Bad request"
body:
text/plain:
example: "Bad request"
422:
description: "Unprocessable Entity"
body:
application/json:
type: errors
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/forgotten:
/password:
type: {compositeForgottenResource: {"resourceTypeName" : "a password"}}
/username:
type: {compositeForgottenResource: {"resourceTypeName" : "a username"}}
/settings:
/myprofile:
/password:
post:
description: Allow change password for user
headers:
User-Agent:
X-Forwarded-For:
body:
application/json:
type: updateCredentials
responses:
204:
description: "Successful update"
body:
text/plain: !!null
400:
description: "Bad request"
body:
application/json:
type: errors
401:
description: "Unauthorized"
body:
text/plain:
example: "Unauthorized"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/password-reset:
/link:
post:
description: Generate and send password reset link
body:
application/json:
type: generateLinkRequest
responses:
200:
body:
application/json:
type: generateLinkResponse
/reset:
post:
description: "Reset password"
headers:
User-Agent:
X-Forwarded-For:
body:
application/json:
type: passwordReset
responses:
204:
description: "Successful password reset"
422:
description: "Unprocessable Entity"
body:
text/plain:
example: "Bad request"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
/validate:
post:
responses:
204:
description: "Successful link validation"
422:
description: "Unprocessable Entity"
body:
text/plain:
example: "Bad request"
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"