diff options
Diffstat (limited to 'app/workers/mail_scheduler/notification_service_worker.rb')
-rw-r--r-- | app/workers/mail_scheduler/notification_service_worker.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/workers/mail_scheduler/notification_service_worker.rb b/app/workers/mail_scheduler/notification_service_worker.rb index 25c9ac5547b..12e8de4491e 100644 --- a/app/workers/mail_scheduler/notification_service_worker.rb +++ b/app/workers/mail_scheduler/notification_service_worker.rb @@ -18,6 +18,12 @@ module MailScheduler def perform(meth, *args) check_arguments!(args) + if ::Feature.enabled?(:verify_mail_scheduler_notification_service_worker_method_names) && + NotificationService.permitted_actions.exclude?(meth.to_sym) + + raise(ArgumentError, "#{meth} not allowed for #{self.class.name}") + end + deserialized_args = ActiveJob::Arguments.deserialize(args) notification_service.public_send(meth, *deserialized_args) # rubocop:disable GitlabSecurity/PublicSend rescue ActiveJob::DeserializationError |