Skip to content

Commit 08e4cd5

Browse files
add issue ref
1 parent 71b64db commit 08e4cd5

File tree

1 file changed

+10
-6
lines changed
  • services/web/server/src/simcore_service_webserver/api_keys

1 file changed

+10
-6
lines changed

services/web/server/src/simcore_service_webserver/api_keys/_repository.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def create_api_key(
4545
row = await result.first()
4646

4747
return ApiKey(
48-
id=f"{row.id}", # NOTE: remove after migration to str
48+
id=f"{row.id}", # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
4949
display_name=display_name,
5050
expiration=expiration,
5151
api_key=api_key,
@@ -91,7 +91,7 @@ async def get_or_create_api_key(
9191
assert row # nosec
9292

9393
return ApiKey(
94-
id=f"{row.id}", # NOTE: remove after migration to str
94+
id=f"{row.id}", # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
9595
display_name=row.display_name,
9696
expiration=row.expires_at,
9797
api_key=row.api_key,
@@ -116,7 +116,7 @@ async def list_api_keys(
116116

117117
return [
118118
ApiKey(
119-
id=f"{row.id}", # NOTE: remove after migration to str
119+
id=f"{row.id}", # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
120120
display_name=row.display_name,
121121
)
122122
for row in rows
@@ -133,7 +133,9 @@ async def get_api_key(
133133
) -> ApiKey | None:
134134
async with transaction_context(get_asyncpg_engine(app), connection) as conn:
135135
stmt = sa.select(api_keys).where(
136-
(api_keys.c.id == int(api_key_id)) # NOTE: remove after migration to str
136+
(
137+
api_keys.c.id == int(api_key_id)
138+
) # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
137139
& (api_keys.c.user_id == user_id)
138140
& (api_keys.c.product_name == product_name)
139141
)
@@ -143,7 +145,7 @@ async def get_api_key(
143145

144146
return (
145147
ApiKey(
146-
id=f"{row.id}", # NOTE: remove after migration to str
148+
id=f"{row.id}", # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
147149
display_name=row.display_name,
148150
expiration=row.expires_at,
149151
api_key=row.api_key,
@@ -164,7 +166,9 @@ async def delete_api_key(
164166
) -> None:
165167
async with transaction_context(get_asyncpg_engine(app), connection) as conn:
166168
stmt = api_keys.delete().where(
167-
(api_keys.c.id == int(api_key_id)) # NOTE: remove after migration to str
169+
(
170+
api_keys.c.id == int(api_key_id)
171+
) # NOTE See: https://github.com/ITISFoundation/osparc-simcore/issues/6919
168172
& (api_keys.c.user_id == user_id)
169173
& (api_keys.c.product_name == product_name)
170174
)

0 commit comments

Comments
 (0)