mirror of
https://github.com/bringout/oca-server-auth.git
synced 2026-04-18 13:12:05 +02:00
Initial commit: OCA Server Auth packages (29 packages)
This commit is contained in:
commit
3ed80311c4
1325 changed files with 127292 additions and 0 deletions
|
|
@ -0,0 +1,54 @@
|
|||
# Copyright 2021 ACSONE SA/NV
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl)
|
||||
|
||||
from werkzeug.exceptions import InternalServerError, Unauthorized
|
||||
|
||||
|
||||
class UnauthorizedMissingAuthorizationHeader(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedMissingCookie(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedMalformedAuthorizationHeader(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedSessionMismatch(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class AmbiguousJwtValidator(InternalServerError):
|
||||
pass
|
||||
|
||||
|
||||
class JwtValidatorNotFound(InternalServerError):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedInvalidToken(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedPartnerNotFound(Unauthorized):
|
||||
pass
|
||||
|
||||
|
||||
class UnauthorizedCompositeJwtError(Unauthorized):
|
||||
"""Indicate that multiple errors occurred during JWT chain validation."""
|
||||
|
||||
def __init__(self, errors):
|
||||
self.errors = errors
|
||||
super().__init__(
|
||||
"Multiple errors occurred during JWT chain validation:\n"
|
||||
+ "\n".join(
|
||||
"{}: {}".format(validator_name, error)
|
||||
for validator_name, error in self.errors.items()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class ConfigurationError(InternalServerError):
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue