Commit cffb99a8 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix leaky constant in jwt spec

parent d194f3dc
...@@ -372,7 +372,6 @@ RSpec/LeakyConstantDeclaration: ...@@ -372,7 +372,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
- 'spec/lib/gitlab/view/presenter/factory_spec.rb' - 'spec/lib/gitlab/view/presenter/factory_spec.rb'
- 'spec/lib/marginalia_spec.rb' - 'spec/lib/marginalia_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/lib/system_check/simple_executor_spec.rb' - 'spec/lib/system_check/simple_executor_spec.rb'
- 'spec/lib/system_check_spec.rb' - 'spec/lib/system_check_spec.rb'
- 'spec/mailers/notify_spec.rb' - 'spec/mailers/notify_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 ...@@ -35,7 +35,7 @@ describe OmniAuth::Strategies::Jwt do
end end
end end
ECDSA_NAMED_CURVES = { ecdsa_named_curves = {
'ES256' => 'prime256v1', 'ES256' => 'prime256v1',
'ES384' => 'secp384r1', 'ES384' => 'secp384r1',
'ES512' => 'secp521r1' 'ES512' => 'secp521r1'
...@@ -54,7 +54,7 @@ describe OmniAuth::Strategies::Jwt do ...@@ -54,7 +54,7 @@ describe OmniAuth::Strategies::Jwt do
private_key_class.generate(2048) private_key_class.generate(2048)
.to_pem .to_pem
elsif private_key_class == OpenSSL::PKey::EC 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! } .tap { |key| key.generate_key! }
.to_pem .to_pem
else 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