]> git.ipfire.org Git - pbs.git/commitdiff
web: Add handler that disables authentication
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Jan 2025 18:23:18 +0000 (18:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Jan 2025 18:23:18 +0000 (18:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/base.py

index a2ba35f2cd8c8ffa1cc03e23dc12027718f555bd..58715242d6cf73d05e906b9822add1d64b78619c 100644 (file)
@@ -825,3 +825,13 @@ class AdminHandler(BaseHandler):
                # Fail if we don't have admin right
                if not self.current_user.is_admin():
                        raise tornado.web.HTTPError(403, "admin rights required")
+
+
+class NoAuthMixin:
+       """
+               Add this to skip the process of authentication.
+
+               This is only useful to speed up a request when never authentication is required.
+       """
+       async def get_session(self):
+               pass