From eb7dfdd1df48acccee22b736c4ca0ac1ec0a9826 Mon Sep 17 00:00:00 2001 From: "robin.hruska@teskalabs.com" Date: Fri, 25 Oct 2024 17:30:40 +0200 Subject: [PATCH] it is a real introspection, not mock --- asab/web/auth/service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/asab/web/auth/service.py b/asab/web/auth/service.py index 94062757..ba156334 100644 --- a/asab/web/auth/service.py +++ b/asab/web/auth/service.py @@ -142,12 +142,12 @@ def _prepare_mock_mode(self): """ Try to set up direct introspection. In not available, set up static mock userinfo. """ - mock_introspection_url = Config.get("auth", "mock_introspection_url", fallback=None) - if mock_introspection_url is not None: - self.MockIntrospectionUrl = mock_introspection_url + introspection_url = Config.get("auth", "introspection_url", fallback=None) + if introspection_url is not None: + self.IntrospectionUrl = introspection_url L.warning( "AuthService is running in MOCK MODE. Web requests will be authorized with direct introspection " - "call to {!r}.".format(self.MockIntrospectionUrl) + "call to {!r}.".format(self.IntrospectionUrl) ) return @@ -271,12 +271,12 @@ async def get_bearer_token_from_authorization_header(self, request): Validate the Authorizetion header and extract the Bearer token value """ if self.Mode == AuthMode.MOCK: - if not self.MockIntrospectionUrl: + if not self.IntrospectionUrl: return "MOCK" # Send the request headers for introspection async with aiohttp.ClientSession() as session: - async with session.post(self.MockIntrospectionUrl, headers=request.headers) as response: + async with session.post(self.IntrospectionUrl, headers=request.headers) as response: if response.status != 200: L.warning("Access token introspection failed.") raise aiohttp.web.HTTPUnauthorized()