Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨♻️ webserver: refactored groups plugin and new user privacy compliance #6917

Merged
merged 85 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3e09bb1
@sanderegg review: rename patch instead of update
pcrespov Dec 6, 2024
73c73f9
rename ids
pcrespov Dec 6, 2024
2a7af4e
exception handlers groups
pcrespov Dec 6, 2024
e370faf
models
pcrespov Dec 6, 2024
22f22db
mv to common
pcrespov Dec 6, 2024
17675c9
exception handlers
pcrespov Dec 6, 2024
2ba30f9
moving classifiers and users"
pcrespov Dec 6, 2024
252f033
one place for groups
pcrespov Dec 6, 2024
aaffcae
refactors db
pcrespov Dec 6, 2024
c80bb38
service layer
pcrespov Dec 6, 2024
8ba6d46
fixing tests
pcrespov Dec 6, 2024
d15657a
updates models
pcrespov Dec 6, 2024
8727e2a
common and db
pcrespov Dec 6, 2024
ab2c516
sio
pcrespov Dec 6, 2024
90ea82d
cleanup
pcrespov Dec 6, 2024
60f1d92
move user groups fixture to pytest_simcore and drop from integration …
pcrespov Dec 6, 2024
84674ec
rm dependency
pcrespov Dec 6, 2024
8714e20
factory
pcrespov Dec 6, 2024
7458cdf
api
pcrespov Dec 6, 2024
6529cce
nodes uses new inteface
pcrespov Dec 6, 2024
88a98ef
tests
pcrespov Dec 6, 2024
a67a576
fixes test_gc
pcrespov Dec 6, 2024
202e8dd
get_user_group
pcrespov Dec 6, 2024
ed55834
update_user_group
pcrespov Dec 6, 2024
beedae1
cleanup
pcrespov Dec 6, 2024
ae9bb7e
organizations
pcrespov Dec 6, 2024
1ef0c7b
cleanup
pcrespov Dec 6, 2024
853308c
minor
pcrespov Dec 8, 2024
155ee4e
list users in group
pcrespov Dec 8, 2024
90a2af7
crud on orgazniation members
pcrespov Dec 8, 2024
8c7f01b
db refactor
pcrespov Dec 9, 2024
efda082
inter-domain interface
pcrespov Dec 9, 2024
5507295
rm adapter
pcrespov Dec 9, 2024
2dd48d4
cleanup
pcrespov Dec 9, 2024
74c9fda
model conversion and fitures
pcrespov Dec 9, 2024
e402440
fixes circular imports
pcrespov Dec 9, 2024
cf83d59
tests passing
pcrespov Dec 9, 2024
7130f4b
tests groups 2 passing
pcrespov Dec 9, 2024
a25f05b
cleanup
pcrespov Dec 9, 2024
1243701
alternative user name
pcrespov Dec 9, 2024
5c8691d
crud operations
pcrespov Dec 9, 2024
5676c86
cleanup
pcrespov Dec 9, 2024
1948db3
cleanup tests
pcrespov Dec 9, 2024
ceb96ef
fixing tests
pcrespov Dec 9, 2024
36418d5
pre
pcrespov Dec 9, 2024
f2a44a5
rm callable fixture
pcrespov Dec 9, 2024
2545bf4
rm mapping
pcrespov Dec 9, 2024
15e31b4
models for organizations
pcrespov Dec 9, 2024
8cec4b9
drops utils
pcrespov Dec 9, 2024
bab2277
cleanup
pcrespov Dec 9, 2024
6d03a79
update privacy
pcrespov Dec 9, 2024
12ad537
move adapters to schemas
pcrespov Dec 9, 2024
fd2c736
mypy
pcrespov Dec 9, 2024
98e846f
fixes caller
pcrespov Dec 9, 2024
aaf9c4a
gid
pcrespov Dec 9, 2024
604e6a5
hid email
pcrespov Dec 9, 2024
6d8c770
hide email
pcrespov Dec 9, 2024
5380899
updates OAS
pcrespov Dec 9, 2024
ebbd5c1
services/webserver api version: 0.48.0 → 0.49.0
pcrespov Dec 9, 2024
1e0e376
tests
pcrespov Dec 9, 2024
f0d9cbb
tests
pcrespov Dec 9, 2024
8bb03e6
adds tests for conversions
pcrespov Dec 10, 2024
9d38106
tests
pcrespov Dec 10, 2024
6630877
oas
pcrespov Dec 10, 2024
92a5cce
fixes tsets
pcrespov Dec 10, 2024
e4efff7
cleanup tests
pcrespov Dec 10, 2024
d260646
cleanup tests
pcrespov Dec 10, 2024
299f241
@odeimaiz review: adds username
pcrespov Dec 10, 2024
92e68b2
doc
pcrespov Dec 10, 2024
b020206
@sanderegg review:drop organization and renames
pcrespov Dec 10, 2024
37d35db
@sanderegg review:drop organization and renames
pcrespov Dec 10, 2024
0272554
fixes autoinclusion
pcrespov Dec 10, 2024
b836ab0
@sanderegg review: deprecation
pcrespov Dec 10, 2024
eb6071d
@odeimaiz review: deprecated inclusion rules
pcrespov Dec 10, 2024
401438e
TODO
pcrespov Dec 10, 2024
19a7c86
TODO
pcrespov Dec 10, 2024
63aefa7
cleanup
pcrespov Dec 10, 2024
b50842b
migration
pcrespov Dec 10, 2024
0009f95
fix query
pcrespov Dec 10, 2024
438c174
fix tests
pcrespov Dec 10, 2024
dd89a35
fixes tsts
pcrespov Dec 10, 2024
d1fd1d0
fixes tsts
pcrespov Dec 10, 2024
cee4f33
fixes tsts
pcrespov Dec 10, 2024
6d9e3fb
fixes tests
pcrespov Dec 10, 2024
e4a9810
Merge branch 'master' into is779/prep-users-in-groups
pcrespov Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions api/specs/web-server/_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
GroupCreate,
GroupGet,
GroupUpdate,
GroupUserAdd,
GroupUserGet,
GroupUserUpdate,
MyGroupsGet,
)
from models_library.generics import Envelope
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.groups._handlers import (
GroupUserAdd,
GroupUserUpdate,
_ClassifiersQuery,
_GroupPathParams,
_GroupUserPathParams,
from simcore_service_webserver.groups._common.schemas import (
GroupsClassifiersQuery,
GroupsPathParams,
GroupsUsersPathParams,
)
from simcore_service_webserver.scicrunch.models import ResearchResource, ResourceHit

Expand Down Expand Up @@ -58,7 +58,7 @@ async def create_group(_body: GroupCreate):
"/groups/{gid}",
response_model=Envelope[GroupGet],
)
async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
async def get_group(_path: Annotated[GroupsPathParams, Depends()]):
"""
Get an organization group
"""
Expand All @@ -69,7 +69,7 @@ async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
response_model=Envelope[GroupGet],
)
async def update_group(
_path: Annotated[_GroupPathParams, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_body: GroupUpdate,
):
"""
Expand All @@ -81,7 +81,7 @@ async def update_group(
"/groups/{gid}",
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
async def delete_group(_path: Annotated[GroupsPathParams, Depends()]):
"""
Deletes organization groups
"""
Expand All @@ -91,7 +91,7 @@ async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
"/groups/{gid}/users",
response_model=Envelope[list[GroupUserGet]],
)
async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
async def get_all_group_users(_path: Annotated[GroupsPathParams, Depends()]):
"""
Gets users in organization groups
"""
Expand All @@ -102,11 +102,11 @@ async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
status_code=status.HTTP_204_NO_CONTENT,
)
async def add_group_user(
_path: Annotated[_GroupPathParams, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_body: GroupUserAdd,
):
"""
Adds a user to an organization group
Adds a user to an organization group using their username, user ID, or email (subject to privacy settings)
"""


Expand All @@ -115,7 +115,7 @@ async def add_group_user(
response_model=Envelope[GroupUserGet],
)
async def get_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
):
"""
Gets specific user in an organization group
Expand All @@ -127,7 +127,7 @@ async def get_group_user(
response_model=Envelope[GroupUserGet],
)
async def update_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
_body: GroupUserUpdate,
):
"""
Expand All @@ -140,7 +140,7 @@ async def update_group_user(
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
):
"""
Removes a user from an organization group
Expand All @@ -157,8 +157,8 @@ async def delete_group_user(
response_model=Envelope[dict[str, Any]],
)
async def get_group_classifiers(
_path: Annotated[_GroupPathParams, Depends()],
_query: Annotated[_ClassifiersQuery, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_query: Annotated[GroupsClassifiersQuery, Depends()],
):
...

Expand Down
8 changes: 4 additions & 4 deletions api/specs/web-server/_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Annotated

from fastapi import APIRouter, Depends, status
from models_library.api_schemas_webserver.users import ProfileGet, ProfileUpdate
from models_library.api_schemas_webserver.users import MyProfileGet, MyProfilePatch
from models_library.api_schemas_webserver.users_preferences import PatchRequestBody
from models_library.generics import Envelope
from models_library.user_preferences import PreferenceIdentifier
Expand All @@ -34,7 +34,7 @@

@router.get(
"/me",
response_model=Envelope[ProfileGet],
response_model=Envelope[MyProfileGet],
)
async def get_my_profile():
...
Expand All @@ -44,7 +44,7 @@ async def get_my_profile():
"/me",
status_code=status.HTTP_204_NO_CONTENT,
)
async def update_my_profile(_profile: ProfileUpdate):
async def update_my_profile(_profile: MyProfilePatch):
...


Expand All @@ -54,7 +54,7 @@ async def update_my_profile(_profile: ProfileUpdate):
deprecated=True,
description="Use PATCH instead",
)
async def replace_my_profile(_profile: ProfileUpdate):
async def replace_my_profile(_profile: MyProfilePatch):
...


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class InputSchemaWithoutCamelCase(BaseModel):

class InputSchema(BaseModel):
model_config = ConfigDict(
**InputSchemaWithoutCamelCase.model_config, alias_generator=snake_to_camel
**InputSchemaWithoutCamelCase.model_config,
alias_generator=snake_to_camel,
)


Expand All @@ -50,7 +51,7 @@ def data(
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
**kwargs
**kwargs,
)

def data_json(
Expand All @@ -67,5 +68,5 @@ def data_json(
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
**kwargs
**kwargs,
)
Loading
Loading