aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-03-09 04:39:37 +0300
committerFrederick Muriuki Muriithi2023-03-09 04:39:37 +0300
commitdee42dd14dc7786b1ccf9465bb28dfe74024166c (patch)
tree31af463e825d03776ac46cd859e65610dfcc5457 /gn3/auth/authorisation
parenta35d16f9a191afbb31e2c185e87e5eec5e23122f (diff)
downloadgenenetwork3-dee42dd14dc7786b1ccf9465bb28dfe74024166c.tar.gz
auth: introspection: Protect introspection endpoint
The introspection endpoint could contain privileged information, thus requires that the endpoint be protected. This commit ensures that a user has authenticated to the system and that the client they are using be one of the allowed clients.
Diffstat (limited to 'gn3/auth/authorisation')
-rw-r--r--gn3/auth/authorisation/errors.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gn3/auth/authorisation/errors.py b/gn3/auth/authorisation/errors.py
index ff28cd4..3bc7a04 100644
--- a/gn3/auth/authorisation/errors.py
+++ b/gn3/auth/authorisation/errors.py
@@ -8,6 +8,10 @@ class AuthorisationError(Exception):
"""
error_code: int = 400
+class ForbiddenAccess(AuthorisationError):
+ """Raised for forbidden access."""
+ error_code: int = 403
+
class UserRegistrationError(AuthorisationError):
"""Raised whenever a user registration fails"""