Class: AuthorizedKeysWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker
Defined in:
app/workers/authorized_keys_worker.rb

Constant Summary collapse

PERMITTED_ACTIONS =
%w[add_key remove_key].freeze

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(action, *args) ⇒ Object


14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/workers/authorized_keys_worker.rb', line 14

def perform(action, *args)
  return unless Gitlab::CurrentSettings.authorized_keys_enabled?

  case action.to_s
  when 'add_key'
    authorized_keys.add_key(*args)
  when 'remove_key'
    authorized_keys.remove_key(*args)
  else
    raise "Unknown action: #{action.inspect}"
  end
end