Class: RuboCop::Cop::Sidekiq::PiiInArguments

Inherits:
Base
  • Object
show all
Includes:
ArgumentTraversal
Defined in:
lib/rubocop/cop/sidekiq/pii_in_arguments.rb

Overview

Checks for PII passed as Sidekiq job arguments.

Examples:

# bad
NotifyJob.perform_async(email: '[email protected]')

# good
NotifyJob.perform_async(user_id)

Constant Summary collapse

MSG =
'Avoid passing PII in Sidekiq job arguments.'
DEFAULT_PATTERNS =
%w[email phone address].freeze
RESTRICT_ON_SEND =
PerformMethods.all

Instance Method Summary collapse

Methods included from Sidekiq::Language

#active_job_class?, #perform_call?, #sidekiq_include?, #sidekiq_options_call?

Instance Method Details

#on_send(node) ⇒ Object Also known as: on_csend



24
25
26
27
28
# File 'lib/rubocop/cop/sidekiq/pii_in_arguments.rb', line 24

def on_send(node)
  perform_call?(node) do
    check_arguments(node.arguments, allow_literal: true)
  end
end