File tree 9 files changed +16
-31
lines changed
9 files changed +16
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -77,14 +77,14 @@ jobs:
77
77
uses : actions/upload-artifact@v4
78
78
with :
79
79
name : coverage-${{ matrix.os }}-${{ matrix.ruby }}-${{ env.SANITIZED_GEMFILE }}
80
- path : coverage-* /*.json
80
+ path : coverage/*.json
81
81
retention-days : 1
82
82
83
83
coverage :
84
- name : Report coverage to Code Climate
84
+ name : Report coverage to Qlty
85
85
runs-on : ubuntu-latest
86
86
needs : test
87
- if : success() && github.ref == 'refs/heads/main'
87
+ if : success()
88
88
steps :
89
89
- uses : actions/checkout@v4
90
90
@@ -93,12 +93,10 @@ jobs:
93
93
with :
94
94
merge-multiple : true
95
95
96
- -
uses :
paambaati/[email protected]
97
- env :
98
- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
96
+ - uses : qltysh/qlty-action/coverage@main
99
97
with :
100
- coverageLocations : |
101
- ${{github.workspace}}/ coverage-* /*.json:simplecov
98
+ token : ${{ secrets.QLTY_COVERAGE_TOKEN }}
99
+ files : coverage/*.json
102
100
103
101
smoke :
104
102
name : Built GEM smoke test
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 2
2
3
3
[ ![ Gem Version] ( https://badge.fury.io/rb/jwt.svg )] ( https://badge.fury.io/rb/jwt )
4
4
[ ![ Build Status] ( https://github.com/jwt/ruby-jwt/actions/workflows/test.yml/badge.svg?branch=main )] ( https://github.com/jwt/ruby-jwt/actions )
5
- [ ![ Code Climate] ( https://codeclimate.com/github/jwt/ruby-jwt/badges/gpa.svg )] ( https://codeclimate.com/github/jwt/ruby-jwt )
6
- [ ![ Test Coverage] ( https://codeclimate.com/github/jwt/ruby-jwt/badges/coverage.svg )] ( https://codeclimate.com/github/jwt/ruby-jwt/coverage )
7
- [ ![ Issue Count] ( https://codeclimate.com/github/jwt/ruby-jwt/badges/issue_count.svg )] ( https://codeclimate.com/github/jwt/ruby-jwt )
5
+ [ ![ Maintainability] ( https://qlty.sh/badges/eefe957e-cf90-41f6-b78b-909837542c5f/maintainability.svg )] ( https://qlty.sh/gh/anakinj/projects/ruby-jwt )
6
+ [ ![ Code Coverage] ( https://qlty.sh/badges/eefe957e-cf90-41f6-b78b-909837542c5f/test_coverage.svg )] ( https://qlty.sh/gh/anakinj/projects/ruby-jwt )
8
7
9
8
A ruby implementation of the [ RFC 7519 OAuth JSON Web Token (JWT)] ( https://tools.ietf.org/html/rfc7519 ) standard.
10
9
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