jwt 2.4.1 → 2.9.3

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +177 -14
  3. data/CONTRIBUTING.md +7 -7
  4. data/README.md +180 -37
  5. data/lib/jwt/base64.rb +33 -0
  6. data/lib/jwt/claims/audience.rb +20 -0
  7. data/lib/jwt/claims/decode_verifier.rb +40 -0
  8. data/lib/jwt/claims/expiration.rb +22 -0
  9. data/lib/jwt/claims/issued_at.rb +15 -0
  10. data/lib/jwt/claims/issuer.rb +24 -0
  11. data/lib/jwt/claims/jwt_id.rb +25 -0
  12. data/lib/jwt/claims/not_before.rb +22 -0
  13. data/lib/jwt/claims/numeric.rb +55 -0
  14. data/lib/jwt/claims/required.rb +23 -0
  15. data/lib/jwt/claims/subject.rb +20 -0
  16. data/lib/jwt/claims/verifier.rb +62 -0
  17. data/lib/jwt/claims.rb +82 -0
  18. data/lib/jwt/claims_validator.rb +3 -24
  19. data/lib/jwt/configuration/container.rb +32 -0
  20. data/lib/jwt/configuration/decode_configuration.rb +46 -0
  21. data/lib/jwt/configuration/jwk_configuration.rb +27 -0
  22. data/lib/jwt/configuration.rb +15 -0
  23. data/lib/jwt/decode.rb +54 -41
  24. data/lib/jwt/deprecations.rb +48 -0
  25. data/lib/jwt/encode.rb +21 -21
  26. data/lib/jwt/error.rb +1 -0
  27. data/lib/jwt/jwa/compat.rb +29 -0
  28. data/lib/jwt/jwa/ecdsa.rb +93 -0
  29. data/lib/jwt/jwa/eddsa.rb +34 -0
  30. data/lib/jwt/jwa/hmac.rb +83 -0
  31. data/lib/jwt/jwa/hmac_rbnacl.rb +49 -0
  32. data/lib/jwt/jwa/hmac_rbnacl_fixed.rb +46 -0
  33. data/lib/jwt/jwa/none.rb +23 -0
  34. data/lib/jwt/jwa/ps.rb +36 -0
  35. data/lib/jwt/jwa/rsa.rb +36 -0
  36. data/lib/jwt/jwa/signing_algorithm.rb +60 -0
  37. data/lib/jwt/jwa/unsupported.rb +19 -0
  38. data/lib/jwt/jwa/wrapper.rb +43 -0
  39. data/lib/jwt/jwa.rb +50 -0
  40. data/lib/jwt/jwk/ec.rb +162 -65
  41. data/lib/jwt/jwk/hmac.rb +69 -24
  42. data/lib/jwt/jwk/key_base.rb +45 -7
  43. data/lib/jwt/jwk/key_finder.rb +19 -35
  44. data/lib/jwt/jwk/kid_as_key_digest.rb +15 -0
  45. data/lib/jwt/jwk/okp_rbnacl.rb +110 -0
  46. data/lib/jwt/jwk/rsa.rb +141 -54
  47. data/lib/jwt/jwk/set.rb +80 -0
  48. data/lib/jwt/jwk/thumbprint.rb +26 -0
  49. data/lib/jwt/jwk.rb +14 -11
  50. data/lib/jwt/verify.rb +10 -89
  51. data/lib/jwt/version.rb +24 -2
  52. data/lib/jwt/x5c_key_finder.rb +3 -6
  53. data/lib/jwt.rb +12 -4
  54. data/ruby-jwt.gemspec +11 -4
  55. metadata +59 -31
  56. data/.codeclimate.yml +0 -8
  57. data/.github/workflows/coverage.yml +0 -27
  58. data/.github/workflows/test.yml +0 -66
  59. data/.gitignore +0 -13
  60. data/.reek.yml +0 -22
  61. data/.rspec +0 -2
  62. data/.rubocop.yml +0 -67
  63. data/.sourcelevel.yml +0 -17
  64. data/Appraisals +0 -13
  65. data/Gemfile +0 -7
  66. data/Rakefile +0 -16
  67. data/lib/jwt/algos/ecdsa.rb +0 -64
  68. data/lib/jwt/algos/eddsa.rb +0 -33
  69. data/lib/jwt/algos/hmac.rb +0 -36
  70. data/lib/jwt/algos/none.rb +0 -17
  71. data/lib/jwt/algos/ps.rb +0 -43
  72. data/lib/jwt/algos/rsa.rb +0 -22
  73. data/lib/jwt/algos/unsupported.rb +0 -19
  74. data/lib/jwt/algos.rb +0 -44
  75. data/lib/jwt/default_options.rb +0 -18
  76. data/lib/jwt/security_utils.rb +0 -59
  77. data/lib/jwt/signature.rb +0 -35
data/lib/jwt/verify.rb CHANGED
@@ -1,27 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'jwt/error'
3
+ require_relative 'error'
4
4
 
5
5
  module JWT
6
- # JWT verify methods
7
6
  class Verify
8
- DEFAULTS = {
9
- leeway: 0
10
- }.freeze
7
+ DEFAULTS = { leeway: 0 }.freeze
8
+ METHODS = %w[verify_aud verify_expiration verify_iat verify_iss verify_jti verify_not_before verify_sub verify_required_claims].freeze
11
9
 
12
10
  class << self
13
- %w[verify_aud verify_expiration verify_iat verify_iss verify_jti verify_not_before verify_sub verify_required_claims].each do |method_name|
14
- define_method method_name do |payload, options|
11
+ METHODS.each do |method_name|
12
+ define_method(method_name) do |payload, options|
15
13
  new(payload, options).send(method_name)
16
14
  end
17
15
  end
18
16
 
19
17
  def verify_claims(payload, options)
20
- options.each do |key, val|
21
- next unless key.to_s =~ /verify/
22
-
23
- Verify.send(key, payload, options) if val
24
- end
18
+ ::JWT::Claims.verify!(payload, options)
19
+ true
25
20
  end
26
21
  end
27
22
 
@@ -30,84 +25,10 @@ module JWT
30
25
  @options = DEFAULTS.merge(options)
31
26
  end
32
27
 
33
- def verify_aud
34
- return unless (options_aud = @options[:aud])
35
-
36
- aud = @payload['aud']
37
- raise(JWT::InvalidAudError, "Invalid audience. Expected #{options_aud}, received #{aud || '<none>'}") if ([*aud] & [*options_aud]).empty?
38
- end
39
-
40
- def verify_expiration
41
- return unless @payload.include?('exp')
42
- raise(JWT::ExpiredSignature, 'Signature has expired') if @payload['exp'].to_i <= (Time.now.to_i - exp_leeway)
43
- end
44
-
45
- def verify_iat
46
- return unless @payload.include?('iat')
47
-
48
- iat = @payload['iat']
49
- raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(Numeric) || iat.to_f > Time.now.to_f
50
- end
51
-
52
- def verify_iss
53
- return unless (options_iss = @options[:iss])
54
-
55
- iss = @payload['iss']
56
-
57
- options_iss = Array(options_iss).map { |item| item.is_a?(Symbol) ? item.to_s : item }
58
-
59
- case iss
60
- when *options_iss
61
- nil
62
- else
63
- raise(JWT::InvalidIssuerError, "Invalid issuer. Expected #{options_iss}, received #{iss || '<none>'}")
64
- end
65
- end
66
-
67
- def verify_jti
68
- options_verify_jti = @options[:verify_jti]
69
- jti = @payload['jti']
70
-
71
- if options_verify_jti.respond_to?(:call)
72
- verified = options_verify_jti.arity == 2 ? options_verify_jti.call(jti, @payload) : options_verify_jti.call(jti)
73
- raise(JWT::InvalidJtiError, 'Invalid jti') unless verified
74
- elsif jti.to_s.strip.empty?
75
- raise(JWT::InvalidJtiError, 'Missing jti')
28
+ METHODS.each do |method_name|
29
+ define_method(method_name) do
30
+ ::JWT::Claims.verify!(@payload, @options.merge(method_name => true))
76
31
  end
77
32
  end
78
-
79
- def verify_not_before
80
- return unless @payload.include?('nbf')
81
- raise(JWT::ImmatureSignature, 'Signature nbf has not been reached') if @payload['nbf'].to_i > (Time.now.to_i + nbf_leeway)
82
- end
83
-
84
- def verify_sub
85
- return unless (options_sub = @options[:sub])
86
-
87
- sub = @payload['sub']
88
- raise(JWT::InvalidSubError, "Invalid subject. Expected #{options_sub}, received #{sub || '<none>'}") unless sub.to_s == options_sub.to_s
89
- end
90
-
91
- def verify_required_claims
92
- return unless (options_required_claims = @options[:required_claims])
93
-
94
- options_required_claims.each do |required_claim|
95
- raise(JWT::MissingRequiredClaim, "Missing required claim #{required_claim}") unless @payload.include?(required_claim)
96
- end
97
- end
98
-
99
- private
100
-
101
- def global_leeway
102
- @options[:leeway]
103
- end
104
-
105
- def exp_leeway
106
- @options[:exp_leeway] || global_leeway
107
- end
108
-
109
- def nbf_leeway
110
- @options[:nbf_leeway] || global_leeway
111
- end
112
33
  end
113
34
  end
data/lib/jwt/version.rb CHANGED
@@ -11,13 +11,35 @@ module JWT
11
11
  # major version
12
12
  MAJOR = 2
13
13
  # minor version
14
- MINOR = 4
14
+ MINOR = 9
15
15
  # tiny version
16
- TINY = 1
16
+ TINY = 3
17
17
  # alpha, beta, etc. tag
18
18
  PRE = nil
19
19
 
20
20
  # Build version string
21
21
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
22
22
  end
23
+
24
+ def self.openssl_3?
25
+ return false if OpenSSL::OPENSSL_VERSION.include?('LibreSSL')
26
+
27
+ true if 3 * 0x10000000 <= OpenSSL::OPENSSL_VERSION_NUMBER
28
+ end
29
+
30
+ def self.rbnacl?
31
+ defined?(::RbNaCl)
32
+ end
33
+
34
+ def self.rbnacl_6_or_greater?
35
+ rbnacl? && ::Gem::Version.new(::RbNaCl::VERSION) >= ::Gem::Version.new('6.0.0')
36
+ end
37
+
38
+ def self.openssl_3_hmac_empty_key_regression?
39
+ openssl_3? && openssl_version <= ::Gem::Version.new('3.0.0')
40
+ end
41
+
42
+ def self.openssl_version
43
+ @openssl_version ||= ::Gem::Version.new(OpenSSL::VERSION)
44
+ end
23
45
  end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'base64'
4
- require 'jwt/error'
5
-
6
3
  module JWT
7
4
  # If the x5c header certificate chain can be validated by trusted root
8
5
  # certificates, and none of the certificates are revoked, returns the public
@@ -10,7 +7,7 @@ module JWT
10
7
  # See https://tools.ietf.org/html/rfc7515#section-4.1.6
11
8
  class X5cKeyFinder
12
9
  def initialize(root_certificates, crls = nil)
13
- raise(ArgumentError, 'Root certificates must be specified') unless root_certificates
10
+ raise ArgumentError, 'Root certificates must be specified' unless root_certificates
14
11
 
15
12
  @store = build_store(root_certificates, crls)
16
13
  end
@@ -27,7 +24,7 @@ module JWT
27
24
  error = "#{error} Certificate subject: #{current_cert.subject}."
28
25
  end
29
26
 
30
- raise(JWT::VerificationError, error)
27
+ raise JWT::VerificationError, error
31
28
  end
32
29
  end
33
30
 
@@ -47,7 +44,7 @@ module JWT
47
44
  x5c_header_or_certificates
48
45
  else
49
46
  x5c_header_or_certificates.map do |encoded|
50
- OpenSSL::X509::Certificate.new(::Base64.strict_decode64(encoded))
47
+ OpenSSL::X509::Certificate.new(::JWT::Base64.url_decode(encoded))
51
48
  end
52
49
  end
53
50
  end
data/lib/jwt.rb CHANGED
@@ -1,19 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'base64'
3
+ require 'jwt/version'
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
+
14
+ require 'jwt/claims_validator'
15
+ require 'jwt/verify'
10
16
 
11
17
  # JSON Web Token implementation
12
18
  #
13
19
  # Should be up to date with the latest spec:
14
20
  # https://tools.ietf.org/html/rfc7519
15
21
  module JWT
16
- include JWT::DefaultOptions
22
+ extend ::JWT::Configuration
17
23
 
18
24
  module_function
19
25
 
@@ -25,6 +31,8 @@ module JWT
25
31
  end
26
32
 
27
33
  def decode(jwt, key = nil, verify = true, options = {}, &keyfinder) # rubocop:disable Style/OptionalBooleanParameter
28
- Decode.new(jwt, key, verify, DEFAULT_OPTIONS.merge(options), &keyfinder).decode_segments
34
+ Deprecations.context do
35
+ Decode.new(jwt, key, verify, configuration.decode.to_h.merge(options), &keyfinder).decode_segments
36
+ end
29
37
  end
30
38
  end
data/ruby-jwt.gemspec CHANGED
@@ -18,18 +18,25 @@ Gem::Specification.new do |spec|
18
18
  spec.required_ruby_version = '>= 2.5'
19
19
  spec.metadata = {
20
20
  'bug_tracker_uri' => 'https://github.com/jwt/ruby-jwt/issues',
21
- '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'
22
23
  }
23
24
 
24
- 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
+
25
31
  spec.executables = []
26
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
27
32
  spec.require_paths = %w[lib]
28
33
 
34
+ spec.add_dependency 'base64'
35
+
29
36
  spec.add_development_dependency 'appraisal'
30
37
  spec.add_development_dependency 'bundler'
31
38
  spec.add_development_dependency 'rake'
32
- spec.add_development_dependency 'reek'
33
39
  spec.add_development_dependency 'rspec'
40
+ spec.add_development_dependency 'rubocop'
34
41
  spec.add_development_dependency 'simplecov'
35
42
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Rudat
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: appraisal
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +67,7 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: reek
70
+ name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: rspec
84
+ name: rubocop
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -101,46 +115,59 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
- - ".codeclimate.yml"
105
- - ".github/workflows/coverage.yml"
106
- - ".github/workflows/test.yml"
107
- - ".gitignore"
108
- - ".reek.yml"
109
- - ".rspec"
110
- - ".rubocop.yml"
111
- - ".sourcelevel.yml"
112
118
  - AUTHORS
113
- - Appraisals
114
119
  - CHANGELOG.md
115
120
  - CODE_OF_CONDUCT.md
116
121
  - CONTRIBUTING.md
117
- - Gemfile
118
122
  - LICENSE
119
123
  - README.md
120
- - Rakefile
121
124
  - lib/jwt.rb
122
- - lib/jwt/algos.rb
123
- - lib/jwt/algos/ecdsa.rb
124
- - lib/jwt/algos/eddsa.rb
125
- - lib/jwt/algos/hmac.rb
126
- - lib/jwt/algos/none.rb
127
- - lib/jwt/algos/ps.rb
128
- - lib/jwt/algos/rsa.rb
129
- - lib/jwt/algos/unsupported.rb
125
+ - lib/jwt/base64.rb
126
+ - lib/jwt/claims.rb
127
+ - lib/jwt/claims/audience.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/verifier.rb
130
138
  - lib/jwt/claims_validator.rb
139
+ - lib/jwt/configuration.rb
140
+ - lib/jwt/configuration/container.rb
141
+ - lib/jwt/configuration/decode_configuration.rb
142
+ - lib/jwt/configuration/jwk_configuration.rb
131
143
  - lib/jwt/decode.rb
132
- - lib/jwt/default_options.rb
144
+ - lib/jwt/deprecations.rb
133
145
  - lib/jwt/encode.rb
134
146
  - lib/jwt/error.rb
135
147
  - lib/jwt/json.rb
148
+ - lib/jwt/jwa.rb
149
+ - lib/jwt/jwa/compat.rb
150
+ - lib/jwt/jwa/ecdsa.rb
151
+ - lib/jwt/jwa/eddsa.rb
152
+ - lib/jwt/jwa/hmac.rb
153
+ - lib/jwt/jwa/hmac_rbnacl.rb
154
+ - lib/jwt/jwa/hmac_rbnacl_fixed.rb
155
+ - lib/jwt/jwa/none.rb
156
+ - lib/jwt/jwa/ps.rb
157
+ - lib/jwt/jwa/rsa.rb
158
+ - lib/jwt/jwa/signing_algorithm.rb
159
+ - lib/jwt/jwa/unsupported.rb
160
+ - lib/jwt/jwa/wrapper.rb
136
161
  - lib/jwt/jwk.rb
137
162
  - lib/jwt/jwk/ec.rb
138
163
  - lib/jwt/jwk/hmac.rb
139
164
  - lib/jwt/jwk/key_base.rb
140
165
  - lib/jwt/jwk/key_finder.rb
166
+ - lib/jwt/jwk/kid_as_key_digest.rb
167
+ - lib/jwt/jwk/okp_rbnacl.rb
141
168
  - lib/jwt/jwk/rsa.rb
142
- - lib/jwt/security_utils.rb
143
- - lib/jwt/signature.rb
169
+ - lib/jwt/jwk/set.rb
170
+ - lib/jwt/jwk/thumbprint.rb
144
171
  - lib/jwt/verify.rb
145
172
  - lib/jwt/version.rb
146
173
  - lib/jwt/x5c_key_finder.rb
@@ -150,8 +177,9 @@ licenses:
150
177
  - MIT
151
178
  metadata:
152
179
  bug_tracker_uri: https://github.com/jwt/ruby-jwt/issues
153
- changelog_uri: https://github.com/jwt/ruby-jwt/blob/v2.4.1/CHANGELOG.md
154
- post_install_message:
180
+ changelog_uri: https://github.com/jwt/ruby-jwt/blob/v2.9.3/CHANGELOG.md
181
+ rubygems_mfa_required: 'true'
182
+ post_install_message:
155
183
  rdoc_options: []
156
184
  require_paths:
157
185
  - lib
@@ -166,8 +194,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
194
  - !ruby/object:Gem::Version
167
195
  version: '0'
168
196
  requirements: []
169
- rubygems_version: 3.3.7
170
- signing_key:
197
+ rubygems_version: 3.5.16
198
+ signing_key:
171
199
  specification_version: 4
172
200
  summary: JSON Web Token implementation in Ruby
173
201
  test_files: []
data/.codeclimate.yml DELETED
@@ -1,8 +0,0 @@
1
- plugins:
2
- fixme:
3
- enabled: true
4
- shellcheck:
5
- enabled: true
6
- rubocop:
7
- enabled: true
8
- channel: rubocop-1-23-0
@@ -1,27 +0,0 @@
1
- ---
2
- name: coverage
3
- on:
4
- push:
5
- branches:
6
- - "master"
7
- jobs:
8
- coverage:
9
- name: coverage
10
- runs-on: ubuntu-20.04
11
- env:
12
- BUNDLE_GEMFILE: 'gemfiles/rbnacl.gemfile'
13
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
14
- steps:
15
- - uses: actions/checkout@v2
16
- - name: Install libsodium
17
- run: |
18
- sudo apt-get update -q
19
- sudo apt-get install libsodium-dev -y
20
- - name: Set up Ruby
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: "2.7"
24
- bundler-cache: true
25
- - uses: paambaati/codeclimate-action@v3.0.0
26
- with:
27
- coverageCommand: bundle exec rspec
@@ -1,66 +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: "3.0"
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.5
30
- - 2.6
31
- - 2.7
32
- - "3.0"
33
- - 3.1
34
- gemfile:
35
- - gemfiles/standalone.gemfile
36
- - gemfiles/openssl.gemfile
37
- - gemfiles/rbnacl.gemfile
38
- experimental: [false]
39
- include:
40
- - ruby: 2.7
41
- gemfile: 'gemfiles/rbnacl.gemfile'
42
- - ruby: "ruby-head"
43
- experimental: true
44
- - ruby: "truffleruby-head"
45
- experimental: true
46
- runs-on: ubuntu-20.04
47
- continue-on-error: ${{ matrix.experimental }}
48
- env:
49
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
50
-
51
- steps:
52
- - uses: actions/checkout@v2
53
-
54
- - name: Install libsodium
55
- run: |
56
- sudo apt-get update -q
57
- sudo apt-get install libsodium-dev -y
58
-
59
- - name: Set up Ruby
60
- uses: ruby/setup-ruby@v1
61
- with:
62
- ruby-version: ${{ matrix.ruby }}
63
- bundler-cache: true
64
-
65
- - name: Run tests
66
- run: bundle exec rspec
data/.gitignore DELETED
@@ -1,13 +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
12
- .byebug_history
13
- *.gem
data/.reek.yml DELETED
@@ -1,22 +0,0 @@
1
- ---
2
- detectors:
3
- TooManyStatements:
4
- max_statements: 10
5
- UtilityFunction:
6
- enabled: false
7
- LongParameterList:
8
- enabled: false
9
- DuplicateMethodCall:
10
- max_calls: 2
11
- IrresponsibleModule:
12
- enabled: false
13
- NestedIterators:
14
- max_allowed_nesting: 2
15
- UnusedParameters:
16
- enabled: false
17
- FeatureEnvy:
18
- enabled: false
19
- ControlParameter:
20
- enabled: false
21
- UnusedPrivateMethod:
22
- enabled: false
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --require spec_helper
2
- --color
data/.rubocop.yml DELETED
@@ -1,67 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.5
3
- NewCops: enable
4
- SuggestExtensions: false
5
- Exclude:
6
- - 'gemfiles/*.gemfile'
7
- - 'vendor/**/*'
8
-
9
- Style/Documentation:
10
- Enabled: false
11
-
12
- Style/BlockDelimiters:
13
- Exclude:
14
- - spec/**/*_spec.rb
15
-
16
- Style/GuardClause:
17
- Enabled: false
18
-
19
- Style/IfUnlessModifier:
20
- Enabled: false
21
-
22
- Style/Lambda:
23
- Enabled: false
24
-
25
- Style/RaiseArgs:
26
- Enabled: false
27
-
28
- Metrics/AbcSize:
29
- Max: 25
30
-
31
- Metrics/ClassLength:
32
- Max: 105
33
-
34
- Metrics/ModuleLength:
35
- Max: 100
36
-
37
- Metrics/MethodLength:
38
- Max: 20
39
-
40
- Metrics/BlockLength:
41
- Exclude:
42
- - spec/**/*_spec.rb
43
-
44
- Layout/LineLength:
45
- Enabled: false
46
-
47
- Layout/EndAlignment:
48
- EnforcedStyleAlignWith: variable
49
-
50
- Layout/EmptyLineBetweenDefs:
51
- Enabled: true
52
- AllowAdjacentOneLineDefs: true
53
-
54
- Style/FormatString:
55
- Enabled: false
56
-
57
- Layout/MultilineMethodCallIndentation:
58
- EnforcedStyle: indented
59
-
60
- Layout/MultilineOperationIndentation:
61
- EnforcedStyle: indented
62
-
63
- Style/WordArray:
64
- Enabled: false
65
-
66
- Gemspec/RequireMFA:
67
- Enabled: false
data/.sourcelevel.yml DELETED
@@ -1,17 +0,0 @@
1
- engines:
2
- reek:
3
- enabled: true
4
- fixme:
5
- enabled: true
6
- rubocop:
7
- enabled: true
8
- channel: latest
9
- duplication:
10
- config:
11
- languages:
12
- - ruby
13
- enabled: true
14
- remark-lint:
15
- enabled: false
16
- exclude_paths:
17
- - spec
data/Appraisals DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise 'standalone' do
4
- # No additions
5
- end
6
-
7
- appraise 'openssl' do
8
- gem 'openssl', '~> 2.1'
9
- end
10
-
11
- appraise 'rbnacl' do
12
- gem 'rbnacl'
13
- end
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- gem 'rubocop', '~> 1.23.0' # Keep .codeclimate.yml channel in sync with this one
data/Rakefile DELETED
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- require 'bundler/gem_tasks'
5
-
6
- begin
7
- require 'rspec/core/rake_task'
8
- require 'rubocop/rake_task'
9
-
10
- RSpec::Core::RakeTask.new(:test)
11
- RuboCop::RakeTask.new(:rubocop)
12
-
13
- task default: %i[rubocop test]
14
- rescue LoadError
15
- puts 'RSpec rake tasks not available. Please run "bundle install" to install missing dependencies.'
16
- end