mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Unify docstring representations based on PEP 257 https://www.python.org/dev/peps/pep-0257/ Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>
38 lines
1 KiB
Python
38 lines
1 KiB
Python
from django.core.exceptions import PermissionDenied
|
|
|
|
|
|
class AxesPermissionDenied(PermissionDenied):
|
|
"""
|
|
Base class for permission denied errors raised by axes specifically for easier debugging.
|
|
|
|
Two different types of errors are used because of the behaviour Django has:
|
|
|
|
- If an authentication backend raises a PermissionDenied error the authentication flow is aborted.
|
|
- If another component raises a PermissionDenied error a HTTP 403 Forbidden response is returned.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
class AxesSignalPermissionDenied(AxesPermissionDenied):
|
|
"""
|
|
Raised by signal handler on failed authentication attempts to send user a HTTP 403 Forbidden status code.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
class AxesBackendPermissionDenied(AxesPermissionDenied):
|
|
"""
|
|
Raised by authentication backend on locked out requests to stop the Django authentication flow.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
class AxesBackendRequestParameterRequired(ValueError):
|
|
"""
|
|
Raised by authentication backend on invalid or missing request parameter value.
|
|
"""
|
|
|
|
pass
|