]> git.ipfire.org Git - pbs.git/commitdiff
auth: Allow to configure only authenticating builders
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Oct 2022 13:33:52 +0000 (13:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Oct 2022 13:33:52 +0000 (13:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hub/handlers.py
src/hub/queue.py

index 95af230f73c8f993f7da5ef8b1a86261480e4c53..4a9d37a9c5960e675e14afbe6568a2be60cd2d71 100644 (file)
@@ -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)
 
index 1a10d95b4f681724eb43361e86a34d9bb89bdd59..32f50b352d44f240a43c8fd0271a6435aa72d6e6 100644 (file)
@@ -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):