From 2335a3130ac60441799b6411b65736c2e369e41c Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Thu, 27 Mar 2025 14:35:16 +0100 Subject: [PATCH] lint Signed-off-by: Marc 'risson' Schmitt --- authentik/tasks/broker.py | 4 ++-- authentik/tasks/management/commands/worker.py | 2 +- authentik/tasks/schedules/scheduler.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/authentik/tasks/broker.py b/authentik/tasks/broker.py index 461ddbb182..766d5a294d 100644 --- a/authentik/tasks/broker.py +++ b/authentik/tasks/broker.py @@ -356,7 +356,7 @@ class _PostgresConsumer(Consumer): if not self.notifies: self._poll_for_notify() - if not self.notifies and not randint(0, 300): + if not self.notifies and not randint(0, 300): # nosec # If there aren't any more notifies, randomly poll for missed/crashed messages. # Since this method is called every second, this condition limits polling to # on average one SELECT every five minutes of inactivity. @@ -393,7 +393,7 @@ class _PostgresConsumer(Consumer): def _auto_purge(self): # Automatically purge messages on average every 100k iteration. # Dramatiq defaults to 1s, so this means one purge every 28 hours. - if randint(0, 100_000): + if randint(0, 100_000): # nosec return self.logger.debug("Running garbage collector") count = self.query_set.filter( diff --git a/authentik/tasks/management/commands/worker.py b/authentik/tasks/management/commands/worker.py index ca74d4b416..e45faa56e1 100644 --- a/authentik/tasks/management/commands/worker.py +++ b/authentik/tasks/management/commands/worker.py @@ -68,7 +68,7 @@ class Command(BaseCommand): *tasks_modules, ] - os.execvp(executable_path, process_args) + os.execvp(executable_path, process_args) # nosec def _resolve_executable(self, exec_name: str): bin_dir = os.path.dirname(sys.executable) diff --git a/authentik/tasks/schedules/scheduler.py b/authentik/tasks/schedules/scheduler.py index 3eb0006bed..dc95377d72 100644 --- a/authentik/tasks/schedules/scheduler.py +++ b/authentik/tasks/schedules/scheduler.py @@ -1,4 +1,4 @@ -import pickle +import pickle # nosec import pglock from django.db import router, transaction @@ -26,8 +26,8 @@ class Scheduler: actor = self.broker.get_actor(schedule.actor_name) actor.send_with_options( - args=pickle.loads(schedule.args), - kwargs=pickle.loads(schedule.kwargs), + args=pickle.loads(schedule.args), # nosec + kwargs=pickle.loads(schedule.kwargs), # nosec options={ "schedule_uid": schedule.uid, },