From: Michael Tremer Date: Mon, 10 Oct 2022 13:33:52 +0000 (+0000) Subject: auth: Allow to configure only authenticating builders X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d3cc1ca260121571da5ce0496111e10873e5cbe;p=pbs.git auth: Allow to configure only authenticating builders Signed-off-by: Michael Tremer --- diff --git a/src/hub/handlers.py b/src/hub/handlers.py index 95af230f..4a9d37a9 100644 --- a/src/hub/handlers.py +++ b/src/hub/handlers.py @@ -13,6 +13,9 @@ from ..web.auth import KerberosAuthMixin log = logging.getLogger("pakfire.hub") class AuthMixin(KerberosAuthMixin): + # Allow users to authenticate + allow_users = True + """ Requires a builder or user to authenticate """ @@ -35,6 +38,10 @@ class AuthMixin(KerberosAuthMixin): return self.backend.builders.get_by_name(hostname) + # End here if users are not allowed to authenticate + if not self.allow_users: + return + # Return users return self.backend.users.get_by_name(principal) diff --git a/src/hub/queue.py b/src/hub/queue.py index 1a10d95b..32f50b35 100644 --- a/src/hub/queue.py +++ b/src/hub/queue.py @@ -78,12 +78,9 @@ class QueueHandler(BackendMixin, tornado.websocket.WebSocketHandler): For all connections, we regularly check if we have any new build jobs, and if so, we will send them the job. """ - def get_current_user(self): - name, password = self.get_basic_auth_credentials() - if name is None: - return - return self.backend.builders.auth(name, password) + # Don't allow users to authenticate + allow_users = False @property def builder(self):