Commit e1db24b5 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-25' into 'master'

Fix leaky constant in jwt spec

See merge request gitlab-org/gitlab!32093
parents 1e030be7 cffb99a8
......@@ -372,7 +372,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
- 'spec/lib/gitlab/view/presenter/factory_spec.rb'
- 'spec/lib/marginalia_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/lib/system_check/simple_executor_spec.rb'
- 'spec/mailers/notify_spec.rb'
- 'spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb'
......
---
title: Fix leaky constant issue in jwt spec
merge_request: 32093
author: Rajendra Kadam
type: fixed
......@@ -35,7 +35,7 @@ describe OmniAuth::Strategies::Jwt do
end
end
ECDSA_NAMED_CURVES = {
ecdsa_named_curves = {
'ES256' => 'prime256v1',
'ES384' => 'secp384r1',
'ES512' => 'secp521r1'
......@@ -54,7 +54,7 @@ describe OmniAuth::Strategies::Jwt do
private_key_class.generate(2048)
.to_pem
elsif private_key_class == OpenSSL::PKey::EC
private_key_class.new(ECDSA_NAMED_CURVES[algorithm])
private_key_class.new(ecdsa_named_curves[algorithm])
.tap { |key| key.generate_key! }
.to_pem
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment