Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/deployments.rb2
-rw-r--r--lib/gitlab/sidekiq_middleware/pause_control/server.rb4
-rw-r--r--lib/gitlab/sidekiq_middleware/pause_control/workers_map.rb3
-rw-r--r--lib/integrations/google_cloud_platform/jwt.rb8
4 files changed, 13 insertions, 4 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb
index 8161c2b850f..1468164081c 100644
--- a/lib/api/deployments.rb
+++ b/lib/api/deployments.rb
@@ -139,6 +139,8 @@ module API
authorize!(:create_deployment, user_project)
authorize!(:create_environment, user_project)
+ render_api_error!({ ref: ["The branch or tag does not exist"] }, 400) unless user_project.commit(declared_params[:ref])
+
environment = user_project
.environments
.find_or_create_by_name(params[:environment])
diff --git a/lib/gitlab/sidekiq_middleware/pause_control/server.rb b/lib/gitlab/sidekiq_middleware/pause_control/server.rb
index cfa02b3ec3a..7beb5f9ca5b 100644
--- a/lib/gitlab/sidekiq_middleware/pause_control/server.rb
+++ b/lib/gitlab/sidekiq_middleware/pause_control/server.rb
@@ -4,8 +4,8 @@ module Gitlab
module SidekiqMiddleware
module PauseControl
class Server
- def call(worker_class, job, _queue, &block)
- ::Gitlab::SidekiqMiddleware::PauseControl::StrategyHandler.new(worker_class, job).perform(&block)
+ def call(worker, job, _queue, &block)
+ ::Gitlab::SidekiqMiddleware::PauseControl::StrategyHandler.new(worker, job).perform(&block)
end
end
end
diff --git a/lib/gitlab/sidekiq_middleware/pause_control/workers_map.rb b/lib/gitlab/sidekiq_middleware/pause_control/workers_map.rb
index dc6aff92f50..97080dc91fc 100644
--- a/lib/gitlab/sidekiq_middleware/pause_control/workers_map.rb
+++ b/lib/gitlab/sidekiq_middleware/pause_control/workers_map.rb
@@ -17,7 +17,8 @@ module Gitlab
def strategy_for(worker:)
return unless @workers
- @workers.find { |_, v| v.include?(worker) }&.first
+ worker_class = worker.is_a?(Class) ? worker : worker.class
+ @workers.find { |_, v| v.include?(worker_class) }&.first
end
end
end
diff --git a/lib/integrations/google_cloud_platform/jwt.rb b/lib/integrations/google_cloud_platform/jwt.rb
index a103f379bc8..26343a3a9db 100644
--- a/lib/integrations/google_cloud_platform/jwt.rb
+++ b/lib/integrations/google_cloud_platform/jwt.rb
@@ -70,13 +70,19 @@ module Integrations
override :issuer
def issuer
- Settings.gitlab.host
+ Feature.enabled?(:oidc_issuer_url) ? Gitlab.config.gitlab.url : Settings.gitlab.base_url
end
override :audience
def audience
@claims[:audience]
end
+
+ override :kid
+ def kid
+ rsa_key = OpenSSL::PKey::RSA.new(key_data)
+ rsa_key.public_key.to_jwk[:kid]
+ end
end
end
end