jwt 2.3.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS +60 -53
  3. data/CHANGELOG.md +194 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/CONTRIBUTING.md +99 -0
  6. data/README.md +360 -106
  7. data/lib/jwt/base64.rb +19 -2
  8. data/lib/jwt/claims/audience.rb +30 -0
  9. data/lib/jwt/claims/crit.rb +35 -0
  10. data/lib/jwt/claims/decode_verifier.rb +40 -0
  11. data/lib/jwt/claims/expiration.rb +32 -0
  12. data/lib/jwt/claims/issued_at.rb +22 -0
  13. data/lib/jwt/claims/issuer.rb +34 -0
  14. data/lib/jwt/claims/jwt_id.rb +35 -0
  15. data/lib/jwt/claims/not_before.rb +32 -0
  16. data/lib/jwt/claims/numeric.rb +77 -0
  17. data/lib/jwt/claims/required.rb +33 -0
  18. data/lib/jwt/claims/subject.rb +30 -0
  19. data/lib/jwt/claims/verification_methods.rb +20 -0
  20. data/lib/jwt/claims/verifier.rb +61 -0
  21. data/lib/jwt/claims.rb +74 -0
  22. data/lib/jwt/claims_validator.rb +7 -24
  23. data/lib/jwt/configuration/container.rb +52 -0
  24. data/lib/jwt/configuration/decode_configuration.rb +70 -0
  25. data/lib/jwt/configuration/jwk_configuration.rb +28 -0
  26. data/lib/jwt/configuration.rb +23 -0
  27. data/lib/jwt/decode.rb +70 -61
  28. data/lib/jwt/deprecations.rb +49 -0
  29. data/lib/jwt/encode.rb +18 -57
  30. data/lib/jwt/encoded_token.rb +139 -0
  31. data/lib/jwt/error.rb +36 -0
  32. data/lib/jwt/json.rb +1 -1
  33. data/lib/jwt/jwa/compat.rb +32 -0
  34. data/lib/jwt/jwa/ecdsa.rb +90 -0
  35. data/lib/jwt/jwa/eddsa.rb +35 -0
  36. data/lib/jwt/jwa/hmac.rb +82 -0
  37. data/lib/jwt/jwa/hmac_rbnacl.rb +50 -0
  38. data/lib/jwt/jwa/hmac_rbnacl_fixed.rb +47 -0
  39. data/lib/jwt/jwa/none.rb +24 -0
  40. data/lib/jwt/jwa/ps.rb +35 -0
  41. data/lib/jwt/jwa/rsa.rb +35 -0
  42. data/lib/jwt/jwa/signing_algorithm.rb +63 -0
  43. data/lib/jwt/jwa/unsupported.rb +20 -0
  44. data/lib/jwt/jwa/wrapper.rb +44 -0
  45. data/lib/jwt/jwa.rb +58 -0
  46. data/lib/jwt/jwk/ec.rb +163 -63
  47. data/lib/jwt/jwk/hmac.rb +68 -24
  48. data/lib/jwt/jwk/key_base.rb +46 -6
  49. data/lib/jwt/jwk/key_finder.rb +20 -35
  50. data/lib/jwt/jwk/kid_as_key_digest.rb +16 -0
  51. data/lib/jwt/jwk/okp_rbnacl.rb +109 -0
  52. data/lib/jwt/jwk/rsa.rb +141 -54
  53. data/lib/jwt/jwk/set.rb +82 -0
  54. data/lib/jwt/jwk/thumbprint.rb +26 -0
  55. data/lib/jwt/jwk.rb +16 -11
  56. data/lib/jwt/token.rb +112 -0
  57. data/lib/jwt/verify.rb +16 -81
  58. data/lib/jwt/version.rb +53 -11
  59. data/lib/jwt/x5c_key_finder.rb +52 -0
  60. data/lib/jwt.rb +28 -4
  61. data/ruby-jwt.gemspec +15 -5
  62. metadata +75 -28
  63. data/.github/workflows/test.yml +0 -74
  64. data/.gitignore +0 -11
  65. data/.rspec +0 -2
  66. data/.rubocop.yml +0 -97
  67. data/.rubocop_todo.yml +0 -185
  68. data/.sourcelevel.yml +0 -18
  69. data/Appraisals +0 -10
  70. data/Gemfile +0 -5
  71. data/Rakefile +0 -14
  72. data/lib/jwt/algos/ecdsa.rb +0 -35
  73. data/lib/jwt/algos/eddsa.rb +0 -30
  74. data/lib/jwt/algos/hmac.rb +0 -34
  75. data/lib/jwt/algos/none.rb +0 -15
  76. data/lib/jwt/algos/ps.rb +0 -43
  77. data/lib/jwt/algos/rsa.rb +0 -19
  78. data/lib/jwt/algos/unsupported.rb +0 -17
  79. data/lib/jwt/algos.rb +0 -44
  80. data/lib/jwt/default_options.rb +0 -16
  81. data/lib/jwt/security_utils.rb +0 -57
  82. data/lib/jwt/signature.rb +0 -39
data/lib/jwt/version.rb CHANGED
@@ -1,24 +1,66 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
- # Moments version builder module
3
+ # JSON Web Token implementation
4
+ #
5
+ # Should be up to date with the latest spec:
6
+ # https://tools.ietf.org/html/rfc7519
5
7
  module JWT
8
+ # Returns the gem version of the JWT library.
9
+ #
10
+ # @return [Gem::Version] the gem version.
6
11
  def self.gem_version
7
- Gem::Version.new VERSION::STRING
12
+ Gem::Version.new(VERSION::STRING)
8
13
  end
9
14
 
10
- # Moments version builder module
15
+ # @api private
11
16
  module VERSION
12
- # major version
13
17
  MAJOR = 2
14
- # minor version
15
- MINOR = 3
16
- # tiny version
17
- TINY = 0
18
- # alpha, beta, etc. tag
18
+ MINOR = 10
19
+ TINY = 1
19
20
  PRE = nil
20
21
 
21
- # Build version string
22
22
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
23
23
  end
24
+
25
+ # Checks if the OpenSSL version is 3 or greater.
26
+ #
27
+ # @return [Boolean] true if OpenSSL version is 3 or greater, false otherwise.
28
+ # @api private
29
+ def self.openssl_3?
30
+ return false if OpenSSL::OPENSSL_VERSION.include?('LibreSSL')
31
+
32
+ true if 3 * 0x10000000 <= OpenSSL::OPENSSL_VERSION_NUMBER
33
+ end
34
+
35
+ # Checks if the RbNaCl library is defined.
36
+ #
37
+ # @return [Boolean] true if RbNaCl is defined, false otherwise.
38
+ # @api private
39
+ def self.rbnacl?
40
+ defined?(::RbNaCl)
41
+ end
42
+
43
+ # Checks if the RbNaCl library version is 6.0.0 or greater.
44
+ #
45
+ # @return [Boolean] true if RbNaCl version is 6.0.0 or greater, false otherwise.
46
+ # @api private
47
+ def self.rbnacl_6_or_greater?
48
+ rbnacl? && ::Gem::Version.new(::RbNaCl::VERSION) >= ::Gem::Version.new('6.0.0')
49
+ end
50
+
51
+ # Checks if there is an OpenSSL 3 HMAC empty key regression.
52
+ #
53
+ # @return [Boolean] true if there is an OpenSSL 3 HMAC empty key regression, false otherwise.
54
+ # @api private
55
+ def self.openssl_3_hmac_empty_key_regression?
56
+ openssl_3? && openssl_version <= ::Gem::Version.new('3.0.0')
57
+ end
58
+
59
+ # Returns the OpenSSL version.
60
+ #
61
+ # @return [Gem::Version] the OpenSSL version.
62
+ # @api private
63
+ def self.openssl_version
64
+ @openssl_version ||= ::Gem::Version.new(OpenSSL::VERSION)
65
+ end
24
66
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JWT
4
+ # If the x5c header certificate chain can be validated by trusted root
5
+ # certificates, and none of the certificates are revoked, returns the public
6
+ # key from the first certificate.
7
+ # See https://tools.ietf.org/html/rfc7515#section-4.1.6
8
+ class X5cKeyFinder
9
+ def initialize(root_certificates, crls = nil)
10
+ raise ArgumentError, 'Root certificates must be specified' unless root_certificates
11
+
12
+ @store = build_store(root_certificates, crls)
13
+ end
14
+
15
+ def from(x5c_header_or_certificates)
16
+ signing_certificate, *certificate_chain = parse_certificates(x5c_header_or_certificates)
17
+ store_context = OpenSSL::X509::StoreContext.new(@store, signing_certificate, certificate_chain)
18
+
19
+ if store_context.verify
20
+ signing_certificate.public_key
21
+ else
22
+ error = "Certificate verification failed: #{store_context.error_string}."
23
+ if (current_cert = store_context.current_cert)
24
+ error = "#{error} Certificate subject: #{current_cert.subject}."
25
+ end
26
+
27
+ raise JWT::VerificationError, error
28
+ end
29
+ end
30
+
31
+ private
32
+
33
+ def build_store(root_certificates, crls)
34
+ store = OpenSSL::X509::Store.new
35
+ store.purpose = OpenSSL::X509::PURPOSE_ANY
36
+ store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK | OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
37
+ root_certificates.each { |certificate| store.add_cert(certificate) }
38
+ crls&.each { |crl| store.add_crl(crl) }
39
+ store
40
+ end
41
+
42
+ def parse_certificates(x5c_header_or_certificates)
43
+ if x5c_header_or_certificates.all? { |obj| obj.is_a?(OpenSSL::X509::Certificate) }
44
+ x5c_header_or_certificates
45
+ else
46
+ x5c_header_or_certificates.map do |encoded|
47
+ OpenSSL::X509::Certificate.new(::JWT::Base64.url_decode(encoded))
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
data/lib/jwt.rb CHANGED
@@ -1,22 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'jwt/version'
3
4
  require 'jwt/base64'
4
5
  require 'jwt/json'
5
6
  require 'jwt/decode'
6
- require 'jwt/default_options'
7
+ require 'jwt/configuration'
8
+ require 'jwt/deprecations'
7
9
  require 'jwt/encode'
8
10
  require 'jwt/error'
9
11
  require 'jwt/jwk'
12
+ require 'jwt/claims'
13
+ require 'jwt/encoded_token'
14
+ require 'jwt/token'
15
+
16
+ require 'jwt/claims_validator'
17
+ require 'jwt/verify'
10
18
 
11
19
  # JSON Web Token implementation
12
20
  #
13
21
  # Should be up to date with the latest spec:
14
22
  # https://tools.ietf.org/html/rfc7519
15
23
  module JWT
16
- include JWT::DefaultOptions
24
+ extend ::JWT::Configuration
17
25
 
18
26
  module_function
19
27
 
28
+ # Encodes a payload into a JWT.
29
+ #
30
+ # @param payload [Hash] the payload to encode.
31
+ # @param key [String] the key used to sign the JWT.
32
+ # @param algorithm [String] the algorithm used to sign the JWT.
33
+ # @param header_fields [Hash] additional headers to include in the JWT.
34
+ # @return [String] the encoded JWT.
20
35
  def encode(payload, key, algorithm = 'HS256', header_fields = {})
21
36
  Encode.new(payload: payload,
22
37
  key: key,
@@ -24,7 +39,16 @@ module JWT
24
39
  headers: header_fields).segments
25
40
  end
26
41
 
27
- def decode(jwt, key = nil, verify = true, options = {}, &keyfinder)
28
- Decode.new(jwt, key, verify, DEFAULT_OPTIONS.merge(options), &keyfinder).decode_segments
42
+ # Decodes a JWT to extract the payload and header
43
+ #
44
+ # @param jwt [String] the JWT to decode.
45
+ # @param key [String] the key used to verify the JWT.
46
+ # @param verify [Boolean] whether to verify the JWT signature.
47
+ # @param options [Hash] additional options for decoding.
48
+ # @return [Array<Hash>] the decoded payload and headers.
49
+ def decode(jwt, key = nil, verify = true, options = {}, &keyfinder) # rubocop:disable Style/OptionalBooleanParameter
50
+ Deprecations.context do
51
+ Decode.new(jwt, key, verify, configuration.decode.to_h.merge(options), &keyfinder).decode_segments
52
+ end
29
53
  end
30
54
  end
data/ruby-jwt.gemspec CHANGED
@@ -1,4 +1,6 @@
1
- lib = File.expand_path('../lib/', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'jwt/version'
4
6
 
@@ -13,20 +15,28 @@ Gem::Specification.new do |spec|
13
15
  spec.description = 'A pure ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard.'
14
16
  spec.homepage = 'https://github.com/jwt/ruby-jwt'
15
17
  spec.license = 'MIT'
16
- spec.required_ruby_version = '>= 2.1'
18
+ spec.required_ruby_version = '>= 2.5'
17
19
  spec.metadata = {
18
20
  'bug_tracker_uri' => 'https://github.com/jwt/ruby-jwt/issues',
19
- 'changelog_uri' => "https://github.com/jwt/ruby-jwt/blob/v#{JWT.gem_version}/CHANGELOG.md"
21
+ 'changelog_uri' => "https://github.com/jwt/ruby-jwt/blob/v#{JWT.gem_version}/CHANGELOG.md",
22
+ 'rubygems_mfa_required' => 'true'
20
23
  }
21
24
 
22
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|gemfiles|coverage|bin)/}) }
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(spec|gemfiles|coverage|bin)/}) || # Irrelevant folders
27
+ f.match(/^\.+/) || # Files and folders starting with .
28
+ f.match(/^(Appraisals|Gemfile|Rakefile)$/) # Irrelevant files
29
+ end
30
+
23
31
  spec.executables = []
24
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
32
  spec.require_paths = %w[lib]
26
33
 
34
+ spec.add_dependency 'base64'
35
+
27
36
  spec.add_development_dependency 'appraisal'
28
37
  spec.add_development_dependency 'bundler'
29
38
  spec.add_development_dependency 'rake'
30
39
  spec.add_development_dependency 'rspec'
40
+ spec.add_development_dependency 'rubocop'
31
41
  spec.add_development_dependency 'simplecov'
32
42
  end
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Rudat
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-10-03 00:00:00.000000000 Z
10
+ date: 2024-12-26 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: appraisal
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +79,20 @@ dependencies:
66
79
  - - ">="
67
80
  - !ruby/object:Gem::Version
68
81
  version: '0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: rubocop
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
69
96
  - !ruby/object:Gem::Dependency
70
97
  name: simplecov
71
98
  requirement: !ruby/object:Gem::Requirement
@@ -87,53 +114,74 @@ executables: []
87
114
  extensions: []
88
115
  extra_rdoc_files: []
89
116
  files:
90
- - ".github/workflows/test.yml"
91
- - ".gitignore"
92
- - ".rspec"
93
- - ".rubocop.yml"
94
- - ".rubocop_todo.yml"
95
- - ".sourcelevel.yml"
96
117
  - AUTHORS
97
- - Appraisals
98
118
  - CHANGELOG.md
99
- - Gemfile
119
+ - CODE_OF_CONDUCT.md
120
+ - CONTRIBUTING.md
100
121
  - LICENSE
101
122
  - README.md
102
- - Rakefile
103
123
  - lib/jwt.rb
104
- - lib/jwt/algos.rb
105
- - lib/jwt/algos/ecdsa.rb
106
- - lib/jwt/algos/eddsa.rb
107
- - lib/jwt/algos/hmac.rb
108
- - lib/jwt/algos/none.rb
109
- - lib/jwt/algos/ps.rb
110
- - lib/jwt/algos/rsa.rb
111
- - lib/jwt/algos/unsupported.rb
112
124
  - lib/jwt/base64.rb
125
+ - lib/jwt/claims.rb
126
+ - lib/jwt/claims/audience.rb
127
+ - lib/jwt/claims/crit.rb
128
+ - lib/jwt/claims/decode_verifier.rb
129
+ - lib/jwt/claims/expiration.rb
130
+ - lib/jwt/claims/issued_at.rb
131
+ - lib/jwt/claims/issuer.rb
132
+ - lib/jwt/claims/jwt_id.rb
133
+ - lib/jwt/claims/not_before.rb
134
+ - lib/jwt/claims/numeric.rb
135
+ - lib/jwt/claims/required.rb
136
+ - lib/jwt/claims/subject.rb
137
+ - lib/jwt/claims/verification_methods.rb
138
+ - lib/jwt/claims/verifier.rb
113
139
  - lib/jwt/claims_validator.rb
140
+ - lib/jwt/configuration.rb
141
+ - lib/jwt/configuration/container.rb
142
+ - lib/jwt/configuration/decode_configuration.rb
143
+ - lib/jwt/configuration/jwk_configuration.rb
114
144
  - lib/jwt/decode.rb
115
- - lib/jwt/default_options.rb
145
+ - lib/jwt/deprecations.rb
116
146
  - lib/jwt/encode.rb
147
+ - lib/jwt/encoded_token.rb
117
148
  - lib/jwt/error.rb
118
149
  - lib/jwt/json.rb
150
+ - lib/jwt/jwa.rb
151
+ - lib/jwt/jwa/compat.rb
152
+ - lib/jwt/jwa/ecdsa.rb
153
+ - lib/jwt/jwa/eddsa.rb
154
+ - lib/jwt/jwa/hmac.rb
155
+ - lib/jwt/jwa/hmac_rbnacl.rb
156
+ - lib/jwt/jwa/hmac_rbnacl_fixed.rb
157
+ - lib/jwt/jwa/none.rb
158
+ - lib/jwt/jwa/ps.rb
159
+ - lib/jwt/jwa/rsa.rb
160
+ - lib/jwt/jwa/signing_algorithm.rb
161
+ - lib/jwt/jwa/unsupported.rb
162
+ - lib/jwt/jwa/wrapper.rb
119
163
  - lib/jwt/jwk.rb
120
164
  - lib/jwt/jwk/ec.rb
121
165
  - lib/jwt/jwk/hmac.rb
122
166
  - lib/jwt/jwk/key_base.rb
123
167
  - lib/jwt/jwk/key_finder.rb
168
+ - lib/jwt/jwk/kid_as_key_digest.rb
169
+ - lib/jwt/jwk/okp_rbnacl.rb
124
170
  - lib/jwt/jwk/rsa.rb
125
- - lib/jwt/security_utils.rb
126
- - lib/jwt/signature.rb
171
+ - lib/jwt/jwk/set.rb
172
+ - lib/jwt/jwk/thumbprint.rb
173
+ - lib/jwt/token.rb
127
174
  - lib/jwt/verify.rb
128
175
  - lib/jwt/version.rb
176
+ - lib/jwt/x5c_key_finder.rb
129
177
  - ruby-jwt.gemspec
130
178
  homepage: https://github.com/jwt/ruby-jwt
131
179
  licenses:
132
180
  - MIT
133
181
  metadata:
134
182
  bug_tracker_uri: https://github.com/jwt/ruby-jwt/issues
135
- changelog_uri: https://github.com/jwt/ruby-jwt/blob/v2.3.0/CHANGELOG.md
136
- post_install_message:
183
+ changelog_uri: https://github.com/jwt/ruby-jwt/blob/v2.10.1/CHANGELOG.md
184
+ rubygems_mfa_required: 'true'
137
185
  rdoc_options: []
138
186
  require_paths:
139
187
  - lib
@@ -141,15 +189,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
189
  requirements:
142
190
  - - ">="
143
191
  - !ruby/object:Gem::Version
144
- version: '2.1'
192
+ version: '2.5'
145
193
  required_rubygems_version: !ruby/object:Gem::Requirement
146
194
  requirements:
147
195
  - - ">="
148
196
  - !ruby/object:Gem::Version
149
197
  version: '0'
150
198
  requirements: []
151
- rubygems_version: 3.2.19
152
- signing_key:
199
+ rubygems_version: 3.6.2
153
200
  specification_version: 4
154
201
  summary: JSON Web Token implementation in Ruby
155
202
  test_files: []
@@ -1,74 +0,0 @@
1
- ---
2
- name: test
3
- on:
4
- push:
5
- branches:
6
- - "*"
7
- pull_request:
8
- branches:
9
- - "*"
10
- jobs:
11
- lint:
12
- name: RuboCop
13
- timeout-minutes: 30
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v2
17
- - name: Set up Ruby
18
- uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: "2.4"
21
- bundler-cache: true
22
- - name: Run RuboCop
23
- run: bundle exec rubocop
24
- test:
25
- strategy:
26
- fail-fast: false
27
- matrix:
28
- ruby:
29
- - 2.3
30
- - 2.4
31
- - 2.5
32
- - 2.6
33
- - 2.7
34
- - "3.0"
35
- gemfile:
36
- - gemfiles/standalone.gemfile
37
- - gemfiles/openssl.gemfile
38
- - gemfiles/rbnacl.gemfile
39
- experimental: [false]
40
- include:
41
- - ruby: 2.1
42
- gemfile: 'gemfiles/rbnacl.gemfile'
43
- experimental: false
44
- - ruby: 2.2
45
- gemfile: 'gemfiles/rbnacl.gemfile'
46
- experimental: false
47
- - ruby: 2.7
48
- coverage: "true"
49
- gemfile: 'gemfiles/rbnacl.gemfile'
50
- - ruby: "ruby-head"
51
- experimental: true
52
- - ruby: "truffleruby-head"
53
- experimental: true
54
- runs-on: ubuntu-20.04
55
- continue-on-error: ${{ matrix.experimental }}
56
- env:
57
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
58
-
59
- steps:
60
- - uses: actions/checkout@v2
61
-
62
- - name: Install libsodium
63
- run: |
64
- sudo apt-get update -q
65
- sudo apt-get install libsodium-dev -y
66
-
67
- - name: Set up Ruby
68
- uses: ruby/setup-ruby@v1
69
- with:
70
- ruby-version: ${{ matrix.ruby }}
71
- bundler-cache: true
72
-
73
- - name: Run tests
74
- run: bundle exec rspec
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- .idea/
2
- jwt.gemspec
3
- pkg
4
- Gemfile.lock
5
- coverage/
6
- .DS_Store
7
- .rbenv-gemsets
8
- .ruby-version
9
- .vscode/
10
- .bundle
11
- *gemfile.lock
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --require spec_helper
2
- --color
data/.rubocop.yml DELETED
@@ -1,97 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- AllCops:
4
- TargetRubyVersion: 2.1
5
-
6
- Layout/AlignParameters:
7
- EnforcedStyle: with_fixed_indentation
8
-
9
- Layout/CaseIndentation:
10
- EnforcedStyle: end
11
-
12
- Style/AsciiComments:
13
- Enabled: false
14
-
15
- Layout/IndentHash:
16
- Enabled: false
17
-
18
- Style/CollectionMethods:
19
- Enabled: true
20
- PreferredMethods:
21
- inject: 'inject'
22
-
23
- Style/Documentation:
24
- Enabled: false
25
-
26
- Style/BlockDelimiters:
27
- Exclude:
28
- - spec/**/*_spec.rb
29
-
30
- Style/BracesAroundHashParameters:
31
- Exclude:
32
- - spec/**/*_spec.rb
33
-
34
- Style/GuardClause:
35
- Enabled: false
36
-
37
- Style/IfUnlessModifier:
38
- Enabled: false
39
-
40
- Layout/SpaceInsideHashLiteralBraces:
41
- Enabled: false
42
-
43
- Style/Lambda:
44
- Enabled: false
45
-
46
- Style/RaiseArgs:
47
- Enabled: false
48
-
49
- Style/SignalException:
50
- Enabled: false
51
-
52
- Metrics/AbcSize:
53
- Max: 20
54
-
55
- Metrics/ClassLength:
56
- Max: 101
57
-
58
- Metrics/ModuleLength:
59
- Max: 100
60
-
61
- Metrics/LineLength:
62
- Enabled: false
63
-
64
- Metrics/BlockLength:
65
- Exclude:
66
- - spec/**/*_spec.rb
67
-
68
- Metrics/MethodLength:
69
- Max: 15
70
-
71
- Style/SingleLineBlockParams:
72
- Enabled: false
73
-
74
- Lint/EndAlignment:
75
- EnforcedStyleAlignWith: variable
76
-
77
- Style/FormatString:
78
- Enabled: false
79
-
80
- Layout/MultilineMethodCallIndentation:
81
- EnforcedStyle: indented
82
-
83
- Layout/MultilineOperationIndentation:
84
- EnforcedStyle: indented
85
-
86
- Style/WordArray:
87
- Enabled: false
88
-
89
- Style/RedundantSelf:
90
- Enabled: false
91
-
92
- Layout/AlignHash:
93
- Enabled: true
94
- EnforcedLastArgumentHashStyle: always_ignore
95
-
96
- Style/TrivialAccessors:
97
- AllowPredicates: true