-
Notifications
You must be signed in to change notification settings - Fork 6
/
the-usher-openapi-spec.yaml
1837 lines (1776 loc) · 53.3 KB
/
the-usher-openapi-spec.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
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
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: The Usher
description: |
The Usher server allows a business to authorize an identified user for access to resources or services offered by the business.
contact:
name: The Usher Support Page
url: https://github.com/DMGT-TECH/the-usher-server/issues
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: 2.5.0
externalDocs:
description: GitHub Repository
url: https://github.com/DMGT-TECH/the-usher-server
servers:
- url: https://localhost:3001
- url: https://o07e9wdidk.execute-api.us-east-1.amazonaws.com/prod
tags:
- name: Server Configuration
description: This API endpoint allows setting up initial top-level admin personas, who must subsequently access the other endpoints with a valid ID token.
- name: Self APIs
description: The Self APIs are the main APIs accessed by a client application that a persona has logged in to.
- name: Admin APIs
description: APIs that provide access to top-level Usher Related data
- name: Client Admin APIs
description: APIs that provide access to client specific data and operations
#Default security scheme:
security:
- bearerSelfAuth: []
- bearerAdminAuth: []
- bearerClientAdminAuth: []
paths:
/:
get:
operationId: getConfiguration
'x-swagger-router-controller': 'endpoint_root'
summary: Returns basic information about this server.
description: This endpoint returns a JSON object with URIs for an authenticated persona to obtain an access token, and for an API or client application to get this server's JSON Web Key Set (JWKS).
security:
#any authenticated user
- bearerSelfAuth: []
- bearerAdminAuth: []
tags:
- Server Configuration
responses:
'200':
description: On success.
content:
application/json:
schema:
$ref: '#/components/schemas/ServerConfig'
default:
$ref: '#/components/responses/Default'
/.well-known/jwks.json:
get:
'x-swagger-router-controller': 'endpoint_jwksjson'
operationId: getJwks
summary: Returns this server's public key in JSON Web Key Set (JWKS) format.
tags:
- Server Configuration
description: "Returns public key information that can be used to verify the signature on tokens (JWTs) issued by this server."
security: [] # public endpoint
responses:
'200':
description: On success.
content:
application/json:
schema:
$ref: '#/components/schemas/Jwks'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/clients:
get:
operationId: getSelfClients
'x-swagger-router-controller': 'endpoint_self_clients'
tags:
- Self APIs
security:
- bearerSelfAuth: []
summary: List all of the client applications for which currently logged-in persona has at least one role or permission.
parameters:
- $ref: '#/components/parameters/userContextParam'
responses:
'200':
description: On success.
content:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfSelfClients'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/roles:
get:
operationId: getSelfRoles
'x-swagger-router-controller': 'endpoint_self_roles'
tags:
- Self APIs
security:
- bearerSelfAuth: []
summary: List entitled roles for the currently logged-in persona for the client application(s).
description: |-
Returns the list of roles assigned to this persona and for the group(s) of which they are a member.
parameters:
- $ref: '#/components/parameters/clientIdParam'
- $ref: '#/components/parameters/userContextParam'
- $ref: '#/components/parameters/payloadFormatParam'
responses:
'200':
description: On success return a list of granted roles.
content:
application/json:
schema:
$ref: '#/components/schemas/CollectionOfRoles'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/permissions:
get:
operationId: getSelfPermissions
'x-swagger-router-controller': 'endpoint_self_permissions'
tags:
- Self APIs
security:
- bearerSelfAuth: []
summary: List entitled permissions for the currently logged-in persona for the client application(s).
description: |-
Returns the list of permissions assigned to this persona and for the group(s) of which they are a member. <P>
parameters:
- $ref: '#/components/parameters/clientIdParam'
- $ref: '#/components/parameters/userContextParam'
- $ref: '#/components/parameters/payloadFormatParam'
responses:
'200':
description: On success return a list of granted permissions.
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/CollectionOfPermissions'
- $ref: '#/components/schemas/DictionaryOfPermissions'
- $ref: '#/components/schemas/ArrayOfPermissions'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/scope:
get:
'x-swagger-router-controller': 'endpoint_self_scopes'
tags:
- Self APIs
security:
- bearerSelfAuth: []
summary: List the granted roles and permissions of the currently logged-in persona for the client application.
description: |-
Returns a list of permissions and roles assigned to this persona and for the group(s) of which they are a member. A smaller scope than what was requested may be returned.
operationId: listSelfScopes
parameters:
- $ref: '#/components/parameters/clientIdParam'
- $ref: '#/components/parameters/userContextParam'
- $ref: '#/components/parameters/scopeParam'
- $ref: '#/components/parameters/payloadFormatParam'
responses:
'200':
description: On success, returns a keyed list of granted entitlements.
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/CollectionOfScope'
- $ref: '#/components/schemas/DictionaryOfScope'
- $ref: '#/components/schemas/ArrayOfScope'
- $ref: '#/components/schemas/HierarchyOfScope'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/token:
post:
'x-swagger-router-controller': 'endpoint_self_token'
operationId: issueSelfToken # https://tools.ietf.org/html/rfc7523#section-2.1
summary: Issue an access token (JWT) containing permissions for the logged-in persona to cover the requested scope.
description: |
Returns, in the response body (not in the header), a signed JWT access token with the requested scope, if granted. May return a smaller scope if fewer entitlements were granted to the persona. Requires a signed access token from the Persona Authorization (identity) server (e.g., Auth0, Cognito, or Azure AD) containing the **sub** claim and possibly a **groups** claim if individual personas are not being managed on this server for the given client application.
Use this endpoint if the scope need to be passed to a publicly accessible resource server.
tags:
- Self APIs
security:
- bearerSelfAuth: []
parameters:
- $ref: '#/components/parameters/clientIdParam'
- $ref: '#/components/parameters/userContextParam'
- $ref: '#/components/parameters/scopeParam'
- $ref: '#/components/parameters/lifetimeParam'
responses:
'200':
description: Returns a signed JWT containing the following JSON payload.
headers:
X-OAuth-Scopes:
schema:
type: string
description: The scopes the token has authorized.
X-Accepted-OAuth-Scopes:
schema:
type: string
description: The scopes that the action checks for.
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'415':
$ref: '#/components/responses/UnsupportedMediaType'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/self/refresh_token:
post:
'x-swagger-router-controller': 'endpoint_self_refresh_token'
operationId: issueSelfRefreshToken
summary: Issue a refreshed access token (JWT) containing permissions for the logged-in persona to cover the requested scope.
description: "Returns, in the response body (not in the header), a signed JWT access token with the requested scope, if granted. May return a smaller scope if fewer entitlements were granted to the persona. Requires a non-expired refresh token issued by The Usher's <b>/self/token</b> endpoint."
tags:
- Self APIs
security: [] # public endpoint
parameters:
- name: client_id
description: Unique identifier for the client.
in: query
required: true
schema:
$ref: '#/components/schemas/EntityNameDef'
- $ref: '#/components/parameters/userContextParam'
- name: grant_type
schema:
type: string
maxLength: 13
minLength: 13
pattern: '\brefresh_token\b'
in: query
required: true
description: "Value MUST be set to \"refresh_token\""
- name: refresh_token
schema:
type: string
maxLength: 36
minLength: 36
pattern: '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4{1}[a-fA-F0-9]{3}-[89abAB]{1}[a-fA-F0-9]{3}-[a-fA-F0-9]{12}$'
in: query
required: true
description: "The refresh_token issued to the client returned in the response from <b>/self/token</b>"
responses:
'200':
description: Returns a signed JWT containing the following JSON payload.
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
'400':
$ref: '#/components/responses/BadRequest'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'415':
$ref: '#/components/responses/UnsupportedMediaType'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Default'
/roles:
get:
'x-swagger-router-controller': 'endpoint_roles'
operationId: getRoles
summary: Get a List of Roles for a given Client
tags:
- Admin APIs
security:
- bearerAdminAuth: []
parameters:
- $ref: '#/components/parameters/clientIdQueryParam'
- $ref: '#/components/parameters/includePermissionsQueryParam'
responses:
200:
description: The List of Roles
content:
application/json:
schema:
$ref: '#/components/schemas/CollectionOfRolesWithPermissions'
400:
$ref: '#/components/responses/BadRequest'
post:
'x-swagger-router-controller': 'endpoint_roles'
operationId: createRole
summary: Create a new Role for a given Client
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
client_id:
type: string
name:
type: string
description:
type: string
required:
- client_id
- name
responses:
201:
description: The newly created Role
content:
application/json:
schema:
$ref: '#/components/schemas/Role'
400:
$ref: '#/components/responses/BadRequest'
/roles/{role_key}:
parameters:
- $ref: '#/components/parameters/roleKeyPathParam'
get:
'x-swagger-router-controller': 'roles/role_key'
summary: Get a single Role
operationId: getRole
tags:
- Admin APIs
security:
- bearerAdminAuth: []
parameters:
- $ref: '#/components/parameters/includePermissionsQueryParam'
responses:
200:
description: Return a Role for the given key
content:
application/json:
schema:
$ref: '#/components/schemas/RoleWithPermissions'
404:
$ref: '#/components/responses/NotFound'
patch:
'x-swagger-router-controller': 'roles/role_key'
summary: Update a single Role
operationId: patchRole
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description:
type: string
responses:
204:
description: OK if the Role is updated
404:
$ref: '#/components/responses/NotFound'
delete:
'x-swagger-router-controller': 'roles/role_key'
summary: Delete a single Role
operationId: deleteRole
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
204:
description: OK if the Role is deleted
404:
$ref: '#/components/responses/NotFound'
/roles/{role_key}/permissions:
parameters:
- $ref: '#/components/parameters/roleKeyPathParam'
get:
'x-swagger-router-controller': 'roles/permissions'
operationId: getRolesPermissions
summary: "Roles: Get list of Permissions"
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a list of permissions for the subject roles
content:
application/json:
schema:
$ref: "#/components/schemas/ArrayOfPermissionObject"
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
put:
'x-swagger-router-controller': 'roles/permissions'
operationId: createRolePermissions
summary: Assigns permissions to the subject role
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: array
minItems: 1
items:
type: integer
minimum: 1
responses:
204:
description: Successfully created permissions for the subject role
headers:
Location:
description: The URL to get all the role permissions
schema:
type: string
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/permissions:
get:
'x-swagger-router-controller': 'endpoint_permissions'
operationId: getPermissions
summary: Get a List of permissions, optionally filtered by name, client_id and client_key
tags:
- Admin APIs
security:
- bearerAdminAuth: []
parameters:
- $ref: '#/components/parameters/nameQueryParam'
- $ref: '#/components/parameters/clientIdQueryParam'
- $ref: '#/components/parameters/clientKeyQueryParam'
responses:
200:
description: The List of Permissions
content:
application/json:
schema:
type: array
items:
allOf:
- $ref: '#/components/schemas/PermissionObject'
- type: object
properties:
client_id:
type: string
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas:
get:
'x-swagger-router-controller': 'personas/persona'
operationId: getPersonas
summary: Retrieve a list of personas
parameters:
- name: key
in: query
description: Filter by key (exact match)
schema:
type: number
example: 10
- name: tenantkey
in: query
description: Filter by tenantkey (exact match)
schema:
type: number
example: 10
- name: tenantname
in: query
description: Filter by tenantname (exact match)
schema:
type: string
example: DMGT
- name: sub_claim
in: query
description: Filter by sub_claim (exact match)
schema:
type: string
example: auth0|test-persona
- name: user_context
in: query
description: Filter by user_context (exact match)
schema:
type: string
- name: sort
in: query
description: Sort the results by a field
schema:
type: string
example: sub_claim
enum:
[
key,
tenantkey,
tenantname,
sub_claim,
user_context,
created_at,
updated_at,
]
- name: order
in: query
description: Specify the sort order (asc or desc)
schema:
type: string
enum: [asc, desc]
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a list of personas
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Persona"
properties:
tenantname:
type: string
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
post:
'x-swagger-router-controller': 'personas/persona'
summary: Create a single persona
operationId: createPersona
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
tenant_key:
type: number
minimum: 1
format: int32
sub_claim:
type: string
user_context:
type: string
required:
- tenant_key
- sub_claim
responses:
201:
description: Returns the created persona
content:
application/json:
schema:
$ref: "#/components/schemas/Persona"
400:
$ref: '#/components/responses/BadRequest'
409:
$ref: '#/components/responses/Conflict'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas/{persona_key}:
get:
'x-swagger-router-controller': 'personas/persona'
operationId: getPersona
summary: Get a Persona by persona_key
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a persona
content:
application/json:
schema:
$ref: "#/components/schemas/Persona"
properties:
tenantname:
type: string
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
delete:
'x-swagger-router-controller': 'personas/persona'
operationId: deletePersona
summary: Deletes the subject persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
204:
description: Empty response on success
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas/{persona_key}/permissions:
get:
'x-swagger-router-controller': 'personas/permissions'
operationId: getPersonaPermissions
summary: Get a list of permissions assigned to the given Persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a list of permissions for the subject persona
content:
application/json:
schema:
$ref: "#/components/schemas/ArrayOfPermissionObject"
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
put:
'x-swagger-router-controller': 'personas/permissions'
operationId: createPersonaPermissions
summary: Assigns permissions to the subject persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: array
minItems: 1
items:
type: integer
minimum: 1
responses:
204:
description: Successfully created permissions for the subject persona
headers:
Location:
description: The URL to get all the persona permissions
schema:
type: string
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas/{persona_key}/permissions/{permission_key}:
delete:
'x-swagger-router-controller': 'personas/permissions'
operationId: deletePersonaPermission
summary: Removes a permission for subject persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
- $ref: '#/components/parameters/permissionKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
204:
description: Empty response on success
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas/{persona_key}/roles:
get:
'x-swagger-router-controller': 'personas/roles'
operationId: getPersonaRoles
summary: Get a list of roles assigned to the given Persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
- $ref: '#/components/parameters/includePermissionsQueryParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a list of roles for the subject persona
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/RoleWithPermissions"
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
put:
'x-swagger-router-controller': 'personas/roles'
operationId: createPersonaRoles
summary: Assigns roles to the subject persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: array
minItems: 1
items:
type: integer
minimum: 1
responses:
204:
description: Successfully created roles for the subject persona
headers:
Location:
description: The URL to get all the persona roles
schema:
type: string
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/personas/{persona_key}/roles/{role_key}:
delete:
'x-swagger-router-controller': 'personas/roles'
operationId: deletePersonaRole
summary: Removes a role for subject persona
parameters:
- $ref: '#/components/parameters/personaKeyPathParam'
- $ref: '#/components/parameters/roleKeyPathParam'
tags:
- Admin APIs
security:
- bearerAdminAuth: []
responses:
204:
description: Empty response on success
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
/clients:
get:
'x-swagger-router-controller': 'clients/index'
operationId: getClients
summary: Get a list of Clients
tags:
- Client Admin APIs
security:
- bearerAdminAuth: []
responses:
200:
description: Returns a list of clients
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Client"
401:
$ref: '#/components/responses/Unauthorized'
500:
$ref: '#/components/responses/InternalError'
503:
$ref: '#/components/responses/ServiceUnavailableError'
post:
'x-swagger-router-controller': 'clients/index'
operationId: createClient
summary: Create a new Client
tags:
- Client Admin APIs
security:
- bearerAdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
tenant_name:
type: string
client_id:
type: string
maxLength: 50
pattern: ^[a-z0-9-_]*$
name:
type: string
maxLength: 50
description:
type: string
secret:
type: string
required:
- tenant_name
- client_id
- name
responses:
201:
description: The newly created Client object
content:
application/json:
schema:
$ref: '#/components/schemas/Client'
400:
$ref: '#/components/responses/BadRequest'
/clients/{client_id}:
parameters:
- $ref: '#/components/parameters/clientIdPathParam'
get:
'x-swagger-router-controller': 'clients/index'
operationId: getClient
summary: Get a single Client
tags:
- Client Admin APIs
security:
- bearerAdminAuth: []
- bearerClientAdminAuth: []
responses:
200:
description: Return details for the given Client object
content:
application/json:
schema:
$ref: '#/components/schemas/Client'
404:
$ref: '#/components/responses/NotFound'
delete:
'x-swagger-router-controller': 'clients/index'
operationId: deleteClient
summary: Delete a Client and associated data
description: In addition to deleting the Client, any roles belonging to this Client
are also deleted.
tags:
- Client Admin APIs
security:
- bearerAdminAuth: []
- bearerClientAdminAuth: []
responses:
204:
description: Successfully deleted the Client and data
404:
$ref: '#/components/responses/NotFound'
put: