From dee42dd14dc7786b1ccf9465bb28dfe74024166c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 9 Mar 2023 04:39:37 +0300 Subject: 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. --- gn3/auth/authorisation/errors.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gn3/auth/authorisation') 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""" -- cgit v1.2.3