-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.raml
690 lines (690 loc) · 18.3 KB
/
api.raml
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
#%RAML 1.0
title: Password Manager Backend
version: 4
protocols: [ HTTPS ]
mediaType: application/json
securitySchemes:
AuthzHttpOnlyCookie:
type: x-cookie
describedBy:
headers:
Cookie:
description: |
The access token is stored in a secure, HttpOnly cookie
type: string
example: access_token=your_secure_token_value
securedBy: [ AuthzHttpOnlyCookie ]
types:
Config:
type: object
properties:
idpName: string
support:
type: object
properties:
phone: string
email: string
url: string
feedbackUrl: string
passwordRules:
type: object
properties:
minLength: integer
maxLength: integer
minScore: integer
hibpEnable: boolean
example:
{
"idpName": "Acme",
"support": {
"phone": "1-234-567-8901",
"email": "[email protected]",
"url": "http://support.example.com",
"feedbackUrl": "[email protected]"
},
"passwordRules": {
"minLength": 10,
"maxLength": 255,
"minScore": 3,
"enableHIBP": true
}
}
}
Error:
type: object
properties:
name: string
message: string
code: integer
status: integer
example:
{
"name": "Bad Request",
"message": "Unable to update password. If this password has been used before please use something different.",
"code": 1469194882,
"status": 409
}
Method:
type: object
properties:
id?: string
value: string
type:
enum: [ primary, supervisor, email ]
verified?: boolean
example:
value:
{
"id": "nFV7mQQJl3L0PB4kfS2tG1YYbmzT0Ghm",
"type": "email",
"value": "[email protected]"
}
Mfa:
type: object
properties:
id?: integer
type:
enum: [ backupcode, totp, webauthn ]
label?: string
created_utc?: string
last_used_utc?: string
data?: array
example:
{
"id": 1,
"type": "backupcode",
"label": "a_label",
"created_utc": "2018-09-07T17:46:37Z",
"last_used_utc": "2018-09-07T17:47:06Z",
"data": [
"count": 9
]
}
MfaWebauthn:
type: object
properties:
id?: integer
type: string
label?: string
created_utc?: string
last_used_utc?: string
data?: array
example:
{
"id": 1,
"type": "webauthn",
"label": "",
"created_utc": "2018-09-07T17:46:37Z",
"last_used_utc": "2018-09-07T17:47:06Z",
"data": [
{
"id": 11,
"mfa_id": 1,
"key_handle_hash": "ABC123",
"label": "Security Key-1",
"created_utc": "2018-09-07T17:46:37Z",
"last_used_utc": "2018-09-07T17:47:06Z"
}
]
}
Webauthn:
type: object
properties:
id: integer
mfa_id: integer
key_handle_hash: string
label: string
created_utc: string
last_used_utc?: string
example:
{
"id": 11,
"mfa_id": 1,
"key_handle_hash": "ABC123",
"label": "My First Security Key",
"created_utc": "2018-09-07T17:46:37Z",
"last_used_utc": "2018-09-07T17:47:06Z"
}
PasswordMeta:
type: object
properties:
last_changed: string
expires: string
example:
{
"last_changed": "2018-09-13T19:21:57Z",
"expires": "2020-09-13T23:59:59Z"
}
Reset:
description: |
An object holding the verified emails that can be used for performing
a password reset. The addresses in the response are
masked for privacy.
type: object
properties:
uid: string
methods: Method[]
example:
{
"uid": 123asdf123lkjfsdfw23,
"methods": [
{
"type": "primary",
"value": "i****@s**.com"
},
{
"type": "supervisor",
"value": "a*******@s**.org"
},
{
"id": a4a45eg5h6h7tjy8kaw4w33,
"type": "email",
"value": "j****@c*********.com"
}
]
}
User:
description: |
A limited set of information describing a user account. Does not necessarily
contain all of the properties in the personnel record, and may contain other
non-personnel information.
type: object
properties:
uuid: string
first_name: string
last_name: string
idp_username: string
email: string
auth_type:
enum: [ login, reset ]
hide:
enum: [ yes, no ]
last_login: string
password_meta?: PasswordMeta
manager_email?: string
example:
{
"uuid": "55b2447f-87f7-4286-8bd1-a7478f9dae38",
"first_name": "John",
"last_name": "Doe",
"idp_username": "john_doe",
"email": "[email protected]",
"auth_type": "login",
"hide": "no",
"last_login": "2018-09-13T19:21:57Z",
"password_meta": {
"last_changed": "2018-09-13T19:21:57Z",
"expires": "2020-09-13T23:59:59Z"
}
"manager_email": "[email protected]"
}
/auth:
/login:
get:
securedBy: null
queryParameters:
ReturnTo:
description: URL to return to after login or invite
type: string
ReturnToOnError?:
description: URL to return to in case of expired invite
type: string
invite?:
description: New user invite code
type: string
responses:
302:
description: >
On successful login or invite, a redirection to `ReturnTo`. If `invite` was provided, but it has expired,
this response will be a redirection to `ReturnToOnError` with no query string parameters.
headers:
location:
description: redirect URL
type: string
example:
https://idp-pw.org/profile/#
400:
description: Error or missing information in request.
post:
securedBy: null
body:
mediaType: application/x-www-form-urlencoded
properties:
SAMLResponse:
RelayState:
/logout:
get:
securedBy: null
responses:
200:
/config:
get:
securedBy: null
description: Request various configuration parameters.
responses:
200:
body:
type: Config
500:
description: Backend configuration is missing one or more parameters.
/method:
get:
description: >
Request a list of password recovery methods, including methods
not yet verified.
responses:
200:
body:
type: Method[]
500:
description: User not found in personnel database.
post:
description: >
Create a new password recovery method. The creation of a method
is not completed until the following verification call is made.
Unverified Methods will automatically expire if not verified
within a certain amount of time.
body:
properties:
value: string
responses:
200:
body:
type: Method
400:
description: Missing parameter
409:
description: New method matches an already existing verified method
500:
description: Database or other system error
/{methodId}:
get:
description: Request a single verified password recovery method.
responses:
200:
body:
type: Method
404:
description: Method not found.
body:
type: Error
delete:
description: Delete a recovery method object.
responses:
204:
description: Method has been deleted.
404:
description: Method not found.
500:
description: Delete failed.
/verify:
securedBy: null
put:
description: Attempt to verify a recovery method.
body:
properties:
code: string
responses:
200:
body:
type: Method
400:
description: Submitted code was incorrect or missing.
404:
description: Method not found.
410:
description: Expired verification code
429:
description: Too many verification attempts on this method.
500:
description: Database or other system error
/resend:
put:
description: Resend recovery verification message.
responses:
204:
description: Message sent.
400:
description: Method already verified.
500:
description: Resend failed.
/mfa:
get:
description: Request a list of MFA objects for logged in user.
responses:
200:
body:
type: Mfa
500:
body:
type: Error
post:
description: |
Create a new MFA object. Only properties `type` and `label` are
needed in the request.
body:
type: Mfa
responses:
200:
description: |
MFA object created. Only `id` and `data` are in the response.
If `type` is `backupcode` then `data` is populated with the
backup codes.
body:
type: Mfa
409:
description: >
An MFA of the requested type already exists. Note that this would only
be returned for 'totp' or 'webauthn'. The code types ('backupcode' and
'manager') reuse the existing MFA and create new codes.
body:
type: Error
400:
description: Property `type` was omitted.
body:
type: Error
/{mfaId}:
put:
description: Update an MFA object.
body:
properties:
label: string
responses:
200:
description: Object updated
body:
type: Mfa
400:
description: Property `label` was blank or omitted.
body:
type: Error
404:
description: Object not found
body:
type: Error
delete:
description: Delete an MFA object.
responses:
200:
description: Object deleted
404:
description: Object not found
body:
type: Error
/verify:
put:
description: Attempt to verify an MFA object.
body:
properties:
value: string
responses:
200:
description: MFA verified successfully.
body:
type: Mfa
400:
description: Property `value` was omitted or incorrect.
429:
description: Too many verify requests have been attempted.
/registration:
put:
description: Verify the registration of a new mfa webauthn credential.
body:
properties:
value: array
label: string
example: |
{
"value": {
"id":"abc123",
"rawId":"abc123",
"response": {
"attestationObject":"abc123",
"clientDataJSON":"abc123"
},
"type":"public-key",
"clientExtensionResults":{},
"transports":["usb"]
}
"label": "Yubikey"
}
responses:
200:
description: Value provided passed verification
body:
type: MfaWebauthn
400:
description: >
Value provided failed verification or was unacceptable for some
other reason (such as current user's `employee_id` was not accepted).
body:
type: Error
404:
description: No MFA record found with that `id` and `employee_id`.
body:
type: Error
/webauthn:
/{webauthnId}:
put:
description: Update the label of a MFA webauthn credential.
body:
properties:
label: string
example: |
{
"label": "My First Security Key"
}
responses:
200:
description: Webauthn label successfully updated
body:
type: Webauthn
400:
description: Missing or blank label value or invalid employee_id
body:
type: Error
403:
description: Forbidden for user with auth_type not 'login'.
body:
type: Error
404:
description: >
No MFA record found with that `mfa_id` or no webauthn
record found with that `id` and that `mfa_id`.
body:
type: Error
500:
description: Internal server error
body:
type: Error
delete:
description: >
Delete a webauthn credential from an MFA. If it is the last credential,
the whole MFA will be deleted.
responses:
204:
description: Successful deletion of record
400:
description: current user's employee_id was not accepted
body:
type: Error
403:
description: The MFA record was not of type webauthn
body:
type: Error
404:
description: >
No MFA record found with that `mfa_id` or no webauthn
record found with that `id` and that `mfa_id`.
body:
type: Error
500:
description: Unable to delete the webauthn credential or the MFA record
body:
type: Error
/password:
put:
description: Set a new password.
body:
properties:
password:
type: string
example:
{
"password": "abc123!@*ABC"
}
responses:
200:
body:
type: PasswordMeta
400:
description: A password was not provided or it does not pass validation.
body:
type: Error
409:
description: The requested password has been used too recently.
body:
type: Error
get:
description: Get password metadata.
responses:
200:
body:
type: PasswordMeta
/assess:
put:
description: Assess whether a new password will pass all validation rules.
body:
properties:
password: string
example:
{
"password": "abc123!@#ABC"
}
responses:
204:
description: All validation rules pass.
400:
description: A password was not provided or it does not pass validation.
body:
type: Error
409:
description: The requested password has been used too recently.
body:
type: Error
/reset:
post:
securedBy: null
description: |
Initiate a password reset.
Sends reset email to primary email address with a link like
`https://idp-pw.local/#/recovery/verify/{resetUid}/{code}`
Responds with id of reset object and all available email addresses
for the user.
body:
properties:
username:
type: string
verification_token?:
description: |
ReCAPTCHA verification token. Required if app is configured
to require ReCAPTCHA for password reset.
type: string
responses:
200:
body:
type: Reset
/{resetId}:
get:
securedBy: null
description: Request the reset object by its id.
responses:
200:
body:
type: Reset
put:
securedBy: null
description: >
Update the reset to use a different email. If `type` is `email`,
then this request is for an alternate recovery Method, and
`methodId` is required.
body:
properties:
type:
enum: [ primary, supervisor, email ]
methodId?: string
responses:
200:
body:
type: Reset
400:
description: >
The reset `type` was not provided or is not valid, or the
`methodId` parameter was not provided when required.
body:
type: Error
404:
description: >
The reset could not be found or the referenced Method has
not been verified.
body:
type: Error
/resend:
put:
securedBy: null
description: Request to resend verification email.
responses:
200:
body:
type: Reset
404:
description: Reset could not be found.
body:
type: Error
/validate:
put:
securedBy: null
description: Validate reset code to complete password reset process
body:
properties:
code: string
responses:
200:
description: >
Reset was validated. Subsequent API calls will use a http only cookie for the access token.
400:
description: >
The provided code was incorrect.
410:
description: >
The code has expired.
/site:
/system-status:
get:
securedBy: null
description: Check site status.
responses:
200:
description: Site is operational.
/user:
/me:
description: Operations for currently-authenticated user.
get:
description: Request basic information for the user.
responses:
200:
body:
type: User
put:
description: >
Limited options for updating the user record. If no
properties are provided, no changes will be made.
body:
properties:
hide?:
enum: [ yes, no ]
responses:
200:
description: User information after changes have been made.
body:
type: User