Skip to content

Commit 2ca2ba6

Browse files
fix test
1 parent 91390d4 commit 2ca2ba6

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
from typing import Annotated
22

3+
from models_library.basic_types import IDStr
34
from pydantic import BaseModel, ConfigDict, Field
45

56

67
class ApiKeyGet(BaseModel):
8+
id: IDStr
79
display_name: Annotated[str, Field(..., min_length=3)]
8-
api_key: str
9-
api_secret: str
10+
api_key: str | None = None
11+
api_secret: str | None = None
1012

1113
model_config = ConfigDict(
1214
from_attributes=True,
1315
json_schema_extra={
1416
"examples": [
1517
{
18+
"id": "42",
1619
"display_name": "test-api-forever",
1720
"api_key": "key",
1821
"api_secret": "secret",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ async def get_api_key(
146146
id=f"{row.id}", # NOTE: remove after migration to str
147147
display_name=row.display_name,
148148
expiration=row.expires_at,
149+
api_key=row.api_key,
150+
api_secret=row.api_secret,
149151
)
150152
if row
151153
else None

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ async def get_api_key(
6868
product_name: ProductName,
6969
) -> ApiKey:
7070
api_key: ApiKey | None = await _repository.get_api_key(
71-
app, api_key_id=api_key_id, user_id=user_id, product_name=product_name
71+
app,
72+
api_key_id=api_key_id,
73+
user_id=user_id,
74+
product_name=product_name,
7275
)
7376
if api_key is not None:
7477
return api_key

0 commit comments

Comments
 (0)