update to new version of openapi-python-client

now: 0.13.0
master
TuxCoder 2023-01-13 19:21:38 +01:00
parent deb73d06e6
commit 4a31250bca
159 changed files with 13668 additions and 11420 deletions

View File

@ -1,5 +1,5 @@
# ory-hydra-client
A client library for accessing ORY Hydra
A client library for accessing Ory Hydra
## Usage
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:
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_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_detailed`: Like `sync_detailed` by async instead of blocking
1. `asyncio`: Like `sync` but 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. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)

View File

@ -1,2 +1,7 @@
""" A client library for accessing ORY Hydra """
""" A client library for accessing Ory Hydra """
from .client import AuthenticatedClient, Client
__all__ = (
"AuthenticatedClient",
"Client",
)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,15 +1,16 @@
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.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from ...models.json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
from typing import Dict
from ...models.json_web_key_set import JsonWebKeySet
from ...models.create_json_web_key_set import CreateJsonWebKeySet
@ -17,10 +18,10 @@ def _get_kwargs(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
json_body: CreateJsonWebKeySet,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(
url = "{}/admin/keys/{set}".format(
_client.base_url,set=set_)
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:
response_201 = JSONWebKeySet.from_dict(response.json())
response_201 = JsonWebKeySet.from_dict(response.json())
return response_201
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -89,10 +75,10 @@ def sync_detailed(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
json_body: CreateJsonWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
) -> Response[JsonWebKeySet]:
"""Create JSON Web Key
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
@ -106,10 +92,14 @@ def sync_detailed(
Args:
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:
Response[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -125,16 +115,16 @@ json_body=json_body,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
json_body: CreateJsonWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
) -> Optional[JsonWebKeySet]:
"""Create JSON Web Key
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
@ -148,10 +138,14 @@ def sync(
Args:
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:
Response[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -166,10 +160,10 @@ async def asyncio_detailed(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
json_body: CreateJsonWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
) -> Response[JsonWebKeySet]:
"""Create JSON Web Key
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
@ -183,10 +177,14 @@ async def asyncio_detailed(
Args:
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:
Response[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -202,16 +200,16 @@ json_body=json_body,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
set_: str,
*,
_client: Client,
json_body: JsonWebKeySetGeneratorRequest,
json_body: CreateJsonWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
"""Generate a New JSON Web Key
) -> Optional[JsonWebKeySet]:
"""Create JSON Web Key
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
@ -225,10 +223,14 @@ async def asyncio(
Args:
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:
Response[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -1,14 +1,15 @@
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.generic_error import GenericError
from ...models.json_web_key_set import JSONWebKeySet
from typing import cast
from typing import Dict
from ...models.json_web_key_set import JsonWebKeySet
@ -18,7 +19,7 @@ def _get_kwargs(
_client: Client,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(
url = "{}/admin/keys/{set}".format(
_client.base_url,set=set_)
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:
response_200 = JSONWebKeySet.from_dict(response.json())
response_200 = JsonWebKeySet.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -85,7 +71,7 @@ def sync_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
) -> Response[JsonWebKeySet]:
"""Retrieve a JSON Web Key Set
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
@ -99,8 +85,12 @@ def sync_detailed(
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[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -115,14 +105,14 @@ _client=_client,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
set_: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
) -> Optional[JsonWebKeySet]:
"""Retrieve a JSON Web Key Set
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
@ -136,8 +126,12 @@ def sync(
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[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -152,7 +146,7 @@ async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[GenericError, JSONWebKeySet]]:
) -> Response[JsonWebKeySet]:
"""Retrieve a JSON Web Key Set
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
@ -166,8 +160,12 @@ async def asyncio_detailed(
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[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -182,14 +180,14 @@ _client=_client,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
set_: str,
*,
_client: Client,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
) -> Optional[JsonWebKeySet]:
"""Retrieve a JSON Web Key Set
This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
@ -203,8 +201,12 @@ async def asyncio(
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[Union[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""

View File

@ -1,14 +1,15 @@
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.generic_error import GenericError
from typing import cast
from ...models.json_web_key import JSONWebKey
from typing import Dict
from ...models.json_web_key import JsonWebKey
from typing import cast
@ -17,10 +18,10 @@ def _get_kwargs(
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
json_body: JsonWebKey,
) -> Dict[str, Any]:
url = "{}/keys/{set}/{kid}".format(
url = "{}/admin/keys/{set}/{kid}".format(
_client.base_url,set=set_,kid=kid)
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:
response_200 = JSONWebKey.from_dict(response.json())
response_200 = JsonWebKey.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKey]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -90,10 +76,10 @@ def sync_detailed(
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
json_body: JsonWebKey,
) -> Response[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
) -> Response[JsonWebKey]:
"""Set JSON Web Key
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
own.
@ -107,12 +93,14 @@ def sync_detailed(
Args:
set_ (str):
kid (str):
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
"swagger generate spec" to generate only on definition of a
JSONWebKey.
json_body (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:
Response[Union[GenericError, JSONWebKey]]
Response[JsonWebKey]
"""
@ -129,17 +117,17 @@ json_body=json_body,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
set_: str,
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
json_body: JsonWebKey,
) -> Optional[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
) -> Optional[JsonWebKey]:
"""Set JSON Web Key
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
own.
@ -153,12 +141,14 @@ def sync(
Args:
set_ (str):
kid (str):
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
"swagger generate spec" to generate only on definition of a
JSONWebKey.
json_body (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:
Response[Union[GenericError, JSONWebKey]]
Response[JsonWebKey]
"""
@ -175,10 +165,10 @@ async def asyncio_detailed(
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
json_body: JsonWebKey,
) -> Response[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
) -> Response[JsonWebKey]:
"""Set JSON Web Key
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
own.
@ -192,12 +182,14 @@ async def asyncio_detailed(
Args:
set_ (str):
kid (str):
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
"swagger generate spec" to generate only on definition of a
JSONWebKey.
json_body (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:
Response[Union[GenericError, JSONWebKey]]
Response[JsonWebKey]
"""
@ -214,17 +206,17 @@ json_body=json_body,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
set_: str,
kid: str,
*,
_client: Client,
json_body: JSONWebKey,
json_body: JsonWebKey,
) -> Optional[Union[GenericError, JSONWebKey]]:
"""Update a JSON Web Key
) -> Optional[JsonWebKey]:
"""Set JSON Web Key
Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your
own.
@ -238,12 +230,14 @@ async def asyncio(
Args:
set_ (str):
kid (str):
json_body (JSONWebKey): It is important that this model object is named JSONWebKey for
"swagger generate spec" to generate only on definition of a
JSONWebKey.
json_body (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:
Response[Union[GenericError, JSONWebKey]]
Response[JsonWebKey]
"""

View File

@ -1,14 +1,15 @@
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.generic_error import GenericError
from typing import Dict
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,
*,
_client: Client,
json_body: JSONWebKeySet,
json_body: JsonWebKeySet,
) -> Dict[str, Any]:
url = "{}/keys/{set}".format(
url = "{}/admin/keys/{set}".format(
_client.base_url,set=set_)
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:
response_200 = JSONWebKeySet.from_dict(response.json())
response_200 = JsonWebKeySet.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.UNAUTHORIZED:
response_401 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[JsonWebKeySet]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -88,9 +74,9 @@ def sync_detailed(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
json_body: JsonWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
) -> Response[JsonWebKeySet]:
"""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
@ -104,15 +90,14 @@ def sync_detailed(
Args:
set_ (str):
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
for
"swagger generate spec" to generate only on definition of a
JSONWebKeySet. Since one with the same name is previously defined as
client.Client.JSONWebKeys and this one is last, this one will be
effectively written in the swagger spec.
json_body (JsonWebKeySet): JSON Web Key Set
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[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -128,15 +113,15 @@ json_body=json_body,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
json_body: JsonWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
) -> Optional[JsonWebKeySet]:
"""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
@ -150,15 +135,14 @@ def sync(
Args:
set_ (str):
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
for
"swagger generate spec" to generate only on definition of a
JSONWebKeySet. Since one with the same name is previously defined as
client.Client.JSONWebKeys and this one is last, this one will be
effectively written in the swagger spec.
json_body (JsonWebKeySet): JSON Web Key Set
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[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -173,9 +157,9 @@ async def asyncio_detailed(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
json_body: JsonWebKeySet,
) -> Response[Union[GenericError, JSONWebKeySet]]:
) -> Response[JsonWebKeySet]:
"""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
@ -189,15 +173,14 @@ async def asyncio_detailed(
Args:
set_ (str):
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
for
"swagger generate spec" to generate only on definition of a
JSONWebKeySet. Since one with the same name is previously defined as
client.Client.JSONWebKeys and this one is last, this one will be
effectively written in the swagger spec.
json_body (JsonWebKeySet): JSON Web Key Set
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[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""
@ -213,15 +196,15 @@ json_body=json_body,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
set_: str,
*,
_client: Client,
json_body: JSONWebKeySet,
json_body: JsonWebKeySet,
) -> Optional[Union[GenericError, JSONWebKeySet]]:
) -> Optional[JsonWebKeySet]:
"""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
@ -235,15 +218,14 @@ async def asyncio(
Args:
set_ (str):
json_body (JSONWebKeySet): It is important that this model object is named JSONWebKeySet
for
"swagger generate spec" to generate only on definition of a
JSONWebKeySet. Since one with the same name is previously defined as
client.Client.JSONWebKeys and this one is last, this one will be
effectively written in the swagger spec.
json_body (JsonWebKeySet): JSON Web Key Set
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[GenericError, JSONWebKeySet]]
Response[JsonWebKeySet]
"""

View File

@ -1,14 +1,15 @@
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.health_status import HealthStatus
from typing import cast
from ...models.health_not_ready_status import HealthNotReadyStatus
from ...models.get_version_response_200 import GetVersionResponse200
from typing import Dict
from typing import cast
@ -17,7 +18,7 @@ def _get_kwargs(
_client: Client,
) -> Dict[str, Any]:
url = "{}/health/ready".format(
url = "{}/version".format(
_client.base_url)
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:
response_200 = HealthStatus.from_dict(response.json())
response_200 = GetVersionResponse200.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.SERVICE_UNAVAILABLE:
response_503 = HealthNotReadyStatus.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
return response_503
return None
def _build_response(*, response: httpx.Response) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[GetVersionResponse200]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -71,21 +69,23 @@ def sync_detailed(
*,
_client: Client,
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
) -> Response[GetVersionResponse200]:
"""Return Running Software Version.
This endpoint returns a 200 status code when the HTTP server is up running and the environment
dependencies (e.g.
the database) are responsive as well.
This endpoint returns the version of Ory Hydra.
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 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.
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[HealthNotReadyStatus, HealthStatus]]
Response[GetVersionResponse200]
"""
@ -99,27 +99,29 @@ def sync_detailed(
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
*,
_client: Client,
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
) -> Optional[GetVersionResponse200]:
"""Return Running Software Version.
This endpoint returns a 200 status code when the HTTP server is up running and the environment
dependencies (e.g.
the database) are responsive as well.
This endpoint returns the version of Ory Hydra.
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 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.
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[HealthNotReadyStatus, HealthStatus]]
Response[GetVersionResponse200]
"""
@ -132,21 +134,23 @@ async def asyncio_detailed(
*,
_client: Client,
) -> Response[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
) -> Response[GetVersionResponse200]:
"""Return Running Software Version.
This endpoint returns a 200 status code when the HTTP server is up running and the environment
dependencies (e.g.
the database) are responsive as well.
This endpoint returns the version of Ory Hydra.
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 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.
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[HealthNotReadyStatus, HealthStatus]]
Response[GetVersionResponse200]
"""
@ -160,27 +164,29 @@ async def asyncio_detailed(
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
*,
_client: Client,
) -> Optional[Union[HealthNotReadyStatus, HealthStatus]]:
"""Check Readiness Status
) -> Optional[GetVersionResponse200]:
"""Return Running Software Version.
This endpoint returns a 200 status code when the HTTP server is up running and the environment
dependencies (e.g.
the database) are responsive as well.
This endpoint returns the version of Ory Hydra.
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 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.
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[HealthNotReadyStatus, HealthStatus]]
Response[GetVersionResponse200]
"""

View File

@ -1,14 +1,16 @@
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.generic_error import GenericError
from ...models.health_status import HealthStatus
from typing import cast
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:
response_200 = HealthStatus.from_dict(response.json())
@ -55,15 +57,18 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[GenericError,
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(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
@ -72,10 +77,11 @@ def sync_detailed(
_client: Client,
) -> 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 status does currently not include checks whether the database connection is working.
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
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
`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
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[GenericError, HealthStatus]]
"""
@ -98,17 +108,18 @@ def sync_detailed(
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
*,
_client: Client,
) -> 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 status does currently not include checks whether the database connection is working.
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
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
`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
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[GenericError, HealthStatus]]
"""
@ -131,10 +146,11 @@ async def asyncio_detailed(
_client: Client,
) -> 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 status does currently not include checks whether the database connection is working.
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
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
`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
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[GenericError, HealthStatus]]
"""
@ -157,17 +177,18 @@ async def asyncio_detailed(
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
*,
_client: Client,
) -> 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 status does currently not include checks whether the database connection is working.
This endpoint returns a HTTP 200 status code when Ory Hydra is accepting incoming
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
`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
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[GenericError, HealthStatus]]
"""

View 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

View File

@ -1,26 +1,27 @@
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_redirect_browser_to import OAuth20RedirectBrowserTo
from ...models.the_request_payload_used_to_accept_a_consent_request import TheRequestPayloadUsedToAcceptAConsentRequest
from typing import cast
from ...models.completed_request import CompletedRequest
from ...models.generic_error import GenericError
from ...models.accept_consent_request import AcceptConsentRequest
from typing import Dict
def _get_kwargs(
*,
_client: Client,
json_body: AcceptConsentRequest,
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
consent_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/consent/accept".format(
url = "{}/admin/oauth2/auth/requests/consent/accept".format(
_client.base_url)
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:
response_200 = CompletedRequest.from_dict(response.json())
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
_client: Client,
json_body: AcceptConsentRequest,
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
) -> Response[OAuth20RedirectBrowserTo]:
"""Accept OAuth 2.0 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
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 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
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 Hydra that the subject has authorized the OAuth 2.0 client to access
resources on his/her behalf.
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens,
and if the
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 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 (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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -142,49 +137,52 @@ consent_challenge=consent_challenge,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
*,
_client: Client,
json_body: AcceptConsentRequest,
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
) -> Optional[OAuth20RedirectBrowserTo]:
"""Accept OAuth 2.0 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
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 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
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 Hydra that the subject has authorized the OAuth 2.0 client to access
resources on his/her behalf.
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens,
and if the
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 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 (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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -198,44 +196,47 @@ consent_challenge=consent_challenge,
async def asyncio_detailed(
*,
_client: Client,
json_body: AcceptConsentRequest,
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
consent_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
) -> Response[OAuth20RedirectBrowserTo]:
"""Accept OAuth 2.0 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
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 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
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 Hydra that the subject has authorized the OAuth 2.0 client to access
resources on his/her behalf.
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens,
and if the
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 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 (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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -251,49 +252,52 @@ consent_challenge=consent_challenge,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
*,
_client: Client,
json_body: AcceptConsentRequest,
json_body: TheRequestPayloadUsedToAcceptAConsentRequest,
consent_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Accept a Consent Request
) -> Optional[OAuth20RedirectBrowserTo]:
"""Accept OAuth 2.0 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
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 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
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 Hydra that the subject has authorized the OAuth 2.0 client to access
resources on his/her behalf.
This endpoint tells Ory that the subject has authorized the OAuth 2.0 client to access resources on
his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens,
and if the
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 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 (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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,26 +1,27 @@
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
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,
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
login_challenge: str,
) -> Dict[str, Any]:
url = "{}/oauth2/auth/requests/login/reject".format(
url = "{}/admin/oauth2/auth/requests/login/reject".format(
_client.base_url)
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:
response_200 = CompletedRequest.from_dict(response.json())
response_200 = OAuth20RedirectBrowserTo.from_dict(response.json())
return response_200
if response.status_code == HTTPStatus.BAD_REQUEST:
response_400 = GenericError.from_dict(response.json())
if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
else:
return None
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]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[OAuth20RedirectBrowserTo]:
return Response(
status_code=response.status_code,
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
parsed=_parse_response(client=client, response=response),
)
def sync_detailed(
*,
_client: Client,
json_body: RejectRequest,
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
) -> Response[OAuth20RedirectBrowserTo]:
"""Reject OAuth 2.0 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\").
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 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
was be denied.
was denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
Args:
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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -147,42 +127,42 @@ login_challenge=login_challenge,
**kwargs,
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
def sync(
*,
_client: Client,
json_body: RejectRequest,
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
) -> Optional[OAuth20RedirectBrowserTo]:
"""Reject OAuth 2.0 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\").
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 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
was be denied.
was denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
Args:
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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -196,37 +176,37 @@ login_challenge=login_challenge,
async def asyncio_detailed(
*,
_client: Client,
json_body: RejectRequest,
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
login_challenge: str,
) -> Response[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
) -> Response[OAuth20RedirectBrowserTo]:
"""Reject OAuth 2.0 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\").
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 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
was be denied.
was denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
Args:
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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""
@ -242,42 +222,42 @@ login_challenge=login_challenge,
**kwargs
)
return _build_response(response=response)
return _build_response(client=_client, response=response)
async def asyncio(
*,
_client: Client,
json_body: RejectRequest,
json_body: TheRequestPayloadUsedToAcceptALoginOrConsentRequest,
login_challenge: str,
) -> Optional[Union[CompletedRequest, GenericError]]:
"""Reject a Login Request
) -> Optional[OAuth20RedirectBrowserTo]:
"""Reject OAuth 2.0 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\").
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 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
was be denied.
was denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
Args:
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:
Response[Union[CompletedRequest, GenericError]]
Response[OAuth20RedirectBrowserTo]
"""

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,13 +4,26 @@ import attr
@attr.s(auto_attribs=True)
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
cookies: 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)
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]:
""" 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 """
token: str
prefix: str = "Bearer"
auth_header_name: str = "Authorization"
def get_headers(self) -> Dict[str, str]:
""" Get headers to be used in authenticated endpoints """
return {"Authorization": f"Bearer {self.token}", **self.headers}
"""Get headers to be used in authenticated endpoints"""
auth_header_value = f"{self.prefix} {self.token}" if self.prefix else self.token
return {self.auth_header_name: auth_header_value, **self.headers}

View File

@ -1,49 +1,95 @@
""" Contains all the data models used in inputs/outputs """
from .accept_consent_request import AcceptConsentRequest
from .accept_login_request import AcceptLoginRequest
from .completed_request import CompletedRequest
from .consent_request import ConsentRequest
from .consent_request_session import ConsentRequestSession
from .consent_request_session_access_token import ConsentRequestSessionAccessToken
from .consent_request_session_id_token import ConsentRequestSessionIdToken
from .container_wait_ok_body_error import ContainerWaitOKBodyError
from .flush_inactive_o_auth_2_tokens_request import FlushInactiveOAuth2TokensRequest
from .contains_information_about_an_ongoing_logout_request import ContainsInformationAboutAnOngoingLogoutRequest
from .contains_information_on_an_ongoing_consent_request import ContainsInformationOnAnOngoingConsentRequest
from .contains_information_on_an_ongoing_login_request import ContainsInformationOnAnOngoingLoginRequest
from .contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
from .contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims import ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims
from .create_json_web_key_set import CreateJsonWebKeySet
from .error_o_auth_2 import ErrorOAuth2
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_errors import HealthNotReadyStatusErrors
from .health_status import HealthStatus
from .introspect_o_auth_2_token_data import IntrospectOAuth2TokenData
from .jose_json_web_key_set import JoseJSONWebKeySet
from .json_raw_message import JSONRawMessage
from .json_web_key import JSONWebKey
from .json_web_key_set import JSONWebKeySet
from .json_web_key_set_generator_request import JsonWebKeySetGeneratorRequest
from .login_request import LoginRequest
from .logout_request import LogoutRequest
from .o_auth_2_client import OAuth2Client
from .o_auth_2_token_introspection import OAuth2TokenIntrospection
from .o_auth_2_token_introspection_ext import OAuth2TokenIntrospectionExt
from .oauth_2_token_data import Oauth2TokenData
from .oauth_2_token_response import Oauth2TokenResponse
from .open_id_connect_context import OpenIDConnectContext
from .open_id_connect_context_id_token_hint_claims import OpenIDConnectContextIdTokenHintClaims
from .plugin_config import PluginConfig
from .plugin_config_args import PluginConfigArgs
from .plugin_config_interface import PluginConfigInterface
from .plugin_config_linux import PluginConfigLinux
from .plugin_config_network import PluginConfigNetwork
from .plugin_config_rootfs import PluginConfigRootfs
from .plugin_config_user import PluginConfigUser
from .plugin_device import PluginDevice
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 .introspected_o_auth_2_token import IntrospectedOAuth2Token
from .introspected_o_auth_2_token_ext import IntrospectedOAuth2TokenExt
from .is_ready_response_200 import IsReadyResponse200
from .is_ready_response_503 import IsReadyResponse503
from .is_ready_response_503_errors import IsReadyResponse503Errors
from .json_patch import JsonPatch
from .json_web_key import JsonWebKey
from .json_web_key_set import JsonWebKeySet
from .o_auth_20_client import OAuth20Client
from .o_auth_20_client_token_lifespans import OAuth20ClientTokenLifespans
from .o_auth_20_consent_session import OAuth20ConsentSession
from .o_auth_20_consent_session_expires_at import OAuth20ConsentSessionExpiresAt
from .o_auth_20_redirect_browser_to import OAuth20RedirectBrowserTo
from .o_auth_2_token_exchange import OAuth2TokenExchange
from .oauth_2_token_exchange_data import Oauth2TokenExchangeData
from .oidc_user_info import OidcUserInfo
from .open_id_connect_discovery_metadata import OpenIDConnectDiscoveryMetadata
from .pagination import Pagination
from .pagination_headers import PaginationHeaders
from .pagination_request_parameters import PaginationRequestParameters
from .pagination_response_header import PaginationResponseHeader
from .pass_session_data_to_a_consent_request import PassSessionDataToAConsentRequest
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 .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",
)

View File

@ -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

View File

@ -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

View File

@ -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
@ -7,18 +7,29 @@ import attr
from ..types import UNSET, Unset
from typing import cast
from ..types import UNSET, Unset
from typing import Dict
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)
class LogoutRequest:
class ContainsInformationAboutAnOngoingLogoutRequest:
"""
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.
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.
@ -26,6 +37,8 @@ class LogoutRequest:
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
rp_initiated: Union[Unset, bool] = UNSET
sid: Union[Unset, str] = UNSET
@ -34,6 +47,12 @@ class LogoutRequest:
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
rp_initiated = self.rp_initiated
sid = self.sid
@ -43,6 +62,10 @@ class LogoutRequest:
field_dict.update(self.additional_properties)
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:
field_dict["request_url"] = request_url
if rp_initiated is not UNSET:
@ -58,7 +81,20 @@ class LogoutRequest:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.o_auth_20_client import OAuth20Client
_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)
rp_initiated = _d.pop("rp_initiated", UNSET)
@ -67,15 +103,17 @@ class LogoutRequest:
subject = _d.pop("subject", UNSET)
logout_request = cls(
contains_information_about_an_ongoing_logout_request = cls(
challenge=challenge,
client=client,
request_url=request_url,
rp_initiated=rp_initiated,
sid=sid,
subject=subject,
)
logout_request.additional_properties = _d
return logout_request
contains_information_about_an_ongoing_logout_request.additional_properties = _d
return contains_information_about_an_ongoing_logout_request
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -7,19 +7,23 @@ import attr
from ..types import UNSET, Unset
from ..types import UNSET, Unset
from typing import cast
from typing import Union
from typing import Dict
from typing import cast
from ..types import UNSET, Unset
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)
class ConsentRequest:
class ContainsInformationOnAnOngoingConsentRequest:
"""
Attributes:
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
authentication session. You can use it
to express that, for example, a user authenticated using two factor authentication.
client (Union[Unset, OAuth2Client]):
context (Union[Unset, JSONRawMessage]):
amr (Union[Unset, List[str]]):
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
can be used to associate
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
Front-/Back-
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
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
@ -58,11 +65,12 @@ class ConsentRequest:
challenge: str
acr: Union[Unset, str] = UNSET
client: Union[Unset, 'OAuth2Client'] = UNSET
context: Union[Unset, 'JSONRawMessage'] = UNSET
amr: Union[Unset, List[str]] = UNSET
client: Union[Unset, 'OAuth20Client'] = UNSET
context: Union[Unset, Any] = UNSET
login_challenge: 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
requested_access_token_audience: 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]:
from ..models.contains_optional_information_about_the_open_id_connect_request import ContainsOptionalInformationAboutTheOpenIDConnectRequest
from ..models.o_auth_20_client import OAuth20Client
challenge = self.challenge
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
if not isinstance(self.client, Unset):
client = self.client.to_dict()
context: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.context, Unset):
context = self.context.to_dict()
context = self.context
login_challenge = self.login_challenge
login_session_id = self.login_session_id
oidc_context: Union[Unset, Dict[str, Any]] = UNSET
@ -113,6 +127,8 @@ class ConsentRequest:
})
if acr is not UNSET:
field_dict["acr"] = acr
if amr is not UNSET:
field_dict["amr"] = amr
if client is not UNSET:
field_dict["client"] = client
if context is not UNSET:
@ -140,41 +156,38 @@ class ConsentRequest:
@classmethod
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()
challenge = _d.pop("challenge")
acr = _d.pop("acr", UNSET)
amr = cast(List[str], _d.pop("amr", UNSET))
_client = _d.pop("client", UNSET)
client: Union[Unset, OAuth2Client]
client: Union[Unset, OAuth20Client]
if isinstance(_client, Unset):
client = UNSET
else:
client = OAuth2Client.from_dict(_client)
client = OAuth20Client.from_dict(_client)
_context = _d.pop("context", UNSET)
context: Union[Unset, JSONRawMessage]
if isinstance(_context, Unset):
context = UNSET
else:
context = JSONRawMessage.from_dict(_context)
context = _d.pop("context", UNSET)
login_challenge = _d.pop("login_challenge", UNSET)
login_session_id = _d.pop("login_session_id", UNSET)
_oidc_context = _d.pop("oidc_context", UNSET)
oidc_context: Union[Unset, OpenIDConnectContext]
oidc_context: Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]
if isinstance(_oidc_context, Unset):
oidc_context = UNSET
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)
consent_request = cls(
contains_information_on_an_ongoing_consent_request = cls(
challenge=challenge,
acr=acr,
amr=amr,
client=client,
context=context,
login_challenge=login_challenge,
@ -206,8 +220,8 @@ class ConsentRequest:
subject=subject,
)
consent_request.additional_properties = _d
return consent_request
contains_information_on_an_ongoing_consent_request.additional_properties = _d
return contains_information_on_an_ongoing_consent_request
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -7,24 +7,30 @@ import attr
from ..types import UNSET, Unset
from typing import Union
from typing import Dict
from typing import cast
from ..types import UNSET, Unset
from typing import Union
from typing import cast
from typing import Dict
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)
class LoginRequest:
class ContainsInformationOnAnOngoingLoginRequest:
"""
Attributes:
challenge (str): ID is the identifier ("login challenge") of the login request. It is used to
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
is the URL which
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
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.
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
cookie / remember flag)
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
client: 'OAuth2Client'
client: 'OAuth20Client'
request_url: str
requested_access_token_audience: List[str]
requested_scope: List[str]
skip: bool
subject: str
oidc_context: Union[Unset, 'OpenIDConnectContext'] = UNSET
oidc_context: Union[Unset, 'ContainsOptionalInformationAboutTheOpenIDConnectRequest'] = UNSET
session_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
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
client = self.client.to_dict()
@ -107,10 +115,12 @@ class LoginRequest:
@classmethod
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()
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")
_oidc_context = _d.pop("oidc_context", UNSET)
oidc_context: Union[Unset, OpenIDConnectContext]
oidc_context: Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequest]
if isinstance(_oidc_context, Unset):
oidc_context = UNSET
else:
oidc_context = OpenIDConnectContext.from_dict(_oidc_context)
oidc_context = ContainsOptionalInformationAboutTheOpenIDConnectRequest.from_dict(_oidc_context)
session_id = _d.pop("session_id", UNSET)
login_request = cls(
contains_information_on_an_ongoing_login_request = cls(
challenge=challenge,
client=client,
request_url=request_url,
@ -151,8 +161,8 @@ class LoginRequest:
session_id=session_id,
)
login_request.additional_properties = _d
return login_request
contains_information_on_an_ongoing_login_request.additional_properties = _d
return contains_information_on_an_ongoing_login_request
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -7,19 +7,22 @@ import attr
from ..types import UNSET, Unset
from ..types import UNSET, Unset
from typing import cast
from typing import Union
from typing import Dict
from typing import cast
from ..types import UNSET, Unset
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)
class OpenIDConnectContext:
class ContainsOptionalInformationAboutTheOpenIDConnectRequest:
"""
Attributes:
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
appropriate display.
id_token_hint_claims (Union[Unset, OpenIDConnectContextIdTokenHintClaims]): IDTokenHintClaims are the claims of
the ID Token previously issued by the Authorization Server being passed as a hint about the
id_token_hint_claims (Union[Unset, ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims]):
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.
login_hint (Union[Unset, str]): LoginHint hints about the login identifier the End-User might use to log in (if
necessary).
@ -68,13 +72,14 @@ class OpenIDConnectContext:
acr_values: Union[Unset, List[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
ui_locales: Union[Unset, List[str]] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
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
if not isinstance(self.acr_values, Unset):
acr_values = self.acr_values
@ -117,6 +122,7 @@ class OpenIDConnectContext:
@classmethod
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()
acr_values = cast(List[str], _d.pop("acr_values", UNSET))
@ -124,11 +130,11 @@ class OpenIDConnectContext:
display = _d.pop("display", 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):
id_token_hint_claims = UNSET
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))
open_id_connect_context = cls(
contains_optional_information_about_the_open_id_connect_request = cls(
acr_values=acr_values,
display=display,
id_token_hint_claims=id_token_hint_claims,
@ -146,8 +152,8 @@ class OpenIDConnectContext:
ui_locales=ui_locales,
)
open_id_connect_context.additional_properties = _d
return open_id_connect_context
contains_optional_information_about_the_open_id_connect_request.additional_properties = _d
return contains_optional_information_about_the_open_id_connect_request
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -11,10 +11,11 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="OpenIDConnectContextIdTokenHintClaims")
T = TypeVar("T", bound="ContainsOptionalInformationAboutTheOpenIDConnectRequestIdTokenHintClaims")
@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
hint about the
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
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
_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
return open_id_connect_context_id_token_hint_claims
contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims.additional_properties = _d
return contains_optional_information_about_the_open_id_connect_request_id_token_hint_claims
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -11,15 +11,23 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="JsonWebKeySetGeneratorRequest")
T = TypeVar("T", bound="CreateJsonWebKeySet")
@attr.s(auto_attribs=True)
class JsonWebKeySetGeneratorRequest:
"""
class CreateJsonWebKeySet:
"""Create JSON Web Key Set Request Body
Attributes:
alg (str): The algorithm to be used for creating the key. Supports "RS256", "ES512", "HS512", and "HS256"
kid (str): The kid of the key to be created
use (str): The "use" (public key use) parameter identifies the intended use of
alg (str): JSON Web Key Algorithm
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
a public key is used for encrypting data or verifying the signature
on data. Valid values are "enc" and "sig".
@ -57,14 +65,14 @@ class JsonWebKeySetGeneratorRequest:
use = _d.pop("use")
json_web_key_set_generator_request = cls(
create_json_web_key_set = cls(
alg=alg,
kid=kid,
use=use,
)
json_web_key_set_generator_request.additional_properties = _d
return json_web_key_set_generator_request
create_json_web_key_set.additional_properties = _d
return create_json_web_key_set
@property
def additional_keys(self) -> List[str]:

View 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

View File

@ -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
@ -13,45 +13,73 @@ from typing import Union
T = TypeVar("T", bound="GenericError")
@attr.s(auto_attribs=True)
class GenericError:
"""Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.
"""
Attributes:
error (str): Name is the error name. Example: The requested resource could not be found.
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.
error_description (Union[Unset, str]): Description contains further information on the nature of the error.
Example: Object with ID 12345 does not exist.
status_code (Union[Unset, int]): Code represents the error status code (404, 403, 401, ...). Example: 404.
message (str): Error message
The error's message. Example: The resource could not be found.
code (Union[Unset, int]): The status code Example: 404.
debug (Union[Unset, str]): Debug information
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
error_description: Union[Unset, str] = UNSET
status_code: Union[Unset, int] = UNSET
details: Union[Unset, Any] = 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)
def to_dict(self) -> Dict[str, Any]:
error = self.error
message = self.message
code = self.code
debug = self.debug
error_description = self.error_description
status_code = self.status_code
details = self.details
id = self.id
reason = self.reason
request = self.request
status = self.status
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({
"error": error,
"message": message,
})
if code is not UNSET:
field_dict["code"] = code
if debug is not UNSET:
field_dict["debug"] = debug
if error_description is not UNSET:
field_dict["error_description"] = error_description
if status_code is not UNSET:
field_dict["status_code"] = status_code
if details is not UNSET:
field_dict["details"] = details
if id is not UNSET:
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
@ -60,19 +88,31 @@ class GenericError:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
_d = src_dict.copy()
error = _d.pop("error")
message = _d.pop("message")
code = _d.pop("code", 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(
error=error,
message=message,
code=code,
debug=debug,
error_description=error_description,
status_code=status_code,
details=details,
id=id,
reason=reason,
request=request,
status=status,
)
generic_error.additional_properties = _d

View File

@ -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
@ -13,29 +13,29 @@ from typing import Union
T = TypeVar("T", bound="ContainerWaitOKBodyError")
T = TypeVar("T", bound="GetVersionResponse200")
@attr.s(auto_attribs=True)
class ContainerWaitOKBodyError:
"""ContainerWaitOKBodyError container waiting error, if any
class GetVersionResponse200:
"""
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)
def to_dict(self) -> Dict[str, Any]:
message = self.message
version = self.version
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({
})
if message is not UNSET:
field_dict["Message"] = message
if version is not UNSET:
field_dict["version"] = version
return field_dict
@ -44,14 +44,14 @@ class ContainerWaitOKBodyError:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
_d = src_dict.copy()
message = _d.pop("Message", UNSET)
version = _d.pop("version", UNSET)
container_wait_ok_body_error = cls(
message=message,
get_version_response_200 = cls(
version=version,
)
container_wait_ok_body_error.additional_properties = _d
return container_wait_ok_body_error
get_version_response_200.additional_properties = _d
return get_version_response_200
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -7,25 +7,26 @@ import attr
from ..types import UNSET, Unset
from typing import Union
from typing import cast
from typing import cast, List
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)
class AcceptLoginRequest:
class HandledLoginRequestIsTheRequestPayloadUsedToAcceptALoginRequest:
"""
Attributes:
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
authentication session. You can use it
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-
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
@ -58,7 +59,8 @@ class AcceptLoginRequest:
subject: str
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
remember: Union[Unset, bool] = UNSET
remember_for: Union[Unset, int] = UNSET
@ -68,10 +70,14 @@ class AcceptLoginRequest:
def to_dict(self) -> Dict[str, Any]:
subject = self.subject
acr = self.acr
context: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.context, Unset):
context = self.context.to_dict()
amr: Union[Unset, List[str]] = UNSET
if not isinstance(self.amr, Unset):
amr = self.amr
context = self.context
force_subject_identifier = self.force_subject_identifier
remember = self.remember
remember_for = self.remember_for
@ -83,6 +89,8 @@ class AcceptLoginRequest:
})
if acr is not UNSET:
field_dict["acr"] = acr
if amr is not UNSET:
field_dict["amr"] = amr
if context is not UNSET:
field_dict["context"] = context
if force_subject_identifier is not UNSET:
@ -103,15 +111,10 @@ class AcceptLoginRequest:
acr = _d.pop("acr", UNSET)
_context = _d.pop("context", UNSET)
context: Union[Unset, JSONRawMessage]
if isinstance(_context, Unset):
context = UNSET
else:
context = JSONRawMessage.from_dict(_context)
amr = cast(List[str], _d.pop("amr", UNSET))
context = _d.pop("context", UNSET)
force_subject_identifier = _d.pop("force_subject_identifier", UNSET)
@ -119,17 +122,18 @@ class AcceptLoginRequest:
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,
acr=acr,
amr=amr,
context=context,
force_subject_identifier=force_subject_identifier,
remember=remember,
remember_for=remember_for,
)
accept_login_request.additional_properties = _d
return accept_login_request
handled_login_request_is_the_request_payload_used_to_accept_a_login_request.additional_properties = _d
return handled_login_request_is_the_request_payload_used_to_accept_a_login_request
@property
def additional_keys(self) -> List[str]:

View File

@ -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
@ -7,10 +7,13 @@ import attr
from ..types import UNSET, Unset
from typing import Union
from typing import cast
from ..types import UNSET, Unset
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]:
from ..models.health_not_ready_status_errors import HealthNotReadyStatusErrors
errors: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.errors, Unset):
errors = self.errors.to_dict()
@ -48,6 +52,7 @@ class HealthNotReadyStatus:
@classmethod
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()
_errors = _d.pop("errors", UNSET)
errors: Union[Unset, HealthNotReadyStatusErrors]

View File

@ -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
@ -11,6 +11,7 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="HealthNotReadyStatusErrors")
@attr.s(auto_attribs=True)
@ -39,6 +40,7 @@ class HealthNotReadyStatusErrors:
health_not_ready_status_errors = cls(
)
health_not_ready_status_errors.additional_properties = _d
return health_not_ready_status_errors

View File

@ -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
@ -13,6 +13,7 @@ from typing import Union
T = TypeVar("T", bound="HealthStatus")
@attr.s(auto_attribs=True)

Some files were not shown because too many files have changed in this diff Show More