update to new version of openapi-python-client
now: 0.13.0
This commit is contained in:
parent
deb73d06e6
commit
4a31250bca
|
@ -1,5 +1,5 @@
|
||||||
# ory-hydra-client
|
# ory-hydra-client
|
||||||
A client library for accessing ORY Hydra
|
A client library for accessing Ory Hydra
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
First, create a client:
|
First, create a client:
|
||||||
|
@ -61,12 +61,14 @@ client = AuthenticatedClient(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info.
|
||||||
|
|
||||||
Things to know:
|
Things to know:
|
||||||
1. Every path/method combo becomes a Python module with four functions:
|
1. Every path/method combo becomes a Python module with four functions:
|
||||||
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
||||||
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
||||||
1. `asyncio`: Like `sync` but the async instead of blocking
|
1. `asyncio`: Like `sync` but async instead of blocking
|
||||||
1. `asyncio_detailed`: Like `sync_detailed` by async instead of blocking
|
1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
|
||||||
|
|
||||||
1. All path/query params, and bodies become method arguments.
|
1. All path/query params, and bodies become method arguments.
|
||||||
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
""" A client library for accessing ORY Hydra """
|
""" A client library for accessing Ory Hydra """
|
||||||
from .client import AuthenticatedClient, Client
|
from .client import AuthenticatedClient, Client
|
||||||
|
|
||||||
|
__all__ = (
|
||||||
|
"AuthenticatedClient",
|
||||||
|
"Client",
|
||||||
|
)
|
||||||
|
|
|
@ -1,298 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
|
||||||
from ...models.completed_request import CompletedRequest
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.accept_login_request import AcceptLoginRequest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: AcceptLoginRequest,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/login/accept".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["login_challenge"] = login_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "put",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = CompletedRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: AcceptLoginRequest,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
|
|
||||||
additional information such as
|
|
||||||
the subject's ID and if ORY Hydra should remember the subject's subject agent for future
|
|
||||||
authentication attempts by setting
|
|
||||||
a cookie.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
json_body (AcceptLoginRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: AcceptLoginRequest,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
|
|
||||||
additional information such as
|
|
||||||
the subject's ID and if ORY Hydra should remember the subject's subject agent for future
|
|
||||||
authentication attempts by setting
|
|
||||||
a cookie.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
json_body (AcceptLoginRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: AcceptLoginRequest,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
|
|
||||||
additional information such as
|
|
||||||
the subject's ID and if ORY Hydra should remember the subject's subject agent for future
|
|
||||||
authentication attempts by setting
|
|
||||||
a cookie.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
json_body (AcceptLoginRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: AcceptLoginRequest,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes
|
|
||||||
additional information such as
|
|
||||||
the subject's ID and if ORY Hydra should remember the subject's subject agent for future
|
|
||||||
authentication attempts by setting
|
|
||||||
a cookie.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
json_body (AcceptLoginRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,209 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.completed_request import CompletedRequest
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/logout/accept".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["logout_challenge"] = logout_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "put",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = CompletedRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Accept a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,223 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.o_auth_2_client import OAuth2Client
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/clients".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "post",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
if response.status_code == HTTPStatus.CREATED:
|
|
||||||
response_201 = OAuth2Client.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_201
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.CONFLICT:
|
|
||||||
response_409 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_409
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Create an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
|
|
||||||
random secret will be generated. The secret will be returned in the response and you will not be
|
|
||||||
able to retrieve it later on. Write the secret down and keep it somwhere safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Create an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
|
|
||||||
random secret will be generated. The secret will be returned in the response and you will not be
|
|
||||||
able to retrieve it later on. Write the secret down and keep it somwhere safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Create an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
|
|
||||||
random secret will be generated. The secret will be returned in the response and you will not be
|
|
||||||
able to retrieve it later on. Write the secret down and keep it somwhere safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Create an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a
|
|
||||||
random secret will be generated. The secret will be returned in the response and you will not be
|
|
||||||
able to retrieve it later on. Write the secret down and keep it somwhere safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,225 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/keys/{set}/{kid}".format(
|
|
||||||
_client.base_url,set=set_,kid=kid)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key
|
|
||||||
|
|
||||||
Use this endpoint to delete a single JSON Web Key.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key
|
|
||||||
|
|
||||||
Use this endpoint to delete a single JSON Web Key.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key
|
|
||||||
|
|
||||||
Use this endpoint to delete a single JSON Web Key.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key
|
|
||||||
|
|
||||||
Use this endpoint to delete a single JSON Web Key.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,212 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
set_: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/keys/{set}".format(
|
|
||||||
_client.base_url,set=set_)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
set_: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key Set
|
|
||||||
|
|
||||||
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
set_: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key Set
|
|
||||||
|
|
||||||
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
set_=set_,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
set_: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key Set
|
|
||||||
|
|
||||||
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
set_: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete a JSON Web Key Set
|
|
||||||
|
|
||||||
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
|
||||||
|
|
||||||
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
|
||||||
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
|
||||||
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
|
||||||
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
|
||||||
keys as well.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
set_=set_,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,202 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/clients/{id}".format(
|
|
||||||
_client.base_url,id=id)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Deletes an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Delete an existing OAuth 2.0 Client by its ID.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Deletes an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Delete an existing OAuth 2.0 Client by its ID.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Deletes an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Delete an existing OAuth 2.0 Client by its ID.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Deletes an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Delete an existing OAuth 2.0 Client by its ID.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,189 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
client_id: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/tokens".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["client_id"] = client_id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
client_id: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete OAuth2 Access Tokens from a Client
|
|
||||||
|
|
||||||
This endpoint deletes OAuth2 access tokens issued for a client from the database
|
|
||||||
|
|
||||||
Args:
|
|
||||||
client_id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
client_id=client_id,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
client_id: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete OAuth2 Access Tokens from a Client
|
|
||||||
|
|
||||||
This endpoint deletes OAuth2 access tokens issued for a client from the database
|
|
||||||
|
|
||||||
Args:
|
|
||||||
client_id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
client_id=client_id,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
client_id: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Delete OAuth2 Access Tokens from a Client
|
|
||||||
|
|
||||||
This endpoint deletes OAuth2 access tokens issued for a client from the database
|
|
||||||
|
|
||||||
Args:
|
|
||||||
client_id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
client_id=client_id,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
client_id: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Delete OAuth2 Access Tokens from a Client
|
|
||||||
|
|
||||||
This endpoint deletes OAuth2 access tokens issued for a client from the database
|
|
||||||
|
|
||||||
Args:
|
|
||||||
client_id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
client_id=client_id,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,202 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.flush_inactive_o_auth_2_tokens_request import FlushInactiveOAuth2TokensRequest
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: FlushInactiveOAuth2TokensRequest,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/flush".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "post",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: FlushInactiveOAuth2TokensRequest,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Flush Expired OAuth2 Access Tokens
|
|
||||||
|
|
||||||
This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
|
|
||||||
no tokens will be
|
|
||||||
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
|
|
||||||
flushed as they are deleted
|
|
||||||
automatically when performing the refresh flow.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (FlushInactiveOAuth2TokensRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: FlushInactiveOAuth2TokensRequest,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Flush Expired OAuth2 Access Tokens
|
|
||||||
|
|
||||||
This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
|
|
||||||
no tokens will be
|
|
||||||
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
|
|
||||||
flushed as they are deleted
|
|
||||||
automatically when performing the refresh flow.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (FlushInactiveOAuth2TokensRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: FlushInactiveOAuth2TokensRequest,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Flush Expired OAuth2 Access Tokens
|
|
||||||
|
|
||||||
This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
|
|
||||||
no tokens will be
|
|
||||||
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
|
|
||||||
flushed as they are deleted
|
|
||||||
automatically when performing the refresh flow.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (FlushInactiveOAuth2TokensRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: FlushInactiveOAuth2TokensRequest,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Flush Expired OAuth2 Access Tokens
|
|
||||||
|
|
||||||
This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which
|
|
||||||
no tokens will be
|
|
||||||
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be
|
|
||||||
flushed as they are deleted
|
|
||||||
automatically when performing the refresh flow.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
json_body (FlushInactiveOAuth2TokensRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,263 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.consent_request import ConsentRequest
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/consent".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["consent_challenge"] = consent_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[ConsentRequest, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = ConsentRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.CONFLICT:
|
|
||||||
response_409 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_409
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[ConsentRequest, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[ConsentRequest, GenericError]]:
|
|
||||||
"""Get Consent Request Information
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[ConsentRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[ConsentRequest, GenericError]]:
|
|
||||||
"""Get Consent Request Information
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[ConsentRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[ConsentRequest, GenericError]]:
|
|
||||||
"""Get Consent Request Information
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[ConsentRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[ConsentRequest, GenericError]]:
|
|
||||||
"""Get Consent Request Information
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[ConsentRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,199 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.json_web_key_set import JSONWebKeySet
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/keys/{set}/{kid}".format(
|
|
||||||
_client.base_url,set=set_,kid=kid)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = JSONWebKeySet.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""Fetch a JSON Web Key
|
|
||||||
|
|
||||||
This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""Fetch a JSON Web Key
|
|
||||||
|
|
||||||
This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""Fetch a JSON Web Key
|
|
||||||
|
|
||||||
This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
set_: str,
|
|
||||||
kid: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""Fetch a JSON Web Key
|
|
||||||
|
|
||||||
This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
set_ (str):
|
|
||||||
kid (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
set_=set_,
|
|
||||||
kid=kid,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,249 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.login_request import LoginRequest
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/login".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["login_challenge"] = login_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LoginRequest]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = LoginRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.CONFLICT:
|
|
||||||
response_409 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_409
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, LoginRequest]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, LoginRequest]]:
|
|
||||||
"""Get a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LoginRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, LoginRequest]]:
|
|
||||||
"""Get a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LoginRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, LoginRequest]]:
|
|
||||||
"""Get a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LoginRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
login_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, LoginRequest]]:
|
|
||||||
"""Get a Login Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The login
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
|
||||||
the requested authentication process.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
login_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LoginRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
login_challenge=login_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,193 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.logout_request import LogoutRequest
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/logout".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["logout_challenge"] = logout_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, LogoutRequest]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = LogoutRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, LogoutRequest]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, LogoutRequest]]:
|
|
||||||
"""Get a Logout Request
|
|
||||||
|
|
||||||
Use this endpoint to fetch a logout request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LogoutRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, LogoutRequest]]:
|
|
||||||
"""Get a Logout Request
|
|
||||||
|
|
||||||
Use this endpoint to fetch a logout request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LogoutRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, LogoutRequest]]:
|
|
||||||
"""Get a Logout Request
|
|
||||||
|
|
||||||
Use this endpoint to fetch a logout request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LogoutRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, LogoutRequest]]:
|
|
||||||
"""Get a Logout Request
|
|
||||||
|
|
||||||
Use this endpoint to fetch a logout request.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, LogoutRequest]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,206 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.o_auth_2_client import OAuth2Client
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/clients/{id}".format(
|
|
||||||
_client.base_url,id=id)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = OAuth2Client.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Get an OAuth 2.0 Client.
|
|
||||||
|
|
||||||
Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Get an OAuth 2.0 Client.
|
|
||||||
|
|
||||||
Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Get an OAuth 2.0 Client.
|
|
||||||
|
|
||||||
Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Get an OAuth 2.0 Client.
|
|
||||||
|
|
||||||
Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,164 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.version import Version
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/version".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Version]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = Version.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Version]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Version]:
|
|
||||||
"""Get Service Version
|
|
||||||
|
|
||||||
This endpoint returns the service version typically notated using semantic versioning.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Version]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Version]:
|
|
||||||
"""Get Service Version
|
|
||||||
|
|
||||||
This endpoint returns the service version typically notated using semantic versioning.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Version]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Version]:
|
|
||||||
"""Get Service Version
|
|
||||||
|
|
||||||
This endpoint returns the service version typically notated using semantic versioning.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Version]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Version]:
|
|
||||||
"""Get Service Version
|
|
||||||
|
|
||||||
This endpoint returns the service version typically notated using semantic versioning.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Version]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,194 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
|
|
||||||
from ...models.o_auth_2_token_introspection import OAuth2TokenIntrospection
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/introspect".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "post",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = OAuth2TokenIntrospection.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
"""Introspect OAuth2 Tokens
|
|
||||||
|
|
||||||
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
|
||||||
active token
|
|
||||||
is neither expired nor revoked. If a token is active, additional information on the token will be
|
|
||||||
included. You can
|
|
||||||
set additional data for a token by setting `accessTokenExtra` during the consent flow.
|
|
||||||
|
|
||||||
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
|
|
||||||
endpoint/).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2TokenIntrospection]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
"""Introspect OAuth2 Tokens
|
|
||||||
|
|
||||||
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
|
||||||
active token
|
|
||||||
is neither expired nor revoked. If a token is active, additional information on the token will be
|
|
||||||
included. You can
|
|
||||||
set additional data for a token by setting `accessTokenExtra` during the consent flow.
|
|
||||||
|
|
||||||
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
|
|
||||||
endpoint/).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2TokenIntrospection]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
"""Introspect OAuth2 Tokens
|
|
||||||
|
|
||||||
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
|
||||||
active token
|
|
||||||
is neither expired nor revoked. If a token is active, additional information on the token will be
|
|
||||||
included. You can
|
|
||||||
set additional data for a token by setting `accessTokenExtra` during the consent flow.
|
|
||||||
|
|
||||||
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
|
|
||||||
endpoint/).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2TokenIntrospection]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2TokenIntrospection]]:
|
|
||||||
"""Introspect OAuth2 Tokens
|
|
||||||
|
|
||||||
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
|
||||||
active token
|
|
||||||
is neither expired nor revoked. If a token is active, additional information on the token will be
|
|
||||||
included. You can
|
|
||||||
set additional data for a token by setting `accessTokenExtra` during the consent flow.
|
|
||||||
|
|
||||||
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-
|
|
||||||
endpoint/).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2TokenIntrospection]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,260 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from typing import Union
|
|
||||||
from typing import cast
|
|
||||||
from ...types import UNSET, Unset
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast, List
|
|
||||||
from ...models.o_auth_2_client import OAuth2Client
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
limit: Union[Unset, None, int] = UNSET,
|
|
||||||
offset: Union[Unset, None, int] = UNSET,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/clients".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["limit"] = limit
|
|
||||||
|
|
||||||
|
|
||||||
params["offset"] = offset
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = []
|
|
||||||
_response_200 = response.json()
|
|
||||||
for response_200_item_data in (_response_200):
|
|
||||||
response_200_item = OAuth2Client.from_dict(response_200_item_data)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response_200.append(response_200_item)
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
limit: Union[Unset, None, int] = UNSET,
|
|
||||||
offset: Union[Unset, None, int] = UNSET,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
"""List OAuth 2.0 Clients
|
|
||||||
|
|
||||||
This endpoint lists all clients in the database, and never returns client secrets. As a default it
|
|
||||||
lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
|
|
||||||
an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
limit (Union[Unset, None, int]):
|
|
||||||
offset (Union[Unset, None, int]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['OAuth2Client']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
limit=limit,
|
|
||||||
offset=offset,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
limit: Union[Unset, None, int] = UNSET,
|
|
||||||
offset: Union[Unset, None, int] = UNSET,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
"""List OAuth 2.0 Clients
|
|
||||||
|
|
||||||
This endpoint lists all clients in the database, and never returns client secrets. As a default it
|
|
||||||
lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
|
|
||||||
an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
limit (Union[Unset, None, int]):
|
|
||||||
offset (Union[Unset, None, int]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['OAuth2Client']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
limit=limit,
|
|
||||||
offset=offset,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
limit: Union[Unset, None, int] = UNSET,
|
|
||||||
offset: Union[Unset, None, int] = UNSET,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
"""List OAuth 2.0 Clients
|
|
||||||
|
|
||||||
This endpoint lists all clients in the database, and never returns client secrets. As a default it
|
|
||||||
lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
|
|
||||||
an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
limit (Union[Unset, None, int]):
|
|
||||||
offset (Union[Unset, None, int]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['OAuth2Client']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
limit=limit,
|
|
||||||
offset=offset,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
limit: Union[Unset, None, int] = UNSET,
|
|
||||||
offset: Union[Unset, None, int] = UNSET,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, List['OAuth2Client']]]:
|
|
||||||
"""List OAuth 2.0 Clients
|
|
||||||
|
|
||||||
This endpoint lists all clients in the database, and never returns client secrets. As a default it
|
|
||||||
lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has
|
|
||||||
an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
limit (Union[Unset, None, int]):
|
|
||||||
offset (Union[Unset, None, int]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['OAuth2Client']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
limit=limit,
|
|
||||||
offset=offset,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,239 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from ...models.previous_consent_session import PreviousConsentSession
|
|
||||||
from typing import cast
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast, List
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/sessions/consent".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["subject"] = subject
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = []
|
|
||||||
_response_200 = response.json()
|
|
||||||
for response_200_item_data in (_response_200):
|
|
||||||
response_200_item = PreviousConsentSession.from_dict(response_200_item_data)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
response_200.append(response_200_item)
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
"""Lists All Consent Sessions of a Subject
|
|
||||||
|
|
||||||
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
|
||||||
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
|
||||||
empty JSON array with status code 200 OK.
|
|
||||||
|
|
||||||
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-
|
|
||||||
url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['PreviousConsentSession']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
"""Lists All Consent Sessions of a Subject
|
|
||||||
|
|
||||||
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
|
||||||
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
|
||||||
empty JSON array with status code 200 OK.
|
|
||||||
|
|
||||||
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-
|
|
||||||
url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['PreviousConsentSession']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
"""Lists All Consent Sessions of a Subject
|
|
||||||
|
|
||||||
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
|
||||||
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
|
||||||
empty JSON array with status code 200 OK.
|
|
||||||
|
|
||||||
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-
|
|
||||||
url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['PreviousConsentSession']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, List['PreviousConsentSession']]]:
|
|
||||||
"""Lists All Consent Sessions of a Subject
|
|
||||||
|
|
||||||
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
|
||||||
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
|
||||||
empty JSON array with status code 200 OK.
|
|
||||||
|
|
||||||
|
|
||||||
The \"Link\" header is also included in successful responses, which contains one or more links for
|
|
||||||
pagination, formatted like so: '<https://hydra-
|
|
||||||
url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>;
|
|
||||||
rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and
|
|
||||||
'previous'.
|
|
||||||
Multiple links can be included in this header, and will be separated by a comma.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, List['PreviousConsentSession']]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,125 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/metrics/prometheus".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=None,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Any]:
|
|
||||||
"""Get Snapshot Metrics from the Hydra Service.
|
|
||||||
|
|
||||||
If you're using k8s, you can then add annotations to your deployment like so:
|
|
||||||
|
|
||||||
```
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
prometheus.io/port: \"4445\"
|
|
||||||
prometheus.io/path: \"/metrics/prometheus\"
|
|
||||||
```
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Any]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Any]:
|
|
||||||
"""Get Snapshot Metrics from the Hydra Service.
|
|
||||||
|
|
||||||
If you're using k8s, you can then add annotations to your deployment like so:
|
|
||||||
|
|
||||||
```
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
prometheus.io/port: \"4445\"
|
|
||||||
prometheus.io/path: \"/metrics/prometheus\"
|
|
||||||
```
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
|
||||||
`X-Forwarded-Proto` header to be set.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Any]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
|
|
|
@ -1,298 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
|
||||||
from ...models.reject_request import RejectRequest
|
|
||||||
from ...models.completed_request import CompletedRequest
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/consent/reject".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["consent_challenge"] = consent_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "put",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = CompletedRequest.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Reject a Consent Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
|
|
||||||
resources on his/her behalf.
|
|
||||||
The consent provider must include a reason why the consent was not granted.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Reject a Consent Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
|
|
||||||
resources on his/her behalf.
|
|
||||||
The consent provider must include a reason why the consent was not granted.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Reject a Consent Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
|
|
||||||
resources on his/her behalf.
|
|
||||||
The consent provider must include a reason why the consent was not granted.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
consent_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
|
||||||
"""Reject a Consent Request
|
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
|
||||||
login provider
|
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
|
||||||
he/she must now be asked if
|
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
|
||||||
subject's behalf.
|
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
|
||||||
(browser) is redirected to. The consent
|
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
|
||||||
the subject accepted
|
|
||||||
or rejected the request.
|
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access
|
|
||||||
resources on his/her behalf.
|
|
||||||
The consent provider must include a reason why the consent was not granted.
|
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
consent_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
consent_challenge=consent_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,222 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.reject_request import RejectRequest
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/requests/logout/reject".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["logout_challenge"] = logout_challenge
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "put",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Reject a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response is empty as the logout provider has to chose what action to perform next.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Reject a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response is empty as the logout provider has to chose what action to perform next.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Reject a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response is empty as the logout provider has to chose what action to perform next.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: RejectRequest,
|
|
||||||
logout_challenge: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Reject a Logout Request
|
|
||||||
|
|
||||||
When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny
|
|
||||||
that logout request.
|
|
||||||
No body is required.
|
|
||||||
|
|
||||||
The response is empty as the logout provider has to chose what action to perform next.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
logout_challenge (str):
|
|
||||||
json_body (RejectRequest):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
logout_challenge=logout_challenge,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,215 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/sessions/login".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["subject"] = subject
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Invalidates All Login Sessions of a Certain User
|
|
||||||
Invalidates a Subject's Authentication Session
|
|
||||||
|
|
||||||
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
|
||||||
session, the subject
|
|
||||||
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
|
|
||||||
with OpenID Connect
|
|
||||||
Front- or Back-channel logout.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Invalidates All Login Sessions of a Certain User
|
|
||||||
Invalidates a Subject's Authentication Session
|
|
||||||
|
|
||||||
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
|
||||||
session, the subject
|
|
||||||
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
|
|
||||||
with OpenID Connect
|
|
||||||
Front- or Back-channel logout.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Invalidates All Login Sessions of a Certain User
|
|
||||||
Invalidates a Subject's Authentication Session
|
|
||||||
|
|
||||||
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
|
||||||
session, the subject
|
|
||||||
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
|
|
||||||
with OpenID Connect
|
|
||||||
Front- or Back-channel logout.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Invalidates All Login Sessions of a Certain User
|
|
||||||
Invalidates a Subject's Authentication Session
|
|
||||||
|
|
||||||
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
|
||||||
session, the subject
|
|
||||||
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work
|
|
||||||
with OpenID Connect
|
|
||||||
Front- or Back-channel logout.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,238 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from typing import Union
|
|
||||||
from typing import cast
|
|
||||||
from ...types import UNSET, Unset
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
client: Union[Unset, None, str] = UNSET,
|
|
||||||
all_: Union[Unset, None, bool] = UNSET,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth/sessions/consent".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["subject"] = subject
|
|
||||||
|
|
||||||
|
|
||||||
params["client"] = client
|
|
||||||
|
|
||||||
|
|
||||||
params["all"] = all_
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "delete",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.NO_CONTENT:
|
|
||||||
response_204 = cast(Any, None)
|
|
||||||
return response_204
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
client: Union[Unset, None, str] = UNSET,
|
|
||||||
all_: Union[Unset, None, bool] = UNSET,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
|
|
||||||
|
|
||||||
This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
|
|
||||||
invalidates all
|
|
||||||
associated OAuth 2.0 Access Tokens.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
client (Union[Unset, None, str]):
|
|
||||||
all_ (Union[Unset, None, bool]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
client=client,
|
|
||||||
all_=all_,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
client: Union[Unset, None, str] = UNSET,
|
|
||||||
all_: Union[Unset, None, bool] = UNSET,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
|
|
||||||
|
|
||||||
This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
|
|
||||||
invalidates all
|
|
||||||
associated OAuth 2.0 Access Tokens.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
client (Union[Unset, None, str]):
|
|
||||||
all_ (Union[Unset, None, bool]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
client=client,
|
|
||||||
all_=all_,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
client: Union[Unset, None, str] = UNSET,
|
|
||||||
all_: Union[Unset, None, bool] = UNSET,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
|
|
||||||
|
|
||||||
This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
|
|
||||||
invalidates all
|
|
||||||
associated OAuth 2.0 Access Tokens.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
client (Union[Unset, None, str]):
|
|
||||||
all_ (Union[Unset, None, bool]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
client=client,
|
|
||||||
all_=all_,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
subject: str,
|
|
||||||
client: Union[Unset, None, str] = UNSET,
|
|
||||||
all_: Union[Unset, None, bool] = UNSET,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
|
|
||||||
|
|
||||||
This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and
|
|
||||||
invalidates all
|
|
||||||
associated OAuth 2.0 Access Tokens.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
subject (str):
|
|
||||||
client (Union[Unset, None, str]):
|
|
||||||
all_ (Union[Unset, None, bool]):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
subject=subject,
|
|
||||||
client=client,
|
|
||||||
all_=all_,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,224 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.o_auth_2_client import OAuth2Client
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/clients/{id}".format(
|
|
||||||
_client.base_url,id=id)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
json_json_body = json_body.to_dict()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "put",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
"json": json_json_body,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = OAuth2Client.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Update an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
|
|
||||||
returned via the API. This is the only time you will be able to retrieve the client secret, so write
|
|
||||||
it down and keep it safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Update an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
|
|
||||||
returned via the API. This is the only time you will be able to retrieve the client secret, so write
|
|
||||||
it down and keep it safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Update an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
|
|
||||||
returned via the API. This is the only time you will be able to retrieve the client secret, so write
|
|
||||||
it down and keep it safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
id: str,
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
json_body: OAuth2Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, OAuth2Client]]:
|
|
||||||
"""Update an OAuth 2.0 Client
|
|
||||||
|
|
||||||
Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and
|
|
||||||
returned via the API. This is the only time you will be able to retrieve the client secret, so write
|
|
||||||
it down and keep it safe.
|
|
||||||
|
|
||||||
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
|
||||||
are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
|
||||||
To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well
|
|
||||||
protected and only callable by first-party components.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
id (str):
|
|
||||||
json_body (OAuth2Client):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, OAuth2Client]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
id=id,
|
|
||||||
_client=_client,
|
|
||||||
json_body=json_body,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from ...models.generic_error import GenericError
|
from typing import Dict
|
||||||
from ...models.json_web_key_set import JSONWebKeySet
|
from ...models.json_web_key_set import JsonWebKeySet
|
||||||
from ...models.json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
|
from ...models.create_json_web_key_set import CreateJsonWebKeySet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,10 +18,10 @@ def _get_kwargs(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JsonWebKeySetGeneratorRequest,
|
json_body: CreateJsonWebKeySet,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/keys/{set}".format(
|
url = "{}/admin/keys/{set}".format(
|
||||||
_client.base_url,set=set_)
|
_client.base_url,set=set_)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -48,40 +49,25 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
|
||||||
if response.status_code == HTTPStatus.CREATED:
|
if response.status_code == HTTPStatus.CREATED:
|
||||||
response_201 = JSONWebKeySet.from_dict(response.json())
|
response_201 = JsonWebKeySet.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_201
|
return response_201
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
if client.raise_on_unexpected_status:
|
||||||
response_401 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,10 +75,10 @@ def sync_detailed(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JsonWebKeySetGeneratorRequest,
|
json_body: CreateJsonWebKeySet,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Generate a New JSON Web Key
|
"""Create JSON Web Key
|
||||||
|
|
||||||
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
||||||
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
||||||
|
@ -106,10 +92,14 @@ def sync_detailed(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JsonWebKeySetGeneratorRequest):
|
json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,16 +115,16 @@ json_body=json_body,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JsonWebKeySetGeneratorRequest,
|
json_body: CreateJsonWebKeySet,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Generate a New JSON Web Key
|
"""Create JSON Web Key
|
||||||
|
|
||||||
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
||||||
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
||||||
|
@ -148,10 +138,14 @@ def sync(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JsonWebKeySetGeneratorRequest):
|
json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,10 +160,10 @@ async def asyncio_detailed(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JsonWebKeySetGeneratorRequest,
|
json_body: CreateJsonWebKeySet,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Generate a New JSON Web Key
|
"""Create JSON Web Key
|
||||||
|
|
||||||
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
||||||
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
||||||
|
@ -183,10 +177,14 @@ async def asyncio_detailed(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JsonWebKeySetGeneratorRequest):
|
json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -202,16 +200,16 @@ json_body=json_body,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JsonWebKeySetGeneratorRequest,
|
json_body: CreateJsonWebKeySet,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Generate a New JSON Web Key
|
"""Create JSON Web Key
|
||||||
|
|
||||||
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies
|
||||||
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys
|
||||||
|
@ -225,10 +223,14 @@ async def asyncio(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JsonWebKeySetGeneratorRequest):
|
json_body (CreateJsonWebKeySet): Create JSON Web Key Set Request Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,156 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/keys/{set}/{kid}".format(
|
||||||
|
_client.base_url,set=set_,kid=kid)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete JSON Web Key
|
||||||
|
|
||||||
|
Use this endpoint to delete a single JSON Web Key.
|
||||||
|
|
||||||
|
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
||||||
|
cryptographic key. A
|
||||||
|
JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its
|
||||||
|
set and key id. ORY Hydra uses
|
||||||
|
this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID
|
||||||
|
Connect ID tokens),
|
||||||
|
and allows storing user-defined keys as well.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete JSON Web Key
|
||||||
|
|
||||||
|
Use this endpoint to delete a single JSON Web Key.
|
||||||
|
|
||||||
|
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
||||||
|
cryptographic key. A
|
||||||
|
JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its
|
||||||
|
set and key id. ORY Hydra uses
|
||||||
|
this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID
|
||||||
|
Connect ID tokens),
|
||||||
|
and allows storing user-defined keys as well.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
set_: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/keys/{set}".format(
|
||||||
|
_client.base_url,set=set_)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
set_: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete JSON Web Key Set
|
||||||
|
|
||||||
|
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
||||||
|
|
||||||
|
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
||||||
|
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
||||||
|
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
||||||
|
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
||||||
|
keys as well.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
set_: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete JSON Web Key Set
|
||||||
|
|
||||||
|
Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
|
||||||
|
|
||||||
|
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a
|
||||||
|
cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key
|
||||||
|
is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys
|
||||||
|
used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined
|
||||||
|
keys as well.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,211 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.json_web_key_set import JsonWebKeySet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/keys/{set}/{kid}".format(
|
||||||
|
_client.base_url,set=set_,kid=kid)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = JsonWebKeySet.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[JsonWebKeySet]:
|
||||||
|
"""Get JSON Web Key
|
||||||
|
|
||||||
|
This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
|
||||||
|
the specific key ID (kid).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[JsonWebKeySet]:
|
||||||
|
"""Get JSON Web Key
|
||||||
|
|
||||||
|
This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
|
||||||
|
the specific key ID (kid).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[JsonWebKeySet]:
|
||||||
|
"""Get JSON Web Key
|
||||||
|
|
||||||
|
This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
|
||||||
|
the specific key ID (kid).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
set_: str,
|
||||||
|
kid: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[JsonWebKeySet]:
|
||||||
|
"""Get JSON Web Key
|
||||||
|
|
||||||
|
This endpoint returns a singular JSON Web Key contained in a set. It is identified by the set and
|
||||||
|
the specific key ID (kid).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
set_ (str):
|
||||||
|
kid (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
set_=set_,
|
||||||
|
kid=kid,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.json_web_key_set import JSONWebKeySet
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from ...models.json_web_key_set import JsonWebKeySet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +19,7 @@ def _get_kwargs(
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/keys/{set}".format(
|
url = "{}/admin/keys/{set}".format(
|
||||||
_client.base_url,set=set_)
|
_client.base_url,set=set_)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -43,40 +44,25 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = JSONWebKeySet.from_dict(response.json())
|
response_200 = JsonWebKeySet.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
if client.raise_on_unexpected_status:
|
||||||
response_401 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +71,7 @@ def sync_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Retrieve a JSON Web Key Set
|
"""Retrieve a JSON Web Key Set
|
||||||
|
|
||||||
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
||||||
|
@ -99,8 +85,12 @@ def sync_detailed(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,14 +105,14 @@ _client=_client,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Retrieve a JSON Web Key Set
|
"""Retrieve a JSON Web Key Set
|
||||||
|
|
||||||
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
||||||
|
@ -136,8 +126,12 @@ def sync(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +146,7 @@ async def asyncio_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Retrieve a JSON Web Key Set
|
"""Retrieve a JSON Web Key Set
|
||||||
|
|
||||||
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
||||||
|
@ -166,8 +160,12 @@ async def asyncio_detailed(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,14 +180,14 @@ _client=_client,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Retrieve a JSON Web Key Set
|
"""Retrieve a JSON Web Key Set
|
||||||
|
|
||||||
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
|
||||||
|
@ -203,8 +201,12 @@ async def asyncio(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from ...models.json_web_key import JSONWebKey
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from ...models.json_web_key import JsonWebKey
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,10 +18,10 @@ def _get_kwargs(
|
||||||
kid: str,
|
kid: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKey,
|
json_body: JsonWebKey,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/keys/{set}/{kid}".format(
|
url = "{}/admin/keys/{set}/{kid}".format(
|
||||||
_client.base_url,set=set_,kid=kid)
|
_client.base_url,set=set_,kid=kid)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -48,40 +49,25 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKey]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKey]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = JSONWebKey.from_dict(response.json())
|
response_200 = JsonWebKey.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
if client.raise_on_unexpected_status:
|
||||||
response_401 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKey]:
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKey]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,10 +76,10 @@ def sync_detailed(
|
||||||
kid: str,
|
kid: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKey,
|
json_body: JsonWebKey,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKey]]:
|
) -> Response[JsonWebKey]:
|
||||||
"""Update a JSON Web Key
|
"""Set JSON Web Key
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
own.
|
own.
|
||||||
|
@ -107,12 +93,14 @@ def sync_detailed(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
kid (str):
|
kid (str):
|
||||||
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
|
json_body (JsonWebKey):
|
||||||
"swagger generate spec" to generate only on definition of a
|
|
||||||
JSONWebKey.
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKey]]
|
Response[JsonWebKey]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,17 +117,17 @@ json_body=json_body,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
set_: str,
|
set_: str,
|
||||||
kid: str,
|
kid: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKey,
|
json_body: JsonWebKey,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKey]]:
|
) -> Optional[JsonWebKey]:
|
||||||
"""Update a JSON Web Key
|
"""Set JSON Web Key
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
own.
|
own.
|
||||||
|
@ -153,12 +141,14 @@ def sync(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
kid (str):
|
kid (str):
|
||||||
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
|
json_body (JsonWebKey):
|
||||||
"swagger generate spec" to generate only on definition of a
|
|
||||||
JSONWebKey.
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKey]]
|
Response[JsonWebKey]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,10 +165,10 @@ async def asyncio_detailed(
|
||||||
kid: str,
|
kid: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKey,
|
json_body: JsonWebKey,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKey]]:
|
) -> Response[JsonWebKey]:
|
||||||
"""Update a JSON Web Key
|
"""Set JSON Web Key
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
own.
|
own.
|
||||||
|
@ -192,12 +182,14 @@ async def asyncio_detailed(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
kid (str):
|
kid (str):
|
||||||
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
|
json_body (JsonWebKey):
|
||||||
"swagger generate spec" to generate only on definition of a
|
|
||||||
JSONWebKey.
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKey]]
|
Response[JsonWebKey]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -214,17 +206,17 @@ json_body=json_body,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
set_: str,
|
set_: str,
|
||||||
kid: str,
|
kid: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKey,
|
json_body: JsonWebKey,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKey]]:
|
) -> Optional[JsonWebKey]:
|
||||||
"""Update a JSON Web Key
|
"""Set JSON Web Key
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
own.
|
own.
|
||||||
|
@ -238,12 +230,14 @@ async def asyncio(
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
kid (str):
|
kid (str):
|
||||||
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
|
json_body (JsonWebKey):
|
||||||
"swagger generate spec" to generate only on definition of a
|
|
||||||
JSONWebKey.
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKey]]
|
Response[JsonWebKey]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from ...models.json_web_key_set import JSONWebKeySet
|
from typing import Dict
|
||||||
|
from ...models.json_web_key_set import JsonWebKeySet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,10 +17,10 @@ def _get_kwargs(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKeySet,
|
json_body: JsonWebKeySet,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/keys/{set}".format(
|
url = "{}/admin/keys/{set}".format(
|
||||||
_client.base_url,set=set_)
|
_client.base_url,set=set_)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -47,40 +48,25 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = JSONWebKeySet.from_dict(response.json())
|
response_200 = JsonWebKeySet.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
if client.raise_on_unexpected_status:
|
||||||
response_401 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.FORBIDDEN:
|
|
||||||
response_403 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_403
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,9 +74,9 @@ def sync_detailed(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKeySet,
|
json_body: JsonWebKeySet,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Update a JSON Web Key Set
|
"""Update a JSON Web Key Set
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
|
@ -104,15 +90,14 @@ def sync_detailed(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
|
json_body (JsonWebKeySet): JSON Web Key Set
|
||||||
for
|
|
||||||
"swagger generate spec" to generate only on definition of a
|
Raises:
|
||||||
JSONWebKeySet. Since one with the same name is previously defined as
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
client.Client.JSONWebKeys and this one is last, this one will be
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
effectively written in the swagger spec.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,15 +113,15 @@ json_body=json_body,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKeySet,
|
json_body: JsonWebKeySet,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Update a JSON Web Key Set
|
"""Update a JSON Web Key Set
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
|
@ -150,15 +135,14 @@ def sync(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
|
json_body (JsonWebKeySet): JSON Web Key Set
|
||||||
for
|
|
||||||
"swagger generate spec" to generate only on definition of a
|
Raises:
|
||||||
JSONWebKeySet. Since one with the same name is previously defined as
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
client.Client.JSONWebKeys and this one is last, this one will be
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
effectively written in the swagger spec.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -173,9 +157,9 @@ async def asyncio_detailed(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKeySet,
|
json_body: JsonWebKeySet,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
) -> Response[JsonWebKeySet]:
|
||||||
"""Update a JSON Web Key Set
|
"""Update a JSON Web Key Set
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
|
@ -189,15 +173,14 @@ async def asyncio_detailed(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
|
json_body (JsonWebKeySet): JSON Web Key Set
|
||||||
for
|
|
||||||
"swagger generate spec" to generate only on definition of a
|
Raises:
|
||||||
JSONWebKeySet. Since one with the same name is previously defined as
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
client.Client.JSONWebKeys and this one is last, this one will be
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
effectively written in the swagger spec.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,15 +196,15 @@ json_body=json_body,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
set_: str,
|
set_: str,
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: JSONWebKeySet,
|
json_body: JsonWebKeySet,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
) -> Optional[JsonWebKeySet]:
|
||||||
"""Update a JSON Web Key Set
|
"""Update a JSON Web Key Set
|
||||||
|
|
||||||
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
|
||||||
|
@ -235,15 +218,14 @@ async def asyncio(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_ (str):
|
set_ (str):
|
||||||
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
|
json_body (JsonWebKeySet): JSON Web Key Set
|
||||||
for
|
|
||||||
"swagger generate spec" to generate only on definition of a
|
Raises:
|
||||||
JSONWebKeySet. Since one with the same name is previously defined as
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
client.Client.JSONWebKeys and this one is last, this one will be
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
effectively written in the swagger spec.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
Response[JsonWebKeySet]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from ...models.health_status import HealthStatus
|
from ...models.get_version_response_200 import GetVersionResponse200
|
||||||
from typing import cast
|
|
||||||
from ...models.health_not_ready_status import HealthNotReadyStatus
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ def _get_kwargs(
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/health/ready".format(
|
url = "{}/version".format(
|
||||||
_client.base_url)
|
_client.base_url)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -42,28 +43,25 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[GetVersionResponse200]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = HealthStatus.from_dict(response.json())
|
response_200 = GetVersionResponse200.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
|
if client.raise_on_unexpected_status:
|
||||||
response_503 = HealthNotReadyStatus.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[GetVersionResponse200]:
|
||||||
return response_503
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,21 +69,23 @@ def sync_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
|
) -> Response[GetVersionResponse200]:
|
||||||
"""Check Readiness Status
|
"""Return Running Software Version.
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running and the environment
|
This endpoint returns the version of Ory Hydra.
|
||||||
dependencies (e.g.
|
|
||||||
the database) are responsive as well.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the version will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[HealthNotReadyStatus, HealthStatus]]
|
Response[GetVersionResponse200]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,27 +99,29 @@ def sync_detailed(
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
|
) -> Optional[GetVersionResponse200]:
|
||||||
"""Check Readiness Status
|
"""Return Running Software Version.
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running and the environment
|
This endpoint returns the version of Ory Hydra.
|
||||||
dependencies (e.g.
|
|
||||||
the database) are responsive as well.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the version will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[HealthNotReadyStatus, HealthStatus]]
|
Response[GetVersionResponse200]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,21 +134,23 @@ async def asyncio_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
|
) -> Response[GetVersionResponse200]:
|
||||||
"""Check Readiness Status
|
"""Return Running Software Version.
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running and the environment
|
This endpoint returns the version of Ory Hydra.
|
||||||
dependencies (e.g.
|
|
||||||
the database) are responsive as well.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the version will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[HealthNotReadyStatus, HealthStatus]]
|
Response[GetVersionResponse200]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,27 +164,29 @@ async def asyncio_detailed(
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
|
) -> Optional[GetVersionResponse200]:
|
||||||
"""Check Readiness Status
|
"""Return Running Software Version.
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running and the environment
|
This endpoint returns the version of Ory Hydra.
|
||||||
dependencies (e.g.
|
|
||||||
the database) are responsive as well.
|
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the version will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[HealthNotReadyStatus, HealthStatus]]
|
Response[GetVersionResponse200]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
from ...models.generic_error import GenericError
|
||||||
from ...models.health_status import HealthStatus
|
from ...models.health_status import HealthStatus
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +44,7 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, HealthStatus]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[GenericError, HealthStatus]]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = HealthStatus.from_dict(response.json())
|
response_200 = HealthStatus.from_dict(response.json())
|
||||||
|
|
||||||
|
@ -55,15 +57,18 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError,
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
return response_500
|
||||||
return None
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, HealthStatus]]:
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[GenericError, HealthStatus]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,10 +77,11 @@ def sync_detailed(
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, HealthStatus]]:
|
) -> Response[Union[GenericError, HealthStatus]]:
|
||||||
"""Check Alive Status
|
"""Check HTTP Server Status
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running.
|
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
|
||||||
This status does currently not include checks whether the database connection is working.
|
HTTP requests. This status does currently not include checks whether the database connection is
|
||||||
|
working.
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
@ -83,6 +89,10 @@ def sync_detailed(
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the health status will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, HealthStatus]]
|
Response[Union[GenericError, HealthStatus]]
|
||||||
"""
|
"""
|
||||||
|
@ -98,17 +108,18 @@ def sync_detailed(
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, HealthStatus]]:
|
) -> Optional[Union[GenericError, HealthStatus]]:
|
||||||
"""Check Alive Status
|
"""Check HTTP Server Status
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running.
|
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
|
||||||
This status does currently not include checks whether the database connection is working.
|
HTTP requests. This status does currently not include checks whether the database connection is
|
||||||
|
working.
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
@ -116,6 +127,10 @@ def sync(
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the health status will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, HealthStatus]]
|
Response[Union[GenericError, HealthStatus]]
|
||||||
"""
|
"""
|
||||||
|
@ -131,10 +146,11 @@ async def asyncio_detailed(
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Response[Union[GenericError, HealthStatus]]:
|
) -> Response[Union[GenericError, HealthStatus]]:
|
||||||
"""Check Alive Status
|
"""Check HTTP Server Status
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running.
|
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
|
||||||
This status does currently not include checks whether the database connection is working.
|
HTTP requests. This status does currently not include checks whether the database connection is
|
||||||
|
working.
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
@ -142,6 +158,10 @@ async def asyncio_detailed(
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the health status will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, HealthStatus]]
|
Response[Union[GenericError, HealthStatus]]
|
||||||
"""
|
"""
|
||||||
|
@ -157,17 +177,18 @@ async def asyncio_detailed(
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, HealthStatus]]:
|
) -> Optional[Union[GenericError, HealthStatus]]:
|
||||||
"""Check Alive Status
|
"""Check HTTP Server Status
|
||||||
|
|
||||||
This endpoint returns a 200 status code when the HTTP server is up running.
|
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
|
||||||
This status does currently not include checks whether the database connection is working.
|
HTTP requests. This status does currently not include checks whether the database connection is
|
||||||
|
working.
|
||||||
|
|
||||||
If the service supports TLS Edge Termination, this endpoint does not require the
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
`X-Forwarded-Proto` header to be set.
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
@ -175,6 +196,10 @@ async def asyncio(
|
||||||
Be aware that if you are running multiple nodes of this service, the health status will never
|
Be aware that if you are running multiple nodes of this service, the health status will never
|
||||||
refer to the cluster state, only to a single instance.
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[GenericError, HealthStatus]]
|
Response[Union[GenericError, HealthStatus]]
|
||||||
"""
|
"""
|
212
libs/ory-hydra-client/ory_hydra_client/api/metadata/is_ready.py
Normal file
212
libs/ory-hydra-client/ory_hydra_client/api/metadata/is_ready.py
Normal file
|
@ -0,0 +1,212 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.is_ready_response_200 import IsReadyResponse200
|
||||||
|
from ...models.is_ready_response_503 import IsReadyResponse503
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/health/ready".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = IsReadyResponse200.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
|
||||||
|
response_503 = IsReadyResponse503.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_503
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
"""Check HTTP Server and Database Status
|
||||||
|
|
||||||
|
This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
|
||||||
|
dependencies (e.g.
|
||||||
|
the database) are responsive as well.
|
||||||
|
|
||||||
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
|
Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
|
||||||
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[IsReadyResponse200, IsReadyResponse503]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
"""Check HTTP Server and Database Status
|
||||||
|
|
||||||
|
This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
|
||||||
|
dependencies (e.g.
|
||||||
|
the database) are responsive as well.
|
||||||
|
|
||||||
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
|
Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
|
||||||
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[IsReadyResponse200, IsReadyResponse503]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
"""Check HTTP Server and Database Status
|
||||||
|
|
||||||
|
This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
|
||||||
|
dependencies (e.g.
|
||||||
|
the database) are responsive as well.
|
||||||
|
|
||||||
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
|
Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
|
||||||
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[IsReadyResponse200, IsReadyResponse503]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[IsReadyResponse200, IsReadyResponse503]]:
|
||||||
|
"""Check HTTP Server and Database Status
|
||||||
|
|
||||||
|
This endpoint returns a HTTP 200 status code when Ory Hydra is up running and the environment
|
||||||
|
dependencies (e.g.
|
||||||
|
the database) are responsive as well.
|
||||||
|
|
||||||
|
If the service supports TLS Edge Termination, this endpoint does not require the
|
||||||
|
`X-Forwarded-Proto` header to be set.
|
||||||
|
|
||||||
|
Be aware that if you are running multiple nodes of Ory Hydra, the health status will never
|
||||||
|
refer to the cluster state, only to a single instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[IsReadyResponse200, IsReadyResponse503]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -1,26 +1,27 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
from typing import Dict
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from ...models.the_request_payload_used_to_accept_a_consent_request import TheRequestPayloadUsedToAcceptAConsentRequest
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from ...models.completed_request import CompletedRequest
|
from typing import Dict
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.accept_consent_request import AcceptConsentRequest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
def _get_kwargs(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: AcceptConsentRequest,
|
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
|
||||||
consent_challenge: str,
|
consent_challenge: str,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/oauth2/auth/requests/consent/accept".format(
|
url = "{}/admin/oauth2/auth/requests/consent/accept".format(
|
||||||
_client.base_url)
|
_client.base_url)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -55,78 +56,72 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = CompletedRequest.from_dict(response.json())
|
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
if client.raise_on_unexpected_status:
|
||||||
response_404 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
def sync_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: AcceptConsentRequest,
|
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
|
||||||
consent_challenge: str,
|
consent_challenge: str,
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
"""Accept a Consent Request
|
"""Accept OAuth 2.0 Consent Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
he/she must now be asked if
|
must now be asked if
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
subject's behalf.
|
subject's behalf.
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The consent
|
(browser) is redirected to. The consent
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
the subject accepted
|
subject accepted
|
||||||
or rejected the request.
|
or rejected the request.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
|
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
|
||||||
resources on his/her behalf.
|
his/her behalf.
|
||||||
The consent provider includes additional information, such as session data for access and ID tokens,
|
The consent provider includes additional information, such as session data for access and ID tokens,
|
||||||
and if the
|
and if the
|
||||||
consent request should be used as basis for future requests.
|
consent request should be used as basis for future requests.
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
consent_challenge (str):
|
consent_challenge (str):
|
||||||
json_body (AcceptConsentRequest):
|
json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,49 +137,52 @@ consent_challenge=consent_challenge,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: AcceptConsentRequest,
|
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
|
||||||
consent_challenge: str,
|
consent_challenge: str,
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
"""Accept a Consent Request
|
"""Accept OAuth 2.0 Consent Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
he/she must now be asked if
|
must now be asked if
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
subject's behalf.
|
subject's behalf.
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The consent
|
(browser) is redirected to. The consent
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
the subject accepted
|
subject accepted
|
||||||
or rejected the request.
|
or rejected the request.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
|
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
|
||||||
resources on his/her behalf.
|
his/her behalf.
|
||||||
The consent provider includes additional information, such as session data for access and ID tokens,
|
The consent provider includes additional information, such as session data for access and ID tokens,
|
||||||
and if the
|
and if the
|
||||||
consent request should be used as basis for future requests.
|
consent request should be used as basis for future requests.
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
consent_challenge (str):
|
consent_challenge (str):
|
||||||
json_body (AcceptConsentRequest):
|
json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -198,44 +196,47 @@ consent_challenge=consent_challenge,
|
||||||
async def asyncio_detailed(
|
async def asyncio_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: AcceptConsentRequest,
|
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
|
||||||
consent_challenge: str,
|
consent_challenge: str,
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
"""Accept a Consent Request
|
"""Accept OAuth 2.0 Consent Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
he/she must now be asked if
|
must now be asked if
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
subject's behalf.
|
subject's behalf.
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The consent
|
(browser) is redirected to. The consent
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
the subject accepted
|
subject accepted
|
||||||
or rejected the request.
|
or rejected the request.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
|
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
|
||||||
resources on his/her behalf.
|
his/her behalf.
|
||||||
The consent provider includes additional information, such as session data for access and ID tokens,
|
The consent provider includes additional information, such as session data for access and ID tokens,
|
||||||
and if the
|
and if the
|
||||||
consent request should be used as basis for future requests.
|
consent request should be used as basis for future requests.
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
consent_challenge (str):
|
consent_challenge (str):
|
||||||
json_body (AcceptConsentRequest):
|
json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -251,49 +252,52 @@ consent_challenge=consent_challenge,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: AcceptConsentRequest,
|
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
|
||||||
consent_challenge: str,
|
consent_challenge: str,
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
"""Accept a Consent Request
|
"""Accept OAuth 2.0 Consent Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated,
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
he/she must now be asked if
|
must now be asked if
|
||||||
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
subject's behalf.
|
subject's behalf.
|
||||||
|
|
||||||
The consent provider which handles this request and is a web app implemented and hosted by you. It
|
|
||||||
shows a subject interface which asks the subject to
|
|
||||||
grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write
|
|
||||||
access to all your private files\").
|
|
||||||
|
|
||||||
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The consent
|
(browser) is redirected to. The consent
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
the subject accepted
|
subject accepted
|
||||||
or rejected the request.
|
or rejected the request.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access
|
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
|
||||||
resources on his/her behalf.
|
his/her behalf.
|
||||||
The consent provider includes additional information, such as session data for access and ID tokens,
|
The consent provider includes additional information, such as session data for access and ID tokens,
|
||||||
and if the
|
and if the
|
||||||
consent request should be used as basis for future requests.
|
consent request should be used as basis for future requests.
|
||||||
|
|
||||||
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
consent_challenge (str):
|
consent_challenge (str):
|
||||||
json_body (AcceptConsentRequest):
|
json_body (TheRequestPayloadUsedToAcceptAConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,278 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.handled_login_request_is_the_request_payload_used_to_accept_a_login_request import HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/login/accept".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["login_challenge"] = login_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has successfully authenticated and includes additional
|
||||||
|
information such as
|
||||||
|
the subject's ID and if Ory should remember the subject's subject agent for future authentication
|
||||||
|
attempts by setting
|
||||||
|
a cookie.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has successfully authenticated and includes additional
|
||||||
|
information such as
|
||||||
|
the subject's ID and if Ory should remember the subject's subject agent for future authentication
|
||||||
|
attempts by setting
|
||||||
|
a cookie.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has successfully authenticated and includes additional
|
||||||
|
information such as
|
||||||
|
the subject's ID and if Ory should remember the subject's subject agent for future authentication
|
||||||
|
attempts by setting
|
||||||
|
a cookie.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has successfully authenticated and includes additional
|
||||||
|
information such as
|
||||||
|
the subject's ID and if Ory should remember the subject's subject agent for future authentication
|
||||||
|
attempts by setting
|
||||||
|
a cookie.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
json_body (HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,213 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/logout/accept".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["logout_challenge"] = logout_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to confirm that logout request.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to confirm that logout request.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to confirm that logout request.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Accept OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to confirm that logout request.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,220 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
if response.status_code == HTTPStatus.CREATED:
|
||||||
|
response_201 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_201
|
||||||
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
response_400 = cast(Any, None)
|
||||||
|
return response_400
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Create OAuth 2.0 Client
|
||||||
|
|
||||||
|
Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
|
||||||
|
secret
|
||||||
|
is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Create OAuth 2.0 Client
|
||||||
|
|
||||||
|
Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
|
||||||
|
secret
|
||||||
|
is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Create OAuth 2.0 Client
|
||||||
|
|
||||||
|
Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
|
||||||
|
secret
|
||||||
|
is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Create OAuth 2.0 Client
|
||||||
|
|
||||||
|
Create a new OAuth 2.0 client. If you pass `client_secret` the secret is used, otherwise a random
|
||||||
|
secret
|
||||||
|
is generated. The secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Client
|
||||||
|
|
||||||
|
Delete an existing OAuth 2.0 Client by its ID.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Make sure that this endpoint is well protected and only callable by first-party components.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Client
|
||||||
|
|
||||||
|
Delete an existing OAuth 2.0 Client by its ID.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Make sure that this endpoint is well protected and only callable by first-party components.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
client_id: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/tokens".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["client_id"] = client_id
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
client_id: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
|
||||||
|
|
||||||
|
This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
client_id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
client_id=client_id,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
client_id: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
|
||||||
|
|
||||||
|
This endpoint deletes OAuth2 access tokens issued to an OAuth 2.0 Client from the database.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
client_id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
client_id=client_id,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/trust/grants/jwt-bearer/issuers/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when
|
||||||
|
you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT)
|
||||||
|
Profile
|
||||||
|
for OAuth 2.0 Client Authentication and Authorization Grant.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when
|
||||||
|
you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT)
|
||||||
|
Profile
|
||||||
|
for OAuth 2.0 Client Authentication and Authorization Grant.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,210 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Get an OAuth 2.0 Client
|
||||||
|
|
||||||
|
Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Get an OAuth 2.0 Client
|
||||||
|
|
||||||
|
Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Get an OAuth 2.0 Client
|
||||||
|
|
||||||
|
Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Get an OAuth 2.0 Client
|
||||||
|
|
||||||
|
Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,268 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from ...models.contains_information_on_an_ongoing_consent_request import ContainsInformationOnAnOngoingConsentRequest
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/consent".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["consent_challenge"] = consent_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = ContainsInformationOnAnOngoingConsentRequest.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.GONE:
|
||||||
|
response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_410
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingConsentRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,256 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.contains_information_on_an_ongoing_login_request import ContainsInformationOnAnOngoingLoginRequest
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/login".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["login_challenge"] = login_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = ContainsInformationOnAnOngoingLoginRequest.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.GONE:
|
||||||
|
response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_410
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
Per default, the login provider is Ory itself. You may use a different login provider which needs to
|
||||||
|
be a web-app
|
||||||
|
you write and host, and it must be able to authenticate (\"show the subject a login screen\")
|
||||||
|
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
Per default, the login provider is Ory itself. You may use a different login provider which needs to
|
||||||
|
be a web-app
|
||||||
|
you write and host, and it must be able to authenticate (\"show the subject a login screen\")
|
||||||
|
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
Per default, the login provider is Ory itself. You may use a different login provider which needs to
|
||||||
|
be a web-app
|
||||||
|
you write and host, and it must be able to authenticate (\"show the subject a login screen\")
|
||||||
|
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
login_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Login Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
|
|
||||||
|
Per default, the login provider is Ory itself. You may use a different login provider which needs to
|
||||||
|
be a web-app
|
||||||
|
you write and host, and it must be able to authenticate (\"show the subject a login screen\")
|
||||||
|
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
||||||
|
|
||||||
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The login
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
|
the requested authentication process.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
login_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationOnAnOngoingLoginRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
login_challenge=login_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,208 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.contains_information_about_an_ongoing_logout_request import ContainsInformationAboutAnOngoingLogoutRequest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/logout".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["logout_challenge"] = logout_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = ContainsInformationAboutAnOngoingLogoutRequest.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.GONE:
|
||||||
|
response_410 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_410
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
Use this endpoint to fetch an Ory OAuth 2.0 logout request.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
Use this endpoint to fetch an Ory OAuth 2.0 logout request.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
Use this endpoint to fetch an Ory OAuth 2.0 logout request.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]:
|
||||||
|
"""Get OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
Use this endpoint to fetch an Ory OAuth 2.0 logout request.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[ContainsInformationAboutAnOngoingLogoutRequest, OAuth20RedirectBrowserTo]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,198 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/trust/grants/jwt-bearer/issuers/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = TrustedOAuth2JwtGrantIssuer.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Get Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Get Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Get Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Get Trusted OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
|
||||||
|
created the trust relationship.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,200 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.introspected_o_auth_2_token import IntrospectedOAuth2Token
|
||||||
|
from ...models.introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
form_data: IntrospectOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/introspect".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"data": form_data.to_dict(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[IntrospectedOAuth2Token]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = IntrospectedOAuth2Token.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[IntrospectedOAuth2Token]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
form_data: IntrospectOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Response[IntrospectedOAuth2Token]:
|
||||||
|
"""Introspect OAuth2 Access and Refresh Tokens
|
||||||
|
|
||||||
|
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
||||||
|
active token
|
||||||
|
is neither expired nor revoked. If a token is active, additional information on the token will be
|
||||||
|
included. You can
|
||||||
|
set additional data for a token by setting `session.access_token` during the consent flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[IntrospectedOAuth2Token]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
form_data: IntrospectOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Optional[IntrospectedOAuth2Token]:
|
||||||
|
"""Introspect OAuth2 Access and Refresh Tokens
|
||||||
|
|
||||||
|
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
||||||
|
active token
|
||||||
|
is neither expired nor revoked. If a token is active, additional information on the token will be
|
||||||
|
included. You can
|
||||||
|
set additional data for a token by setting `session.access_token` during the consent flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[IntrospectedOAuth2Token]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
form_data: IntrospectOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Response[IntrospectedOAuth2Token]:
|
||||||
|
"""Introspect OAuth2 Access and Refresh Tokens
|
||||||
|
|
||||||
|
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
||||||
|
active token
|
||||||
|
is neither expired nor revoked. If a token is active, additional information on the token will be
|
||||||
|
included. You can
|
||||||
|
set additional data for a token by setting `session.access_token` during the consent flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[IntrospectedOAuth2Token]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
form_data: IntrospectOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Optional[IntrospectedOAuth2Token]:
|
||||||
|
"""Introspect OAuth2 Access and Refresh Tokens
|
||||||
|
|
||||||
|
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An
|
||||||
|
active token
|
||||||
|
is neither expired nor revoked. If a token is active, additional information on the token will be
|
||||||
|
included. You can
|
||||||
|
set additional data for a token by setting `session.access_token` during the consent flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[IntrospectedOAuth2Token]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,175 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...types import UNSET, Unset
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
client_name: Union[Unset, None, str] = UNSET,
|
||||||
|
owner: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["page_size"] = page_size
|
||||||
|
|
||||||
|
|
||||||
|
params["page_token"] = page_token
|
||||||
|
|
||||||
|
|
||||||
|
params["client_name"] = client_name
|
||||||
|
|
||||||
|
|
||||||
|
params["owner"] = owner
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
client_name: Union[Unset, None, str] = UNSET,
|
||||||
|
owner: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""List OAuth 2.0 Clients
|
||||||
|
|
||||||
|
This endpoint lists all clients in the database, and never returns client secrets.
|
||||||
|
As a default it lists the first 100 clients.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
client_name (Union[Unset, None, str]):
|
||||||
|
owner (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
client_name=client_name,
|
||||||
|
owner=owner,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
client_name: Union[Unset, None, str] = UNSET,
|
||||||
|
owner: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""List OAuth 2.0 Clients
|
||||||
|
|
||||||
|
This endpoint lists all clients in the database, and never returns client secrets.
|
||||||
|
As a default it lists the first 100 clients.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
client_name (Union[Unset, None, str]):
|
||||||
|
owner (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
client_name=client_name,
|
||||||
|
owner=owner,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,266 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...types import UNSET, Unset
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Union
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.o_auth_20_consent_session import OAuth20ConsentSession
|
||||||
|
from typing import cast, List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
subject: str,
|
||||||
|
login_session_id: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/sessions/consent".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["page_size"] = page_size
|
||||||
|
|
||||||
|
|
||||||
|
params["page_token"] = page_token
|
||||||
|
|
||||||
|
|
||||||
|
params["subject"] = subject
|
||||||
|
|
||||||
|
|
||||||
|
params["login_session_id"] = login_session_id
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List['OAuth20ConsentSession']]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = []
|
||||||
|
_response_200 = response.json()
|
||||||
|
for componentsschemaso_auth_2_consent_sessions_item_data in (_response_200):
|
||||||
|
componentsschemaso_auth_2_consent_sessions_item = OAuth20ConsentSession.from_dict(componentsschemaso_auth_2_consent_sessions_item_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
response_200.append(componentsschemaso_auth_2_consent_sessions_item)
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[List['OAuth20ConsentSession']]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
subject: str,
|
||||||
|
login_session_id: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[List['OAuth20ConsentSession']]:
|
||||||
|
"""List OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
||||||
|
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
||||||
|
empty JSON array with status code 200 OK.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
subject (str):
|
||||||
|
login_session_id (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['OAuth20ConsentSession']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
subject=subject,
|
||||||
|
login_session_id=login_session_id,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
subject: str,
|
||||||
|
login_session_id: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Optional[List['OAuth20ConsentSession']]:
|
||||||
|
"""List OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
||||||
|
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
||||||
|
empty JSON array with status code 200 OK.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
subject (str):
|
||||||
|
login_session_id (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['OAuth20ConsentSession']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
subject=subject,
|
||||||
|
login_session_id=login_session_id,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
subject: str,
|
||||||
|
login_session_id: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[List['OAuth20ConsentSession']]:
|
||||||
|
"""List OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
||||||
|
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
||||||
|
empty JSON array with status code 200 OK.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
subject (str):
|
||||||
|
login_session_id (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['OAuth20ConsentSession']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
subject=subject,
|
||||||
|
login_session_id=login_session_id,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
page_size: Union[Unset, None, int] = 250,
|
||||||
|
page_token: Union[Unset, None, str] = '1',
|
||||||
|
subject: str,
|
||||||
|
login_session_id: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Optional[List['OAuth20ConsentSession']]:
|
||||||
|
"""List OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint lists all subject's granted consent sessions, including client and granted scope.
|
||||||
|
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
|
||||||
|
empty JSON array with status code 200 OK.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
page_size (Union[Unset, None, int]): Default: 250.
|
||||||
|
page_token (Union[Unset, None, str]): Default: '1'.
|
||||||
|
subject (str):
|
||||||
|
login_session_id (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['OAuth20ConsentSession']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
page_size=page_size,
|
||||||
|
page_token=page_token,
|
||||||
|
subject=subject,
|
||||||
|
login_session_id=login_session_id,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,242 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...types import UNSET, Unset
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Union
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast, List
|
||||||
|
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
max_items: Union[Unset, None, int] = UNSET,
|
||||||
|
default_items: Union[Unset, None, int] = UNSET,
|
||||||
|
issuer: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/trust/grants/jwt-bearer/issuers".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["MaxItems"] = max_items
|
||||||
|
|
||||||
|
|
||||||
|
params["DefaultItems"] = default_items
|
||||||
|
|
||||||
|
|
||||||
|
params["issuer"] = issuer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = []
|
||||||
|
_response_200 = response.json()
|
||||||
|
for componentsschemastrusted_o_auth_2_jwt_grant_issuers_item_data in (_response_200):
|
||||||
|
componentsschemastrusted_o_auth_2_jwt_grant_issuers_item = TrustedOAuth2JwtGrantIssuer.from_dict(componentsschemastrusted_o_auth_2_jwt_grant_issuers_item_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
response_200.append(componentsschemastrusted_o_auth_2_jwt_grant_issuers_item)
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
max_items: Union[Unset, None, int] = UNSET,
|
||||||
|
default_items: Union[Unset, None, int] = UNSET,
|
||||||
|
issuer: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
"""List Trusted OAuth2 JWT Bearer Grant Type Issuers
|
||||||
|
|
||||||
|
Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
max_items (Union[Unset, None, int]):
|
||||||
|
default_items (Union[Unset, None, int]):
|
||||||
|
issuer (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['TrustedOAuth2JwtGrantIssuer']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
max_items=max_items,
|
||||||
|
default_items=default_items,
|
||||||
|
issuer=issuer,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
max_items: Union[Unset, None, int] = UNSET,
|
||||||
|
default_items: Union[Unset, None, int] = UNSET,
|
||||||
|
issuer: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
"""List Trusted OAuth2 JWT Bearer Grant Type Issuers
|
||||||
|
|
||||||
|
Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
max_items (Union[Unset, None, int]):
|
||||||
|
default_items (Union[Unset, None, int]):
|
||||||
|
issuer (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['TrustedOAuth2JwtGrantIssuer']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
max_items=max_items,
|
||||||
|
default_items=default_items,
|
||||||
|
issuer=issuer,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
max_items: Union[Unset, None, int] = UNSET,
|
||||||
|
default_items: Union[Unset, None, int] = UNSET,
|
||||||
|
issuer: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
"""List Trusted OAuth2 JWT Bearer Grant Type Issuers
|
||||||
|
|
||||||
|
Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
max_items (Union[Unset, None, int]):
|
||||||
|
default_items (Union[Unset, None, int]):
|
||||||
|
issuer (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['TrustedOAuth2JwtGrantIssuer']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
max_items=max_items,
|
||||||
|
default_items=default_items,
|
||||||
|
issuer=issuer,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
max_items: Union[Unset, None, int] = UNSET,
|
||||||
|
default_items: Union[Unset, None, int] = UNSET,
|
||||||
|
issuer: Union[Unset, None, str] = UNSET,
|
||||||
|
|
||||||
|
) -> Optional[List['TrustedOAuth2JwtGrantIssuer']]:
|
||||||
|
"""List Trusted OAuth2 JWT Bearer Grant Type Issuers
|
||||||
|
|
||||||
|
Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
max_items (Union[Unset, None, int]):
|
||||||
|
default_items (Union[Unset, None, int]):
|
||||||
|
issuer (Union[Unset, None, str]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[List['TrustedOAuth2JwtGrantIssuer']]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
max_items=max_items,
|
||||||
|
default_items=default_items,
|
||||||
|
issuer=issuer,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/auth".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.FOUND:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""OAuth 2.0 Authorize Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries at https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""OAuth 2.0 Authorize Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries at https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,200 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_2_token_exchange import OAuth2TokenExchange
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.oauth_2_token_exchange_data import Oauth2TokenExchangeData
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: Oauth2TokenExchangeData,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/token".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"data": form_data.to_dict(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth2TokenExchange]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth2TokenExchange.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth2TokenExchange]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: Oauth2TokenExchangeData,
|
||||||
|
|
||||||
|
) -> Response[OAuth2TokenExchange]:
|
||||||
|
"""The OAuth 2.0 Token Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries here
|
||||||
|
https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth2TokenExchange]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: Oauth2TokenExchangeData,
|
||||||
|
|
||||||
|
) -> Optional[OAuth2TokenExchange]:
|
||||||
|
"""The OAuth 2.0 Token Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries here
|
||||||
|
https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth2TokenExchange]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: Oauth2TokenExchangeData,
|
||||||
|
|
||||||
|
) -> Response[OAuth2TokenExchange]:
|
||||||
|
"""The OAuth 2.0 Token Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries here
|
||||||
|
https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth2TokenExchange]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: Oauth2TokenExchangeData,
|
||||||
|
|
||||||
|
) -> Optional[OAuth2TokenExchange]:
|
||||||
|
"""The OAuth 2.0 Token Endpoint
|
||||||
|
|
||||||
|
Use open source libraries to perform OAuth 2.0 and OpenID Connect
|
||||||
|
available for any programming language. You can find a list of libraries here
|
||||||
|
https://oauth.net/code/
|
||||||
|
|
||||||
|
The Ory SDK is not yet able to this endpoint properly.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth2TokenExchange]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,246 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.json_patch import JsonPatch
|
||||||
|
from typing import cast, List
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: List['JsonPatch'],
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = []
|
||||||
|
for componentsschemasjson_patch_document_item_data in json_body:
|
||||||
|
componentsschemasjson_patch_document_item = componentsschemasjson_patch_document_item_data.to_dict()
|
||||||
|
|
||||||
|
json_json_body.append(componentsschemasjson_patch_document_item)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "patch",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
|
response_404 = cast(Any, None)
|
||||||
|
return response_404
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: List['JsonPatch'],
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Patch OAuth 2.0 Client
|
||||||
|
|
||||||
|
Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
|
||||||
|
the secret will be updated and returned via the API. This is the
|
||||||
|
only time you will be able to retrieve the client secret, so write it down and keep it safe.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (List['JsonPatch']): A JSONPatchDocument request
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: List['JsonPatch'],
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Patch OAuth 2.0 Client
|
||||||
|
|
||||||
|
Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
|
||||||
|
the secret will be updated and returned via the API. This is the
|
||||||
|
only time you will be able to retrieve the client secret, so write it down and keep it safe.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (List['JsonPatch']): A JSONPatchDocument request
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: List['JsonPatch'],
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Patch OAuth 2.0 Client
|
||||||
|
|
||||||
|
Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
|
||||||
|
the secret will be updated and returned via the API. This is the
|
||||||
|
only time you will be able to retrieve the client secret, so write it down and keep it safe.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (List['JsonPatch']): A JSONPatchDocument request
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: List['JsonPatch'],
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Patch OAuth 2.0 Client
|
||||||
|
|
||||||
|
Patch an existing OAuth 2.0 Client using JSON Patch. If you pass `client_secret`
|
||||||
|
the secret will be updated and returned via the API. This is the
|
||||||
|
only time you will be able to retrieve the client secret, so write it down and keep it safe.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (List['JsonPatch']): A JSONPatchDocument request
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,302 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.the_request_payload_used_to_accept_a_login_or_consent_request import TheRequestPayloadUsedToAcceptALoginOrConsentRequest
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/consent/reject".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["consent_challenge"] = consent_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Reject OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
|
||||||
|
on his/her behalf.
|
||||||
|
The consent provider must include a reason why the consent was not granted.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Reject OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
|
||||||
|
on his/her behalf.
|
||||||
|
The consent provider must include a reason why the consent was not granted.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Reject OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
|
||||||
|
on his/her behalf.
|
||||||
|
The consent provider must include a reason why the consent was not granted.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
|
consent_challenge: str,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
|
"""Reject OAuth 2.0 Consent Request
|
||||||
|
|
||||||
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
|
provider
|
||||||
|
to authenticate the subject and then tell Ory now about it. If the subject authenticated, he/she
|
||||||
|
must now be asked if
|
||||||
|
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the
|
||||||
|
subject's behalf.
|
||||||
|
|
||||||
|
The consent challenge is appended to the consent provider's URL to which the subject's user-agent
|
||||||
|
(browser) is redirected to. The consent
|
||||||
|
provider uses that challenge to fetch information on the OAuth2 request and then tells Ory if the
|
||||||
|
subject accepted
|
||||||
|
or rejected the request.
|
||||||
|
|
||||||
|
This endpoint tells Ory that the subject has not authorized the OAuth 2.0 client to access resources
|
||||||
|
on his/her behalf.
|
||||||
|
The consent provider must include a reason why the consent was not granted.
|
||||||
|
|
||||||
|
The response contains a redirect URL which the consent provider should redirect the user-agent to.
|
||||||
|
|
||||||
|
The default consent provider is available via the Ory Managed Account Experience. To customize the
|
||||||
|
consent provider, please
|
||||||
|
head over to the OAuth 2.0 documentation.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
consent_challenge (str):
|
||||||
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20RedirectBrowserTo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
consent_challenge=consent_challenge,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -1,26 +1,27 @@
|
||||||
|
from http import HTTPStatus
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...types import Response, UNSET
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from ...models.the_request_payload_used_to_accept_a_login_or_consent_request import TheRequestPayloadUsedToAcceptALoginOrConsentRequest
|
||||||
from typing import cast
|
from typing import cast
|
||||||
from ...models.reject_request import RejectRequest
|
|
||||||
from ...models.completed_request import CompletedRequest
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
def _get_kwargs(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: RejectRequest,
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
login_challenge: str,
|
login_challenge: str,
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
url = "{}/oauth2/auth/requests/login/reject".format(
|
url = "{}/admin/oauth2/auth/requests/login/reject".format(
|
||||||
_client.base_url)
|
_client.base_url)
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
@ -55,83 +56,62 @@ def _get_kwargs(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CompletedRequest, GenericError]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = CompletedRequest.from_dict(response.json())
|
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
if client.raise_on_unexpected_status:
|
||||||
response_400 = GenericError.from_dict(response.json())
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
||||||
response_404 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_404
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[CompletedRequest, GenericError]]:
|
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
parsed=_parse_response(response=response),
|
parsed=_parse_response(client=client, response=response),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
def sync_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: RejectRequest,
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
login_challenge: str,
|
login_challenge: str,
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
"""Reject a Login Request
|
"""Reject OAuth 2.0 Login Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The login
|
(browser) is redirected to. The login
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
the requested authentication process.
|
the requested authentication process.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
|
This endpoint tells Ory that the subject has not authenticated and includes a reason why the
|
||||||
authentication
|
authentication
|
||||||
was be denied.
|
was denied.
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
login_challenge (str):
|
login_challenge (str):
|
||||||
json_body (RejectRequest):
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,42 +127,42 @@ login_challenge=login_challenge,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: RejectRequest,
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
login_challenge: str,
|
login_challenge: str,
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
"""Reject a Login Request
|
"""Reject OAuth 2.0 Login Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The login
|
(browser) is redirected to. The login
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
the requested authentication process.
|
the requested authentication process.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
|
This endpoint tells Ory that the subject has not authenticated and includes a reason why the
|
||||||
authentication
|
authentication
|
||||||
was be denied.
|
was denied.
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
login_challenge (str):
|
login_challenge (str):
|
||||||
json_body (RejectRequest):
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,37 +176,37 @@ login_challenge=login_challenge,
|
||||||
async def asyncio_detailed(
|
async def asyncio_detailed(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: RejectRequest,
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
login_challenge: str,
|
login_challenge: str,
|
||||||
|
|
||||||
) -> Response[Union[CompletedRequest, GenericError]]:
|
) -> Response[OAuth20RedirectBrowserTo]:
|
||||||
"""Reject a Login Request
|
"""Reject OAuth 2.0 Login Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The login
|
(browser) is redirected to. The login
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
the requested authentication process.
|
the requested authentication process.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
|
This endpoint tells Ory that the subject has not authenticated and includes a reason why the
|
||||||
authentication
|
authentication
|
||||||
was be denied.
|
was denied.
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
login_challenge (str):
|
login_challenge (str):
|
||||||
json_body (RejectRequest):
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,42 +222,42 @@ login_challenge=login_challenge,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
return _build_response(response=response)
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
*,
|
*,
|
||||||
_client: Client,
|
_client: Client,
|
||||||
json_body: RejectRequest,
|
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
|
||||||
login_challenge: str,
|
login_challenge: str,
|
||||||
|
|
||||||
) -> Optional[Union[CompletedRequest, GenericError]]:
|
) -> Optional[OAuth20RedirectBrowserTo]:
|
||||||
"""Reject a Login Request
|
"""Reject OAuth 2.0 Login Request
|
||||||
|
|
||||||
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the
|
When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, Ory asks the login
|
||||||
login provider
|
provider
|
||||||
(sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now
|
to authenticate the subject and then tell the Ory OAuth2 Service about it.
|
||||||
about it. The login
|
|
||||||
provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a
|
|
||||||
login screen\")
|
|
||||||
a subject (in OAuth2 the proper name for subject is \"resource owner\").
|
|
||||||
|
|
||||||
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
The authentication challenge is appended to the login provider URL to which the subject's user-agent
|
||||||
(browser) is redirected to. The login
|
(browser) is redirected to. The login
|
||||||
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject
|
||||||
the requested authentication process.
|
the requested authentication process.
|
||||||
|
|
||||||
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the
|
This endpoint tells Ory that the subject has not authenticated and includes a reason why the
|
||||||
authentication
|
authentication
|
||||||
was be denied.
|
was denied.
|
||||||
|
|
||||||
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
The response contains a redirect URL which the login provider should redirect the user-agent to.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
login_challenge (str):
|
login_challenge (str):
|
||||||
json_body (RejectRequest):
|
json_body (TheRequestPayloadUsedToAcceptALoginOrConsentRequest):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[CompletedRequest, GenericError]]
|
Response[OAuth20RedirectBrowserTo]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/requests/logout/reject".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["logout_challenge"] = logout_challenge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Reject OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to deny that logout request.
|
||||||
|
No HTTP request body is required.
|
||||||
|
|
||||||
|
The response is empty as the logout provider has to chose what action to perform next.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
logout_challenge: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Reject OAuth 2.0 Session Logout Request
|
||||||
|
|
||||||
|
When a user or an application requests Ory OAuth 2.0 to remove the session state of a subject, this
|
||||||
|
endpoint is used to deny that logout request.
|
||||||
|
No HTTP request body is required.
|
||||||
|
|
||||||
|
The response is empty as the logout provider has to chose what action to perform next.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
logout_challenge (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
logout_challenge=logout_challenge,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,167 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...types import UNSET, Unset
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
client: Union[Unset, None, str] = UNSET,
|
||||||
|
all_: Union[Unset, None, bool] = UNSET,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/sessions/consent".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["subject"] = subject
|
||||||
|
|
||||||
|
|
||||||
|
params["client"] = client
|
||||||
|
|
||||||
|
|
||||||
|
params["all"] = all_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
client: Union[Unset, None, str] = UNSET,
|
||||||
|
all_: Union[Unset, None, bool] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revoke OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint revokes a subject's granted consent sessions and invalidates all
|
||||||
|
associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0
|
||||||
|
Client ID.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
subject (str):
|
||||||
|
client (Union[Unset, None, str]):
|
||||||
|
all_ (Union[Unset, None, bool]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
subject=subject,
|
||||||
|
client=client,
|
||||||
|
all_=all_,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
client: Union[Unset, None, str] = UNSET,
|
||||||
|
all_: Union[Unset, None, bool] = UNSET,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revoke OAuth 2.0 Consent Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint revokes a subject's granted consent sessions and invalidates all
|
||||||
|
associated OAuth 2.0 Access Tokens. You may also only revoke sessions for a specific OAuth 2.0
|
||||||
|
Client ID.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
subject (str):
|
||||||
|
client (Union[Unset, None, str]):
|
||||||
|
all_ (Union[Unset, None, bool]):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
subject=subject,
|
||||||
|
client=client,
|
||||||
|
all_=all_,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/oauth2/auth/sessions/login".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params: Dict[str, Any] = {}
|
||||||
|
params["subject"] = subject
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"params": params,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revokes All OAuth 2.0 Login Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
||||||
|
session, the subject
|
||||||
|
has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens and
|
||||||
|
does not work with OpenID Connect Front- or Back-channel logout.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
subject (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
subject=subject,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
subject: str,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revokes All OAuth 2.0 Login Sessions of a Subject
|
||||||
|
|
||||||
|
This endpoint invalidates a subject's authentication session. After revoking the authentication
|
||||||
|
session, the subject
|
||||||
|
has to re-authenticate at the Ory OAuth2 Provider. This endpoint does not invalidate any tokens and
|
||||||
|
does not work with OpenID Connect Front- or Back-channel logout.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
subject (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
subject=subject,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.revoke_o_auth_2_token_data import RevokeOAuth2TokenData
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: RevokeOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/revoke".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"data": form_data.to_dict(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: RevokeOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revoke OAuth 2.0 Access or Refresh Token
|
||||||
|
|
||||||
|
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
||||||
|
token can no
|
||||||
|
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
||||||
|
an access token.
|
||||||
|
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
||||||
|
only be revoked by
|
||||||
|
the client the token was generated for.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
form_data: RevokeOAuth2TokenData,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Revoke OAuth 2.0 Access or Refresh Token
|
||||||
|
|
||||||
|
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
||||||
|
token can no
|
||||||
|
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
||||||
|
an access token.
|
||||||
|
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
||||||
|
only be revoked by
|
||||||
|
the client the token was generated for.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
form_data=form_data,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,260 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
response_400 = cast(Any, None)
|
||||||
|
return response_400
|
||||||
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
|
response_404 = cast(Any, None)
|
||||||
|
return response_404
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth 2.0 Client
|
||||||
|
|
||||||
|
Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
|
||||||
|
secret is used,
|
||||||
|
otherwise the existing secret is used.
|
||||||
|
|
||||||
|
If set, the secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth 2.0 Client
|
||||||
|
|
||||||
|
Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
|
||||||
|
secret is used,
|
||||||
|
otherwise the existing secret is used.
|
||||||
|
|
||||||
|
If set, the secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth 2.0 Client
|
||||||
|
|
||||||
|
Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
|
||||||
|
secret is used,
|
||||||
|
otherwise the existing secret is used.
|
||||||
|
|
||||||
|
If set, the secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth 2.0 Client
|
||||||
|
|
||||||
|
Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the
|
||||||
|
secret is used,
|
||||||
|
otherwise the existing secret is used.
|
||||||
|
|
||||||
|
If set, the secret is echoed in the response. It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,219 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.o_auth_20_client_token_lifespans import OAuth20ClientTokenLifespans
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20ClientTokenLifespans,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/clients/{id}/lifespans".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20ClientTokenLifespans,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Set OAuth2 Client Token Lifespans
|
||||||
|
|
||||||
|
Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
|
||||||
|
fields.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
|
||||||
|
this OAuth 2.0 Client.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20ClientTokenLifespans,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Set OAuth2 Client Token Lifespans
|
||||||
|
|
||||||
|
Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
|
||||||
|
fields.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
|
||||||
|
this OAuth 2.0 Client.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20ClientTokenLifespans,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Set OAuth2 Client Token Lifespans
|
||||||
|
|
||||||
|
Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
|
||||||
|
fields.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
|
||||||
|
this OAuth 2.0 Client.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20ClientTokenLifespans,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Set OAuth2 Client Token Lifespans
|
||||||
|
|
||||||
|
Set lifespans of different token types issued for this OAuth 2.0 client. Does not modify other
|
||||||
|
fields.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20ClientTokenLifespans): Lifespans of different token types issued for
|
||||||
|
this OAuth 2.0 Client.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,210 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.trust_o_auth_2_jwt_grant_issuer import TrustOAuth2JwtGrantIssuer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TrustOAuth2JwtGrantIssuer,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/admin/trust/grants/jwt-bearer/issuers".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
if response.status_code == HTTPStatus.CREATED:
|
||||||
|
response_201 = TrustedOAuth2JwtGrantIssuer.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_201
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TrustOAuth2JwtGrantIssuer,
|
||||||
|
|
||||||
|
) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Trust OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to establish a trust relationship for a JWT issuer
|
||||||
|
to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
|
||||||
|
and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
|
||||||
|
Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TrustOAuth2JwtGrantIssuer,
|
||||||
|
|
||||||
|
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Trust OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to establish a trust relationship for a JWT issuer
|
||||||
|
to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
|
||||||
|
and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
|
||||||
|
Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TrustOAuth2JwtGrantIssuer,
|
||||||
|
|
||||||
|
) -> Response[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Trust OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to establish a trust relationship for a JWT issuer
|
||||||
|
to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
|
||||||
|
and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
|
||||||
|
Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: TrustOAuth2JwtGrantIssuer,
|
||||||
|
|
||||||
|
) -> Optional[TrustedOAuth2JwtGrantIssuer]:
|
||||||
|
"""Trust OAuth2 JWT Bearer Grant Type Issuer
|
||||||
|
|
||||||
|
Use this endpoint to establish a trust relationship for a JWT issuer
|
||||||
|
to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
|
||||||
|
and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (TrustOAuth2JwtGrantIssuer): Trust OAuth2 JWT Bearer Grant Type Issuer Request
|
||||||
|
Body
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[TrustedOAuth2JwtGrantIssuer]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,272 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/register".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "post",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
if response.status_code == HTTPStatus.CREATED:
|
||||||
|
response_201 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_201
|
||||||
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
response_400 = cast(Any, None)
|
||||||
|
return response_400
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Register OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
Please note that using this endpoint you are not able to choose the `client_secret` nor the
|
||||||
|
`client_id` as those
|
||||||
|
values will be server generated when specifying `token_endpoint_auth_method` as
|
||||||
|
`client_secret_basic` or
|
||||||
|
`client_secret_post`.
|
||||||
|
|
||||||
|
The `client_secret` will be returned in the response and you will not be able to retrieve it later
|
||||||
|
on.
|
||||||
|
Write the secret down and keep it somewhere safe.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Register OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
Please note that using this endpoint you are not able to choose the `client_secret` nor the
|
||||||
|
`client_id` as those
|
||||||
|
values will be server generated when specifying `token_endpoint_auth_method` as
|
||||||
|
`client_secret_basic` or
|
||||||
|
`client_secret_post`.
|
||||||
|
|
||||||
|
The `client_secret` will be returned in the response and you will not be able to retrieve it later
|
||||||
|
on.
|
||||||
|
Write the secret down and keep it somewhere safe.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Register OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
Please note that using this endpoint you are not able to choose the `client_secret` nor the
|
||||||
|
`client_id` as those
|
||||||
|
values will be server generated when specifying `token_endpoint_auth_method` as
|
||||||
|
`client_secret_basic` or
|
||||||
|
`client_secret_post`.
|
||||||
|
|
||||||
|
The `client_secret` will be returned in the response and you will not be able to retrieve it later
|
||||||
|
on.
|
||||||
|
Write the secret down and keep it somewhere safe.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Register OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
Please note that using this endpoint you are not able to choose the `client_secret` nor the
|
||||||
|
`client_id` as those
|
||||||
|
values will be server generated when specifying `token_endpoint_auth_method` as
|
||||||
|
`client_secret_basic` or
|
||||||
|
`client_secret_post`.
|
||||||
|
|
||||||
|
The `client_secret` will be returned in the response and you will not be able to retrieve it later
|
||||||
|
on.
|
||||||
|
Write the secret down and keep it somewhere safe.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,165 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/register/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "delete",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.NO_CONTENT:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This
|
||||||
|
endpoint
|
||||||
|
is disabled by default. It can be enabled by an administrator.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,193 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.open_id_connect_discovery_metadata import OpenIDConnectDiscoveryMetadata
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/.well-known/openid-configuration".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OpenIDConnectDiscoveryMetadata.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
"""OpenID Connect Discovery
|
||||||
|
|
||||||
|
A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
|
||||||
|
obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
|
||||||
|
|
||||||
|
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
||||||
|
and others.
|
||||||
|
For a full list of clients go here: https://openid.net/developers/certified/
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OpenIDConnectDiscoveryMetadata]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
"""OpenID Connect Discovery
|
||||||
|
|
||||||
|
A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
|
||||||
|
obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
|
||||||
|
|
||||||
|
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
||||||
|
and others.
|
||||||
|
For a full list of clients go here: https://openid.net/developers/certified/
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OpenIDConnectDiscoveryMetadata]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
"""OpenID Connect Discovery
|
||||||
|
|
||||||
|
A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
|
||||||
|
obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
|
||||||
|
|
||||||
|
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
||||||
|
and others.
|
||||||
|
For a full list of clients go here: https://openid.net/developers/certified/
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OpenIDConnectDiscoveryMetadata]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[OpenIDConnectDiscoveryMetadata]:
|
||||||
|
"""OpenID Connect Discovery
|
||||||
|
|
||||||
|
A mechanism for an OpenID Connect Relying Party to discover the End-User's OpenID Provider and
|
||||||
|
obtain information needed to interact with it, including its OAuth 2.0 endpoint locations.
|
||||||
|
|
||||||
|
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
||||||
|
and others.
|
||||||
|
For a full list of clients go here: https://openid.net/developers/certified/
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OpenIDConnectDiscoveryMetadata]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,234 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/register/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OAuth20Client]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20Client]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Get OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Get OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[OAuth20Client]:
|
||||||
|
"""Get OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Optional[OAuth20Client]:
|
||||||
|
"""Get OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly and can be used in self-service. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OAuth20Client]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,197 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from ...models.oidc_user_info import OidcUserInfo
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/userinfo".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[OidcUserInfo]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OidcUserInfo.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[OidcUserInfo]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[OidcUserInfo]:
|
||||||
|
"""OpenID Connect Userinfo
|
||||||
|
|
||||||
|
This endpoint returns the payload of the ID Token, including `session.id_token` values, of
|
||||||
|
the provided OAuth 2.0 Access Token's consent request.
|
||||||
|
|
||||||
|
In the case of authentication error, a WWW-Authenticate header might be set in the response
|
||||||
|
with more information about the error. See [the
|
||||||
|
spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
|
||||||
|
for more details about header format.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OidcUserInfo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Optional[OidcUserInfo]:
|
||||||
|
"""OpenID Connect Userinfo
|
||||||
|
|
||||||
|
This endpoint returns the payload of the ID Token, including `session.id_token` values, of
|
||||||
|
the provided OAuth 2.0 Access Token's consent request.
|
||||||
|
|
||||||
|
In the case of authentication error, a WWW-Authenticate header might be set in the response
|
||||||
|
with more information about the error. See [the
|
||||||
|
spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
|
||||||
|
for more details about header format.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OidcUserInfo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Response[OidcUserInfo]:
|
||||||
|
"""OpenID Connect Userinfo
|
||||||
|
|
||||||
|
This endpoint returns the payload of the ID Token, including `session.id_token` values, of
|
||||||
|
the provided OAuth 2.0 Access Token's consent request.
|
||||||
|
|
||||||
|
In the case of authentication error, a WWW-Authenticate header might be set in the response
|
||||||
|
with more information about the error. See [the
|
||||||
|
spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
|
||||||
|
for more details about header format.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OidcUserInfo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
|
||||||
|
) -> Optional[OidcUserInfo]:
|
||||||
|
"""OpenID Connect Userinfo
|
||||||
|
|
||||||
|
This endpoint returns the payload of the ID Token, including `session.id_token` values, of
|
||||||
|
the provided OAuth 2.0 Access Token's consent request.
|
||||||
|
|
||||||
|
In the case of authentication error, a WWW-Authenticate header might be set in the response
|
||||||
|
with more information about the error. See [the
|
||||||
|
spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3)
|
||||||
|
for more details about header format.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[OidcUserInfo]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -0,0 +1,134 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/sessions/logout".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]:
|
||||||
|
if response.status_code == HTTPStatus.FOUND:
|
||||||
|
return None
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""OpenID Connect Front- and Back-channel Enabled Logout
|
||||||
|
|
||||||
|
This endpoint initiates and completes user logout at the Ory OAuth2 & OpenID provider and initiates
|
||||||
|
OpenID Connect Front- / Back-channel logout:
|
||||||
|
|
||||||
|
https://openid.net/specs/openid-connect-frontchannel-1_0.html
|
||||||
|
https://openid.net/specs/openid-connect-backchannel-1_0.html
|
||||||
|
|
||||||
|
Back-channel logout is performed asynchronously and does not affect logout flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[Any]:
|
||||||
|
"""OpenID Connect Front- and Back-channel Enabled Logout
|
||||||
|
|
||||||
|
This endpoint initiates and completes user logout at the Ory OAuth2 & OpenID provider and initiates
|
||||||
|
OpenID Connect Front- / Back-channel logout:
|
||||||
|
|
||||||
|
https://openid.net/specs/openid-connect-frontchannel-1_0.html
|
||||||
|
https://openid.net/specs/openid-connect-backchannel-1_0.html
|
||||||
|
|
||||||
|
Back-channel logout is performed asynchronously and does not affect logout flow.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Any]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,305 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import Dict
|
||||||
|
from typing import cast
|
||||||
|
from ...models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/oauth2/register/{id}".format(
|
||||||
|
_client.base_url,id=id)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
json_json_body = json_body.to_dict()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "put",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
"json": json_json_body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = OAuth20Client.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
|
response_404 = cast(Any, None)
|
||||||
|
return response_404
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly to be used by third parties. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
This feature is disabled per default. It can be enabled by a system administrator.
|
||||||
|
|
||||||
|
If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
|
||||||
|
secret is echoed in the response.
|
||||||
|
It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly to be used by third parties. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
This feature is disabled per default. It can be enabled by a system administrator.
|
||||||
|
|
||||||
|
If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
|
||||||
|
secret is echoed in the response.
|
||||||
|
It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Response[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly to be used by third parties. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
This feature is disabled per default. It can be enabled by a system administrator.
|
||||||
|
|
||||||
|
If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
|
||||||
|
secret is echoed in the response.
|
||||||
|
It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
_client: AuthenticatedClient,
|
||||||
|
json_body: OAuth20Client,
|
||||||
|
|
||||||
|
) -> Optional[Union[Any, OAuth20Client]]:
|
||||||
|
"""Set OAuth2 Client using OpenID Dynamic Client Registration
|
||||||
|
|
||||||
|
This endpoint behaves like the administrative counterpart (`setOAuth2Client`) but is capable of
|
||||||
|
facing the
|
||||||
|
public internet directly to be used by third parties. It implements the OpenID Connect
|
||||||
|
Dynamic Client Registration Protocol.
|
||||||
|
|
||||||
|
This feature is disabled per default. It can be enabled by a system administrator.
|
||||||
|
|
||||||
|
If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the
|
||||||
|
secret is echoed in the response.
|
||||||
|
It is not possible to retrieve it later on.
|
||||||
|
|
||||||
|
To use this endpoint, you will need to present the client's authentication credentials. If the
|
||||||
|
OAuth2 Client
|
||||||
|
uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client
|
||||||
|
secret in the URL query.
|
||||||
|
If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization
|
||||||
|
header.
|
||||||
|
|
||||||
|
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients
|
||||||
|
are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
id (str):
|
||||||
|
json_body (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID
|
||||||
|
Connect flows. Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect
|
||||||
|
capabilities.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[Union[Any, OAuth20Client]]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
_client=_client,
|
||||||
|
json_body=json_body,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -1,113 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/sessions/logout".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Any]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=None,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Any]:
|
|
||||||
"""OpenID Connect Front-Backchannel Enabled Logout
|
|
||||||
|
|
||||||
This endpoint initiates and completes user logout at ORY Hydra and initiates OpenID Connect
|
|
||||||
Front-/Back-channel logout:
|
|
||||||
|
|
||||||
https://openid.net/specs/openid-connect-frontchannel-1_0.html
|
|
||||||
https://openid.net/specs/openid-connect-backchannel-1_0.html
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Any]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Any]:
|
|
||||||
"""OpenID Connect Front-Backchannel Enabled Logout
|
|
||||||
|
|
||||||
This endpoint initiates and completes user logout at ORY Hydra and initiates OpenID Connect
|
|
||||||
Front-/Back-channel logout:
|
|
||||||
|
|
||||||
https://openid.net/specs/openid-connect-frontchannel-1_0.html
|
|
||||||
https://openid.net/specs/openid-connect-backchannel-1_0.html
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Any]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
|
|
|
@ -1,197 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
|
||||||
from ...models.well_known import WellKnown
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/.well-known/openid-configuration".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, WellKnown]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = WellKnown.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, WellKnown]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, WellKnown]]:
|
|
||||||
"""OpenID Connect Discovery
|
|
||||||
|
|
||||||
The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage
|
|
||||||
you to not roll
|
|
||||||
your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn
|
|
||||||
more on this
|
|
||||||
flow at https://openid.net/specs/openid-connect-discovery-1_0.html .
|
|
||||||
|
|
||||||
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
|
||||||
and others.
|
|
||||||
For a full list of clients go here: https://openid.net/developers/certified/
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, WellKnown]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, WellKnown]]:
|
|
||||||
"""OpenID Connect Discovery
|
|
||||||
|
|
||||||
The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage
|
|
||||||
you to not roll
|
|
||||||
your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn
|
|
||||||
more on this
|
|
||||||
flow at https://openid.net/specs/openid-connect-discovery-1_0.html .
|
|
||||||
|
|
||||||
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
|
||||||
and others.
|
|
||||||
For a full list of clients go here: https://openid.net/developers/certified/
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, WellKnown]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, WellKnown]]:
|
|
||||||
"""OpenID Connect Discovery
|
|
||||||
|
|
||||||
The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage
|
|
||||||
you to not roll
|
|
||||||
your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn
|
|
||||||
more on this
|
|
||||||
flow at https://openid.net/specs/openid-connect-discovery-1_0.html .
|
|
||||||
|
|
||||||
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
|
||||||
and others.
|
|
||||||
For a full list of clients go here: https://openid.net/developers/certified/
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, WellKnown]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, WellKnown]]:
|
|
||||||
"""OpenID Connect Discovery
|
|
||||||
|
|
||||||
The well known endpoint an be used to retrieve information for OpenID Connect clients. We encourage
|
|
||||||
you to not roll
|
|
||||||
your own OpenID Connect client but to use an OpenID Connect client library instead. You can learn
|
|
||||||
more on this
|
|
||||||
flow at https://openid.net/specs/openid-connect-discovery-1_0.html .
|
|
||||||
|
|
||||||
Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang),
|
|
||||||
and others.
|
|
||||||
For a full list of clients go here: https://openid.net/developers/certified/
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, WellKnown]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,208 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from typing import Dict
|
|
||||||
from ...models.oauth_2_token_response import Oauth2TokenResponse
|
|
||||||
from typing import cast
|
|
||||||
from ...models.oauth_2_token_data import Oauth2TokenData
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/token".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "post",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = Oauth2TokenResponse.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
|
||||||
response_400 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_400
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
"""The OAuth 2.0 Token Endpoint
|
|
||||||
|
|
||||||
The client makes a request to the token endpoint by sending the
|
|
||||||
following parameters using the \"application/x-www-form-urlencoded\" HTTP
|
|
||||||
request entity-body.
|
|
||||||
|
|
||||||
> Do not implement a client for this endpoint yourself. Use a library. There are many libraries
|
|
||||||
> available for any programming language. You can find a list of libraries here:
|
|
||||||
https://oauth.net/code/
|
|
||||||
>
|
|
||||||
> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed
|
|
||||||
above!
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, Oauth2TokenResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
"""The OAuth 2.0 Token Endpoint
|
|
||||||
|
|
||||||
The client makes a request to the token endpoint by sending the
|
|
||||||
following parameters using the \"application/x-www-form-urlencoded\" HTTP
|
|
||||||
request entity-body.
|
|
||||||
|
|
||||||
> Do not implement a client for this endpoint yourself. Use a library. There are many libraries
|
|
||||||
> available for any programming language. You can find a list of libraries here:
|
|
||||||
https://oauth.net/code/
|
|
||||||
>
|
|
||||||
> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed
|
|
||||||
above!
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, Oauth2TokenResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
"""The OAuth 2.0 Token Endpoint
|
|
||||||
|
|
||||||
The client makes a request to the token endpoint by sending the
|
|
||||||
following parameters using the \"application/x-www-form-urlencoded\" HTTP
|
|
||||||
request entity-body.
|
|
||||||
|
|
||||||
> Do not implement a client for this endpoint yourself. Use a library. There are many libraries
|
|
||||||
> available for any programming language. You can find a list of libraries here:
|
|
||||||
https://oauth.net/code/
|
|
||||||
>
|
|
||||||
> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed
|
|
||||||
above!
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, Oauth2TokenResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, Oauth2TokenResponse]]:
|
|
||||||
"""The OAuth 2.0 Token Endpoint
|
|
||||||
|
|
||||||
The client makes a request to the token endpoint by sending the
|
|
||||||
following parameters using the \"application/x-www-form-urlencoded\" HTTP
|
|
||||||
request entity-body.
|
|
||||||
|
|
||||||
> Do not implement a client for this endpoint yourself. Use a library. There are many libraries
|
|
||||||
> available for any programming language. You can find a list of libraries here:
|
|
||||||
https://oauth.net/code/
|
|
||||||
>
|
|
||||||
> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed
|
|
||||||
above!
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, Oauth2TokenResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,177 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/auth".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.FOUND:
|
|
||||||
response_302 = cast(Any, None)
|
|
||||||
return response_302
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""The OAuth 2.0 Authorize Endpoint
|
|
||||||
|
|
||||||
This endpoint is not documented here because you should never use your own implementation to perform
|
|
||||||
OAuth2 flows.
|
|
||||||
OAuth2 is a very popular protocol and a library for your programming language will exists.
|
|
||||||
|
|
||||||
To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""The OAuth 2.0 Authorize Endpoint
|
|
||||||
|
|
||||||
This endpoint is not documented here because you should never use your own implementation to perform
|
|
||||||
OAuth2 flows.
|
|
||||||
OAuth2 is a very popular protocol and a library for your programming language will exists.
|
|
||||||
|
|
||||||
To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""The OAuth 2.0 Authorize Endpoint
|
|
||||||
|
|
||||||
This endpoint is not documented here because you should never use your own implementation to perform
|
|
||||||
OAuth2 flows.
|
|
||||||
OAuth2 is a very popular protocol and a library for your programming language will exists.
|
|
||||||
|
|
||||||
To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""The OAuth 2.0 Authorize Endpoint
|
|
||||||
|
|
||||||
This endpoint is not documented here because you should never use your own implementation to perform
|
|
||||||
OAuth2 flows.
|
|
||||||
OAuth2 is a very popular protocol and a library for your programming language will exists.
|
|
||||||
|
|
||||||
To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,186 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.revoke_o_auth_2_token_data import RevokeOAuth2TokenData
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/oauth2/revoke".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "post",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, GenericError]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = cast(Any, None)
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, GenericError]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Revoke OAuth2 Tokens
|
|
||||||
|
|
||||||
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
|
||||||
token can no
|
|
||||||
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
|
||||||
an access token.
|
|
||||||
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
|
||||||
only be revoked by
|
|
||||||
the client the token was generated for.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Revoke OAuth2 Tokens
|
|
||||||
|
|
||||||
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
|
||||||
token can no
|
|
||||||
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
|
||||||
an access token.
|
|
||||||
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
|
||||||
only be revoked by
|
|
||||||
the client the token was generated for.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[Any, GenericError]]:
|
|
||||||
"""Revoke OAuth2 Tokens
|
|
||||||
|
|
||||||
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
|
||||||
token can no
|
|
||||||
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
|
||||||
an access token.
|
|
||||||
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
|
||||||
only be revoked by
|
|
||||||
the client the token was generated for.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[Any, GenericError]]:
|
|
||||||
"""Revoke OAuth2 Tokens
|
|
||||||
|
|
||||||
Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access
|
|
||||||
token can no
|
|
||||||
longer be used to make access requests, and a revoked refresh token can no longer be used to refresh
|
|
||||||
an access token.
|
|
||||||
Revoking a refresh token also invalidates the access token that was created with it. A token may
|
|
||||||
only be revoked by
|
|
||||||
the client the token was generated for.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[Any, GenericError]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,181 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.userinfo_response import UserinfoResponse
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/userinfo".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, UserinfoResponse]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = UserinfoResponse.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, UserinfoResponse]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, UserinfoResponse]]:
|
|
||||||
"""OpenID Connect Userinfo
|
|
||||||
|
|
||||||
This endpoint returns the payload of the ID Token, including the idTokenExtra values, of
|
|
||||||
the provided OAuth 2.0 Access Token.
|
|
||||||
|
|
||||||
For more information please [refer to the spec](http://openid.net/specs/openid-connect-
|
|
||||||
core-1_0.html#UserInfo).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, UserinfoResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, UserinfoResponse]]:
|
|
||||||
"""OpenID Connect Userinfo
|
|
||||||
|
|
||||||
This endpoint returns the payload of the ID Token, including the idTokenExtra values, of
|
|
||||||
the provided OAuth 2.0 Access Token.
|
|
||||||
|
|
||||||
For more information please [refer to the spec](http://openid.net/specs/openid-connect-
|
|
||||||
core-1_0.html#UserInfo).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, UserinfoResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, UserinfoResponse]]:
|
|
||||||
"""OpenID Connect Userinfo
|
|
||||||
|
|
||||||
This endpoint returns the payload of the ID Token, including the idTokenExtra values, of
|
|
||||||
the provided OAuth 2.0 Access Token.
|
|
||||||
|
|
||||||
For more information please [refer to the spec](http://openid.net/specs/openid-connect-
|
|
||||||
core-1_0.html#UserInfo).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, UserinfoResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: AuthenticatedClient,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, UserinfoResponse]]:
|
|
||||||
"""OpenID Connect Userinfo
|
|
||||||
|
|
||||||
This endpoint returns the payload of the ID Token, including the idTokenExtra values, of
|
|
||||||
the provided OAuth 2.0 Access Token.
|
|
||||||
|
|
||||||
For more information please [refer to the spec](http://openid.net/specs/openid-connect-
|
|
||||||
core-1_0.html#UserInfo).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, UserinfoResponse]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -1,171 +0,0 @@
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import AuthenticatedClient, Client
|
|
||||||
from ...types import Response, UNSET
|
|
||||||
|
|
||||||
from ...models.generic_error import GenericError
|
|
||||||
from ...models.json_web_key_set import JSONWebKeySet
|
|
||||||
from typing import cast
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/.well-known/jwks.json".format(
|
|
||||||
_client.base_url)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = _client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = _client.get_cookies()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": _client.get_timeout(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = JSONWebKeySet.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_200
|
|
||||||
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
|
|
||||||
response_500 = GenericError.from_dict(response.json())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response_500
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""JSON Web Keys Discovery
|
|
||||||
|
|
||||||
This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens
|
|
||||||
and,
|
|
||||||
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
|
||||||
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=_client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""JSON Web Keys Discovery
|
|
||||||
|
|
||||||
This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens
|
|
||||||
and,
|
|
||||||
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
|
||||||
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Response[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""JSON Web Keys Discovery
|
|
||||||
|
|
||||||
This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens
|
|
||||||
and,
|
|
||||||
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
|
||||||
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
|
||||||
response = await __client.request(
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
*,
|
|
||||||
_client: Client,
|
|
||||||
|
|
||||||
) -> Optional[Union[GenericError, JSONWebKeySet]]:
|
|
||||||
"""JSON Web Keys Discovery
|
|
||||||
|
|
||||||
This endpoint returns JSON Web Keys to be used as public keys for verifying OpenID Connect ID Tokens
|
|
||||||
and,
|
|
||||||
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
|
||||||
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Response[Union[GenericError, JSONWebKeySet]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
return (await asyncio_detailed(
|
|
||||||
_client=_client,
|
|
||||||
|
|
||||||
)).parsed
|
|
||||||
|
|
|
@ -0,0 +1,181 @@
|
||||||
|
from http import HTTPStatus
|
||||||
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import AuthenticatedClient, Client
|
||||||
|
from ...types import Response, UNSET
|
||||||
|
from ... import errors
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
|
from ...models.json_web_key_set import JsonWebKeySet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/.well-known/jwks.json".format(
|
||||||
|
_client.base_url)
|
||||||
|
|
||||||
|
headers: Dict[str, str] = _client.get_headers()
|
||||||
|
cookies: Dict[str, Any] = _client.get_cookies()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "get",
|
||||||
|
"url": url,
|
||||||
|
"headers": headers,
|
||||||
|
"cookies": cookies,
|
||||||
|
"timeout": _client.get_timeout(),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[JsonWebKeySet]:
|
||||||
|
if response.status_code == HTTPStatus.OK:
|
||||||
|
response_200 = JsonWebKeySet.from_dict(response.json())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response_200
|
||||||
|
if client.raise_on_unexpected_status:
|
||||||
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
|
||||||
|
return Response(
|
||||||
|
status_code=HTTPStatus(response.status_code),
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(client=client, response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[JsonWebKeySet]:
|
||||||
|
"""Discover Well-Known JSON Web Keys
|
||||||
|
|
||||||
|
This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and,
|
||||||
|
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
||||||
|
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.request(
|
||||||
|
verify=_client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[JsonWebKeySet]:
|
||||||
|
"""Discover Well-Known JSON Web Keys
|
||||||
|
|
||||||
|
This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and,
|
||||||
|
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
||||||
|
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Response[JsonWebKeySet]:
|
||||||
|
"""Discover Well-Known JSON Web Keys
|
||||||
|
|
||||||
|
This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and,
|
||||||
|
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
||||||
|
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
async with httpx.AsyncClient(verify=_client.verify_ssl) as __client:
|
||||||
|
response = await __client.request(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(client=_client, response=response)
|
||||||
|
|
||||||
|
async def asyncio(
|
||||||
|
*,
|
||||||
|
_client: Client,
|
||||||
|
|
||||||
|
) -> Optional[JsonWebKeySet]:
|
||||||
|
"""Discover Well-Known JSON Web Keys
|
||||||
|
|
||||||
|
This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and,
|
||||||
|
if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
|
||||||
|
[node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||||
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Response[JsonWebKeySet]
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
return (await asyncio_detailed(
|
||||||
|
_client=_client,
|
||||||
|
|
||||||
|
)).parsed
|
||||||
|
|
|
@ -4,13 +4,26 @@ import attr
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class Client:
|
class Client:
|
||||||
""" A class for keeping track of data related to the API """
|
""" A class for keeping track of data related to the API
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
base_url: The base URL for the API, all requests are made to a relative path to this URL
|
||||||
|
cookies: A dictionary of cookies to be sent with every request
|
||||||
|
headers: A dictionary of headers to be sent with every request
|
||||||
|
timeout: The maximum amount of a time in seconds a request can take. API functions will raise
|
||||||
|
httpx.TimeoutException if this is exceeded.
|
||||||
|
verify_ssl: Whether or not to verify the SSL certificate of the API server. This should be True in production,
|
||||||
|
but can be set to False for testing purposes.
|
||||||
|
raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
|
||||||
|
status code that was not documented in the source OpenAPI document.
|
||||||
|
"""
|
||||||
|
|
||||||
base_url: str
|
base_url: str
|
||||||
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||||
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||||
timeout: float = attr.ib(5.0, kw_only=True)
|
timeout: float = attr.ib(5.0, kw_only=True)
|
||||||
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
||||||
|
raise_on_unexpected_status: bool = attr.ib(False, kw_only=True)
|
||||||
|
|
||||||
def get_headers(self) -> Dict[str, str]:
|
def get_headers(self) -> Dict[str, str]:
|
||||||
""" Get headers to be used in all endpoints """
|
""" Get headers to be used in all endpoints """
|
||||||
|
@ -39,7 +52,10 @@ class AuthenticatedClient(Client):
|
||||||
""" A Client which has been authenticated for use on secured endpoints """
|
""" A Client which has been authenticated for use on secured endpoints """
|
||||||
|
|
||||||
token: str
|
token: str
|
||||||
|
prefix: str = "Bearer"
|
||||||
|
auth_header_name: str = "Authorization"
|
||||||
|
|
||||||
def get_headers(self) -> Dict[str, str]:
|
def get_headers(self) -> Dict[str, str]:
|
||||||
""" Get headers to be used in authenticated endpoints """
|
"""Get headers to be used in authenticated endpoints"""
|
||||||
return {"Authorization": f"Bearer {self.token}", **self.headers}
|
auth_header_value = f"{self.prefix} {self.token}" if self.prefix else self.token
|
||||||
|
return {self.auth_header_name: auth_header_value, **self.headers}
|
||||||
|
|
|
@ -1,49 +1,95 @@
|
||||||
""" Contains all the data models used in inputs/outputs """
|
""" Contains all the data models used in inputs/outputs """
|
||||||
|
|
||||||
from .accept_consent_request import AcceptConsentRequest
|
from .contains_information_about_an_ongoing_logout_request import ContainsInformationAboutAnOngoingLogoutRequest
|
||||||
from .accept_login_request import AcceptLoginRequest
|
from .contains_information_on_an_ongoing_consent_request import ContainsInformationOnAnOngoingConsentRequest
|
||||||
from .completed_request import CompletedRequest
|
from .contains_information_on_an_ongoing_login_request import ContainsInformationOnAnOngoingLoginRequest
|
||||||
from .consent_request import ConsentRequest
|
from .contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
from .consent_request_session import ConsentRequestSession
|
from .contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims import ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims
|
||||||
from .consent_request_session_access_token import ConsentRequestSessionAccessToken
|
from .create_json_web_key_set import CreateJsonWebKeySet
|
||||||
from .consent_request_session_id_token import ConsentRequestSessionIdToken
|
from .error_o_auth_2 import ErrorOAuth2
|
||||||
from .container_wait_ok_body_error import ContainerWaitOKBodyError
|
|
||||||
from .flush_inactive_o_auth_2_tokens_request import FlushInactiveOAuth2TokensRequest
|
|
||||||
from .generic_error import GenericError
|
from .generic_error import GenericError
|
||||||
|
from .get_version_response_200 import GetVersionResponse200
|
||||||
|
from .handled_login_request_is_the_request_payload_used_to_accept_a_login_request import HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest
|
||||||
from .health_not_ready_status import HealthNotReadyStatus
|
from .health_not_ready_status import HealthNotReadyStatus
|
||||||
from .health_not_ready_status_errors import HealthNotReadyStatusErrors
|
from .health_not_ready_status_errors import HealthNotReadyStatusErrors
|
||||||
from .health_status import HealthStatus
|
from .health_status import HealthStatus
|
||||||
from .introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
|
from .introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
|
||||||
from .jose_json_web_key_set import JoseJSONWebKeySet
|
from .introspected_o_auth_2_token import IntrospectedOAuth2Token
|
||||||
from .json_raw_message import JSONRawMessage
|
from .introspected_o_auth_2_token_ext import IntrospectedOAuth2TokenExt
|
||||||
from .json_web_key import JSONWebKey
|
from .is_ready_response_200 import IsReadyResponse200
|
||||||
from .json_web_key_set import JSONWebKeySet
|
from .is_ready_response_503 import IsReadyResponse503
|
||||||
from .json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
|
from .is_ready_response_503_errors import IsReadyResponse503Errors
|
||||||
from .login_request import LoginRequest
|
from .json_patch import JsonPatch
|
||||||
from .logout_request import LogoutRequest
|
from .json_web_key import JsonWebKey
|
||||||
from .o_auth_2_client import OAuth2Client
|
from .json_web_key_set import JsonWebKeySet
|
||||||
from .o_auth_2_token_introspection import OAuth2TokenIntrospection
|
from .o_auth_20_client import OAuth20Client
|
||||||
from .o_auth_2_token_introspection_ext import OAuth2TokenIntrospectionExt
|
from .o_auth_20_client_token_lifespans import OAuth20ClientTokenLifespans
|
||||||
from .oauth_2_token_data import Oauth2TokenData
|
from .o_auth_20_consent_session import OAuth20ConsentSession
|
||||||
from .oauth_2_token_response import Oauth2TokenResponse
|
from .o_auth_20_consent_session_expires_at import OAuth20ConsentSessionExpiresAt
|
||||||
from .open_id_connect_context import OpenIDConnectContext
|
from .o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
|
||||||
from .open_id_connect_context_id_token_hint_claims import OpenIDConnectContextIdTokenHintClaims
|
from .o_auth_2_token_exchange import OAuth2TokenExchange
|
||||||
from .plugin_config import PluginConfig
|
from .oauth_2_token_exchange_data import Oauth2TokenExchangeData
|
||||||
from .plugin_config_args import PluginConfigArgs
|
from .oidc_user_info import OidcUserInfo
|
||||||
from .plugin_config_interface import PluginConfigInterface
|
from .open_id_connect_discovery_metadata import OpenIDConnectDiscoveryMetadata
|
||||||
from .plugin_config_linux import PluginConfigLinux
|
from .pagination import Pagination
|
||||||
from .plugin_config_network import PluginConfigNetwork
|
from .pagination_headers import PaginationHeaders
|
||||||
from .plugin_config_rootfs import PluginConfigRootfs
|
from .pagination_request_parameters import PaginationRequestParameters
|
||||||
from .plugin_config_user import PluginConfigUser
|
from .pagination_response_header import PaginationResponseHeader
|
||||||
from .plugin_device import PluginDevice
|
from .pass_session_data_to_a_consent_request import PassSessionDataToAConsentRequest
|
||||||
from .plugin_env import PluginEnv
|
|
||||||
from .plugin_interface_type import PluginInterfaceType
|
|
||||||
from .plugin_mount import PluginMount
|
|
||||||
from .plugin_settings import PluginSettings
|
|
||||||
from .previous_consent_session import PreviousConsentSession
|
|
||||||
from .reject_request import RejectRequest
|
|
||||||
from .revoke_o_auth_2_token_data import RevokeOAuth2TokenData
|
from .revoke_o_auth_2_token_data import RevokeOAuth2TokenData
|
||||||
from .userinfo_response import UserinfoResponse
|
from .the_request_payload_used_to_accept_a_consent_request import TheRequestPayloadUsedToAcceptAConsentRequest
|
||||||
|
from .the_request_payload_used_to_accept_a_login_or_consent_request import TheRequestPayloadUsedToAcceptALoginOrConsentRequest
|
||||||
|
from .token_pagination import TokenPagination
|
||||||
|
from .token_pagination_headers import TokenPaginationHeaders
|
||||||
|
from .trust_o_auth_2_jwt_grant_issuer import TrustOAuth2JwtGrantIssuer
|
||||||
|
from .trusted_o_auth_2_jwt_grant_issuer import TrustedOAuth2JwtGrantIssuer
|
||||||
|
from .trusted_o_auth_2_jwt_grant_json_web_key import TrustedOAuth2JwtGrantJsonWebKey
|
||||||
from .version import Version
|
from .version import Version
|
||||||
from .volume_usage_data import VolumeUsageData
|
|
||||||
from .well_known import WellKnown
|
__all__ = (
|
||||||
|
"ContainsInformationAboutAnOngoingLogoutRequest",
|
||||||
|
"ContainsInformationOnAnOngoingConsentRequest",
|
||||||
|
"ContainsInformationOnAnOngoingLoginRequest",
|
||||||
|
"ContainsOptionalInformationAboutTheOpenIDConnectRequest",
|
||||||
|
"ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims",
|
||||||
|
"CreateJsonWebKeySet",
|
||||||
|
"ErrorOAuth2",
|
||||||
|
"GenericError",
|
||||||
|
"GetVersionResponse200",
|
||||||
|
"HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest",
|
||||||
|
"HealthNotReadyStatus",
|
||||||
|
"HealthNotReadyStatusErrors",
|
||||||
|
"HealthStatus",
|
||||||
|
"IntrospectedOAuth2Token",
|
||||||
|
"IntrospectedOAuth2TokenExt",
|
||||||
|
"IntrospectOAuth2TokenData",
|
||||||
|
"IsReadyResponse200",
|
||||||
|
"IsReadyResponse503",
|
||||||
|
"IsReadyResponse503Errors",
|
||||||
|
"JsonPatch",
|
||||||
|
"JsonWebKey",
|
||||||
|
"JsonWebKeySet",
|
||||||
|
"OAuth20Client",
|
||||||
|
"OAuth20ClientTokenLifespans",
|
||||||
|
"OAuth20ConsentSession",
|
||||||
|
"OAuth20ConsentSessionExpiresAt",
|
||||||
|
"OAuth20RedirectBrowserTo",
|
||||||
|
"OAuth2TokenExchange",
|
||||||
|
"Oauth2TokenExchangeData",
|
||||||
|
"OidcUserInfo",
|
||||||
|
"OpenIDConnectDiscoveryMetadata",
|
||||||
|
"Pagination",
|
||||||
|
"PaginationHeaders",
|
||||||
|
"PaginationRequestParameters",
|
||||||
|
"PaginationResponseHeader",
|
||||||
|
"PassSessionDataToAConsentRequest",
|
||||||
|
"RevokeOAuth2TokenData",
|
||||||
|
"TheRequestPayloadUsedToAcceptAConsentRequest",
|
||||||
|
"TheRequestPayloadUsedToAcceptALoginOrConsentRequest",
|
||||||
|
"TokenPagination",
|
||||||
|
"TokenPaginationHeaders",
|
||||||
|
"TrustedOAuth2JwtGrantIssuer",
|
||||||
|
"TrustedOAuth2JwtGrantJsonWebKey",
|
||||||
|
"TrustOAuth2JwtGrantIssuer",
|
||||||
|
"Version",
|
||||||
|
)
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
|
||||||
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
|
|
||||||
import attr
|
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="ConsentRequestSessionAccessToken")
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
|
||||||
class ConsentRequestSessionAccessToken:
|
|
||||||
"""AccessToken sets session data for the access and refresh token, as well as any future tokens issued by the
|
|
||||||
refresh grant. Keep in mind that this data will be available to anyone performing OAuth 2.0 Challenge Introspection.
|
|
||||||
If only your services can perform OAuth 2.0 Challenge Introspection, this is usually fine. But if third parties
|
|
||||||
can access that endpoint as well, sensitive data from the session might be exposed to them. Use with care!
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
|
||||||
field_dict.update(self.additional_properties)
|
|
||||||
field_dict.update({
|
|
||||||
})
|
|
||||||
|
|
||||||
return field_dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
||||||
_d = src_dict.copy()
|
|
||||||
consent_request_session_access_token = cls(
|
|
||||||
)
|
|
||||||
|
|
||||||
consent_request_session_access_token.additional_properties = _d
|
|
||||||
return consent_request_session_access_token
|
|
||||||
|
|
||||||
@property
|
|
||||||
def additional_keys(self) -> List[str]:
|
|
||||||
return list(self.additional_properties.keys())
|
|
||||||
|
|
||||||
def __getitem__(self, key: str) -> Any:
|
|
||||||
return self.additional_properties[key]
|
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: Any) -> None:
|
|
||||||
self.additional_properties[key] = value
|
|
||||||
|
|
||||||
def __delitem__(self, key: str) -> None:
|
|
||||||
del self.additional_properties[key]
|
|
||||||
|
|
||||||
def __contains__(self, key: str) -> bool:
|
|
||||||
return key in self.additional_properties
|
|
|
@ -1,60 +0,0 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
|
||||||
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
|
|
||||||
import attr
|
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="ConsentRequestSessionIdToken")
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
|
||||||
class ConsentRequestSessionIdToken:
|
|
||||||
"""IDToken sets session data for the OpenID Connect ID token. Keep in mind that the session'id payloads are readable
|
|
||||||
by anyone that has access to the ID Challenge. Use with care!
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
|
||||||
field_dict.update(self.additional_properties)
|
|
||||||
field_dict.update({
|
|
||||||
})
|
|
||||||
|
|
||||||
return field_dict
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
||||||
_d = src_dict.copy()
|
|
||||||
consent_request_session_id_token = cls(
|
|
||||||
)
|
|
||||||
|
|
||||||
consent_request_session_id_token.additional_properties = _d
|
|
||||||
return consent_request_session_id_token
|
|
||||||
|
|
||||||
@property
|
|
||||||
def additional_keys(self) -> List[str]:
|
|
||||||
return list(self.additional_properties.keys())
|
|
||||||
|
|
||||||
def __getitem__(self, key: str) -> Any:
|
|
||||||
return self.additional_properties[key]
|
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: Any) -> None:
|
|
||||||
self.additional_properties[key] = value
|
|
||||||
|
|
||||||
def __delitem__(self, key: str) -> None:
|
|
||||||
del self.additional_properties[key]
|
|
||||||
|
|
||||||
def __contains__(self, key: str) -> bool:
|
|
||||||
return key in self.additional_properties
|
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,18 +7,29 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
from typing import Dict
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="LogoutRequest")
|
|
||||||
|
T = TypeVar("T", bound="ContainsInformationAboutAnOngoingLogoutRequest")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class LogoutRequest:
|
class ContainsInformationAboutAnOngoingLogoutRequest:
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
|
challenge (Union[Unset, str]): Challenge is the identifier ("logout challenge") of the logout authentication
|
||||||
|
request. It is used to
|
||||||
|
identify the session.
|
||||||
|
client (Union[Unset, OAuth20Client]): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows.
|
||||||
|
Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
request_url (Union[Unset, str]): RequestURL is the original Logout URL requested.
|
request_url (Union[Unset, str]): RequestURL is the original Logout URL requested.
|
||||||
rp_initiated (Union[Unset, bool]): RPInitiated is set to true if the request was initiated by a Relying Party
|
rp_initiated (Union[Unset, bool]): RPInitiated is set to true if the request was initiated by a Relying Party
|
||||||
(RP), also known as an OAuth 2.0 Client.
|
(RP), also known as an OAuth 2.0 Client.
|
||||||
|
@ -26,6 +37,8 @@ class LogoutRequest:
|
||||||
subject (Union[Unset, str]): Subject is the user for whom the logout was request.
|
subject (Union[Unset, str]): Subject is the user for whom the logout was request.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
challenge: Union[Unset, str] = UNSET
|
||||||
|
client: Union[Unset, 'OAuth20Client'] = UNSET
|
||||||
request_url: Union[Unset, str] = UNSET
|
request_url: Union[Unset, str] = UNSET
|
||||||
rp_initiated: Union[Unset, bool] = UNSET
|
rp_initiated: Union[Unset, bool] = UNSET
|
||||||
sid: Union[Unset, str] = UNSET
|
sid: Union[Unset, str] = UNSET
|
||||||
|
@ -34,6 +47,12 @@ class LogoutRequest:
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
|
challenge = self.challenge
|
||||||
|
client: Union[Unset, Dict[str, Any]] = UNSET
|
||||||
|
if not isinstance(self.client, Unset):
|
||||||
|
client = self.client.to_dict()
|
||||||
|
|
||||||
request_url = self.request_url
|
request_url = self.request_url
|
||||||
rp_initiated = self.rp_initiated
|
rp_initiated = self.rp_initiated
|
||||||
sid = self.sid
|
sid = self.sid
|
||||||
|
@ -43,6 +62,10 @@ class LogoutRequest:
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
field_dict.update({
|
field_dict.update({
|
||||||
})
|
})
|
||||||
|
if challenge is not UNSET:
|
||||||
|
field_dict["challenge"] = challenge
|
||||||
|
if client is not UNSET:
|
||||||
|
field_dict["client"] = client
|
||||||
if request_url is not UNSET:
|
if request_url is not UNSET:
|
||||||
field_dict["request_url"] = request_url
|
field_dict["request_url"] = request_url
|
||||||
if rp_initiated is not UNSET:
|
if rp_initiated is not UNSET:
|
||||||
|
@ -58,7 +81,20 @@ class LogoutRequest:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
|
challenge = _d.pop("challenge", UNSET)
|
||||||
|
|
||||||
|
_client = _d.pop("client", UNSET)
|
||||||
|
client: Union[Unset, OAuth20Client]
|
||||||
|
if isinstance(_client, Unset):
|
||||||
|
client = UNSET
|
||||||
|
else:
|
||||||
|
client = OAuth20Client.from_dict(_client)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
request_url = _d.pop("request_url", UNSET)
|
request_url = _d.pop("request_url", UNSET)
|
||||||
|
|
||||||
rp_initiated = _d.pop("rp_initiated", UNSET)
|
rp_initiated = _d.pop("rp_initiated", UNSET)
|
||||||
|
@ -67,15 +103,17 @@ class LogoutRequest:
|
||||||
|
|
||||||
subject = _d.pop("subject", UNSET)
|
subject = _d.pop("subject", UNSET)
|
||||||
|
|
||||||
logout_request = cls(
|
contains_information_about_an_ongoing_logout_request = cls(
|
||||||
|
challenge=challenge,
|
||||||
|
client=client,
|
||||||
request_url=request_url,
|
request_url=request_url,
|
||||||
rp_initiated=rp_initiated,
|
rp_initiated=rp_initiated,
|
||||||
sid=sid,
|
sid=sid,
|
||||||
subject=subject,
|
subject=subject,
|
||||||
)
|
)
|
||||||
|
|
||||||
logout_request.additional_properties = _d
|
contains_information_about_an_ongoing_logout_request.additional_properties = _d
|
||||||
return logout_request
|
return contains_information_about_an_ongoing_logout_request
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,19 +7,23 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
from typing import cast
|
||||||
from typing import Union
|
from typing import Union
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from typing import cast
|
|
||||||
from ..types import UNSET, Unset
|
|
||||||
from typing import cast, List
|
from typing import cast, List
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="ConsentRequest")
|
|
||||||
|
T = TypeVar("T", bound="ContainsInformationOnAnOngoingConsentRequest")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class ConsentRequest:
|
class ContainsInformationOnAnOngoingConsentRequest:
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
challenge (str): ID is the identifier ("authorization challenge") of the consent authorization request. It is
|
challenge (str): ID is the identifier ("authorization challenge") of the consent authorization request. It is
|
||||||
|
@ -28,8 +32,11 @@ class ConsentRequest:
|
||||||
acr (Union[Unset, str]): ACR represents the Authentication AuthorizationContext Class Reference value for this
|
acr (Union[Unset, str]): ACR represents the Authentication AuthorizationContext Class Reference value for this
|
||||||
authentication session. You can use it
|
authentication session. You can use it
|
||||||
to express that, for example, a user authenticated using two factor authentication.
|
to express that, for example, a user authenticated using two factor authentication.
|
||||||
client (Union[Unset, OAuth2Client]):
|
amr (Union[Unset, List[str]]):
|
||||||
context (Union[Unset, JSONRawMessage]):
|
client (Union[Unset, OAuth20Client]): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows.
|
||||||
|
Usually, OAuth 2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
|
context (Union[Unset, Any]):
|
||||||
login_challenge (Union[Unset, str]): LoginChallenge is the login challenge this consent challenge belongs to. It
|
login_challenge (Union[Unset, str]): LoginChallenge is the login challenge this consent challenge belongs to. It
|
||||||
can be used to associate
|
can be used to associate
|
||||||
a login and consent request in the login & consent app.
|
a login and consent request in the login & consent app.
|
||||||
|
@ -40,7 +47,7 @@ class ConsentRequest:
|
||||||
this will be a new random value. This value is used as the "sid" parameter in the ID Token and in OIDC
|
this will be a new random value. This value is used as the "sid" parameter in the ID Token and in OIDC
|
||||||
Front-/Back-
|
Front-/Back-
|
||||||
channel logout. It's value can generally be used to associate consecutive login requests by a certain user.
|
channel logout. It's value can generally be used to associate consecutive login requests by a certain user.
|
||||||
oidc_context (Union[Unset, OpenIDConnectContext]):
|
oidc_context (Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]):
|
||||||
request_url (Union[Unset, str]): RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth
|
request_url (Union[Unset, str]): RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth
|
||||||
2.0 client. It is the URL which
|
2.0 client. It is the URL which
|
||||||
initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but
|
initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but
|
||||||
|
@ -58,11 +65,12 @@ class ConsentRequest:
|
||||||
|
|
||||||
challenge: str
|
challenge: str
|
||||||
acr: Union[Unset, str] = UNSET
|
acr: Union[Unset, str] = UNSET
|
||||||
client: Union[Unset, 'OAuth2Client'] = UNSET
|
amr: Union[Unset, List[str]] = UNSET
|
||||||
context: Union[Unset, 'JSONRawMessage'] = UNSET
|
client: Union[Unset, 'OAuth20Client'] = UNSET
|
||||||
|
context: Union[Unset, Any] = UNSET
|
||||||
login_challenge: Union[Unset, str] = UNSET
|
login_challenge: Union[Unset, str] = UNSET
|
||||||
login_session_id: Union[Unset, str] = UNSET
|
login_session_id: Union[Unset, str] = UNSET
|
||||||
oidc_context: Union[Unset, 'OpenIDConnectContext'] = UNSET
|
oidc_context: Union[Unset, 'ContainsOptionalInformationAboutTheOpenIDConnectRequest'] = UNSET
|
||||||
request_url: Union[Unset, str] = UNSET
|
request_url: Union[Unset, str] = UNSET
|
||||||
requested_access_token_audience: Union[Unset, List[str]] = UNSET
|
requested_access_token_audience: Union[Unset, List[str]] = UNSET
|
||||||
requested_scope: Union[Unset, List[str]] = UNSET
|
requested_scope: Union[Unset, List[str]] = UNSET
|
||||||
|
@ -72,16 +80,22 @@ class ConsentRequest:
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
challenge = self.challenge
|
challenge = self.challenge
|
||||||
acr = self.acr
|
acr = self.acr
|
||||||
|
amr: Union[Unset, List[str]] = UNSET
|
||||||
|
if not isinstance(self.amr, Unset):
|
||||||
|
amr = self.amr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client: Union[Unset, Dict[str, Any]] = UNSET
|
client: Union[Unset, Dict[str, Any]] = UNSET
|
||||||
if not isinstance(self.client, Unset):
|
if not isinstance(self.client, Unset):
|
||||||
client = self.client.to_dict()
|
client = self.client.to_dict()
|
||||||
|
|
||||||
context: Union[Unset, Dict[str, Any]] = UNSET
|
context = self.context
|
||||||
if not isinstance(self.context, Unset):
|
|
||||||
context = self.context.to_dict()
|
|
||||||
|
|
||||||
login_challenge = self.login_challenge
|
login_challenge = self.login_challenge
|
||||||
login_session_id = self.login_session_id
|
login_session_id = self.login_session_id
|
||||||
oidc_context: Union[Unset, Dict[str, Any]] = UNSET
|
oidc_context: Union[Unset, Dict[str, Any]] = UNSET
|
||||||
|
@ -113,6 +127,8 @@ class ConsentRequest:
|
||||||
})
|
})
|
||||||
if acr is not UNSET:
|
if acr is not UNSET:
|
||||||
field_dict["acr"] = acr
|
field_dict["acr"] = acr
|
||||||
|
if amr is not UNSET:
|
||||||
|
field_dict["amr"] = amr
|
||||||
if client is not UNSET:
|
if client is not UNSET:
|
||||||
field_dict["client"] = client
|
field_dict["client"] = client
|
||||||
if context is not UNSET:
|
if context is not UNSET:
|
||||||
|
@ -140,41 +156,38 @@ class ConsentRequest:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
challenge = _d.pop("challenge")
|
challenge = _d.pop("challenge")
|
||||||
|
|
||||||
acr = _d.pop("acr", UNSET)
|
acr = _d.pop("acr", UNSET)
|
||||||
|
|
||||||
|
amr = cast(List[str], _d.pop("amr", UNSET))
|
||||||
|
|
||||||
|
|
||||||
_client = _d.pop("client", UNSET)
|
_client = _d.pop("client", UNSET)
|
||||||
client: Union[Unset, OAuth2Client]
|
client: Union[Unset, OAuth20Client]
|
||||||
if isinstance(_client, Unset):
|
if isinstance(_client, Unset):
|
||||||
client = UNSET
|
client = UNSET
|
||||||
else:
|
else:
|
||||||
client = OAuth2Client.from_dict(_client)
|
client = OAuth20Client.from_dict(_client)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_context = _d.pop("context", UNSET)
|
context = _d.pop("context", UNSET)
|
||||||
context: Union[Unset, JSONRawMessage]
|
|
||||||
if isinstance(_context, Unset):
|
|
||||||
context = UNSET
|
|
||||||
else:
|
|
||||||
context = JSONRawMessage.from_dict(_context)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
login_challenge = _d.pop("login_challenge", UNSET)
|
login_challenge = _d.pop("login_challenge", UNSET)
|
||||||
|
|
||||||
login_session_id = _d.pop("login_session_id", UNSET)
|
login_session_id = _d.pop("login_session_id", UNSET)
|
||||||
|
|
||||||
_oidc_context = _d.pop("oidc_context", UNSET)
|
_oidc_context = _d.pop("oidc_context", UNSET)
|
||||||
oidc_context: Union[Unset, OpenIDConnectContext]
|
oidc_context: Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]
|
||||||
if isinstance(_oidc_context, Unset):
|
if isinstance(_oidc_context, Unset):
|
||||||
oidc_context = UNSET
|
oidc_context = UNSET
|
||||||
else:
|
else:
|
||||||
oidc_context = OpenIDConnectContext.from_dict(_oidc_context)
|
oidc_context = ContainsOptionalInformationAboutTheOpenIDConnectRequest.from_dict(_oidc_context)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,9 +204,10 @@ class ConsentRequest:
|
||||||
|
|
||||||
subject = _d.pop("subject", UNSET)
|
subject = _d.pop("subject", UNSET)
|
||||||
|
|
||||||
consent_request = cls(
|
contains_information_on_an_ongoing_consent_request = cls(
|
||||||
challenge=challenge,
|
challenge=challenge,
|
||||||
acr=acr,
|
acr=acr,
|
||||||
|
amr=amr,
|
||||||
client=client,
|
client=client,
|
||||||
context=context,
|
context=context,
|
||||||
login_challenge=login_challenge,
|
login_challenge=login_challenge,
|
||||||
|
@ -206,8 +220,8 @@ class ConsentRequest:
|
||||||
subject=subject,
|
subject=subject,
|
||||||
)
|
)
|
||||||
|
|
||||||
consent_request.additional_properties = _d
|
contains_information_on_an_ongoing_consent_request.additional_properties = _d
|
||||||
return consent_request
|
return contains_information_on_an_ongoing_consent_request
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,24 +7,30 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
from typing import Union
|
|
||||||
from typing import Dict
|
|
||||||
from typing import cast
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
from typing import Union
|
||||||
|
from typing import cast
|
||||||
|
from typing import Dict
|
||||||
from typing import cast, List
|
from typing import cast, List
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="LoginRequest")
|
|
||||||
|
T = TypeVar("T", bound="ContainsInformationOnAnOngoingLoginRequest")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class LoginRequest:
|
class ContainsInformationOnAnOngoingLoginRequest:
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
challenge (str): ID is the identifier ("login challenge") of the login request. It is used to
|
challenge (str): ID is the identifier ("login challenge") of the login request. It is used to
|
||||||
identify the session.
|
identify the session.
|
||||||
client (OAuth2Client):
|
client (OAuth20Client): OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth
|
||||||
|
2.0 clients are
|
||||||
|
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
|
||||||
request_url (str): RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It
|
request_url (str): RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It
|
||||||
is the URL which
|
is the URL which
|
||||||
initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but
|
initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but
|
||||||
|
@ -40,7 +46,7 @@ class LoginRequest:
|
||||||
deny the scope
|
deny the scope
|
||||||
requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type
|
requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type
|
||||||
when accepting the login request, or the request will fail.
|
when accepting the login request, or the request will fail.
|
||||||
oidc_context (Union[Unset, OpenIDConnectContext]):
|
oidc_context (Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]):
|
||||||
session_id (Union[Unset, str]): SessionID is the login session ID. If the user-agent reuses a login session (via
|
session_id (Union[Unset, str]): SessionID is the login session ID. If the user-agent reuses a login session (via
|
||||||
cookie / remember flag)
|
cookie / remember flag)
|
||||||
this ID will remain the same. If the user-agent did not have an existing authentication session (e.g. remember
|
this ID will remain the same. If the user-agent did not have an existing authentication session (e.g. remember
|
||||||
|
@ -51,18 +57,20 @@ class LoginRequest:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
challenge: str
|
challenge: str
|
||||||
client: 'OAuth2Client'
|
client: 'OAuth20Client'
|
||||||
request_url: str
|
request_url: str
|
||||||
requested_access_token_audience: List[str]
|
requested_access_token_audience: List[str]
|
||||||
requested_scope: List[str]
|
requested_scope: List[str]
|
||||||
skip: bool
|
skip: bool
|
||||||
subject: str
|
subject: str
|
||||||
oidc_context: Union[Unset, 'OpenIDConnectContext'] = UNSET
|
oidc_context: Union[Unset, 'ContainsOptionalInformationAboutTheOpenIDConnectRequest'] = UNSET
|
||||||
session_id: Union[Unset, str] = UNSET
|
session_id: Union[Unset, str] = UNSET
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
challenge = self.challenge
|
challenge = self.challenge
|
||||||
client = self.client.to_dict()
|
client = self.client.to_dict()
|
||||||
|
|
||||||
|
@ -107,10 +115,12 @@ class LoginRequest:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
|
||||||
|
from ..models.o_auth_20_client import OAuth20Client
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
challenge = _d.pop("challenge")
|
challenge = _d.pop("challenge")
|
||||||
|
|
||||||
client = OAuth2Client.from_dict(_d.pop("client"))
|
client = OAuth20Client.from_dict(_d.pop("client"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,18 +138,18 @@ class LoginRequest:
|
||||||
subject = _d.pop("subject")
|
subject = _d.pop("subject")
|
||||||
|
|
||||||
_oidc_context = _d.pop("oidc_context", UNSET)
|
_oidc_context = _d.pop("oidc_context", UNSET)
|
||||||
oidc_context: Union[Unset, OpenIDConnectContext]
|
oidc_context: Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]
|
||||||
if isinstance(_oidc_context, Unset):
|
if isinstance(_oidc_context, Unset):
|
||||||
oidc_context = UNSET
|
oidc_context = UNSET
|
||||||
else:
|
else:
|
||||||
oidc_context = OpenIDConnectContext.from_dict(_oidc_context)
|
oidc_context = ContainsOptionalInformationAboutTheOpenIDConnectRequest.from_dict(_oidc_context)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
session_id = _d.pop("session_id", UNSET)
|
session_id = _d.pop("session_id", UNSET)
|
||||||
|
|
||||||
login_request = cls(
|
contains_information_on_an_ongoing_login_request = cls(
|
||||||
challenge=challenge,
|
challenge=challenge,
|
||||||
client=client,
|
client=client,
|
||||||
request_url=request_url,
|
request_url=request_url,
|
||||||
|
@ -151,8 +161,8 @@ class LoginRequest:
|
||||||
session_id=session_id,
|
session_id=session_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
login_request.additional_properties = _d
|
contains_information_on_an_ongoing_login_request.additional_properties = _d
|
||||||
return login_request
|
return contains_information_on_an_ongoing_login_request
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,19 +7,22 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
from typing import cast
|
||||||
from typing import Union
|
from typing import Union
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from typing import cast
|
|
||||||
from ..types import UNSET, Unset
|
|
||||||
from typing import cast, List
|
from typing import cast, List
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims import ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="OpenIDConnectContext")
|
|
||||||
|
T = TypeVar("T", bound="ContainsOptionalInformationAboutTheOpenIDConnectRequest")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class OpenIDConnectContext:
|
class ContainsOptionalInformationAboutTheOpenIDConnectRequest:
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
acr_values (Union[Unset, List[str]]): ACRValues is the Authentication AuthorizationContext Class Reference
|
acr_values (Union[Unset, List[str]]): ACRValues is the Authentication AuthorizationContext Class Reference
|
||||||
|
@ -49,8 +52,9 @@ class OpenIDConnectContext:
|
||||||
|
|
||||||
The Authorization Server MAY also attempt to detect the capabilities of the User Agent and present an
|
The Authorization Server MAY also attempt to detect the capabilities of the User Agent and present an
|
||||||
appropriate display.
|
appropriate display.
|
||||||
id_token_hint_claims (Union[Unset, OpenIDConnectContextIdTokenHintClaims]): IDTokenHintClaims are the claims of
|
id_token_hint_claims (Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims]):
|
||||||
the ID Token previously issued by the Authorization Server being passed as a hint about the
|
IDTokenHintClaims are the claims of the ID Token previously issued by the Authorization Server being passed as a
|
||||||
|
hint about the
|
||||||
End-User's current or past authenticated session with the Client.
|
End-User's current or past authenticated session with the Client.
|
||||||
login_hint (Union[Unset, str]): LoginHint hints about the login identifier the End-User might use to log in (if
|
login_hint (Union[Unset, str]): LoginHint hints about the login identifier the End-User might use to log in (if
|
||||||
necessary).
|
necessary).
|
||||||
|
@ -68,13 +72,14 @@ class OpenIDConnectContext:
|
||||||
|
|
||||||
acr_values: Union[Unset, List[str]] = UNSET
|
acr_values: Union[Unset, List[str]] = UNSET
|
||||||
display: Union[Unset, str] = UNSET
|
display: Union[Unset, str] = UNSET
|
||||||
id_token_hint_claims: Union[Unset, 'OpenIDConnectContextIdTokenHintClaims'] = UNSET
|
id_token_hint_claims: Union[Unset, 'ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims'] = UNSET
|
||||||
login_hint: Union[Unset, str] = UNSET
|
login_hint: Union[Unset, str] = UNSET
|
||||||
ui_locales: Union[Unset, List[str]] = UNSET
|
ui_locales: Union[Unset, List[str]] = UNSET
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims import ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims
|
||||||
acr_values: Union[Unset, List[str]] = UNSET
|
acr_values: Union[Unset, List[str]] = UNSET
|
||||||
if not isinstance(self.acr_values, Unset):
|
if not isinstance(self.acr_values, Unset):
|
||||||
acr_values = self.acr_values
|
acr_values = self.acr_values
|
||||||
|
@ -117,6 +122,7 @@ class OpenIDConnectContext:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
from ..models.contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims import ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
acr_values = cast(List[str], _d.pop("acr_values", UNSET))
|
acr_values = cast(List[str], _d.pop("acr_values", UNSET))
|
||||||
|
|
||||||
|
@ -124,11 +130,11 @@ class OpenIDConnectContext:
|
||||||
display = _d.pop("display", UNSET)
|
display = _d.pop("display", UNSET)
|
||||||
|
|
||||||
_id_token_hint_claims = _d.pop("id_token_hint_claims", UNSET)
|
_id_token_hint_claims = _d.pop("id_token_hint_claims", UNSET)
|
||||||
id_token_hint_claims: Union[Unset, OpenIDConnectContextIdTokenHintClaims]
|
id_token_hint_claims: Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims]
|
||||||
if isinstance(_id_token_hint_claims, Unset):
|
if isinstance(_id_token_hint_claims, Unset):
|
||||||
id_token_hint_claims = UNSET
|
id_token_hint_claims = UNSET
|
||||||
else:
|
else:
|
||||||
id_token_hint_claims = OpenIDConnectContextIdTokenHintClaims.from_dict(_id_token_hint_claims)
|
id_token_hint_claims = ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims.from_dict(_id_token_hint_claims)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,7 +144,7 @@ class OpenIDConnectContext:
|
||||||
ui_locales = cast(List[str], _d.pop("ui_locales", UNSET))
|
ui_locales = cast(List[str], _d.pop("ui_locales", UNSET))
|
||||||
|
|
||||||
|
|
||||||
open_id_connect_context = cls(
|
contains_optional_information_about_the_open_id_connect_request = cls(
|
||||||
acr_values=acr_values,
|
acr_values=acr_values,
|
||||||
display=display,
|
display=display,
|
||||||
id_token_hint_claims=id_token_hint_claims,
|
id_token_hint_claims=id_token_hint_claims,
|
||||||
|
@ -146,8 +152,8 @@ class OpenIDConnectContext:
|
||||||
ui_locales=ui_locales,
|
ui_locales=ui_locales,
|
||||||
)
|
)
|
||||||
|
|
||||||
open_id_connect_context.additional_properties = _d
|
contains_optional_information_about_the_open_id_connect_request.additional_properties = _d
|
||||||
return open_id_connect_context
|
return contains_optional_information_about_the_open_id_connect_request
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -11,10 +11,11 @@ from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="OpenIDConnectContextIdTokenHintClaims")
|
|
||||||
|
T = TypeVar("T", bound="ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class OpenIDConnectContextIdTokenHintClaims:
|
class ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims:
|
||||||
"""IDTokenHintClaims are the claims of the ID Token previously issued by the Authorization Server being passed as a
|
"""IDTokenHintClaims are the claims of the ID Token previously issued by the Authorization Server being passed as a
|
||||||
hint about the
|
hint about the
|
||||||
End-User's current or past authenticated session with the Client.
|
End-User's current or past authenticated session with the Client.
|
||||||
|
@ -38,11 +39,11 @@ End-User's current or past authenticated session with the Client.
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
open_id_connect_context_id_token_hint_claims = cls(
|
contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims = cls(
|
||||||
)
|
)
|
||||||
|
|
||||||
open_id_connect_context_id_token_hint_claims.additional_properties = _d
|
contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims.additional_properties = _d
|
||||||
return open_id_connect_context_id_token_hint_claims
|
return contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -11,15 +11,23 @@ from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="JsonWebKeySetGeneratorRequest")
|
|
||||||
|
T = TypeVar("T", bound="CreateJsonWebKeySet")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class JsonWebKeySetGeneratorRequest:
|
class CreateJsonWebKeySet:
|
||||||
"""
|
"""Create JSON Web Key Set Request Body
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
alg (str): The algorithm to be used for creating the key. Supports "RS256", "ES512", "HS512", and "HS256"
|
alg (str): JSON Web Key Algorithm
|
||||||
kid (str): The kid of the key to be created
|
|
||||||
use (str): The "use" (public key use) parameter identifies the intended use of
|
The algorithm to be used for creating the key. Supports `RS256`, `ES256`, `ES512`, `HS512`, and `HS256`.
|
||||||
|
kid (str): JSON Web Key ID
|
||||||
|
|
||||||
|
The Key ID of the key to be created.
|
||||||
|
use (str): JSON Web Key Use
|
||||||
|
|
||||||
|
The "use" (public key use) parameter identifies the intended use of
|
||||||
the public key. The "use" parameter is employed to indicate whether
|
the public key. The "use" parameter is employed to indicate whether
|
||||||
a public key is used for encrypting data or verifying the signature
|
a public key is used for encrypting data or verifying the signature
|
||||||
on data. Valid values are "enc" and "sig".
|
on data. Valid values are "enc" and "sig".
|
||||||
|
@ -57,14 +65,14 @@ class JsonWebKeySetGeneratorRequest:
|
||||||
|
|
||||||
use = _d.pop("use")
|
use = _d.pop("use")
|
||||||
|
|
||||||
json_web_key_set_generator_request = cls(
|
create_json_web_key_set = cls(
|
||||||
alg=alg,
|
alg=alg,
|
||||||
kid=kid,
|
kid=kid,
|
||||||
use=use,
|
use=use,
|
||||||
)
|
)
|
||||||
|
|
||||||
json_web_key_set_generator_request.additional_properties = _d
|
create_json_web_key_set.additional_properties = _d
|
||||||
return json_web_key_set_generator_request
|
return create_json_web_key_set
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
107
libs/ory-hydra-client/ory_hydra_client/models/error_o_auth_2.py
Normal file
107
libs/ory-hydra-client/ory_hydra_client/models/error_o_auth_2.py
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="ErrorOAuth2")
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class ErrorOAuth2:
|
||||||
|
"""Error
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
error (Union[Unset, str]): Error
|
||||||
|
error_debug (Union[Unset, str]): Error Debug Information
|
||||||
|
|
||||||
|
Only available in dev mode.
|
||||||
|
error_description (Union[Unset, str]): Error Description
|
||||||
|
error_hint (Union[Unset, str]): Error Hint
|
||||||
|
|
||||||
|
Helps the user identify the error cause. Example: The redirect URL is not allowed..
|
||||||
|
status_code (Union[Unset, int]): HTTP Status Code Example: 401.
|
||||||
|
"""
|
||||||
|
|
||||||
|
error: Union[Unset, str] = UNSET
|
||||||
|
error_debug: Union[Unset, str] = UNSET
|
||||||
|
error_description: Union[Unset, str] = UNSET
|
||||||
|
error_hint: Union[Unset, str] = UNSET
|
||||||
|
status_code: Union[Unset, int] = UNSET
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
error = self.error
|
||||||
|
error_debug = self.error_debug
|
||||||
|
error_description = self.error_description
|
||||||
|
error_hint = self.error_hint
|
||||||
|
status_code = self.status_code
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({
|
||||||
|
})
|
||||||
|
if error is not UNSET:
|
||||||
|
field_dict["error"] = error
|
||||||
|
if error_debug is not UNSET:
|
||||||
|
field_dict["error_debug"] = error_debug
|
||||||
|
if error_description is not UNSET:
|
||||||
|
field_dict["error_description"] = error_description
|
||||||
|
if error_hint is not UNSET:
|
||||||
|
field_dict["error_hint"] = error_hint
|
||||||
|
if status_code is not UNSET:
|
||||||
|
field_dict["status_code"] = status_code
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
_d = src_dict.copy()
|
||||||
|
error = _d.pop("error", UNSET)
|
||||||
|
|
||||||
|
error_debug = _d.pop("error_debug", UNSET)
|
||||||
|
|
||||||
|
error_description = _d.pop("error_description", UNSET)
|
||||||
|
|
||||||
|
error_hint = _d.pop("error_hint", UNSET)
|
||||||
|
|
||||||
|
status_code = _d.pop("status_code", UNSET)
|
||||||
|
|
||||||
|
error_o_auth_2 = cls(
|
||||||
|
error=error,
|
||||||
|
error_debug=error_debug,
|
||||||
|
error_description=error_description,
|
||||||
|
error_hint=error_hint,
|
||||||
|
status_code=status_code,
|
||||||
|
)
|
||||||
|
|
||||||
|
error_o_auth_2.additional_properties = _d
|
||||||
|
return error_o_auth_2
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -13,45 +13,73 @@ from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="GenericError")
|
T = TypeVar("T", bound="GenericError")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class GenericError:
|
class GenericError:
|
||||||
"""Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.
|
"""
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
error (str): Name is the error name. Example: The requested resource could not be found.
|
message (str): Error message
|
||||||
debug (Union[Unset, str]): Debug contains debug information. This is usually not available and has to be
|
|
||||||
enabled. Example: The database adapter was unable to find the element.
|
The error's message. Example: The resource could not be found.
|
||||||
error_description (Union[Unset, str]): Description contains further information on the nature of the error.
|
code (Union[Unset, int]): The status code Example: 404.
|
||||||
Example: Object with ID 12345 does not exist.
|
debug (Union[Unset, str]): Debug information
|
||||||
status_code (Union[Unset, int]): Code represents the error status code (404, 403, 401, ...). Example: 404.
|
|
||||||
|
This field is often not exposed to protect against leaking
|
||||||
|
sensitive information. Example: SQL field "foo" is not a bool..
|
||||||
|
details (Union[Unset, Any]): Further error details
|
||||||
|
id (Union[Unset, str]): The error ID
|
||||||
|
|
||||||
|
Useful when trying to identify various errors in application logic.
|
||||||
|
reason (Union[Unset, str]): A human-readable reason for the error Example: User with ID 1234 does not exist..
|
||||||
|
request (Union[Unset, str]): The request ID
|
||||||
|
|
||||||
|
The request ID is often exposed internally in order to trace
|
||||||
|
errors across service architectures. This is often a UUID. Example: d7ef54b1-ec15-46e6-bccb-524b82c035e6.
|
||||||
|
status (Union[Unset, str]): The status description Example: Not Found.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
error: str
|
message: str
|
||||||
|
code: Union[Unset, int] = UNSET
|
||||||
debug: Union[Unset, str] = UNSET
|
debug: Union[Unset, str] = UNSET
|
||||||
error_description: Union[Unset, str] = UNSET
|
details: Union[Unset, Any] = UNSET
|
||||||
status_code: Union[Unset, int] = UNSET
|
id: Union[Unset, str] = UNSET
|
||||||
|
reason: Union[Unset, str] = UNSET
|
||||||
|
request: Union[Unset, str] = UNSET
|
||||||
|
status: Union[Unset, str] = UNSET
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
error = self.error
|
message = self.message
|
||||||
|
code = self.code
|
||||||
debug = self.debug
|
debug = self.debug
|
||||||
error_description = self.error_description
|
details = self.details
|
||||||
status_code = self.status_code
|
id = self.id
|
||||||
|
reason = self.reason
|
||||||
|
request = self.request
|
||||||
|
status = self.status
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
field_dict.update({
|
field_dict.update({
|
||||||
"error": error,
|
"message": message,
|
||||||
})
|
})
|
||||||
|
if code is not UNSET:
|
||||||
|
field_dict["code"] = code
|
||||||
if debug is not UNSET:
|
if debug is not UNSET:
|
||||||
field_dict["debug"] = debug
|
field_dict["debug"] = debug
|
||||||
if error_description is not UNSET:
|
if details is not UNSET:
|
||||||
field_dict["error_description"] = error_description
|
field_dict["details"] = details
|
||||||
if status_code is not UNSET:
|
if id is not UNSET:
|
||||||
field_dict["status_code"] = status_code
|
field_dict["id"] = id
|
||||||
|
if reason is not UNSET:
|
||||||
|
field_dict["reason"] = reason
|
||||||
|
if request is not UNSET:
|
||||||
|
field_dict["request"] = request
|
||||||
|
if status is not UNSET:
|
||||||
|
field_dict["status"] = status
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
|
@ -60,19 +88,31 @@ class GenericError:
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
error = _d.pop("error")
|
message = _d.pop("message")
|
||||||
|
|
||||||
|
code = _d.pop("code", UNSET)
|
||||||
|
|
||||||
debug = _d.pop("debug", UNSET)
|
debug = _d.pop("debug", UNSET)
|
||||||
|
|
||||||
error_description = _d.pop("error_description", UNSET)
|
details = _d.pop("details", UNSET)
|
||||||
|
|
||||||
status_code = _d.pop("status_code", UNSET)
|
id = _d.pop("id", UNSET)
|
||||||
|
|
||||||
|
reason = _d.pop("reason", UNSET)
|
||||||
|
|
||||||
|
request = _d.pop("request", UNSET)
|
||||||
|
|
||||||
|
status = _d.pop("status", UNSET)
|
||||||
|
|
||||||
generic_error = cls(
|
generic_error = cls(
|
||||||
error=error,
|
message=message,
|
||||||
|
code=code,
|
||||||
debug=debug,
|
debug=debug,
|
||||||
error_description=error_description,
|
details=details,
|
||||||
status_code=status_code,
|
id=id,
|
||||||
|
reason=reason,
|
||||||
|
request=request,
|
||||||
|
status=status,
|
||||||
)
|
)
|
||||||
|
|
||||||
generic_error.additional_properties = _d
|
generic_error.additional_properties = _d
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -13,29 +13,29 @@ from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="ContainerWaitOKBodyError")
|
|
||||||
|
T = TypeVar("T", bound="GetVersionResponse200")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class ContainerWaitOKBodyError:
|
class GetVersionResponse200:
|
||||||
"""ContainerWaitOKBodyError container waiting error, if any
|
"""
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
message (Union[Unset, str]): Details of an error
|
version (Union[Unset, str]): The version of Ory Hydra.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
message: Union[Unset, str] = UNSET
|
version: Union[Unset, str] = UNSET
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
message = self.message
|
version = self.version
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
field_dict.update({
|
field_dict.update({
|
||||||
})
|
})
|
||||||
if message is not UNSET:
|
if version is not UNSET:
|
||||||
field_dict["Message"] = message
|
field_dict["version"] = version
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
|
@ -44,14 +44,14 @@ class ContainerWaitOKBodyError:
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
message = _d.pop("Message", UNSET)
|
version = _d.pop("version", UNSET)
|
||||||
|
|
||||||
container_wait_ok_body_error = cls(
|
get_version_response_200 = cls(
|
||||||
message=message,
|
version=version,
|
||||||
)
|
)
|
||||||
|
|
||||||
container_wait_ok_body_error.additional_properties = _d
|
get_version_response_200.additional_properties = _d
|
||||||
return container_wait_ok_body_error
|
return get_version_response_200
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,25 +7,26 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
from typing import Union
|
from typing import cast, List
|
||||||
from typing import cast
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
from typing import Dict
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="AcceptLoginRequest")
|
|
||||||
|
T = TypeVar("T", bound="HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class AcceptLoginRequest:
|
class HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest:
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
subject (str): Subject is the user ID of the end-user that authenticated.
|
subject (str): Subject is the user ID of the end-user that authenticated.
|
||||||
acr (Union[Unset, str]): ACR sets the Authentication AuthorizationContext Class Reference value for this
|
acr (Union[Unset, str]): ACR sets the Authentication AuthorizationContext Class Reference value for this
|
||||||
authentication session. You can use it
|
authentication session. You can use it
|
||||||
to express that, for example, a user authenticated using two factor authentication.
|
to express that, for example, a user authenticated using two factor authentication.
|
||||||
context (Union[Unset, JSONRawMessage]):
|
amr (Union[Unset, List[str]]):
|
||||||
|
context (Union[Unset, Any]):
|
||||||
force_subject_identifier (Union[Unset, str]): ForceSubjectIdentifier forces the "pairwise" user ID of the end-
|
force_subject_identifier (Union[Unset, str]): ForceSubjectIdentifier forces the "pairwise" user ID of the end-
|
||||||
user that authenticated. The "pairwise" user ID refers to the
|
user that authenticated. The "pairwise" user ID refers to the
|
||||||
(Pairwise Identifier Algorithm)[http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg] of the OpenID
|
(Pairwise Identifier Algorithm)[http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg] of the OpenID
|
||||||
|
@ -58,7 +59,8 @@ class AcceptLoginRequest:
|
||||||
|
|
||||||
subject: str
|
subject: str
|
||||||
acr: Union[Unset, str] = UNSET
|
acr: Union[Unset, str] = UNSET
|
||||||
context: Union[Unset, 'JSONRawMessage'] = UNSET
|
amr: Union[Unset, List[str]] = UNSET
|
||||||
|
context: Union[Unset, Any] = UNSET
|
||||||
force_subject_identifier: Union[Unset, str] = UNSET
|
force_subject_identifier: Union[Unset, str] = UNSET
|
||||||
remember: Union[Unset, bool] = UNSET
|
remember: Union[Unset, bool] = UNSET
|
||||||
remember_for: Union[Unset, int] = UNSET
|
remember_for: Union[Unset, int] = UNSET
|
||||||
|
@ -68,10 +70,14 @@ class AcceptLoginRequest:
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
subject = self.subject
|
subject = self.subject
|
||||||
acr = self.acr
|
acr = self.acr
|
||||||
context: Union[Unset, Dict[str, Any]] = UNSET
|
amr: Union[Unset, List[str]] = UNSET
|
||||||
if not isinstance(self.context, Unset):
|
if not isinstance(self.amr, Unset):
|
||||||
context = self.context.to_dict()
|
amr = self.amr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
context = self.context
|
||||||
force_subject_identifier = self.force_subject_identifier
|
force_subject_identifier = self.force_subject_identifier
|
||||||
remember = self.remember
|
remember = self.remember
|
||||||
remember_for = self.remember_for
|
remember_for = self.remember_for
|
||||||
|
@ -83,6 +89,8 @@ class AcceptLoginRequest:
|
||||||
})
|
})
|
||||||
if acr is not UNSET:
|
if acr is not UNSET:
|
||||||
field_dict["acr"] = acr
|
field_dict["acr"] = acr
|
||||||
|
if amr is not UNSET:
|
||||||
|
field_dict["amr"] = amr
|
||||||
if context is not UNSET:
|
if context is not UNSET:
|
||||||
field_dict["context"] = context
|
field_dict["context"] = context
|
||||||
if force_subject_identifier is not UNSET:
|
if force_subject_identifier is not UNSET:
|
||||||
|
@ -103,15 +111,10 @@ class AcceptLoginRequest:
|
||||||
|
|
||||||
acr = _d.pop("acr", UNSET)
|
acr = _d.pop("acr", UNSET)
|
||||||
|
|
||||||
_context = _d.pop("context", UNSET)
|
amr = cast(List[str], _d.pop("amr", UNSET))
|
||||||
context: Union[Unset, JSONRawMessage]
|
|
||||||
if isinstance(_context, Unset):
|
|
||||||
context = UNSET
|
|
||||||
else:
|
|
||||||
context = JSONRawMessage.from_dict(_context)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
context = _d.pop("context", UNSET)
|
||||||
|
|
||||||
force_subject_identifier = _d.pop("force_subject_identifier", UNSET)
|
force_subject_identifier = _d.pop("force_subject_identifier", UNSET)
|
||||||
|
|
||||||
|
@ -119,17 +122,18 @@ class AcceptLoginRequest:
|
||||||
|
|
||||||
remember_for = _d.pop("remember_for", UNSET)
|
remember_for = _d.pop("remember_for", UNSET)
|
||||||
|
|
||||||
accept_login_request = cls(
|
handled_login_request_is_the_request_payload_used_to_accept_a_login_request = cls(
|
||||||
subject=subject,
|
subject=subject,
|
||||||
acr=acr,
|
acr=acr,
|
||||||
|
amr=amr,
|
||||||
context=context,
|
context=context,
|
||||||
force_subject_identifier=force_subject_identifier,
|
force_subject_identifier=force_subject_identifier,
|
||||||
remember=remember,
|
remember=remember,
|
||||||
remember_for=remember_for,
|
remember_for=remember_for,
|
||||||
)
|
)
|
||||||
|
|
||||||
accept_login_request.additional_properties = _d
|
handled_login_request_is_the_request_payload_used_to_accept_a_login_request.additional_properties = _d
|
||||||
return accept_login_request
|
return handled_login_request_is_the_request_payload_used_to_accept_a_login_request
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -7,10 +7,13 @@ import attr
|
||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
from typing import Union
|
|
||||||
from typing import cast
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
from typing import Union
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..models.health_not_ready_status_errors import HealthNotReadyStatusErrors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +33,7 @@ class HealthNotReadyStatus:
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
from ..models.health_not_ready_status_errors import HealthNotReadyStatusErrors
|
||||||
errors: Union[Unset, Dict[str, Any]] = UNSET
|
errors: Union[Unset, Dict[str, Any]] = UNSET
|
||||||
if not isinstance(self.errors, Unset):
|
if not isinstance(self.errors, Unset):
|
||||||
errors = self.errors.to_dict()
|
errors = self.errors.to_dict()
|
||||||
|
@ -48,6 +52,7 @@ class HealthNotReadyStatus:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
from ..models.health_not_ready_status_errors import HealthNotReadyStatusErrors
|
||||||
_d = src_dict.copy()
|
_d = src_dict.copy()
|
||||||
_errors = _d.pop("errors", UNSET)
|
_errors = _d.pop("errors", UNSET)
|
||||||
errors: Union[Unset, HealthNotReadyStatusErrors]
|
errors: Union[Unset, HealthNotReadyStatusErrors]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="HealthNotReadyStatusErrors")
|
T = TypeVar("T", bound="HealthNotReadyStatusErrors")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
|
@ -39,6 +40,7 @@ class HealthNotReadyStatusErrors:
|
||||||
health_not_ready_status_errors = cls(
|
health_not_ready_status_errors = cls(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
health_not_ready_status_errors.additional_properties = _d
|
health_not_ready_status_errors.additional_properties = _d
|
||||||
return health_not_ready_status_errors
|
return health_not_ready_status_errors
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO
|
from typing import Any, Dict, Type, TypeVar, Tuple, Optional, BinaryIO, TextIO, TYPE_CHECKING
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ from typing import Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="HealthStatus")
|
T = TypeVar("T", bound="HealthStatus")
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue