Skip to content

Commit f3b9c47

Browse files
fix: Forgot to set the return type on pilot-login
1 parent 8a28469 commit f3b9c47

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed

diracx-client/src/diracx/client/_generated/aio/operations/_operations.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ async def complete_authorization_flow(
837837
@distributed_trace_async
838838
async def pilot_login(
839839
self, *, pilot_job_reference: str, pilot_secret: str, **kwargs: Any
840-
) -> Any:
840+
) -> _models.TokenResponse:
841841
"""Pilot Login.
842842
843843
Endpoint without policy, the pilot uses only its secret.
@@ -846,8 +846,8 @@ async def pilot_login(
846846
:paramtype pilot_job_reference: str
847847
:keyword pilot_secret: Required.
848848
:paramtype pilot_secret: str
849-
:return: any
850-
:rtype: any
849+
:return: TokenResponse
850+
:rtype: ~_generated.models.TokenResponse
851851
:raises ~azure.core.exceptions.HttpResponseError:
852852
"""
853853
error_map: MutableMapping = {
@@ -861,7 +861,7 @@ async def pilot_login(
861861
_headers = kwargs.pop("headers", {}) or {}
862862
_params = kwargs.pop("params", {}) or {}
863863

864-
cls: ClsType[Any] = kwargs.pop("cls", None)
864+
cls: ClsType[_models.TokenResponse] = kwargs.pop("cls", None)
865865

866866
_request = build_auth_pilot_login_request(
867867
pilot_job_reference=pilot_job_reference,
@@ -886,23 +886,27 @@ async def pilot_login(
886886
)
887887
raise HttpResponseError(response=response)
888888

889-
deserialized = self._deserialize("object", pipeline_response.http_response)
889+
deserialized = self._deserialize(
890+
"TokenResponse", pipeline_response.http_response
891+
)
890892

891893
if cls:
892894
return cls(pipeline_response, deserialized, {}) # type: ignore
893895

894896
return deserialized # type: ignore
895897

896898
@distributed_trace_async
897-
async def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
899+
async def refresh_pilot_tokens(
900+
self, *, refresh_token: str, **kwargs: Any
901+
) -> _models.TokenResponse:
898902
"""Refresh Pilot Tokens.
899903
900904
Endpoint where a pilot can exchange a refresh token against a token.
901905
902906
:keyword refresh_token: Required.
903907
:paramtype refresh_token: str
904-
:return: any
905-
:rtype: any
908+
:return: TokenResponse
909+
:rtype: ~_generated.models.TokenResponse
906910
:raises ~azure.core.exceptions.HttpResponseError:
907911
"""
908912
error_map: MutableMapping = {
@@ -916,7 +920,7 @@ async def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> An
916920
_headers = kwargs.pop("headers", {}) or {}
917921
_params = kwargs.pop("params", {}) or {}
918922

919-
cls: ClsType[Any] = kwargs.pop("cls", None)
923+
cls: ClsType[_models.TokenResponse] = kwargs.pop("cls", None)
920924

921925
_request = build_auth_refresh_pilot_tokens_request(
922926
refresh_token=refresh_token,
@@ -940,7 +944,9 @@ async def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> An
940944
)
941945
raise HttpResponseError(response=response)
942946

943-
deserialized = self._deserialize("object", pipeline_response.http_response)
947+
deserialized = self._deserialize(
948+
"TokenResponse", pipeline_response.http_response
949+
)
944950

945951
if cls:
946952
return cls(pipeline_response, deserialized, {}) # type: ignore

diracx-client/src/diracx/client/_generated/operations/_operations.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ def complete_authorization_flow(
15171517
@distributed_trace
15181518
def pilot_login(
15191519
self, *, pilot_job_reference: str, pilot_secret: str, **kwargs: Any
1520-
) -> Any:
1520+
) -> _models.TokenResponse:
15211521
"""Pilot Login.
15221522
15231523
Endpoint without policy, the pilot uses only its secret.
@@ -1526,8 +1526,8 @@ def pilot_login(
15261526
:paramtype pilot_job_reference: str
15271527
:keyword pilot_secret: Required.
15281528
:paramtype pilot_secret: str
1529-
:return: any
1530-
:rtype: any
1529+
:return: TokenResponse
1530+
:rtype: ~_generated.models.TokenResponse
15311531
:raises ~azure.core.exceptions.HttpResponseError:
15321532
"""
15331533
error_map: MutableMapping = {
@@ -1541,7 +1541,7 @@ def pilot_login(
15411541
_headers = kwargs.pop("headers", {}) or {}
15421542
_params = kwargs.pop("params", {}) or {}
15431543

1544-
cls: ClsType[Any] = kwargs.pop("cls", None)
1544+
cls: ClsType[_models.TokenResponse] = kwargs.pop("cls", None)
15451545

15461546
_request = build_auth_pilot_login_request(
15471547
pilot_job_reference=pilot_job_reference,
@@ -1566,23 +1566,27 @@ def pilot_login(
15661566
)
15671567
raise HttpResponseError(response=response)
15681568

1569-
deserialized = self._deserialize("object", pipeline_response.http_response)
1569+
deserialized = self._deserialize(
1570+
"TokenResponse", pipeline_response.http_response
1571+
)
15701572

15711573
if cls:
15721574
return cls(pipeline_response, deserialized, {}) # type: ignore
15731575

15741576
return deserialized # type: ignore
15751577

15761578
@distributed_trace
1577-
def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
1579+
def refresh_pilot_tokens(
1580+
self, *, refresh_token: str, **kwargs: Any
1581+
) -> _models.TokenResponse:
15781582
"""Refresh Pilot Tokens.
15791583
15801584
Endpoint where a pilot can exchange a refresh token against a token.
15811585
15821586
:keyword refresh_token: Required.
15831587
:paramtype refresh_token: str
1584-
:return: any
1585-
:rtype: any
1588+
:return: TokenResponse
1589+
:rtype: ~_generated.models.TokenResponse
15861590
:raises ~azure.core.exceptions.HttpResponseError:
15871591
"""
15881592
error_map: MutableMapping = {
@@ -1596,7 +1600,7 @@ def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
15961600
_headers = kwargs.pop("headers", {}) or {}
15971601
_params = kwargs.pop("params", {}) or {}
15981602

1599-
cls: ClsType[Any] = kwargs.pop("cls", None)
1603+
cls: ClsType[_models.TokenResponse] = kwargs.pop("cls", None)
16001604

16011605
_request = build_auth_refresh_pilot_tokens_request(
16021606
refresh_token=refresh_token,
@@ -1620,7 +1624,9 @@ def refresh_pilot_tokens(self, *, refresh_token: str, **kwargs: Any) -> Any:
16201624
)
16211625
raise HttpResponseError(response=response)
16221626

1623-
deserialized = self._deserialize("object", pipeline_response.http_response)
1627+
deserialized = self._deserialize(
1628+
"TokenResponse", pipeline_response.http_response
1629+
)
16241630

16251631
if cls:
16261632
return cls(pipeline_response, deserialized, {}) # type: ignore

diracx-routers/src/diracx/routers/auth/pilot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def pilot_login(
4040
config: Config,
4141
settings: AuthSettings,
4242
available_properties: AvailableSecurityProperties,
43-
):
43+
) -> TokenResponse:
4444
"""Endpoint without policy, the pilot uses only its secret."""
4545
try:
4646
await try_login(
@@ -93,7 +93,7 @@ async def refresh_pilot_tokens(
9393
check_permissions: RegisteredPilotAccessPolicyCallable,
9494
refresh_token: str,
9595
pilot_info: Annotated[AuthorizedUserInfo, Depends(verify_dirac_access_token)],
96-
):
96+
) -> TokenResponse:
9797
"""Endpoint where a pilot can exchange a refresh token against a token."""
9898
await check_permissions()
9999

0 commit comments

Comments
 (0)