2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2013-03-21 19:01:14 +00:00
|
|
|
include Gitlab::ShellAdapter
|
2013-01-28 15:22:45 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :source_code_management
|
2020-03-02 18:07:42 +00:00
|
|
|
urgency :high
|
2020-01-24 18:09:00 +00:00
|
|
|
weight 2
|
2020-06-12 12:08:56 +00:00
|
|
|
loggable_arguments 0
|
2019-10-18 11:11:44 +00:00
|
|
|
|
2013-01-28 19:02:10 +00:00
|
|
|
def perform(action, *arg)
|
2020-03-12 12:09:17 +00:00
|
|
|
# Gitlab::Shell is being removed but we need to continue to process jobs
|
|
|
|
# enqueued in the previous release, so handle them here.
|
|
|
|
#
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/25095 for more details
|
2020-03-23 18:09:25 +00:00
|
|
|
if AuthorizedKeysWorker::PERMITTED_ACTIONS.include?(action.to_s)
|
2020-03-12 12:09:17 +00:00
|
|
|
AuthorizedKeysWorker.new.perform(action, *arg)
|
|
|
|
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2019-11-18 18:06:53 +00:00
|
|
|
Gitlab::GitalyClient::NamespaceService.allow do
|
|
|
|
gitlab_shell.__send__(action, *arg) # rubocop:disable GitlabSecurity/PublicSend
|
|
|
|
end
|
2013-01-28 15:22:45 +00:00
|
|
|
end
|
|
|
|
end
|