|
29 | 29 | end
|
30 | 30 |
|
31 | 31 | it 'decodes with HMAC algorithm without secret key' do
|
32 |
| - pending 'Different behaviour on OpenSSL 3.0 (https://github.com/openssl/openssl/issues/13089)' if ::JWT.openssl_3_hmac_empty_key_regression? |
| 32 | + pending 'Different behaviour on OpenSSL 3.0 (https://github.com/openssl/openssl/issues/13089)' if JWT.openssl_3_hmac_empty_key_regression? |
33 | 33 | token = JWT.encode payload, nil, 'HS256'
|
34 | 34 | decoded_token = JWT.decode token, nil, false
|
35 | 35 |
|
|
80 | 80 | end
|
81 | 81 | end
|
82 | 82 |
|
83 |
| - if ::Gem::Version.new(OpenSSL::VERSION) >= ::Gem::Version.new('2.1') |
| 83 | + if Gem::Version.new(OpenSSL::VERSION) >= Gem::Version.new('2.1') |
84 | 84 | it 'RSASSA-PSS' do
|
85 | 85 | rsa_private = OpenSSL::PKey::RSA.generate 2048
|
86 | 86 | rsa_public = rsa_private.public_key
|
|
414 | 414 | end
|
415 | 415 |
|
416 | 416 | it 'JWK with thumbprint as kid via type' do
|
417 |
| - JWT.configuration.jwk.kid_generator = ::JWT::JWK::Thumbprint |
| 417 | + JWT.configuration.jwk.kid_generator = JWT::JWK::Thumbprint |
418 | 418 |
|
419 | 419 | jwk = JWT::JWK.new(OpenSSL::PKey::RSA.new(2048))
|
420 | 420 |
|
|
424 | 424 | end
|
425 | 425 |
|
426 | 426 | it 'JWK with thumbprint given in the initializer (legacy)' do
|
427 |
| - jwk = JWT::JWK.new(OpenSSL::PKey::RSA.new(2048), kid_generator: ::JWT::JWK::Thumbprint) |
| 427 | + jwk = JWT::JWK.new(OpenSSL::PKey::RSA.new(2048), kid_generator: JWT::JWK::Thumbprint) |
428 | 428 |
|
429 | 429 | jwk_hash = jwk.export
|
430 | 430 |
|
431 | 431 | expect(jwk_hash[:kid].size).to eq(43)
|
432 | 432 | end
|
433 | 433 |
|
434 | 434 | it 'JWK with thumbprint given in the initializer' do
|
435 |
| - jwk = JWT::JWK.new(OpenSSL::PKey::RSA.new(2048), nil, kid_generator: ::JWT::JWK::Thumbprint) |
| 435 | + jwk = JWT::JWK.new(OpenSSL::PKey::RSA.new(2048), nil, kid_generator: JWT::JWK::Thumbprint) |
436 | 436 |
|
437 | 437 | jwk_hash = jwk.export
|
438 | 438 |
|
@@ -460,8 +460,8 @@ def self.verify(data:, signature:, verification_key:)
|
460 | 460 | end
|
461 | 461 | end
|
462 | 462 |
|
463 |
| - token = ::JWT.encode({ 'pay' => 'load' }, 'secret', custom_hs512_alg) |
464 |
| - _payload, _header = ::JWT.decode(token, 'secret', true, algorithm: custom_hs512_alg) |
| 463 | + token = JWT.encode({ 'pay' => 'load' }, 'secret', custom_hs512_alg) |
| 464 | + _payload, _header = JWT.decode(token, 'secret', true, algorithm: custom_hs512_alg) |
465 | 465 | end
|
466 | 466 | end
|
467 | 467 | end
|
0 commit comments