Skip to content

Commit 7be9827

Browse files
authored
Is728/permissions server (#799)
Implements #728, mostly server side; Extended security subsystem: - Implements Hierarchical Role Based control access model (HRBAM) - Extend roles: anonymous, guest, user, tester - Checked permissions for the following resources: - /v*/project API - /v*/me (user) API - /v*/storage API - /v*/nodes API (not necessary) - services related /services, /running ... /computational/... (cleanup Some changes in the following webserver subsystems: - services - rest API specs to separated file api/specs/webserver/v0/openapi-services.yaml - Removed body from ``/computation/*`` calls. Operates on project uuid stored on the server side - projects - fine-grained update permissions . See services/web/server/src/simcore_service_webserver/projects/projects_access.py] - new creation and update workflows
1 parent 2799d9b commit 7be9827

File tree

77 files changed

+3108
-1818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3108
-1818
lines changed

api/specs/director/v0/openapi.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ paths:
226226
responses:
227227
"204":
228228
description: Succesfully stopped and removed the service from the oSparc platform
229-
content:
230-
application/json:
231-
schema:
232-
$ref: '../../shared/schemas/response204.yaml#/components/schemas/Response204Enveloped'
233229
"400":
234230
description: Malformed function call, missing field
235231
content:

api/specs/shared/schemas/response204.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

api/specs/webserver/v0/components/schemas/pipeline.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ components:
66
- data
77
properties:
88
data:
9-
$ref: '#/components/schemas/PipelineCreatedType'
9+
$ref: '#/components/schemas/PipelineCreatedSchema'
1010
error:
1111
nullable: true
1212
default: null
13-
14-
PipelineCreatedType:
13+
14+
PipelineCreatedSchema:
1515
type: object
1616
required:
1717
- pipeline_name

api/specs/webserver/v0/openapi-projects.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ paths:
4242
post:
4343
summary: Create new project
4444
operationId: create_projects
45+
parameters:
46+
- name: from_template
47+
in: query
48+
schema:
49+
type: string
50+
description: 'Option to create a project from existing template: from_template={template_uuid}'
4551
requestBody:
4652
content:
4753
application/json:
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
openapi: 3.0.0
2+
info:
3+
title: services API
4+
version: 0.1.0
5+
description: 'Access to interactive and computational services'
6+
servers:
7+
- description: API server
8+
url: '/v0'
9+
paths:
10+
/services:
11+
get:
12+
description: Lists available services in catalog
13+
operationId: services_get
14+
parameters:
15+
- $ref: './openapi-services.yaml#/components/parameters/ServiceType'
16+
responses:
17+
"200":
18+
description: Returns list of services in catalog
19+
content:
20+
application/json:
21+
schema:
22+
$ref: '../../shared/schemas/services.yaml#/components/schemas/ServicesEnveloped'
23+
"401":
24+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
25+
26+
default:
27+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
28+
29+
/running_interactive_services:
30+
post:
31+
description: Starts an interactive service in the oSparc platform and returns its entrypoint
32+
operationId: running_interactive_services_post
33+
parameters:
34+
- $ref: './openapi-services.yaml#/components/parameters/ProjectIdQuery'
35+
- $ref: './openapi-services.yaml#/components/parameters/ServiceKey'
36+
- $ref: './openapi-services.yaml#/components/parameters/ServiceVersion'
37+
- $ref: './openapi-services.yaml#/components/parameters/AssignmentUuid'
38+
responses:
39+
"201":
40+
description: Succesfully created the service in the oSparc platform. Returns the location where the service runs.
41+
content:
42+
application/json:
43+
schema:
44+
$ref: '../../shared/schemas/running_service.yaml#/components/schemas/RunningServiceEnveloped'
45+
"400":
46+
description: Malformed function call, missing field
47+
content:
48+
application/json:
49+
schema:
50+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
51+
"401":
52+
description: Unauthorized access
53+
content:
54+
application/json:
55+
schema:
56+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
57+
"404":
58+
description: Service not found
59+
content:
60+
application/json:
61+
schema:
62+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
63+
"409":
64+
description: A service with the same uuid already exists
65+
content:
66+
application/json:
67+
schema:
68+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
69+
default:
70+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
71+
delete:
72+
description: Stops and removes all user interactive services from the platform
73+
operationId: running_interactive_services_delete_all
74+
responses:
75+
"204":
76+
description: Succesfully stopped and removed the service from the oSparc platform
77+
content:
78+
application/json:
79+
schema:
80+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
81+
default:
82+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
83+
84+
/running_interactive_services/{service_uuid}:
85+
get:
86+
description: Succesfully returns if a service with the defined uuid is up and running
87+
operationId: running_interactive_services_get
88+
parameters:
89+
- $ref: './openapi-services.yaml#/components/parameters/ServiceUuid'
90+
responses:
91+
"204":
92+
description: OK service exists and runs
93+
content:
94+
application/json:
95+
schema:
96+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
97+
"400":
98+
description: Malformed function call, missing field
99+
content:
100+
application/json:
101+
schema:
102+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
103+
"404":
104+
description: Service not found
105+
content:
106+
application/json:
107+
schema:
108+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
109+
default:
110+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
111+
112+
delete:
113+
description: Stops and removes an interactive service from the oSparc platform
114+
operationId: running_interactive_services_delete
115+
parameters:
116+
- $ref: './openapi-services.yaml#/components/parameters/ServiceUuid'
117+
responses:
118+
"204":
119+
description: Succesfully stopped and removed the service from the oSparc platform
120+
content:
121+
application/json:
122+
schema:
123+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
124+
"400":
125+
description: Malformed function call, missing field
126+
content:
127+
application/json:
128+
schema:
129+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
130+
"404":
131+
description: Service not found
132+
content:
133+
application/json:
134+
schema:
135+
$ref: '../../shared/schemas/error.yaml#/components/schemas/ErrorEnveloped'
136+
default:
137+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
138+
139+
140+
/computation/pipeline/{project_id}:
141+
put:
142+
description: "Update a pipeline using workbench section from given project"
143+
operationId: update_pipeline
144+
parameters:
145+
- $ref: './openapi-services.yaml#/components/parameters/ProjectId'
146+
responses:
147+
"204":
148+
description: Succesfully updated the pipeline
149+
default:
150+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
151+
152+
/computation/pipeline/{project_id}/start:
153+
post:
154+
description: Starts a pipeline of a given project
155+
operationId: start_pipeline
156+
parameters:
157+
- $ref: './openapi-services.yaml#/components/parameters/ProjectId'
158+
responses:
159+
"200":
160+
description: Succesffully started the pipeline
161+
content:
162+
application/json:
163+
schema:
164+
$ref: './components/schemas/pipeline.yaml#/components/schemas/PipelineCreatedEnveloped'
165+
default:
166+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
167+
168+
# PROJECT SERVICES -----------------------------------------------------------------
169+
components:
170+
parameters:
171+
ProjectId:
172+
in: path
173+
name: project_id
174+
required: true
175+
description: the uuid of the project
176+
schema:
177+
type: string
178+
# format: uuid
179+
example: 123e4567-e89b-12d3-a456-426655440000
180+
181+
ProjectIdQuery:
182+
in: query
183+
name: project_id
184+
required: true
185+
description: the uuid of the project
186+
schema:
187+
type: string
188+
# format: uuid
189+
example: 123e4567-e89b-12d3-a456-426655440000
190+
191+
AssignmentUuid:
192+
in: query
193+
name: service_uuid
194+
description: The uuid to assign the service with
195+
required: true
196+
schema:
197+
type: string
198+
# format: uuid
199+
example: 123e4567-e89b-12d3-a456-426655440000
200+
201+
ServiceKey:
202+
in: query
203+
name: service_key
204+
description: The key (url) of the service
205+
required: true
206+
schema:
207+
type: string
208+
# format: url
209+
example: simcore/services/dynamic/3d-viewer
210+
211+
ServiceType:
212+
in: query
213+
name: service_type
214+
description: |
215+
The service type:
216+
* computational - a computational service
217+
* interactive - an interactive service
218+
required: false
219+
schema:
220+
type: string
221+
enum:
222+
- computational
223+
- interactive
224+
example: computational
225+
226+
ServiceUuid:
227+
in: path
228+
name: service_uuid
229+
description: The uuid of the service
230+
required: true
231+
schema:
232+
type: string
233+
# format: uuid
234+
example: 123e4567-e89b-12d3-a456-426655440000
235+
236+
ServiceVersion:
237+
in: query
238+
name: service_tag
239+
description: The tag/version of the service
240+
required: false
241+
schema:
242+
type: string
243+
example: "1.4"

api/specs/webserver/v0/openapi-user.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,11 @@ paths:
8686
summary: Updates token
8787
operationId: update_token
8888
responses:
89-
'200':
90-
description: got detailed token
91-
content:
92-
application/json:
93-
schema:
94-
$ref: './components/schemas/me.yaml#/TokenEnveloped'
89+
'204':
90+
description: token has been successfully updated
9591
delete:
9692
summary: Delete token
9793
operationId: delete_token
9894
responses:
9995
'204':
100-
description: project has been successfully deleted
96+
description: token has been successfully deleted

0 commit comments

Comments
 (0)