keycloak.exceptions
Keycloak custom exceptions module.
Exceptions
Base class for custom Keycloak errors. |
|
Keycloak authentication error exception. |
|
Keycloak connection error exception. |
|
Keycloak operation error exception. |
|
Keycloak deprecation error exception. |
|
Keycloak request get error exception. |
|
Keycloak request post error exception. |
|
Keycloak request put error exception. |
|
Keycloak request delete error exception. |
|
Keycloak secret not found exception. |
|
Keycloak RPT not found exception. |
|
Keycloak authorization config exception. |
|
Keycloak invalid token exception. |
|
Keycloak permission format exception. |
|
Keycloak permission definition exception. |
Functions
|
Raise an exception for the response. |
Module Contents
- exception keycloak.exceptions.KeycloakError(error_message='', response_code=None, response_body=None)[source]
Bases:
Exception
Base class for custom Keycloak errors.
- Parameters:
error_message (str) – The error message
response_code (int) – The response status code
- exception keycloak.exceptions.KeycloakAuthenticationError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakError
Keycloak authentication error exception.
- exception keycloak.exceptions.KeycloakConnectionError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakError
Keycloak connection error exception.
- exception keycloak.exceptions.KeycloakOperationError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakError
Keycloak operation error exception.
- exception keycloak.exceptions.KeycloakDeprecationError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakError
Keycloak deprecation error exception.
- exception keycloak.exceptions.KeycloakGetError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak request get error exception.
- exception keycloak.exceptions.KeycloakPostError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak request post error exception.
- exception keycloak.exceptions.KeycloakPutError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak request put error exception.
- exception keycloak.exceptions.KeycloakDeleteError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak request delete error exception.
- exception keycloak.exceptions.KeycloakSecretNotFound(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak secret not found exception.
- exception keycloak.exceptions.KeycloakRPTNotFound(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak RPT not found exception.
- exception keycloak.exceptions.KeycloakAuthorizationConfigError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak authorization config exception.
- exception keycloak.exceptions.KeycloakInvalidTokenError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak invalid token exception.
- exception keycloak.exceptions.KeycloakPermissionFormatError(error_message='', response_code=None, response_body=None)[source]
Bases:
KeycloakOperationError
Keycloak permission format exception.
- exception keycloak.exceptions.PermissionDefinitionError[source]
Bases:
Exception
Keycloak permission definition exception.
- keycloak.exceptions.raise_error_from_response(response, error, expected_codes=None, skip_exists=False)[source]
Raise an exception for the response.
- Parameters:
response (Response) – The response object
error (dict or Exception) – Error object to raise
expected_codes (Sequence[int]) – Set of expected codes, which should not raise the exception
skip_exists (bool) – Indicates whether the response on already existing object should be ignored
- Returns:
Content of the response message
- Type:
bytes or dict
- Raises:
KeycloakError – In case of unexpected status codes