Skip to content

Commit 21b41c6

Browse files
Merge branch 'master' into is1647/collaboration-features-1
2 parents 3d7c505 + acb9f05 commit 21b41c6

File tree

138 files changed

+3227
-1330
lines changed

Some content is hidden

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

138 files changed

+3227
-1330
lines changed

.env-devel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,15 @@ VENDOR_DEV_MANUAL_IMAGE=containous/whoami
269269
VENDOR_DEV_MANUAL_REPLICAS=1
270270
VENDOR_DEV_MANUAL_SUBDOMAIN=manual
271271

272-
## VENDOR DEVELOPMENT SERVICES ---
272+
## WEBSERVER SERVICES VARIANTS ---
273273

274274
WB_API_WEBSERVER_HOST=wb-api-server
275275
WB_API_WEBSERVER_PORT=8080
276276

277+
WB_AUTH_WEBSERVER_HOST=wb-auth
278+
WB_AUTH_WEBSERVER_PORT=8080
279+
WB_AUTH_LOGLEVEL=INFO
280+
277281
WB_GC_ACTIVITY=null
278282
WB_GC_ANNOUNCEMENTS=0
279283
WB_GC_CATALOG=null

.github/workflows/ci-arm-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: show system environs
3939
run: ./ci/helpers/show_system_versions.bash
4040
- name: login to Dockerhub
41-
uses: docker/login-action@v2
41+
uses: docker/login-action@v3
4242
with:
4343
username: ${{ secrets.DOCKER_USERNAME }}
4444
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/ci-multi-architecture-fusing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: show system environs
4040
run: ./ci/helpers/show_system_versions.bash
4141
- name: login to Dockerhub
42-
uses: docker/login-action@v2
42+
uses: docker/login-action@v3
4343
with:
4444
username: ${{ secrets.DOCKER_USERNAME }}
4545
password: ${{ secrets.DOCKER_PASSWORD }}

api/specs/web-server/_functions.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77

88
from typing import Annotated
99

10+
from _common import as_query
1011
from fastapi import APIRouter, Depends, status
1112
from models_library.api_schemas_webserver.functions import (
1213
FunctionToRegister,
1314
RegisteredFunctionGet,
15+
RegisteredFunctionUpdate,
1416
)
1517
from models_library.generics import Envelope
1618
from simcore_service_webserver._meta import API_VTAG
1719
from simcore_service_webserver.functions._controller._functions_rest_schemas import (
20+
FunctionGetQueryParams,
1821
FunctionPathParams,
22+
FunctionsListQueryParams,
1923
)
2024

2125
router = APIRouter(
@@ -35,12 +39,32 @@ async def register_function(
3539
) -> Envelope[RegisteredFunctionGet]: ...
3640

3741

42+
@router.get(
43+
"/functions",
44+
response_model=Envelope[list[RegisteredFunctionGet]],
45+
)
46+
async def list_functions(
47+
_query: Annotated[as_query(FunctionsListQueryParams), Depends()],
48+
): ...
49+
50+
3851
@router.get(
3952
"/functions/{function_id}",
4053
response_model=Envelope[RegisteredFunctionGet],
4154
)
4255
async def get_function(
4356
_path: Annotated[FunctionPathParams, Depends()],
57+
_query: Annotated[as_query(FunctionGetQueryParams), Depends()],
58+
): ...
59+
60+
61+
@router.patch(
62+
"/functions/{function_id}",
63+
response_model=Envelope[RegisteredFunctionGet],
64+
)
65+
async def update_function(
66+
_body: RegisteredFunctionUpdate,
67+
_path: Annotated[FunctionPathParams, Depends()],
4468
): ...
4569

4670

api/specs/web-server/_users.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
from models_library.api_schemas_webserver.users import (
1111
MyFunctionPermissionsGet,
1212
MyPermissionGet,
13-
MyPhoneConfirm,
14-
MyPhoneRegister,
1513
MyProfileRestGet,
1614
MyProfileRestPatch,
1715
MyTokenCreate,
@@ -32,6 +30,10 @@
3230
UserNotificationCreate,
3331
UserNotificationPatch,
3432
)
33+
from simcore_service_webserver.users._controller.rest._rest_schemas import (
34+
MyPhoneConfirm,
35+
MyPhoneRegister,
36+
)
3537

3638
router = APIRouter(prefix=f"/{API_VTAG}", tags=["users"])
3739

api/specs/web-server/_users_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from models_library.generics import Envelope
2020
from models_library.rest_pagination import Page
2121
from simcore_service_webserver._meta import API_VTAG
22-
from simcore_service_webserver.users.schemas import PreRegisteredUserGet
22+
from simcore_service_webserver.users.schemas import UserAccountRestPreRegister
2323

2424
router = APIRouter(prefix=f"/{API_VTAG}", tags=["users"])
2525

@@ -69,4 +69,4 @@ async def search_user_accounts(
6969
response_model=Envelope[UserAccountGet],
7070
tags=_extra_tags,
7171
)
72-
async def pre_register_user_account(_body: PreRegisteredUserGet): ...
72+
async def pre_register_user_account(_body: UserAccountRestPreRegister): ...

packages/models-library/src/models_library/api_schemas_webserver/auth.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from models_library.rest_base import RequestParameters
66
from pydantic import AliasGenerator, ConfigDict, Field, HttpUrl, SecretStr
77
from pydantic.alias_generators import to_camel
8+
from pydantic.config import JsonDict
89

910
from ..emails import LowerCaseEmailStr
1011
from ._base import InputSchema, OutputSchema
@@ -14,33 +15,39 @@ class AccountRequestInfo(InputSchema):
1415
form: dict[str, Any]
1516
captcha: str
1617

18+
@staticmethod
19+
def _update_json_schema_extra(schema: JsonDict) -> None:
20+
schema.update(
21+
{
22+
"example": {
23+
"form": {
24+
"firstName": "James",
25+
"lastName": "Maxwel",
26+
"email": "[email protected]",
27+
"phone": "+41 44 245 96 96",
28+
"company": "EM Com",
29+
"address": "Infinite Loop",
30+
"city": "Washington",
31+
"postalCode": "98001",
32+
"country": "Switzerland",
33+
"application": "Antenna_Design",
34+
"description": "Description of something",
35+
"hear": "Search_Engine",
36+
"privacyPolicy": True,
37+
"eula": True,
38+
},
39+
"captcha": "A12B34",
40+
}
41+
}
42+
)
43+
1744
model_config = ConfigDict(
1845
str_strip_whitespace=True,
1946
str_max_length=200,
2047
# NOTE: this is just informative. The format of the form is defined
2148
# currently in the front-end and it might change
2249
# SEE image in https://github.com/ITISFoundation/osparc-simcore/pull/5378
23-
json_schema_extra={
24-
"example": {
25-
"form": {
26-
"firstName": "James",
27-
"lastName": "Maxwel",
28-
"email": "[email protected]",
29-
"phone": "+1 123456789",
30-
"company": "EM Com",
31-
"address": "Infinite Loop",
32-
"city": "Washington",
33-
"postalCode": "98001",
34-
"country": "USA",
35-
"application": "Antenna_Design",
36-
"description": "Description of something",
37-
"hear": "Search_Engine",
38-
"privacyPolicy": True,
39-
"eula": True,
40-
},
41-
"captcha": "A12B34",
42-
}
43-
},
50+
json_schema_extra=_update_json_schema_extra,
4451
)
4552

4653

packages/models-library/src/models_library/api_schemas_webserver/functions.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import datetime
12
from typing import Annotated, TypeAlias
23

34
from pydantic import Field
45

56
from ..functions import (
67
Function,
8+
FunctionAccessRights,
79
FunctionBase,
810
FunctionClass,
911
FunctionClassSpecificData,
@@ -23,6 +25,7 @@
2325
FunctionOutputs,
2426
FunctionOutputSchema,
2527
FunctionSchemaClass,
28+
FunctionUpdate,
2629
JSONFunctionInputSchema,
2730
JSONFunctionOutputSchema,
2831
ProjectFunction,
@@ -46,6 +49,7 @@
4649
UnsupportedFunctionClassError,
4750
UnsupportedFunctionFunctionJobClassCombinationError,
4851
)
52+
from ..projects import ProjectID
4953
from ._base import InputSchema, OutputSchema
5054

5155
__all__ = [
@@ -113,7 +117,13 @@
113117
class RegisteredSolverFunctionGet(RegisteredSolverFunction, OutputSchema): ...
114118

115119

116-
class RegisteredProjectFunctionGet(RegisteredProjectFunction, OutputSchema): ...
120+
class RegisteredProjectFunctionGet(RegisteredProjectFunction, OutputSchema):
121+
uid: Annotated[FunctionID, Field(alias="uuid")]
122+
project_id: Annotated[ProjectID, Field(alias="templateId")]
123+
created_at: Annotated[datetime.datetime, Field(alias="creationDate")]
124+
modified_at: Annotated[datetime.datetime, Field(alias="lastChangeDate")]
125+
access_rights: FunctionAccessRights | None = None
126+
thumbnail: str | None = None
117127

118128

119129
class SolverFunctionToRegister(SolverFunction, InputSchema): ...
@@ -131,3 +141,6 @@ class ProjectFunctionToRegister(ProjectFunction, InputSchema): ...
131141
RegisteredProjectFunctionGet | RegisteredSolverFunctionGet,
132142
Field(discriminator="function_class"),
133143
]
144+
145+
146+
class RegisteredFunctionUpdate(FunctionUpdate, InputSchema): ...

packages/models-library/src/models_library/api_schemas_webserver/users.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -207,27 +207,6 @@ def _validate_user_name(cls, value: str):
207207
return value
208208

209209

210-
#
211-
# PHONE REGISTRATION
212-
#
213-
214-
215-
class MyPhoneRegister(InputSchema):
216-
phone: Annotated[
217-
str,
218-
StringConstraints(strip_whitespace=True, min_length=1),
219-
Field(description="Phone number to register"),
220-
]
221-
222-
223-
class MyPhoneConfirm(InputSchema):
224-
code: Annotated[
225-
str,
226-
StringConstraints(strip_whitespace=True, pattern=r"^[A-Za-z0-9]+$"),
227-
Field(description="Alphanumeric confirmation code"),
228-
]
229-
230-
231210
#
232211
# USER
233212
#
@@ -407,4 +386,5 @@ def from_domain_model(cls, permission: UserPermission) -> Self:
407386

408387

409388
class MyFunctionPermissionsGet(OutputSchema):
389+
read_functions: bool
410390
write_functions: bool

packages/models-library/src/models_library/functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ class FunctionBase(BaseModel):
9999
class RegisteredFunctionBase(FunctionBase):
100100
uid: FunctionID
101101
created_at: datetime.datetime
102+
modified_at: datetime.datetime
103+
104+
105+
class FunctionUpdate(BaseModel):
106+
title: str | None = None
107+
description: str | None = None
102108

103109

104110
class ProjectFunction(FunctionBase):
@@ -250,6 +256,7 @@ class FunctionDB(BaseModel):
250256
class RegisteredFunctionDB(FunctionDB):
251257
uuid: FunctionID
252258
created: datetime.datetime
259+
modified: datetime.datetime
253260

254261

255262
class FunctionJobCollectionDB(BaseModel):

0 commit comments

Comments
 (0)