jwt 2.1.0 → 2.7.0
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.
- checksums.yaml +5 -5
- data/AUTHORS +119 -0
- data/CHANGELOG.md +355 -19
- data/CODE_OF_CONDUCT.md +84 -0
- data/CONTRIBUTING.md +99 -0
- data/README.md +331 -102
- data/lib/jwt/algos/algo_wrapper.rb +30 -0
- data/lib/jwt/algos/ecdsa.rb +39 -12
- data/lib/jwt/algos/eddsa.rb +18 -8
- data/lib/jwt/algos/hmac.rb +57 -17
- data/lib/jwt/algos/hmac_rbnacl.rb +53 -0
- data/lib/jwt/algos/hmac_rbnacl_fixed.rb +52 -0
- data/lib/jwt/algos/none.rb +19 -0
- data/lib/jwt/algos/ps.rb +41 -0
- data/lib/jwt/algos/rsa.rb +7 -5
- data/lib/jwt/algos/unsupported.rb +7 -4
- data/lib/jwt/algos.rb +67 -0
- data/lib/jwt/base64.rb +19 -0
- data/lib/jwt/claims_validator.rb +37 -0
- data/lib/jwt/configuration/container.rb +21 -0
- data/lib/jwt/configuration/decode_configuration.rb +46 -0
- data/lib/jwt/configuration/jwk_configuration.rb +27 -0
- data/lib/jwt/configuration.rb +15 -0
- data/lib/jwt/decode.rb +143 -24
- data/lib/jwt/encode.rb +54 -26
- data/lib/jwt/error.rb +6 -0
- data/lib/jwt/json.rb +18 -0
- data/lib/jwt/jwk/ec.rb +236 -0
- data/lib/jwt/jwk/hmac.rb +103 -0
- data/lib/jwt/jwk/key_base.rb +55 -0
- data/lib/jwt/jwk/key_finder.rb +46 -0
- data/lib/jwt/jwk/kid_as_key_digest.rb +15 -0
- data/lib/jwt/jwk/okp_rbnacl.rb +110 -0
- data/lib/jwt/jwk/rsa.rb +203 -0
- data/lib/jwt/jwk/set.rb +80 -0
- data/lib/jwt/jwk/thumbprint.rb +26 -0
- data/lib/jwt/jwk.rb +55 -0
- data/lib/jwt/security_utils.rb +8 -27
- data/lib/jwt/verify.rb +19 -8
- data/lib/jwt/version.rb +22 -2
- data/lib/jwt/x5c_key_finder.rb +55 -0
- data/lib/jwt.rb +12 -44
- data/ruby-jwt.gemspec +18 -10
- metadata +45 -118
- data/.codeclimate.yml +0 -20
- data/.ebert.yml +0 -18
- data/.gitignore +0 -11
- data/.reek.yml +0 -40
- data/.rspec +0 -1
- data/.rubocop.yml +0 -98
- data/.travis.yml +0 -14
- data/Gemfile +0 -3
- data/Manifest +0 -8
- data/Rakefile +0 -11
- data/lib/jwt/default_options.rb +0 -15
- data/lib/jwt/signature.rb +0 -50
- data/spec/fixtures/certs/ec256-private.pem +0 -8
- data/spec/fixtures/certs/ec256-public.pem +0 -4
- data/spec/fixtures/certs/ec256-wrong-private.pem +0 -8
- data/spec/fixtures/certs/ec256-wrong-public.pem +0 -4
- data/spec/fixtures/certs/ec384-private.pem +0 -9
- data/spec/fixtures/certs/ec384-public.pem +0 -5
- data/spec/fixtures/certs/ec384-wrong-private.pem +0 -9
- data/spec/fixtures/certs/ec384-wrong-public.pem +0 -5
- data/spec/fixtures/certs/ec512-private.pem +0 -10
- data/spec/fixtures/certs/ec512-public.pem +0 -6
- data/spec/fixtures/certs/ec512-wrong-private.pem +0 -10
- data/spec/fixtures/certs/ec512-wrong-public.pem +0 -6
- data/spec/fixtures/certs/rsa-1024-private.pem +0 -15
- data/spec/fixtures/certs/rsa-1024-public.pem +0 -6
- data/spec/fixtures/certs/rsa-2048-private.pem +0 -27
- data/spec/fixtures/certs/rsa-2048-public.pem +0 -9
- data/spec/fixtures/certs/rsa-2048-wrong-private.pem +0 -27
- data/spec/fixtures/certs/rsa-2048-wrong-public.pem +0 -9
- data/spec/fixtures/certs/rsa-4096-private.pem +0 -51
- data/spec/fixtures/certs/rsa-4096-public.pem +0 -14
- data/spec/integration/readme_examples_spec.rb +0 -202
- data/spec/jwt/verify_spec.rb +0 -232
- data/spec/jwt_spec.rb +0 -315
- data/spec/spec_helper.rb +0 -28
data/lib/jwt/verify.rb
CHANGED
|
@@ -10,7 +10,7 @@ module JWT
|
|
|
10
10
|
}.freeze
|
|
11
11
|
|
|
12
12
|
class << self
|
|
13
|
-
%w[verify_aud verify_expiration verify_iat verify_iss verify_jti verify_not_before verify_sub].each do |method_name|
|
|
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
14
|
define_method method_name do |payload, options|
|
|
15
15
|
new(payload, options).send(method_name)
|
|
16
16
|
end
|
|
@@ -19,6 +19,7 @@ module JWT
|
|
|
19
19
|
def verify_claims(payload, options)
|
|
20
20
|
options.each do |key, val|
|
|
21
21
|
next unless key.to_s =~ /verify/
|
|
22
|
+
|
|
22
23
|
Verify.send(key, payload, options) if val
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -45,7 +46,7 @@ module JWT
|
|
|
45
46
|
return unless @payload.include?('iat')
|
|
46
47
|
|
|
47
48
|
iat = @payload['iat']
|
|
48
|
-
raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(Numeric) || iat.to_f >
|
|
49
|
+
raise(JWT::InvalidIatError, 'Invalid iat') if !iat.is_a?(Numeric) || iat.to_f > Time.now.to_f
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
def verify_iss
|
|
@@ -53,9 +54,14 @@ module JWT
|
|
|
53
54
|
|
|
54
55
|
iss = @payload['iss']
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
options_iss = Array(options_iss).map { |item| item.is_a?(Symbol) ? item.to_s : item }
|
|
57
58
|
|
|
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
|
|
59
65
|
end
|
|
60
66
|
|
|
61
67
|
def verify_jti
|
|
@@ -77,10 +83,19 @@ module JWT
|
|
|
77
83
|
|
|
78
84
|
def verify_sub
|
|
79
85
|
return unless (options_sub = @options[:sub])
|
|
86
|
+
|
|
80
87
|
sub = @payload['sub']
|
|
81
88
|
raise(JWT::InvalidSubError, "Invalid subject. Expected #{options_sub}, received #{sub || '<none>'}") unless sub.to_s == options_sub.to_s
|
|
82
89
|
end
|
|
83
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
|
+
|
|
84
99
|
private
|
|
85
100
|
|
|
86
101
|
def global_leeway
|
|
@@ -91,10 +106,6 @@ module JWT
|
|
|
91
106
|
@options[:exp_leeway] || global_leeway
|
|
92
107
|
end
|
|
93
108
|
|
|
94
|
-
def iat_leeway
|
|
95
|
-
@options[:iat_leeway] || global_leeway
|
|
96
|
-
end
|
|
97
|
-
|
|
98
109
|
def nbf_leeway
|
|
99
110
|
@options[:nbf_leeway] || global_leeway
|
|
100
111
|
end
|
data/lib/jwt/version.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
# frozen_string_literal: true
|
|
3
2
|
|
|
4
3
|
# Moments version builder module
|
|
@@ -12,7 +11,7 @@ module JWT
|
|
|
12
11
|
# major version
|
|
13
12
|
MAJOR = 2
|
|
14
13
|
# minor version
|
|
15
|
-
MINOR =
|
|
14
|
+
MINOR = 7
|
|
16
15
|
# tiny version
|
|
17
16
|
TINY = 0
|
|
18
17
|
# alpha, beta, etc. tag
|
|
@@ -21,4 +20,25 @@ module JWT
|
|
|
21
20
|
# Build version string
|
|
22
21
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
|
|
23
22
|
end
|
|
23
|
+
|
|
24
|
+
def self.openssl_3?
|
|
25
|
+
return false if OpenSSL::OPENSSL_VERSION.include?('LibreSSL')
|
|
26
|
+
return true if OpenSSL::OPENSSL_VERSION_NUMBER >= 3 * 0x10000000
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.rbnacl?
|
|
30
|
+
defined?(::RbNaCl)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.rbnacl_6_or_greater?
|
|
34
|
+
rbnacl? && ::Gem::Version.new(::RbNaCl::VERSION) >= ::Gem::Version.new('6.0.0')
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.openssl_3_hmac_empty_key_regression?
|
|
38
|
+
openssl_3? && openssl_version <= ::Gem::Version.new('3.0.0')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.openssl_version
|
|
42
|
+
@openssl_version ||= ::Gem::Version.new(OpenSSL::VERSION)
|
|
43
|
+
end
|
|
24
44
|
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'base64'
|
|
4
|
+
require 'jwt/error'
|
|
5
|
+
|
|
6
|
+
module JWT
|
|
7
|
+
# If the x5c header certificate chain can be validated by trusted root
|
|
8
|
+
# certificates, and none of the certificates are revoked, returns the public
|
|
9
|
+
# key from the first certificate.
|
|
10
|
+
# See https://tools.ietf.org/html/rfc7515#section-4.1.6
|
|
11
|
+
class X5cKeyFinder
|
|
12
|
+
def initialize(root_certificates, crls = nil)
|
|
13
|
+
raise(ArgumentError, 'Root certificates must be specified') unless root_certificates
|
|
14
|
+
|
|
15
|
+
@store = build_store(root_certificates, crls)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def from(x5c_header_or_certificates)
|
|
19
|
+
signing_certificate, *certificate_chain = parse_certificates(x5c_header_or_certificates)
|
|
20
|
+
store_context = OpenSSL::X509::StoreContext.new(@store, signing_certificate, certificate_chain)
|
|
21
|
+
|
|
22
|
+
if store_context.verify
|
|
23
|
+
signing_certificate.public_key
|
|
24
|
+
else
|
|
25
|
+
error = "Certificate verification failed: #{store_context.error_string}."
|
|
26
|
+
if (current_cert = store_context.current_cert)
|
|
27
|
+
error = "#{error} Certificate subject: #{current_cert.subject}."
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
raise(JWT::VerificationError, error)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
def build_store(root_certificates, crls)
|
|
37
|
+
store = OpenSSL::X509::Store.new
|
|
38
|
+
store.purpose = OpenSSL::X509::PURPOSE_ANY
|
|
39
|
+
store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK | OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
|
|
40
|
+
root_certificates.each { |certificate| store.add_cert(certificate) }
|
|
41
|
+
crls&.each { |crl| store.add_crl(crl) }
|
|
42
|
+
store
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def parse_certificates(x5c_header_or_certificates)
|
|
46
|
+
if x5c_header_or_certificates.all? { |obj| obj.is_a?(OpenSSL::X509::Certificate) }
|
|
47
|
+
x5c_header_or_certificates
|
|
48
|
+
else
|
|
49
|
+
x5c_header_or_certificates.map do |encoded|
|
|
50
|
+
OpenSSL::X509::Certificate.new(::JWT::Base64.url_decode(encoded))
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
data/lib/jwt.rb
CHANGED
|
@@ -1,63 +1,31 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
3
|
+
require 'jwt/version'
|
|
4
|
+
require 'jwt/base64'
|
|
5
|
+
require 'jwt/json'
|
|
4
6
|
require 'jwt/decode'
|
|
5
|
-
require 'jwt/
|
|
7
|
+
require 'jwt/configuration'
|
|
6
8
|
require 'jwt/encode'
|
|
7
9
|
require 'jwt/error'
|
|
8
|
-
require 'jwt/
|
|
9
|
-
require 'jwt/verify'
|
|
10
|
+
require 'jwt/jwk'
|
|
10
11
|
|
|
11
12
|
# JSON Web Token implementation
|
|
12
13
|
#
|
|
13
14
|
# Should be up to date with the latest spec:
|
|
14
15
|
# https://tools.ietf.org/html/rfc7519
|
|
15
16
|
module JWT
|
|
16
|
-
|
|
17
|
+
extend ::JWT::Configuration
|
|
17
18
|
|
|
18
19
|
module_function
|
|
19
20
|
|
|
20
21
|
def encode(payload, key, algorithm = 'HS256', header_fields = {})
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
Encode.new(payload: payload,
|
|
23
|
+
key: key,
|
|
24
|
+
algorithm: algorithm,
|
|
25
|
+
headers: header_fields).segments
|
|
23
26
|
end
|
|
24
27
|
|
|
25
|
-
def decode(jwt, key = nil, verify = true,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
merged_options = DEFAULT_OPTIONS.merge(custom_options)
|
|
29
|
-
|
|
30
|
-
decoder = Decode.new jwt, verify
|
|
31
|
-
header, payload, signature, signing_input = decoder.decode_segments
|
|
32
|
-
decode_verify_signature(key, header, payload, signature, signing_input, merged_options, &keyfinder) if verify
|
|
33
|
-
|
|
34
|
-
Verify.verify_claims(payload, merged_options) if verify
|
|
35
|
-
|
|
36
|
-
raise(JWT::DecodeError, 'Not enough or too many segments') unless header && payload
|
|
37
|
-
|
|
38
|
-
[payload, header]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def decode_verify_signature(key, header, payload, signature, signing_input, options, &keyfinder)
|
|
42
|
-
algo, key = signature_algorithm_and_key(header, payload, key, &keyfinder)
|
|
43
|
-
|
|
44
|
-
raise(JWT::IncorrectAlgorithm, 'An algorithm must be specified') if allowed_algorithms(options).empty?
|
|
45
|
-
raise(JWT::IncorrectAlgorithm, 'Expected a different algorithm') unless allowed_algorithms(options).include?(algo)
|
|
46
|
-
|
|
47
|
-
Signature.verify(algo, key, signing_input, signature)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def signature_algorithm_and_key(header, payload, key, &keyfinder)
|
|
51
|
-
key = (keyfinder.arity == 2 ? yield(header, payload) : yield(header)) if keyfinder
|
|
52
|
-
raise JWT::DecodeError, 'No verification key available' unless key
|
|
53
|
-
[header['alg'], key]
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def allowed_algorithms(options)
|
|
57
|
-
if options.key?(:algorithm)
|
|
58
|
-
[options[:algorithm]]
|
|
59
|
-
else
|
|
60
|
-
options[:algorithms] || []
|
|
61
|
-
end
|
|
28
|
+
def decode(jwt, key = nil, verify = true, options = {}, &keyfinder) # rubocop:disable Style/OptionalBooleanParameter
|
|
29
|
+
Decode.new(jwt, key, verify, configuration.decode.to_h.merge(options), &keyfinder).decode_segments
|
|
62
30
|
end
|
|
63
31
|
end
|
data/ruby-jwt.gemspec
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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
|
|
|
@@ -11,21 +13,27 @@ Gem::Specification.new do |spec|
|
|
|
11
13
|
spec.email = 'timrudat@gmail.com'
|
|
12
14
|
spec.summary = 'JSON Web Token implementation in Ruby'
|
|
13
15
|
spec.description = 'A pure ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard.'
|
|
14
|
-
spec.homepage = '
|
|
16
|
+
spec.homepage = 'https://github.com/jwt/ruby-jwt'
|
|
15
17
|
spec.license = 'MIT'
|
|
16
|
-
spec.required_ruby_version = '>= 2.
|
|
18
|
+
spec.required_ruby_version = '>= 2.5'
|
|
19
|
+
spec.metadata = {
|
|
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",
|
|
22
|
+
'rubygems_mfa_required' => 'true'
|
|
23
|
+
}
|
|
24
|
+
|
|
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
|
|
17
30
|
|
|
18
|
-
spec.
|
|
19
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
20
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
31
|
+
spec.executables = []
|
|
21
32
|
spec.require_paths = %w[lib]
|
|
22
33
|
|
|
34
|
+
spec.add_development_dependency 'appraisal'
|
|
23
35
|
spec.add_development_dependency 'bundler'
|
|
24
36
|
spec.add_development_dependency 'rake'
|
|
25
37
|
spec.add_development_dependency 'rspec'
|
|
26
38
|
spec.add_development_dependency 'simplecov'
|
|
27
|
-
spec.add_development_dependency 'simplecov-json'
|
|
28
|
-
spec.add_development_dependency 'codeclimate-test-reporter'
|
|
29
|
-
spec.add_development_dependency 'codacy-coverage'
|
|
30
|
-
spec.add_development_dependency 'rbnacl'
|
|
31
39
|
end
|
metadata
CHANGED
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jwt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.7.0
|
|
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:
|
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
14
|
+
name: appraisal
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
30
16
|
requirements:
|
|
31
17
|
- - ">="
|
|
@@ -39,35 +25,7 @@ dependencies:
|
|
|
39
25
|
- !ruby/object:Gem::Version
|
|
40
26
|
version: '0'
|
|
41
27
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: simplecov
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - ">="
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: simplecov-json
|
|
28
|
+
name: bundler
|
|
71
29
|
requirement: !ruby/object:Gem::Requirement
|
|
72
30
|
requirements:
|
|
73
31
|
- - ">="
|
|
@@ -81,7 +39,7 @@ dependencies:
|
|
|
81
39
|
- !ruby/object:Gem::Version
|
|
82
40
|
version: '0'
|
|
83
41
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
42
|
+
name: rake
|
|
85
43
|
requirement: !ruby/object:Gem::Requirement
|
|
86
44
|
requirements:
|
|
87
45
|
- - ">="
|
|
@@ -95,7 +53,7 @@ dependencies:
|
|
|
95
53
|
- !ruby/object:Gem::Version
|
|
96
54
|
version: '0'
|
|
97
55
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
56
|
+
name: rspec
|
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
|
100
58
|
requirements:
|
|
101
59
|
- - ">="
|
|
@@ -109,7 +67,7 @@ dependencies:
|
|
|
109
67
|
- !ruby/object:Gem::Version
|
|
110
68
|
version: '0'
|
|
111
69
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
70
|
+
name: simplecov
|
|
113
71
|
requirement: !ruby/object:Gem::Requirement
|
|
114
72
|
requirements:
|
|
115
73
|
- - ">="
|
|
@@ -129,63 +87,57 @@ executables: []
|
|
|
129
87
|
extensions: []
|
|
130
88
|
extra_rdoc_files: []
|
|
131
89
|
files:
|
|
132
|
-
-
|
|
133
|
-
- ".ebert.yml"
|
|
134
|
-
- ".gitignore"
|
|
135
|
-
- ".reek.yml"
|
|
136
|
-
- ".rspec"
|
|
137
|
-
- ".rubocop.yml"
|
|
138
|
-
- ".travis.yml"
|
|
90
|
+
- AUTHORS
|
|
139
91
|
- CHANGELOG.md
|
|
140
|
-
-
|
|
92
|
+
- CODE_OF_CONDUCT.md
|
|
93
|
+
- CONTRIBUTING.md
|
|
141
94
|
- LICENSE
|
|
142
|
-
- Manifest
|
|
143
95
|
- README.md
|
|
144
|
-
- Rakefile
|
|
145
96
|
- lib/jwt.rb
|
|
97
|
+
- lib/jwt/algos.rb
|
|
98
|
+
- lib/jwt/algos/algo_wrapper.rb
|
|
146
99
|
- lib/jwt/algos/ecdsa.rb
|
|
147
100
|
- lib/jwt/algos/eddsa.rb
|
|
148
101
|
- lib/jwt/algos/hmac.rb
|
|
102
|
+
- lib/jwt/algos/hmac_rbnacl.rb
|
|
103
|
+
- lib/jwt/algos/hmac_rbnacl_fixed.rb
|
|
104
|
+
- lib/jwt/algos/none.rb
|
|
105
|
+
- lib/jwt/algos/ps.rb
|
|
149
106
|
- lib/jwt/algos/rsa.rb
|
|
150
107
|
- lib/jwt/algos/unsupported.rb
|
|
108
|
+
- lib/jwt/base64.rb
|
|
109
|
+
- lib/jwt/claims_validator.rb
|
|
110
|
+
- lib/jwt/configuration.rb
|
|
111
|
+
- lib/jwt/configuration/container.rb
|
|
112
|
+
- lib/jwt/configuration/decode_configuration.rb
|
|
113
|
+
- lib/jwt/configuration/jwk_configuration.rb
|
|
151
114
|
- lib/jwt/decode.rb
|
|
152
|
-
- lib/jwt/default_options.rb
|
|
153
115
|
- lib/jwt/encode.rb
|
|
154
116
|
- lib/jwt/error.rb
|
|
117
|
+
- lib/jwt/json.rb
|
|
118
|
+
- lib/jwt/jwk.rb
|
|
119
|
+
- lib/jwt/jwk/ec.rb
|
|
120
|
+
- lib/jwt/jwk/hmac.rb
|
|
121
|
+
- lib/jwt/jwk/key_base.rb
|
|
122
|
+
- lib/jwt/jwk/key_finder.rb
|
|
123
|
+
- lib/jwt/jwk/kid_as_key_digest.rb
|
|
124
|
+
- lib/jwt/jwk/okp_rbnacl.rb
|
|
125
|
+
- lib/jwt/jwk/rsa.rb
|
|
126
|
+
- lib/jwt/jwk/set.rb
|
|
127
|
+
- lib/jwt/jwk/thumbprint.rb
|
|
155
128
|
- lib/jwt/security_utils.rb
|
|
156
|
-
- lib/jwt/signature.rb
|
|
157
129
|
- lib/jwt/verify.rb
|
|
158
130
|
- lib/jwt/version.rb
|
|
131
|
+
- lib/jwt/x5c_key_finder.rb
|
|
159
132
|
- ruby-jwt.gemspec
|
|
160
|
-
|
|
161
|
-
- spec/fixtures/certs/ec256-public.pem
|
|
162
|
-
- spec/fixtures/certs/ec256-wrong-private.pem
|
|
163
|
-
- spec/fixtures/certs/ec256-wrong-public.pem
|
|
164
|
-
- spec/fixtures/certs/ec384-private.pem
|
|
165
|
-
- spec/fixtures/certs/ec384-public.pem
|
|
166
|
-
- spec/fixtures/certs/ec384-wrong-private.pem
|
|
167
|
-
- spec/fixtures/certs/ec384-wrong-public.pem
|
|
168
|
-
- spec/fixtures/certs/ec512-private.pem
|
|
169
|
-
- spec/fixtures/certs/ec512-public.pem
|
|
170
|
-
- spec/fixtures/certs/ec512-wrong-private.pem
|
|
171
|
-
- spec/fixtures/certs/ec512-wrong-public.pem
|
|
172
|
-
- spec/fixtures/certs/rsa-1024-private.pem
|
|
173
|
-
- spec/fixtures/certs/rsa-1024-public.pem
|
|
174
|
-
- spec/fixtures/certs/rsa-2048-private.pem
|
|
175
|
-
- spec/fixtures/certs/rsa-2048-public.pem
|
|
176
|
-
- spec/fixtures/certs/rsa-2048-wrong-private.pem
|
|
177
|
-
- spec/fixtures/certs/rsa-2048-wrong-public.pem
|
|
178
|
-
- spec/fixtures/certs/rsa-4096-private.pem
|
|
179
|
-
- spec/fixtures/certs/rsa-4096-public.pem
|
|
180
|
-
- spec/integration/readme_examples_spec.rb
|
|
181
|
-
- spec/jwt/verify_spec.rb
|
|
182
|
-
- spec/jwt_spec.rb
|
|
183
|
-
- spec/spec_helper.rb
|
|
184
|
-
homepage: http://github.com/jwt/ruby-jwt
|
|
133
|
+
homepage: https://github.com/jwt/ruby-jwt
|
|
185
134
|
licenses:
|
|
186
135
|
- MIT
|
|
187
|
-
metadata:
|
|
188
|
-
|
|
136
|
+
metadata:
|
|
137
|
+
bug_tracker_uri: https://github.com/jwt/ruby-jwt/issues
|
|
138
|
+
changelog_uri: https://github.com/jwt/ruby-jwt/blob/v2.7.0/CHANGELOG.md
|
|
139
|
+
rubygems_mfa_required: 'true'
|
|
140
|
+
post_install_message:
|
|
189
141
|
rdoc_options: []
|
|
190
142
|
require_paths:
|
|
191
143
|
- lib
|
|
@@ -193,40 +145,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
193
145
|
requirements:
|
|
194
146
|
- - ">="
|
|
195
147
|
- !ruby/object:Gem::Version
|
|
196
|
-
version: '2.
|
|
148
|
+
version: '2.5'
|
|
197
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
150
|
requirements:
|
|
199
151
|
- - ">="
|
|
200
152
|
- !ruby/object:Gem::Version
|
|
201
153
|
version: '0'
|
|
202
154
|
requirements: []
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
signing_key:
|
|
155
|
+
rubygems_version: 3.3.7
|
|
156
|
+
signing_key:
|
|
206
157
|
specification_version: 4
|
|
207
158
|
summary: JSON Web Token implementation in Ruby
|
|
208
|
-
test_files:
|
|
209
|
-
- spec/fixtures/certs/ec256-private.pem
|
|
210
|
-
- spec/fixtures/certs/ec256-public.pem
|
|
211
|
-
- spec/fixtures/certs/ec256-wrong-private.pem
|
|
212
|
-
- spec/fixtures/certs/ec256-wrong-public.pem
|
|
213
|
-
- spec/fixtures/certs/ec384-private.pem
|
|
214
|
-
- spec/fixtures/certs/ec384-public.pem
|
|
215
|
-
- spec/fixtures/certs/ec384-wrong-private.pem
|
|
216
|
-
- spec/fixtures/certs/ec384-wrong-public.pem
|
|
217
|
-
- spec/fixtures/certs/ec512-private.pem
|
|
218
|
-
- spec/fixtures/certs/ec512-public.pem
|
|
219
|
-
- spec/fixtures/certs/ec512-wrong-private.pem
|
|
220
|
-
- spec/fixtures/certs/ec512-wrong-public.pem
|
|
221
|
-
- spec/fixtures/certs/rsa-1024-private.pem
|
|
222
|
-
- spec/fixtures/certs/rsa-1024-public.pem
|
|
223
|
-
- spec/fixtures/certs/rsa-2048-private.pem
|
|
224
|
-
- spec/fixtures/certs/rsa-2048-public.pem
|
|
225
|
-
- spec/fixtures/certs/rsa-2048-wrong-private.pem
|
|
226
|
-
- spec/fixtures/certs/rsa-2048-wrong-public.pem
|
|
227
|
-
- spec/fixtures/certs/rsa-4096-private.pem
|
|
228
|
-
- spec/fixtures/certs/rsa-4096-public.pem
|
|
229
|
-
- spec/integration/readme_examples_spec.rb
|
|
230
|
-
- spec/jwt/verify_spec.rb
|
|
231
|
-
- spec/jwt_spec.rb
|
|
232
|
-
- spec/spec_helper.rb
|
|
159
|
+
test_files: []
|
data/.codeclimate.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
engines:
|
|
2
|
-
rubocop:
|
|
3
|
-
enabled: true
|
|
4
|
-
golint:
|
|
5
|
-
enabled: false
|
|
6
|
-
gofmt:
|
|
7
|
-
enabled: false
|
|
8
|
-
eslint:
|
|
9
|
-
enabled: false
|
|
10
|
-
csslint:
|
|
11
|
-
enabled: false
|
|
12
|
-
|
|
13
|
-
ratings:
|
|
14
|
-
paths:
|
|
15
|
-
- lib/**
|
|
16
|
-
- "**.rb"
|
|
17
|
-
|
|
18
|
-
exclude_paths:
|
|
19
|
-
- spec/**/*
|
|
20
|
-
- vendor/**/*
|
data/.ebert.yml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
styleguide: excpt/linters
|
|
2
|
-
engines:
|
|
3
|
-
reek:
|
|
4
|
-
enabled: true
|
|
5
|
-
fixme:
|
|
6
|
-
enabled: true
|
|
7
|
-
rubocop:
|
|
8
|
-
enabled: true
|
|
9
|
-
channel: rubocop-0-49
|
|
10
|
-
duplication:
|
|
11
|
-
config:
|
|
12
|
-
languages:
|
|
13
|
-
- ruby
|
|
14
|
-
enabled: true
|
|
15
|
-
remark-lint:
|
|
16
|
-
enabled: true
|
|
17
|
-
exclude_paths:
|
|
18
|
-
- spec
|
data/.gitignore
DELETED
data/.reek.yml
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
TooManyStatements:
|
|
3
|
-
max_statements: 10
|
|
4
|
-
UncommunicativeMethodName:
|
|
5
|
-
reject:
|
|
6
|
-
- !ruby/regexp /^[a-z]$/
|
|
7
|
-
- !ruby/regexp /[0-9]$/
|
|
8
|
-
UncommunicativeParameterName:
|
|
9
|
-
reject:
|
|
10
|
-
- !ruby/regexp /^.$/
|
|
11
|
-
- !ruby/regexp /[0-9]$/
|
|
12
|
-
- !ruby/regexp /^_/
|
|
13
|
-
UncommunicativeVariableName:
|
|
14
|
-
reject:
|
|
15
|
-
- !ruby/regexp /^.$/
|
|
16
|
-
- !ruby/regexp /[0-9]$/
|
|
17
|
-
UtilityFunction:
|
|
18
|
-
enabled: false
|
|
19
|
-
LongParameterList:
|
|
20
|
-
enabled: false
|
|
21
|
-
DuplicateMethodCall:
|
|
22
|
-
max_calls: 2
|
|
23
|
-
IrresponsibleModule:
|
|
24
|
-
enabled: false
|
|
25
|
-
NestedIterators:
|
|
26
|
-
max_allowed_nesting: 2
|
|
27
|
-
PrimaDonnaMethod:
|
|
28
|
-
enabled: false
|
|
29
|
-
UnusedParameters:
|
|
30
|
-
enabled: false
|
|
31
|
-
FeatureEnvy:
|
|
32
|
-
enabled: false
|
|
33
|
-
ControlParameter:
|
|
34
|
-
enabled: false
|
|
35
|
-
UnusedPrivateMethod:
|
|
36
|
-
enabled: false
|
|
37
|
-
InstanceVariableAssumption:
|
|
38
|
-
exclude:
|
|
39
|
-
- !ruby/regexp /Controller$/
|
|
40
|
-
- !ruby/regexp /Mailer$/s
|
data/.rspec
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|