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

✨ Get and search users applying privacy settings 🗃️ #6966

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
88c2dbc
prefix admin
pcrespov Dec 13, 2024
bbae2be
oas
pcrespov Dec 13, 2024
d43dfd3
adds get user
pcrespov Dec 13, 2024
21ccbe0
admin and users
pcrespov Dec 13, 2024
e99c334
drafter interface
pcrespov Dec 13, 2024
e33efeb
acceptance tests
pcrespov Dec 13, 2024
72751d0
tests
pcrespov Dec 13, 2024
fd9d320
drafts
pcrespov Dec 13, 2024
d5f2dd8
acceptance test passes
pcrespov Dec 13, 2024
f066895
updates OAS
pcrespov Dec 16, 2024
2a13f56
cleanup
pcrespov Dec 16, 2024
ed53e2a
minor
pcrespov Dec 17, 2024
91acb79
cleanup
pcrespov Dec 17, 2024
96d7f4e
drafted groups
pcrespov Dec 17, 2024
2cd0193
drafted tests
pcrespov Dec 17, 2024
fa125d7
acceptance test passes
pcrespov Dec 17, 2024
a76d9a1
update OAS
pcrespov Dec 17, 2024
4c6748d
updates search on names
pcrespov Dec 17, 2024
db860a7
updates OAS
pcrespov Dec 17, 2024
062e508
fixes OAS
pcrespov Dec 17, 2024
f22bd07
fixes
pcrespov Dec 17, 2024
649e6cf
adds restricted access
pcrespov Dec 17, 2024
4e8b6a5
updates doc
pcrespov Dec 17, 2024
07506bb
reverts defaults
pcrespov Dec 17, 2024
620c954
fixes tess
pcrespov Dec 17, 2024
195040a
fixes get users in group
pcrespov Dec 17, 2024
7af1bfa
mypy and oas
pcrespov Dec 17, 2024
ef92fe9
cleanup
pcrespov Dec 17, 2024
1394397
fixes tests
pcrespov Dec 17, 2024
8d088c1
@odeimaiz review: deprecated admin users
pcrespov Dec 17, 2024
1834e83
new tests
pcrespov Dec 17, 2024
72954f4
common
pcrespov Dec 17, 2024
694a0d7
pylint
pcrespov Dec 17, 2024
4aaa20d
cleanup
pcrespov Dec 17, 2024
d0bfb17
reactivated test
pcrespov Dec 18, 2024
1d39673
fixes migration
pcrespov Dec 18, 2024
e937280
minor
pcrespov Dec 18, 2024
490a5c3
disables meta test
pcrespov Dec 18, 2024
82a5348
user_id
pcrespov Dec 18, 2024
c94a135
reduced duplication
pcrespov Dec 18, 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
Prev Previous commit
Next Next commit
mypy and oas
  • Loading branch information
pcrespov committed Dec 18, 2024
commit 7af1bfab6f841f2fc5ed844105575dfde825c634
Original file line number Diff line number Diff line change
@@ -1328,28 +1328,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Envelope_list_MyPermissionGet__'
/v0/users/{user_id}:
get:
tags:
- users
summary: Get User
operationId: get_user
parameters:
- name: user_id
in: path
required: true
schema:
type: integer
exclusiveMinimum: true
title: User Id
minimum: 0
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_UserGet_'
/v0/users:search:
post:
tags:
@@ -8617,19 +8595,6 @@ components:
title: Error
type: object
title: Envelope[UserForAdminGet]
Envelope_UserGet_:
properties:
data:
anyOf:
- $ref: '#/components/schemas/UserGet'
- type: 'null'
error:
anyOf:
- {}
- type: 'null'
title: Error
type: object
title: Envelope[UserGet]
Envelope_WalletGetWithAvailableCredits_:
properties:
data:
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
from models_library.users import UserID
from simcore_postgres_database.errors import UniqueViolation
from simcore_postgres_database.models.users import users
from simcore_postgres_database.utils import as_postgres_sql_query_str
from simcore_postgres_database.utils_products import execute_get_or_create_product_group
from simcore_postgres_database.utils_repos import (
pass_or_acquire_connection,
@@ -515,8 +514,6 @@ async def list_users_in_group(
)
)

print(as_postgres_sql_query_str(query))

result = await conn.execute(query)
group_row = result.first()
if not group_row:
@@ -541,10 +538,10 @@ async def list_users_in_group(
user_to_groups.c.gid == group_id
)

result = await conn.stream(query)
aresult = await conn.stream(query)
return [
GroupMember.model_validate(row, from_attributes=True)
async for row in result
async for row in aresult
]


@@ -742,7 +739,7 @@ async def auto_add_user_to_groups(

# auto add user to the groups with the right rules
# get the groups where there are inclusion rules and see if they apply
query = sa.select(groups).where(groups.c.inclusion_rules != {})
query = sa.select(groups).where(groups.c.inclusion_rules != "{}")
possible_group_ids = set()

async with transaction_context(get_asyncpg_engine(app), connection) as conn: