Skip to content

Commit 1825744

Browse files
authored
Is1717/fine tune default access rights (#1721)
any service before 19.08.2020 is visible by everyone any service after 19.08.2020 will follow "full privacy" rationale (only the owner sees the service)
1 parent adc6ad8 commit 1825744

33 files changed

+2713
-639
lines changed

api/specs/common/schemas/services.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ components:
2525
enum:
2626
- CPU
2727
- GPU
28+
service_build_details:
29+
type: object
30+
properties:
31+
build_date:
32+
type: string
33+
vcs_ref:
34+
type: string
35+
vcs_url:
36+
type: string
2837

2938
ServiceExtrasEnveloped:
3039
type: object

api/specs/director/openapi.yaml

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,31 @@ servers:
1515
url: http://{host}:{port}/{version}
1616
variables:
1717
host:
18-
default: 'localhost'
18+
default: "localhost"
1919
port:
20-
default: '8080'
20+
default: "8080"
2121
version:
22-
default: 'v0'
22+
default: "v0"
2323
enum:
24-
- 'v0'
24+
- "v0"
2525
- description: Production server
2626
url: http://director:{port}/{version}
2727
variables:
2828
port:
29-
default: '8080'
29+
default: "8080"
3030
version:
31-
default: 'v0'
31+
default: "v0"
3232
enum:
33-
- 'v0'
34-
33+
- "v0"
3534

3635
# tags are used for organizing operations
3736
tags:
38-
- name: admins
39-
description: Secured Admin-only calls
40-
- name: developers
41-
description: Operations available to regular developers
42-
- name: users
43-
description: Operations available to regular users
37+
- name: admins
38+
description: Secured Admin-only calls
39+
- name: developers
40+
description: Operations available to regular developers
41+
- name: users
42+
description: Operations available to regular users
4443

4544
paths:
4645
/:
@@ -56,13 +55,13 @@ paths:
5655
content:
5756
application/json:
5857
schema:
59-
$ref: '#/components/schemas/HealthCheckEnveloped'
58+
$ref: "#/components/schemas/HealthCheckEnveloped"
6059
default:
6160
description: Unexpected error
6261
content:
6362
application/json:
6463
schema:
65-
$ref: '#/components/schemas/ErrorEnveloped'
64+
$ref: "#/components/schemas/ErrorEnveloped"
6665

6766
/services:
6867
get:
@@ -72,26 +71,26 @@ paths:
7271
description: Lists available services in the oSparc platform
7372
operationId: services_get
7473
parameters:
75-
- $ref: '#/components/parameters/ServiceType'
74+
- $ref: "#/components/parameters/ServiceType"
7675
responses:
7776
"200":
7877
description: Success, returns the list of available services
7978
content:
8079
application/json:
8180
schema:
82-
$ref: '#/components/schemas/ServicesEnveloped'
81+
$ref: "#/components/schemas/ServicesEnveloped"
8382
"401":
8483
description: Unauthorized access
8584
content:
8685
application/json:
8786
schema:
88-
$ref: '#/components/schemas/ErrorEnveloped'
87+
$ref: "#/components/schemas/ErrorEnveloped"
8988
default:
9089
description: Unexpected error
9190
content:
9291
application/json:
9392
schema:
94-
$ref: '#/components/schemas/ErrorEnveloped'
93+
$ref: "#/components/schemas/ErrorEnveloped"
9594

9695
/services/{service_key}/{service_version}:
9796
get:
@@ -101,69 +100,69 @@ paths:
101100
description: Returns details of the selected service if available in the oSparc platform
102101
operationId: services_by_key_version_get
103102
parameters:
104-
- $ref: '#/components/parameters/ServiceKeyPath'
105-
- $ref: '#/components/parameters/ServiceVersionPath'
103+
- $ref: "#/components/parameters/ServiceKeyPath"
104+
- $ref: "#/components/parameters/ServiceVersionPath"
106105
responses:
107106
"200":
108107
description: Success, returns the details of the service
109108
content:
110109
application/json:
111110
schema:
112-
$ref: '#/components/schemas/ServicesEnveloped'
111+
$ref: "#/components/schemas/ServicesEnveloped"
113112
"401":
114113
description: Unauthorized access
115114
content:
116115
application/json:
117116
schema:
118-
$ref: '#/components/schemas/ErrorEnveloped'
117+
$ref: "#/components/schemas/ErrorEnveloped"
119118
"404":
120119
description: Service not found
121120
content:
122121
application/json:
123122
schema:
124-
$ref: '#/components/schemas/ErrorEnveloped'
123+
$ref: "#/components/schemas/ErrorEnveloped"
125124
default:
126125
description: Unexpected error
127126
content:
128127
application/json:
129128
schema:
130-
$ref: '#/components/schemas/ErrorEnveloped'
129+
$ref: "#/components/schemas/ErrorEnveloped"
131130

132131
/service_extras/{service_key}/{service_version}:
133132
get:
134133
tags:
135134
- users
136135
summary: Returns the service's details which should be hidden from the user defined as extras.
137136
description: Currently returns the node_requirements an array of resoruces needed for scheduling.
138-
operationId: services_extras_get
137+
operationId: service_extras_by_key_version_get
139138
parameters:
140-
- $ref: '#/components/parameters/ServiceKeyPath'
141-
- $ref: '#/components/parameters/ServiceVersionPath'
139+
- $ref: "#/components/parameters/ServiceKeyPath"
140+
- $ref: "#/components/parameters/ServiceVersionPath"
142141
responses:
143142
"200":
144143
description: Success, returns an object containing details hidden from the user
145144
content:
146145
application/json:
147146
schema:
148-
$ref: '#/components/schemas/ServiceExtrasEnveloped'
147+
$ref: "#/components/schemas/ServiceExtrasEnveloped"
149148
"401":
150149
description: Unauthorized access
151150
content:
152151
application/json:
153152
schema:
154-
$ref: '#/components/schemas/ErrorEnveloped'
153+
$ref: "#/components/schemas/ErrorEnveloped"
155154
"404":
156155
description: Service not found
157156
content:
158157
application/json:
159158
schema:
160-
$ref: '#/components/schemas/ErrorEnveloped'
159+
$ref: "#/components/schemas/ErrorEnveloped"
161160
default:
162161
description: Unexpected error
163162
content:
164163
application/json:
165164
schema:
166-
$ref: '#/components/schemas/ErrorEnveloped'
165+
$ref: "#/components/schemas/ErrorEnveloped"
167166

168167
/running_interactive_services:
169168
get:
@@ -188,62 +187,62 @@ paths:
188187
content:
189188
application/json:
190189
schema:
191-
$ref: '#/components/schemas/RunningServicesEnveloped'
190+
$ref: "#/components/schemas/RunningServicesEnveloped"
192191
default:
193192
description: Unexpected error
194193
content:
195194
application/json:
196195
schema:
197-
$ref: '#/components/schemas/ErrorEnveloped'
196+
$ref: "#/components/schemas/ErrorEnveloped"
198197
post:
199198
tags:
200199
- users
201200
summary: Starts an interactive service in the oSparc platform
202201
operationId: running_interactive_services_post
203202
parameters:
204-
- $ref: '#/components/parameters/UserId'
205-
- $ref: '#/components/parameters/ProjectId'
206-
- $ref: '#/components/parameters/ServiceKey'
207-
- $ref: '#/components/parameters/ServiceVersion'
208-
- $ref: '#/components/parameters/AssignmentUuid'
209-
- $ref: '#/components/parameters/ServiceBasePath'
203+
- $ref: "#/components/parameters/UserId"
204+
- $ref: "#/components/parameters/ProjectId"
205+
- $ref: "#/components/parameters/ServiceKey"
206+
- $ref: "#/components/parameters/ServiceVersion"
207+
- $ref: "#/components/parameters/AssignmentUuid"
208+
- $ref: "#/components/parameters/ServiceBasePath"
210209
responses:
211210
"201":
212211
description: Succesfully created the service in the oSparc platform. Returns the location where the service runs.
213212
content:
214213
application/json:
215214
schema:
216-
$ref: '#/components/schemas/RunningServiceEnveloped'
215+
$ref: "#/components/schemas/RunningServiceEnveloped"
217216
"400":
218217
description: Malformed function call, missing field
219218
content:
220219
application/json:
221220
schema:
222-
$ref: '#/components/schemas/ErrorEnveloped'
221+
$ref: "#/components/schemas/ErrorEnveloped"
223222
"401":
224223
description: Unauthorized access
225224
content:
226225
application/json:
227226
schema:
228-
$ref: '#/components/schemas/ErrorEnveloped'
227+
$ref: "#/components/schemas/ErrorEnveloped"
229228
"404":
230229
description: Service not found
231230
content:
232231
application/json:
233232
schema:
234-
$ref: '#/components/schemas/ErrorEnveloped'
233+
$ref: "#/components/schemas/ErrorEnveloped"
235234
"409":
236235
description: A service with the same uuid already exists
237236
content:
238237
application/json:
239238
schema:
240-
$ref: '#/components/schemas/ErrorEnveloped'
239+
$ref: "#/components/schemas/ErrorEnveloped"
241240
default:
242241
description: Unexpected error
243242
content:
244243
application/json:
245244
schema:
246-
$ref: '#/components/schemas/ErrorEnveloped'
245+
$ref: "#/components/schemas/ErrorEnveloped"
247246

248247
/running_interactive_services/{service_uuid}:
249248
get:
@@ -253,40 +252,40 @@ paths:
253252
description: Succesfully returns if a service with the defined uuid is up and running
254253
operationId: running_interactive_services_get
255254
parameters:
256-
- $ref: '#/components/parameters/ServiceUuid'
255+
- $ref: "#/components/parameters/ServiceUuid"
257256
responses:
258257
"200":
259258
description: OK service exists and runs. Returns service location.
260259
content:
261260
application/json:
262261
schema:
263-
$ref: '#/components/schemas/RunningServiceEnveloped'
262+
$ref: "#/components/schemas/RunningServiceEnveloped"
264263
"400":
265264
description: Malformed function call, missing field
266265
content:
267266
application/json:
268267
schema:
269-
$ref: '#/components/schemas/ErrorEnveloped'
268+
$ref: "#/components/schemas/ErrorEnveloped"
270269
"404":
271270
description: Service not found
272271
content:
273272
application/json:
274273
schema:
275-
$ref: '#/components/schemas/ErrorEnveloped'
274+
$ref: "#/components/schemas/ErrorEnveloped"
276275
default:
277276
description: Unexpected error
278277
content:
279278
application/json:
280279
schema:
281-
$ref: '#/components/schemas/ErrorEnveloped'
280+
$ref: "#/components/schemas/ErrorEnveloped"
282281
delete:
283282
tags:
284283
- users
285284
summary: Stops and removes an interactive service from the oSparc platform
286285
description: Stops and removes an interactive service from the oSparc platform
287286
operationId: running_interactive_services_delete
288287
parameters:
289-
- $ref: '#/components/parameters/ServiceUuid'
288+
- $ref: "#/components/parameters/ServiceUuid"
290289
responses:
291290
"204":
292291
description: Succesfully stopped and removed the service from the oSparc platform
@@ -295,19 +294,19 @@ paths:
295294
content:
296295
application/json:
297296
schema:
298-
$ref: '#/components/schemas/ErrorEnveloped'
297+
$ref: "#/components/schemas/ErrorEnveloped"
299298
"404":
300299
description: Service not found
301300
content:
302301
application/json:
303302
schema:
304-
$ref: '#/components/schemas/ErrorEnveloped'
303+
$ref: "#/components/schemas/ErrorEnveloped"
305304
default:
306305
description: Unexpected error
307306
content:
308307
application/json:
309308
schema:
310-
$ref: '#/components/schemas/ErrorEnveloped'
309+
$ref: "#/components/schemas/ErrorEnveloped"
311310

312311
components:
313312
parameters:
@@ -385,8 +384,8 @@ components:
385384
required: false
386385
schema:
387386
type: string
388-
example: '/x/EycCXbU0H/'
389-
default: ''
387+
example: "/x/EycCXbU0H/"
388+
default: ""
390389

391390
ServiceUuid:
392391
in: path
@@ -428,19 +427,19 @@ components:
428427

429428
schemas:
430429
ErrorEnveloped:
431-
$ref: '../common/schemas/error.yaml#/components/schemas/ErrorEnveloped'
430+
$ref: "../common/schemas/error.yaml#/components/schemas/ErrorEnveloped"
432431

433432
RunningServiceEnveloped:
434-
$ref: '../common/schemas/running_service.yaml#/components/schemas/RunningServiceEnveloped'
433+
$ref: "../common/schemas/running_service.yaml#/components/schemas/RunningServiceEnveloped"
435434

436435
RunningServicesEnveloped:
437-
$ref: '../common/schemas/running_service.yaml#/components/schemas/RunningServicesEnveloped'
436+
$ref: "../common/schemas/running_service.yaml#/components/schemas/RunningServicesEnveloped"
438437

439438
ServicesEnveloped:
440-
$ref: '../common/schemas/services.yaml#/components/schemas/ServicesEnveloped'
439+
$ref: "../common/schemas/services.yaml#/components/schemas/ServicesEnveloped"
441440

442441
ServiceExtrasEnveloped:
443-
$ref: '../common/schemas/services.yaml#/components/schemas/ServiceExtrasEnveloped'
442+
$ref: "../common/schemas/services.yaml#/components/schemas/ServiceExtrasEnveloped"
444443

445444
HealthCheckEnveloped:
446-
$ref: '../common/schemas/health_check.yaml#/components/schemas/HealthCheckEnveloped'
445+
$ref: "../common/schemas/health_check.yaml#/components/schemas/HealthCheckEnveloped"

0 commit comments

Comments
 (0)