File tree 7 files changed +8
-20
lines changed 7 files changed +8
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ require 'simplecov_json_formatter'
6
6
SimpleCov . start do
7
7
command_name "Job #{ File . basename ( ENV [ 'BUNDLE_GEMFILE' ] ) } " if ENV [ 'BUNDLE_GEMFILE' ]
8
8
project_name 'Ruby JWT - Ruby JSON Web Token implementation'
9
- coverage_dir "coverage-#{ OpenSSL ::Digest ::SHA256 . hexdigest ( ENV . fetch ( 'GITHUB_STEP_SUMMARY' , nil ) ) } " if ENV [ 'GITHUB_STEP_SUMMARY' ]
10
9
add_filter 'spec'
11
10
end
12
11
Original file line number Diff line number Diff line change 3
3
source 'https://rubygems.org'
4
4
5
5
gemspec
6
-
7
- gem 'rubocop' , '~> 1.56.3' # Keep .codeclimate.yml channel in sync with this one
Original file line number Diff line number Diff line change 6
6
module JWT
7
7
# The Decode class is responsible for decoding and verifying JWT tokens.
8
8
class Decode
9
+ # Order is very important - first check for string keys, next for symbols
10
+ ALGORITHM_KEYS = [ 'algorithm' ,
11
+ :algorithm ,
12
+ 'algorithms' ,
13
+ :algorithms ] . freeze
9
14
# Initializes a new Decode instance.
10
15
#
11
16
# @param jwt [String] the JWT to decode.
@@ -70,12 +75,6 @@ def allowed_and_valid_algorithms
70
75
@allowed_and_valid_algorithms ||= allowed_algorithms . select { |alg | alg . valid_alg? ( alg_in_header ) }
71
76
end
72
77
73
- # Order is very important - first check for string keys, next for symbols
74
- ALGORITHM_KEYS = [ 'algorithm' ,
75
- :algorithm ,
76
- 'algorithms' ,
77
- :algorithms ] . freeze
78
-
79
78
def given_algorithms
80
79
alg_key = ALGORITHM_KEYS . find { |key | @options [ key ] }
81
80
Array ( @options [ alg_key ] )
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def key_digest
68
68
def []=( key , value )
69
69
raise ArgumentError , 'cannot overwrite cryptographic key attributes' if EC_KEY_ELEMENTS . include? ( key . to_sym )
70
70
71
- super ( key , value )
71
+ super
72
72
end
73
73
74
74
private
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def key_digest
64
64
def []=( key , value )
65
65
raise ArgumentError , 'cannot overwrite cryptographic key attributes' if HMAC_KEY_ELEMENTS . include? ( key . to_sym )
66
66
67
- super ( key , value )
67
+ super
68
68
end
69
69
70
70
private
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def key_digest
67
67
def []=( key , value )
68
68
raise ArgumentError , 'cannot overwrite cryptographic key attributes' if RSA_KEY_ELEMENTS . include? ( key . to_sym )
69
69
70
- super ( key , value )
70
+ super
71
71
end
72
72
73
73
private
You can’t perform that action at this time.
0 commit comments