diracx-client 0.0.1a50__py3-none-any.whl → 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diracx/client/_generated/aio/operations/_operations.py +1 -54
 - diracx/client/_generated/models/__init__.py +2 -0
 - diracx/client/_generated/models/_models.py +40 -0
 - diracx/client/_generated/operations/_operations.py +2 -75
 - diracx/client/patches/auth/aio.py +27 -3
 - diracx/client/patches/auth/common.py +37 -8
 - diracx/client/patches/auth/sync.py +29 -4
 - {diracx_client-0.0.1a50.dist-info → diracx_client-0.0.2.dist-info}/METADATA +1 -1
 - {diracx_client-0.0.1a50.dist-info → diracx_client-0.0.2.dist-info}/RECORD +10 -10
 - {diracx_client-0.0.1a50.dist-info → diracx_client-0.0.2.dist-info}/WHEEL +0 -0
 
| 
         @@ -35,7 +35,6 @@ from ...operations._operations import ( 
     | 
|
| 
       35 
35 
     | 
    
         
             
                build_auth_initiate_authorization_flow_request,
         
     | 
| 
       36 
36 
     | 
    
         
             
                build_auth_initiate_device_flow_request,
         
     | 
| 
       37 
37 
     | 
    
         
             
                build_auth_revoke_refresh_token_by_jti_request,
         
     | 
| 
       38 
     | 
    
         
            -
                build_auth_revoke_refresh_token_by_refresh_token_request,
         
     | 
| 
       39 
38 
     | 
    
         
             
                build_auth_userinfo_request,
         
     | 
| 
       40 
39 
     | 
    
         
             
                build_config_serve_config_request,
         
     | 
| 
       41 
40 
     | 
    
         
             
                build_jobs_add_heartbeat_request,
         
     | 
| 
         @@ -293,6 +292,7 @@ class AuthOperations:  # pylint: disable=abstract-class-instantiated 
     | 
|
| 
       293 
292 
     | 
    
         
             
                    raise_if_not_implemented(
         
     | 
| 
       294 
293 
     | 
    
         
             
                        self.__class__,
         
     | 
| 
       295 
294 
     | 
    
         
             
                        [
         
     | 
| 
      
 295 
     | 
    
         
            +
                            "revoke_refresh_token_by_refresh_token",
         
     | 
| 
       296 
296 
     | 
    
         
             
                            "get_oidc_token",
         
     | 
| 
       297 
297 
     | 
    
         
             
                        ],
         
     | 
| 
       298 
298 
     | 
    
         
             
                    )
         
     | 
| 
         @@ -583,59 +583,6 @@ class AuthOperations:  # pylint: disable=abstract-class-instantiated 
     | 
|
| 
       583 
583 
     | 
    
         | 
| 
       584 
584 
     | 
    
         
             
                    return deserialized  # type: ignore
         
     | 
| 
       585 
585 
     | 
    
         | 
| 
       586 
     | 
    
         
            -
                @distributed_trace_async
         
     | 
| 
       587 
     | 
    
         
            -
                async def revoke_refresh_token_by_refresh_token(self, *, refresh_token: str, client_id: str, **kwargs: Any) -> str:
         
     | 
| 
       588 
     | 
    
         
            -
                    """Revoke Refresh Token By Refresh Token.
         
     | 
| 
       589 
     | 
    
         
            -
             
     | 
| 
       590 
     | 
    
         
            -
                    Revoke a refresh token.
         
     | 
| 
       591 
     | 
    
         
            -
             
     | 
| 
       592 
     | 
    
         
            -
                    :keyword refresh_token: Required.
         
     | 
| 
       593 
     | 
    
         
            -
                    :paramtype refresh_token: str
         
     | 
| 
       594 
     | 
    
         
            -
                    :keyword client_id: Required.
         
     | 
| 
       595 
     | 
    
         
            -
                    :paramtype client_id: str
         
     | 
| 
       596 
     | 
    
         
            -
                    :return: str
         
     | 
| 
       597 
     | 
    
         
            -
                    :rtype: str
         
     | 
| 
       598 
     | 
    
         
            -
                    :raises ~azure.core.exceptions.HttpResponseError:
         
     | 
| 
       599 
     | 
    
         
            -
                    """
         
     | 
| 
       600 
     | 
    
         
            -
                    error_map: MutableMapping = {
         
     | 
| 
       601 
     | 
    
         
            -
                        401: ClientAuthenticationError,
         
     | 
| 
       602 
     | 
    
         
            -
                        404: ResourceNotFoundError,
         
     | 
| 
       603 
     | 
    
         
            -
                        409: ResourceExistsError,
         
     | 
| 
       604 
     | 
    
         
            -
                        304: ResourceNotModifiedError,
         
     | 
| 
       605 
     | 
    
         
            -
                    }
         
     | 
| 
       606 
     | 
    
         
            -
                    error_map.update(kwargs.pop("error_map", {}) or {})
         
     | 
| 
       607 
     | 
    
         
            -
             
     | 
| 
       608 
     | 
    
         
            -
                    _headers = kwargs.pop("headers", {}) or {}
         
     | 
| 
       609 
     | 
    
         
            -
                    _params = kwargs.pop("params", {}) or {}
         
     | 
| 
       610 
     | 
    
         
            -
             
     | 
| 
       611 
     | 
    
         
            -
                    cls: ClsType[str] = kwargs.pop("cls", None)
         
     | 
| 
       612 
     | 
    
         
            -
             
     | 
| 
       613 
     | 
    
         
            -
                    _request = build_auth_revoke_refresh_token_by_refresh_token_request(
         
     | 
| 
       614 
     | 
    
         
            -
                        refresh_token=refresh_token,
         
     | 
| 
       615 
     | 
    
         
            -
                        client_id=client_id,
         
     | 
| 
       616 
     | 
    
         
            -
                        headers=_headers,
         
     | 
| 
       617 
     | 
    
         
            -
                        params=_params,
         
     | 
| 
       618 
     | 
    
         
            -
                    )
         
     | 
| 
       619 
     | 
    
         
            -
                    _request.url = self._client.format_url(_request.url)
         
     | 
| 
       620 
     | 
    
         
            -
             
     | 
| 
       621 
     | 
    
         
            -
                    _stream = False
         
     | 
| 
       622 
     | 
    
         
            -
                    pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
         
     | 
| 
       623 
     | 
    
         
            -
                        _request, stream=_stream, **kwargs
         
     | 
| 
       624 
     | 
    
         
            -
                    )
         
     | 
| 
       625 
     | 
    
         
            -
             
     | 
| 
       626 
     | 
    
         
            -
                    response = pipeline_response.http_response
         
     | 
| 
       627 
     | 
    
         
            -
             
     | 
| 
       628 
     | 
    
         
            -
                    if response.status_code not in [200]:
         
     | 
| 
       629 
     | 
    
         
            -
                        map_error(status_code=response.status_code, response=response, error_map=error_map)
         
     | 
| 
       630 
     | 
    
         
            -
                        raise HttpResponseError(response=response)
         
     | 
| 
       631 
     | 
    
         
            -
             
     | 
| 
       632 
     | 
    
         
            -
                    deserialized = self._deserialize("str", pipeline_response.http_response)
         
     | 
| 
       633 
     | 
    
         
            -
             
     | 
| 
       634 
     | 
    
         
            -
                    if cls:
         
     | 
| 
       635 
     | 
    
         
            -
                        return cls(pipeline_response, deserialized, {})  # type: ignore
         
     | 
| 
       636 
     | 
    
         
            -
             
     | 
| 
       637 
     | 
    
         
            -
                    return deserialized  # type: ignore
         
     | 
| 
       638 
     | 
    
         
            -
             
     | 
| 
       639 
586 
     | 
    
         
             
                @distributed_trace_async
         
     | 
| 
       640 
587 
     | 
    
         
             
                async def revoke_refresh_token_by_jti(self, jti: str, **kwargs: Any) -> str:
         
     | 
| 
       641 
588 
     | 
    
         
             
                    """Revoke Refresh Token By Jti.
         
     | 
| 
         @@ -14,6 +14,7 @@ if TYPE_CHECKING: 
     | 
|
| 
       14 
14 
     | 
    
         
             
            from ._models import (  # type: ignore
         
     | 
| 
       15 
15 
     | 
    
         
             
                BodyAuthGetOidcToken,
         
     | 
| 
       16 
16 
     | 
    
         
             
                BodyAuthGetOidcTokenGrantType,
         
     | 
| 
      
 17 
     | 
    
         
            +
                BodyAuthRevokeRefreshTokenByRefreshToken,
         
     | 
| 
       17 
18 
     | 
    
         
             
                BodyJobsRescheduleJobs,
         
     | 
| 
       18 
19 
     | 
    
         
             
                BodyJobsUnassignBulkJobsSandboxes,
         
     | 
| 
       19 
20 
     | 
    
         
             
                GroupInfo,
         
     | 
| 
         @@ -65,6 +66,7 @@ from ._patch import patch_sdk as _patch_sdk 
     | 
|
| 
       65 
66 
     | 
    
         
             
            __all__ = [
         
     | 
| 
       66 
67 
     | 
    
         
             
                "BodyAuthGetOidcToken",
         
     | 
| 
       67 
68 
     | 
    
         
             
                "BodyAuthGetOidcTokenGrantType",
         
     | 
| 
      
 69 
     | 
    
         
            +
                "BodyAuthRevokeRefreshTokenByRefreshToken",
         
     | 
| 
       68 
70 
     | 
    
         
             
                "BodyJobsRescheduleJobs",
         
     | 
| 
       69 
71 
     | 
    
         
             
                "BodyJobsUnassignBulkJobsSandboxes",
         
     | 
| 
       70 
72 
     | 
    
         
             
                "GroupInfo",
         
     | 
| 
         @@ -94,6 +94,46 @@ class BodyAuthGetOidcTokenGrantType(_serialization.Model): 
     | 
|
| 
       94 
94 
     | 
    
         
             
                """OAuth2 Grant type."""
         
     | 
| 
       95 
95 
     | 
    
         | 
| 
       96 
96 
     | 
    
         | 
| 
      
 97 
     | 
    
         
            +
            class BodyAuthRevokeRefreshTokenByRefreshToken(_serialization.Model):
         
     | 
| 
      
 98 
     | 
    
         
            +
                """Body_auth_revoke_refresh_token_by_refresh_token.
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
                All required parameters must be populated in order to send to server.
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                :ivar token: The refresh token to revoke. Required.
         
     | 
| 
      
 103 
     | 
    
         
            +
                :vartype token: str
         
     | 
| 
      
 104 
     | 
    
         
            +
                :ivar token_type_hint: Hint for the type of token being revoked.
         
     | 
| 
      
 105 
     | 
    
         
            +
                :vartype token_type_hint: str
         
     | 
| 
      
 106 
     | 
    
         
            +
                :ivar client_id: The client ID of the application requesting the revocation.
         
     | 
| 
      
 107 
     | 
    
         
            +
                :vartype client_id: str
         
     | 
| 
      
 108 
     | 
    
         
            +
                """
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                _validation = {
         
     | 
| 
      
 111 
     | 
    
         
            +
                    "token": {"required": True},
         
     | 
| 
      
 112 
     | 
    
         
            +
                }
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
                _attribute_map = {
         
     | 
| 
      
 115 
     | 
    
         
            +
                    "token": {"key": "token", "type": "str"},
         
     | 
| 
      
 116 
     | 
    
         
            +
                    "token_type_hint": {"key": "token_type_hint", "type": "str"},
         
     | 
| 
      
 117 
     | 
    
         
            +
                    "client_id": {"key": "client_id", "type": "str"},
         
     | 
| 
      
 118 
     | 
    
         
            +
                }
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                def __init__(
         
     | 
| 
      
 121 
     | 
    
         
            +
                    self, *, token: str, token_type_hint: Optional[str] = None, client_id: str = "myDIRACClientID", **kwargs: Any
         
     | 
| 
      
 122 
     | 
    
         
            +
                ) -> None:
         
     | 
| 
      
 123 
     | 
    
         
            +
                    """
         
     | 
| 
      
 124 
     | 
    
         
            +
                    :keyword token: The refresh token to revoke. Required.
         
     | 
| 
      
 125 
     | 
    
         
            +
                    :paramtype token: str
         
     | 
| 
      
 126 
     | 
    
         
            +
                    :keyword token_type_hint: Hint for the type of token being revoked.
         
     | 
| 
      
 127 
     | 
    
         
            +
                    :paramtype token_type_hint: str
         
     | 
| 
      
 128 
     | 
    
         
            +
                    :keyword client_id: The client ID of the application requesting the revocation.
         
     | 
| 
      
 129 
     | 
    
         
            +
                    :paramtype client_id: str
         
     | 
| 
      
 130 
     | 
    
         
            +
                    """
         
     | 
| 
      
 131 
     | 
    
         
            +
                    super().__init__(**kwargs)
         
     | 
| 
      
 132 
     | 
    
         
            +
                    self.token = token
         
     | 
| 
      
 133 
     | 
    
         
            +
                    self.token_type_hint = token_type_hint
         
     | 
| 
      
 134 
     | 
    
         
            +
                    self.client_id = client_id
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
       97 
137 
     | 
    
         
             
            class BodyJobsRescheduleJobs(_serialization.Model):
         
     | 
| 
       98 
138 
     | 
    
         
             
                """Body_jobs_reschedule_jobs.
         
     | 
| 
       99 
139 
     | 
    
         | 
| 
         @@ -83,7 +83,7 @@ def build_well_known_get_security_txt_request(**kwargs: Any) -> HttpRequest:  # 
     | 
|
| 
       83 
83 
     | 
    
         
             
                accept = _headers.pop("Accept", "application/json")
         
     | 
| 
       84 
84 
     | 
    
         | 
| 
       85 
85 
     | 
    
         
             
                # Construct URL
         
     | 
| 
       86 
     | 
    
         
            -
                _url = "/.well-known 
     | 
| 
      
 86 
     | 
    
         
            +
                _url = "/.well-known/security.txt"
         
     | 
| 
       87 
87 
     | 
    
         | 
| 
       88 
88 
     | 
    
         
             
                # Construct headers
         
     | 
| 
       89 
89 
     | 
    
         
             
                _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
         
     | 
| 
         @@ -175,27 +175,6 @@ def build_auth_get_refresh_tokens_request(**kwargs: Any) -> HttpRequest: 
     | 
|
| 
       175 
175 
     | 
    
         
             
                return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
         
     | 
| 
       176 
176 
     | 
    
         | 
| 
       177 
177 
     | 
    
         | 
| 
       178 
     | 
    
         
            -
            def build_auth_revoke_refresh_token_by_refresh_token_request(  # pylint: disable=name-too-long
         
     | 
| 
       179 
     | 
    
         
            -
                *, refresh_token: str, client_id: str, **kwargs: Any
         
     | 
| 
       180 
     | 
    
         
            -
            ) -> HttpRequest:
         
     | 
| 
       181 
     | 
    
         
            -
                _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
         
     | 
| 
       182 
     | 
    
         
            -
                _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
         
     | 
| 
       183 
     | 
    
         
            -
             
     | 
| 
       184 
     | 
    
         
            -
                accept = _headers.pop("Accept", "application/json")
         
     | 
| 
       185 
     | 
    
         
            -
             
     | 
| 
       186 
     | 
    
         
            -
                # Construct URL
         
     | 
| 
       187 
     | 
    
         
            -
                _url = "/api/auth/revoke"
         
     | 
| 
       188 
     | 
    
         
            -
             
     | 
| 
       189 
     | 
    
         
            -
                # Construct parameters
         
     | 
| 
       190 
     | 
    
         
            -
                _params["refresh_token"] = _SERIALIZER.query("refresh_token", refresh_token, "str")
         
     | 
| 
       191 
     | 
    
         
            -
                _params["client_id"] = _SERIALIZER.query("client_id", client_id, "str")
         
     | 
| 
       192 
     | 
    
         
            -
             
     | 
| 
       193 
     | 
    
         
            -
                # Construct headers
         
     | 
| 
       194 
     | 
    
         
            -
                _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
         
     | 
| 
       195 
     | 
    
         
            -
             
     | 
| 
       196 
     | 
    
         
            -
                return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
         
     | 
| 
       197 
     | 
    
         
            -
             
     | 
| 
       198 
     | 
    
         
            -
             
     | 
| 
       199 
178 
     | 
    
         
             
            def build_auth_revoke_refresh_token_by_jti_request(  # pylint: disable=name-too-long
         
     | 
| 
       200 
179 
     | 
    
         
             
                jti: str, **kwargs: Any
         
     | 
| 
       201 
180 
     | 
    
         
             
            ) -> HttpRequest:
         
     | 
| 
         @@ -816,6 +795,7 @@ class AuthOperations:  # pylint: disable=abstract-class-instantiated 
     | 
|
| 
       816 
795 
     | 
    
         
             
                    raise_if_not_implemented(
         
     | 
| 
       817 
796 
     | 
    
         
             
                        self.__class__,
         
     | 
| 
       818 
797 
     | 
    
         
             
                        [
         
     | 
| 
      
 798 
     | 
    
         
            +
                            "revoke_refresh_token_by_refresh_token",
         
     | 
| 
       819 
799 
     | 
    
         
             
                            "get_oidc_token",
         
     | 
| 
       820 
800 
     | 
    
         
             
                        ],
         
     | 
| 
       821 
801 
     | 
    
         
             
                    )
         
     | 
| 
         @@ -1104,59 +1084,6 @@ class AuthOperations:  # pylint: disable=abstract-class-instantiated 
     | 
|
| 
       1104 
1084 
     | 
    
         | 
| 
       1105 
1085 
     | 
    
         
             
                    return deserialized  # type: ignore
         
     | 
| 
       1106 
1086 
     | 
    
         | 
| 
       1107 
     | 
    
         
            -
                @distributed_trace
         
     | 
| 
       1108 
     | 
    
         
            -
                def revoke_refresh_token_by_refresh_token(self, *, refresh_token: str, client_id: str, **kwargs: Any) -> str:
         
     | 
| 
       1109 
     | 
    
         
            -
                    """Revoke Refresh Token By Refresh Token.
         
     | 
| 
       1110 
     | 
    
         
            -
             
     | 
| 
       1111 
     | 
    
         
            -
                    Revoke a refresh token.
         
     | 
| 
       1112 
     | 
    
         
            -
             
     | 
| 
       1113 
     | 
    
         
            -
                    :keyword refresh_token: Required.
         
     | 
| 
       1114 
     | 
    
         
            -
                    :paramtype refresh_token: str
         
     | 
| 
       1115 
     | 
    
         
            -
                    :keyword client_id: Required.
         
     | 
| 
       1116 
     | 
    
         
            -
                    :paramtype client_id: str
         
     | 
| 
       1117 
     | 
    
         
            -
                    :return: str
         
     | 
| 
       1118 
     | 
    
         
            -
                    :rtype: str
         
     | 
| 
       1119 
     | 
    
         
            -
                    :raises ~azure.core.exceptions.HttpResponseError:
         
     | 
| 
       1120 
     | 
    
         
            -
                    """
         
     | 
| 
       1121 
     | 
    
         
            -
                    error_map: MutableMapping = {
         
     | 
| 
       1122 
     | 
    
         
            -
                        401: ClientAuthenticationError,
         
     | 
| 
       1123 
     | 
    
         
            -
                        404: ResourceNotFoundError,
         
     | 
| 
       1124 
     | 
    
         
            -
                        409: ResourceExistsError,
         
     | 
| 
       1125 
     | 
    
         
            -
                        304: ResourceNotModifiedError,
         
     | 
| 
       1126 
     | 
    
         
            -
                    }
         
     | 
| 
       1127 
     | 
    
         
            -
                    error_map.update(kwargs.pop("error_map", {}) or {})
         
     | 
| 
       1128 
     | 
    
         
            -
             
     | 
| 
       1129 
     | 
    
         
            -
                    _headers = kwargs.pop("headers", {}) or {}
         
     | 
| 
       1130 
     | 
    
         
            -
                    _params = kwargs.pop("params", {}) or {}
         
     | 
| 
       1131 
     | 
    
         
            -
             
     | 
| 
       1132 
     | 
    
         
            -
                    cls: ClsType[str] = kwargs.pop("cls", None)
         
     | 
| 
       1133 
     | 
    
         
            -
             
     | 
| 
       1134 
     | 
    
         
            -
                    _request = build_auth_revoke_refresh_token_by_refresh_token_request(
         
     | 
| 
       1135 
     | 
    
         
            -
                        refresh_token=refresh_token,
         
     | 
| 
       1136 
     | 
    
         
            -
                        client_id=client_id,
         
     | 
| 
       1137 
     | 
    
         
            -
                        headers=_headers,
         
     | 
| 
       1138 
     | 
    
         
            -
                        params=_params,
         
     | 
| 
       1139 
     | 
    
         
            -
                    )
         
     | 
| 
       1140 
     | 
    
         
            -
                    _request.url = self._client.format_url(_request.url)
         
     | 
| 
       1141 
     | 
    
         
            -
             
     | 
| 
       1142 
     | 
    
         
            -
                    _stream = False
         
     | 
| 
       1143 
     | 
    
         
            -
                    pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
         
     | 
| 
       1144 
     | 
    
         
            -
                        _request, stream=_stream, **kwargs
         
     | 
| 
       1145 
     | 
    
         
            -
                    )
         
     | 
| 
       1146 
     | 
    
         
            -
             
     | 
| 
       1147 
     | 
    
         
            -
                    response = pipeline_response.http_response
         
     | 
| 
       1148 
     | 
    
         
            -
             
     | 
| 
       1149 
     | 
    
         
            -
                    if response.status_code not in [200]:
         
     | 
| 
       1150 
     | 
    
         
            -
                        map_error(status_code=response.status_code, response=response, error_map=error_map)
         
     | 
| 
       1151 
     | 
    
         
            -
                        raise HttpResponseError(response=response)
         
     | 
| 
       1152 
     | 
    
         
            -
             
     | 
| 
       1153 
     | 
    
         
            -
                    deserialized = self._deserialize("str", pipeline_response.http_response)
         
     | 
| 
       1154 
     | 
    
         
            -
             
     | 
| 
       1155 
     | 
    
         
            -
                    if cls:
         
     | 
| 
       1156 
     | 
    
         
            -
                        return cls(pipeline_response, deserialized, {})  # type: ignore
         
     | 
| 
       1157 
     | 
    
         
            -
             
     | 
| 
       1158 
     | 
    
         
            -
                    return deserialized  # type: ignore
         
     | 
| 
       1159 
     | 
    
         
            -
             
     | 
| 
       1160 
1087 
     | 
    
         
             
                @distributed_trace
         
     | 
| 
       1161 
1088 
     | 
    
         
             
                def revoke_refresh_token_by_jti(self, jti: str, **kwargs: Any) -> str:
         
     | 
| 
       1162 
1089 
     | 
    
         
             
                    """Revoke Refresh Token By Jti.
         
     | 
| 
         @@ -6,6 +6,7 @@ __all__ list in the corresponding file in the patches directory. 
     | 
|
| 
       6 
6 
     | 
    
         
             
            """
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            from __future__ import annotations
         
     | 
| 
      
 9 
     | 
    
         
            +
            from ast import Dict
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
       10 
11 
     | 
    
         
             
            __all__ = [
         
     | 
| 
       11 
12 
     | 
    
         
             
                "AuthOperations",
         
     | 
| 
         @@ -19,7 +20,7 @@ from ..._generated.aio.operations._operations import ( 
     | 
|
| 
       19 
20 
     | 
    
         
             
                _models,
         
     | 
| 
       20 
21 
     | 
    
         
             
                AuthOperations as _AuthOperations,
         
     | 
| 
       21 
22 
     | 
    
         
             
            )
         
     | 
| 
       22 
     | 
    
         
            -
            from .common import  
     | 
| 
      
 23 
     | 
    
         
            +
            from .common import handle_revoke_response, prepare_oidc_request, handle_oidc_response, prepare_revoke_request
         
     | 
| 
       23 
24 
     | 
    
         | 
| 
       24 
25 
     | 
    
         | 
| 
       25 
26 
     | 
    
         
             
            class AuthOperations(_AuthOperations):
         
     | 
| 
         @@ -27,7 +28,7 @@ class AuthOperations(_AuthOperations): 
     | 
|
| 
       27 
28 
     | 
    
         
             
                async def get_oidc_token(
         
     | 
| 
       28 
29 
     | 
    
         
             
                    self, device_code: str, client_id: str, **kwargs
         
     | 
| 
       29 
30 
     | 
    
         
             
                ) -> TokenResponse | _models.DeviceFlowErrorResponse:
         
     | 
| 
       30 
     | 
    
         
            -
                    request =  
     | 
| 
      
 31 
     | 
    
         
            +
                    request = prepare_oidc_request(
         
     | 
| 
       31 
32 
     | 
    
         
             
                        device_code=device_code,
         
     | 
| 
       32 
33 
     | 
    
         
             
                        client_id=client_id,
         
     | 
| 
       33 
34 
     | 
    
         
             
                        format_url=self._client.format_url,
         
     | 
| 
         @@ -39,7 +40,30 @@ class AuthOperations(_AuthOperations): 
     | 
|
| 
       39 
40 
     | 
    
         
             
                        )
         
     | 
| 
       40 
41 
     | 
    
         
             
                    )
         
     | 
| 
       41 
42 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
                    response =  
     | 
| 
      
 43 
     | 
    
         
            +
                    response = handle_oidc_response(pipeline_response, self._deserialize)
         
     | 
| 
       43 
44 
     | 
    
         
             
                    if isinstance(response, _models.DeviceFlowErrorResponse):
         
     | 
| 
       44 
45 
     | 
    
         
             
                        return response
         
     | 
| 
       45 
46 
     | 
    
         
             
                    return TokenResponse.model_validate(response.as_dict())
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                @distributed_trace_async
         
     | 
| 
      
 49 
     | 
    
         
            +
                async def revoke_refresh_token_by_refresh_token(
         
     | 
| 
      
 50 
     | 
    
         
            +
                    self,
         
     | 
| 
      
 51 
     | 
    
         
            +
                    *,
         
     | 
| 
      
 52 
     | 
    
         
            +
                    token: str,
         
     | 
| 
      
 53 
     | 
    
         
            +
                    client_id: str,
         
     | 
| 
      
 54 
     | 
    
         
            +
                    token_type_hint: str = "refresh_token",
         
     | 
| 
      
 55 
     | 
    
         
            +
                    **kwargs,
         
     | 
| 
      
 56 
     | 
    
         
            +
                ) -> str:
         
     | 
| 
      
 57 
     | 
    
         
            +
                    request = prepare_revoke_request(
         
     | 
| 
      
 58 
     | 
    
         
            +
                        token=token,
         
     | 
| 
      
 59 
     | 
    
         
            +
                        client_id=client_id,
         
     | 
| 
      
 60 
     | 
    
         
            +
                        token_type_hint=token_type_hint,
         
     | 
| 
      
 61 
     | 
    
         
            +
                        format_url=self._client.format_url,
         
     | 
| 
      
 62 
     | 
    
         
            +
                    )
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                    pipeline_response: PipelineResponse = (
         
     | 
| 
      
 65 
     | 
    
         
            +
                        await self._client._pipeline.run(  # pylint: disable=protected-access
         
     | 
| 
      
 66 
     | 
    
         
            +
                            request, stream=False, **kwargs
         
     | 
| 
      
 67 
     | 
    
         
            +
                        )
         
     | 
| 
      
 68 
     | 
    
         
            +
                    )
         
     | 
| 
      
 69 
     | 
    
         
            +
                    return handle_revoke_response(pipeline_response, self._deserialize)
         
     | 
| 
         @@ -3,8 +3,8 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            from __future__ import annotations
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            __all__ = [
         
     | 
| 
       6 
     | 
    
         
            -
                " 
     | 
| 
       7 
     | 
    
         
            -
                " 
     | 
| 
      
 6 
     | 
    
         
            +
                "prepare_oidc_request",
         
     | 
| 
      
 7 
     | 
    
         
            +
                "handle_oidc_response",
         
     | 
| 
       8 
8 
     | 
    
         
             
            ]
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
            from typing import Any
         
     | 
| 
         @@ -18,20 +18,24 @@ from ..._generated.models import TokenResponse, DeviceFlowErrorResponse 
     | 
|
| 
       18 
18 
     | 
    
         
             
            from ..._generated.operations._operations import _SERIALIZER
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
            def  
     | 
| 
      
 21 
     | 
    
         
            +
            def build_request(**kwargs: Any) -> HttpRequest:
         
     | 
| 
       22 
22 
     | 
    
         
             
                _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
                accept = _headers.pop("Accept", "application/json")
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                _url = " 
     | 
| 
      
 26 
     | 
    
         
            +
                _url = kwargs.pop("url")
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                 
     | 
| 
      
 30 
     | 
    
         
            +
                _method = kwargs.pop("method")
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
      
 32 
     | 
    
         
            +
                return HttpRequest(method=_method, url=_url, headers=_headers, **kwargs)
         
     | 
| 
       32 
33 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            def prepare_oidc_request(device_code, client_id, format_url) -> HttpRequest:
         
     | 
| 
      
 36 
     | 
    
         
            +
                request = build_request(
         
     | 
| 
      
 37 
     | 
    
         
            +
                    method="POST",
         
     | 
| 
      
 38 
     | 
    
         
            +
                    url="/api/auth/token",
         
     | 
| 
       35 
39 
     | 
    
         
             
                    data={
         
     | 
| 
       36 
40 
     | 
    
         
             
                        "grant_type": "urn:ietf:params:oauth:grant-type:device_code",
         
     | 
| 
       37 
41 
     | 
    
         
             
                        "device_code": device_code,
         
     | 
| 
         @@ -42,7 +46,21 @@ def prepare_request(device_code, client_id, format_url) -> HttpRequest: 
     | 
|
| 
       42 
46 
     | 
    
         
             
                return request
         
     | 
| 
       43 
47 
     | 
    
         | 
| 
       44 
48 
     | 
    
         | 
| 
       45 
     | 
    
         
            -
            def  
     | 
| 
      
 49 
     | 
    
         
            +
            def prepare_revoke_request(token, client_id, token_type_hint, format_url) -> HttpRequest:
         
     | 
| 
      
 50 
     | 
    
         
            +
                request = build_request(
         
     | 
| 
      
 51 
     | 
    
         
            +
                    method="POST",
         
     | 
| 
      
 52 
     | 
    
         
            +
                    url="/api/auth/revoke",
         
     | 
| 
      
 53 
     | 
    
         
            +
                    data={
         
     | 
| 
      
 54 
     | 
    
         
            +
                        "token": token,
         
     | 
| 
      
 55 
     | 
    
         
            +
                        "client_id": client_id,
         
     | 
| 
      
 56 
     | 
    
         
            +
                        "token_type_hint": token_type_hint,
         
     | 
| 
      
 57 
     | 
    
         
            +
                    }
         
     | 
| 
      
 58 
     | 
    
         
            +
                )
         
     | 
| 
      
 59 
     | 
    
         
            +
                request.url = format_url(request.url)
         
     | 
| 
      
 60 
     | 
    
         
            +
                return request
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
            def handle_oidc_response(
         
     | 
| 
       46 
64 
     | 
    
         
             
                pipeline_response: PipelineResponse, deserialize
         
     | 
| 
       47 
65 
     | 
    
         
             
            ) -> TokenResponse | DeviceFlowErrorResponse:
         
     | 
| 
       48 
66 
     | 
    
         
             
                response = pipeline_response.http_response
         
     | 
| 
         @@ -54,3 +72,14 @@ def handle_response( 
     | 
|
| 
       54 
72 
     | 
    
         
             
                else:
         
     | 
| 
       55 
73 
     | 
    
         
             
                    map_error(status_code=response.status_code, response=response, error_map={})
         
     | 
| 
       56 
74 
     | 
    
         
             
                    raise HttpResponseError(response=response)
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
            def handle_revoke_response(
         
     | 
| 
      
 78 
     | 
    
         
            +
                pipeline_response: PipelineResponse, deserialize
         
     | 
| 
      
 79 
     | 
    
         
            +
            ) -> str:
         
     | 
| 
      
 80 
     | 
    
         
            +
                response = pipeline_response.http_response
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                if response.status_code != 200:
         
     | 
| 
      
 83 
     | 
    
         
            +
                    map_error(status_code=response.status_code, response=response, error_map={})
         
     | 
| 
      
 84 
     | 
    
         
            +
                    raise HttpResponseError(response=response)
         
     | 
| 
      
 85 
     | 
    
         
            +
                return deserialize("str", pipeline_response)
         
     | 
| 
         @@ -18,15 +18,15 @@ from ..._generated.operations._operations import ( 
     | 
|
| 
       18 
18 
     | 
    
         
             
                _models,
         
     | 
| 
       19 
19 
     | 
    
         
             
                AuthOperations as _AuthOperations,
         
     | 
| 
       20 
20 
     | 
    
         
             
            )
         
     | 
| 
       21 
     | 
    
         
            -
            from .common import  
     | 
| 
      
 21 
     | 
    
         
            +
            from .common import handle_revoke_response, prepare_oidc_request, handle_oidc_response, prepare_revoke_request
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            class AuthOperations(_AuthOperations):
         
     | 
| 
       25 
25 
     | 
    
         
             
                @distributed_trace
         
     | 
| 
       26 
     | 
    
         
            -
                 
     | 
| 
      
 26 
     | 
    
         
            +
                def get_oidc_token(
         
     | 
| 
       27 
27 
     | 
    
         
             
                    self, device_code: str, client_id: str, **kwargs
         
     | 
| 
       28 
28 
     | 
    
         
             
                ) -> _models.TokenResponse | _models.DeviceFlowErrorResponse:
         
     | 
| 
       29 
     | 
    
         
            -
                    request =  
     | 
| 
      
 29 
     | 
    
         
            +
                    request = prepare_oidc_request(
         
     | 
| 
       30 
30 
     | 
    
         
             
                        device_code=device_code,
         
     | 
| 
       31 
31 
     | 
    
         
             
                        client_id=client_id,
         
     | 
| 
       32 
32 
     | 
    
         
             
                        format_url=self._client.format_url,
         
     | 
| 
         @@ -38,4 +38,29 @@ class AuthOperations(_AuthOperations): 
     | 
|
| 
       38 
38 
     | 
    
         
             
                        )
         
     | 
| 
       39 
39 
     | 
    
         
             
                    )
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                    return  
     | 
| 
      
 41 
     | 
    
         
            +
                    return handle_oidc_response(pipeline_response, self._deserialize)
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                @distributed_trace
         
     | 
| 
      
 45 
     | 
    
         
            +
                def revoke_refresh_token_by_refresh_token(
         
     | 
| 
      
 46 
     | 
    
         
            +
                    self,
         
     | 
| 
      
 47 
     | 
    
         
            +
                    *,
         
     | 
| 
      
 48 
     | 
    
         
            +
                    token: str,
         
     | 
| 
      
 49 
     | 
    
         
            +
                    client_id: str,
         
     | 
| 
      
 50 
     | 
    
         
            +
                    token_type_hint: str = "refresh_token",
         
     | 
| 
      
 51 
     | 
    
         
            +
                    **kwargs,
         
     | 
| 
      
 52 
     | 
    
         
            +
                ) -> str:
         
     | 
| 
      
 53 
     | 
    
         
            +
                    request = prepare_revoke_request(
         
     | 
| 
      
 54 
     | 
    
         
            +
                        token=token,
         
     | 
| 
      
 55 
     | 
    
         
            +
                        client_id=client_id,
         
     | 
| 
      
 56 
     | 
    
         
            +
                        token_type_hint=token_type_hint,
         
     | 
| 
      
 57 
     | 
    
         
            +
                        format_url=self._client.format_url,
         
     | 
| 
      
 58 
     | 
    
         
            +
                    )
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                    pipeline_response: PipelineResponse = (
         
     | 
| 
      
 61 
     | 
    
         
            +
                        self._client._pipeline.run(  # pylint: disable=protected-access
         
     | 
| 
      
 62 
     | 
    
         
            +
                            request, stream=False, **kwargs
         
     | 
| 
      
 63 
     | 
    
         
            +
                        )
         
     | 
| 
      
 64 
     | 
    
         
            +
                    )
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
                    return handle_revoke_response(pipeline_response, self._deserialize)
         
     | 
| 
         @@ -20,19 +20,19 @@ diracx/client/_generated/aio/_configuration.py,sha256=JWKZSmE3mnX6JR3SIHvVed20_8 
     | 
|
| 
       20 
20 
     | 
    
         
             
            diracx/client/_generated/aio/_patch.py,sha256=sKaNgM0-20jF_R-S87eusC0aZa38QJEsLLzW-HgOjOQ,686
         
     | 
| 
       21 
21 
     | 
    
         
             
            diracx/client/_generated/aio/_vendor.py,sha256=6EFsP3ValI_vbZ_ivnRYHg_oRjZ5jDiLlUqvAYyDMhM,1936
         
     | 
| 
       22 
22 
     | 
    
         
             
            diracx/client/_generated/aio/operations/__init__.py,sha256=gtvv0durn3Cr8FUdFImqDcCtCVp7RKULjprmO4jOoeI,1070
         
     | 
| 
       23 
     | 
    
         
            -
            diracx/client/_generated/aio/operations/_operations.py,sha256= 
     | 
| 
      
 23 
     | 
    
         
            +
            diracx/client/_generated/aio/operations/_operations.py,sha256=nGCYU9HJHKK7M4b-pbRYQW__uFk2X-4hQuvnzgsxXV0,83943
         
     | 
| 
       24 
24 
     | 
    
         
             
            diracx/client/_generated/aio/operations/_patch.py,sha256=jyk2R4wUaClz07zK9TiH6V_SxKakrHNZAUm35lqUC6k,816
         
     | 
| 
       25 
     | 
    
         
            -
            diracx/client/_generated/models/__init__.py,sha256= 
     | 
| 
      
 25 
     | 
    
         
            +
            diracx/client/_generated/models/__init__.py,sha256=QRqgQrc6KxUjebhh4G9A43Su7U9JSu5_3lnr0xx6p8w,3022
         
     | 
| 
       26 
26 
     | 
    
         
             
            diracx/client/_generated/models/_enums.py,sha256=7ANOVuRfxsJLHSGGh34Nl4PwCBjK7FAbCO9djayU2_0,1808
         
     | 
| 
       27 
     | 
    
         
            -
            diracx/client/_generated/models/_models.py,sha256= 
     | 
| 
      
 27 
     | 
    
         
            +
            diracx/client/_generated/models/_models.py,sha256=ToHQKKDfgPxmuqW4VTRNh17a8izu3UdxEWmcTKe06KA,59218
         
     | 
| 
       28 
28 
     | 
    
         
             
            diracx/client/_generated/models/_patch.py,sha256=D8bxd8gAeLH7RWZNUuzTT7P_dyot9Cey91Rb-UwI2BI,1501
         
     | 
| 
       29 
29 
     | 
    
         
             
            diracx/client/_generated/operations/__init__.py,sha256=gtvv0durn3Cr8FUdFImqDcCtCVp7RKULjprmO4jOoeI,1070
         
     | 
| 
       30 
     | 
    
         
            -
            diracx/client/_generated/operations/_operations.py,sha256= 
     | 
| 
      
 30 
     | 
    
         
            +
            diracx/client/_generated/operations/_operations.py,sha256=b-oL_31wFU355mAU_9l7-oUBXqqUlzp-Exbv7nUBYFA,101275
         
     | 
| 
       31 
31 
     | 
    
         
             
            diracx/client/_generated/operations/_patch.py,sha256=xE3M4iVZE5LKlg9XfMveXmOMxFQZCDrPE40nba9VUq8,816
         
     | 
| 
       32 
32 
     | 
    
         
             
            diracx/client/patches/utils.py,sha256=rsw76XnstQgTxjqs5p95jwFsPuR3zkt5JTBc8VhqoAs,10733
         
     | 
| 
       33 
     | 
    
         
            -
            diracx/client/patches/auth/aio.py,sha256= 
     | 
| 
       34 
     | 
    
         
            -
            diracx/client/patches/auth/common.py,sha256= 
     | 
| 
       35 
     | 
    
         
            -
            diracx/client/patches/auth/sync.py,sha256= 
     | 
| 
      
 33 
     | 
    
         
            +
            diracx/client/patches/auth/aio.py,sha256=uqnz06XKLEwb6Iu8kqf2I7JVokQNQSoRfIMKpsm8Dog,2286
         
     | 
| 
      
 34 
     | 
    
         
            +
            diracx/client/patches/auth/common.py,sha256=7YVuFsfD4OahbLILSgtaG6VsyN1qSA7WCieC524wATQ,2617
         
     | 
| 
      
 35 
     | 
    
         
            +
            diracx/client/patches/auth/sync.py,sha256=2WY-sEVbYIrGBG1BKGgkdfAoo_xYtJnuRl4Be7THrPg,2016
         
     | 
| 
       36 
36 
     | 
    
         
             
            diracx/client/patches/client/aio.py,sha256=GYUVCgSvlEeJnjVoqdorBAEdP4H6JoC_4L8tlvtAZIE,5330
         
     | 
| 
       37 
37 
     | 
    
         
             
            diracx/client/patches/client/common.py,sha256=sWQ4-2iMHl5kwQzfAhny89uOWo8paoYpgp15Ak0UP5c,6243
         
     | 
| 
       38 
38 
     | 
    
         
             
            diracx/client/patches/client/sync.py,sha256=AVfGtr0O8KsfX2TrtikftfSNFrZRIaujz_MOuaHKk3U,4720
         
     | 
| 
         @@ -40,6 +40,6 @@ diracx/client/patches/jobs/aio.py,sha256=8zUlwKPyx0yUkoxEjUkdYZcErs9jSv1ZEnZTHQe 
     | 
|
| 
       40 
40 
     | 
    
         
             
            diracx/client/patches/jobs/common.py,sha256=fTlQKEg06RSGG4ccFn-Mk_zSlZofPbpAJCzNtAZrPJA,4263
         
     | 
| 
       41 
41 
     | 
    
         
             
            diracx/client/patches/jobs/sync.py,sha256=3tJDAm4Hq0X8DztJtjWPv69UzvIEcv195BG1fruoUN4,1977
         
     | 
| 
       42 
42 
     | 
    
         
             
            _diracx_client_importer.pth,sha256=wJwJieKpvzPdCVaM-1oKiKN8OL3wBaHgrl8qyexFoKY,31
         
     | 
| 
       43 
     | 
    
         
            -
            diracx_client-0.0. 
     | 
| 
       44 
     | 
    
         
            -
            diracx_client-0.0. 
     | 
| 
       45 
     | 
    
         
            -
            diracx_client-0.0. 
     | 
| 
      
 43 
     | 
    
         
            +
            diracx_client-0.0.2.dist-info/METADATA,sha256=MQmnvFT0ThQ6BcITWvPhddIHD8579tPfbVZ3T0ZLKZI,603
         
     | 
| 
      
 44 
     | 
    
         
            +
            diracx_client-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
         
     | 
| 
      
 45 
     | 
    
         
            +
            diracx_client-0.0.2.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     |