forked from uc-cdis/requestor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
406 lines (366 loc) · 11.4 KB
/
openapi.yaml
File metadata and controls
406 lines (366 loc) · 11.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
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
components:
schemas:
Body_check_user_resource_paths_request_user_resource_paths_post:
properties:
permissions:
items: {}
title: Permissions
type: array
resource_paths:
items: {}
title: Resource Paths
type: array
required:
- resource_paths
title: Body_check_user_resource_paths_request_user_resource_paths_post
type: object
Body_update_request_request__request_id__put:
properties:
status:
title: Status
type: string
required:
- status
title: Body_update_request_request__request_id__put
type: object
CreateRequestInput:
description: Create an access request.
properties:
policy_id:
title: Policy Id
type: string
resource_display_name:
title: Resource Display Name
type: string
resource_id:
title: Resource Id
type: string
resource_path:
title: Resource Path
type: string
resource_paths:
items:
type: string
title: Resource Paths
type: array
role_ids:
items:
type: string
title: Role Ids
type: array
status:
title: Status
type: string
username:
title: Username
type: string
title: CreateRequestInput
type: object
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
title: Detail
type: array
title: HTTPValidationError
type: object
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
title: Location
type: array
msg:
title: Message
type: string
type:
title: Error Type
type: string
required:
- loc
- msg
- type
title: ValidationError
type: object
securitySchemes:
HTTPBearer:
scheme: bearer
type: http
info:
title: Requestor
version: 2.0.0
openapi: 3.1.0
paths:
/_status:
get:
operationId: get_status__status_get
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Get Status Status Get
type: object
description: Successful Response
summary: Get Status
tags:
- System
/_version:
get:
operationId: get_version__version_get
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Get Version Version Get
type: object
description: Successful Response
summary: Get Version
tags:
- System
/request:
get:
description: 'List all the requests the current user has access to see.
Use the "active" query parameter to get only the requests
created by the user that are not in DRAFT or FINAL statuses.
Add filter values as key=value pairs in the query string
to get filtered results.
Note: for filters based on Date, only follow `YYYY-MM-DD` format
Providing the same key with more than one value filters records whose
value of the given key matches any of the given values. But values of
different keys must all match.
Example: `GET /requests/request?policy_id=foo&policy_id=bar&revoke=False&status=APPROVED`
"policy_id=foo&policy_id=bar" means "the policy is either foo or bar" (same
field name).
"policy_id=foo&revoke=False" means "the policy is foo and revoke is false"
(different field names).'
operationId: list_requests_request_get
responses:
'200':
content:
application/json:
schema:
items: {}
title: Response List Requests Request Get
type: array
description: Successful Response
security:
- HTTPBearer: []
summary: List Requests
tags:
- Query
post:
description: "Create a new access request.\n\nUse the \"revoke\" query parameter\
\ to create a request to revoke access\ninstead of a request to grant access.\n\
\nIf no \"status\" is specified in the request body, will use the configured\n\
DEFAULT_INITIAL_STATUS. Because users can only request access to a\npolicy\
\ once, each (\"username\", \"policy_id\") combination must be\nunique unless\
\ past requests' statuses are in FINAL_STATUSES.\n\nIf no \"username\" is\
\ specified in the request body, will create an access\nrequest for the user\
\ who provided the token.\n\nThe request should include one of the following\
\ for which access is being granted:\n * policy_id\n * resource_path(s)\
\ + existing role_ids\n * resource_path(s) without a role_id (a default reader\
\ role is assigned)"
operationId: create_request_request_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRequestInput'
required: true
responses:
'201':
content:
application/json:
schema:
additionalProperties: true
title: Response Create Request Request Post
type: object
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
security:
- HTTPBearer: []
summary: Create Request
tags:
- Manage
/request/user:
get:
description: 'List current user''s requests.
Use the "active" query parameter to get only the requests
created by the user that are not in DRAFT or FINAL statuses.
Add filter values as key=value pairs in the query string
to get filtered results.
Note: for filters based on Date, only follow `YYYY-MM-DD` format
Providing the same key with more than one value filters records whose
value of the given key matches any of the given values. But values of
different keys must all match.
Example: `GET /requests/user?policy_id=foo&policy_id=bar&revoke=False&status=APPROVED`
"policy_id=foo&policy_id=bar" means "the policy is either foo or bar" (same
field name).
"policy_id=foo&revoke=False" means "the policy is foo and revoke is false"
(different field names).'
operationId: list_user_requests_request_user_get
responses:
'200':
content:
application/json:
schema:
items: {}
title: Response List User Requests Request User Get
type: array
description: Successful Response
security:
- HTTPBearer: []
summary: List User Requests
tags:
- Query
/request/user_resource_paths:
post:
description: 'Return whether the current user has already requested access to
the
specified resource path(s), including prefixes of the resource path(s).
If the previous request was denied or is still in draft status, will
return False.'
operationId: check_user_resource_paths_request_user_resource_paths_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body_check_user_resource_paths_request_user_resource_paths_post'
required: true
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Check User Resource Paths Request User Resource Paths
Post
type: object
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
security:
- HTTPBearer: []
summary: Check User Resource Paths
tags:
- Query
/request/{request_id}:
delete:
description: 'Delete an access request.
WARNING: deleting an access request that has already been approved does NOT
revoke the access
that has been granted. It only removes the trace of that access request from
the database.'
operationId: delete_request_request__request_id__delete
parameters:
- in: path
name: request_id
required: true
schema:
format: uuid
title: Request Id
type: string
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Delete Request Request Request Id Delete
type: object
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
security:
- HTTPBearer: []
summary: Delete Request
tags:
- Manage
get:
operationId: get_request_request__request_id__get
parameters:
- in: path
name: request_id
required: true
schema:
format: uuid
title: Request Id
type: string
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Get Request Request Request Id Get
type: object
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
security:
- HTTPBearer: []
summary: Get Request
tags:
- Query
put:
description: Update an access request with a new "status".
operationId: update_request_request__request_id__put
parameters:
- in: path
name: request_id
required: true
schema:
format: uuid
title: Request Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body_update_request_request__request_id__put'
required: true
responses:
'200':
content:
application/json:
schema:
additionalProperties: true
title: Response Update Request Request Request Id Put
type: object
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
security:
- HTTPBearer: []
summary: Update Request
tags:
- Manage