From 618e8a237f967cca95c81fae3253f25cfda706ff Mon Sep 17 00:00:00 2001 From: Joakim Antman Date: Tue, 1 Oct 2024 22:40:13 +0300 Subject: [PATCH] Bring back old methods --- lib/jwt.rb | 3 +++ lib/jwt/claims.rb | 2 +- lib/jwt/jwa.rb | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/jwt.rb b/lib/jwt.rb index f7f28d47..dd5cdff5 100644 --- a/lib/jwt.rb +++ b/lib/jwt.rb @@ -11,6 +11,9 @@ require 'jwt/jwk' require 'jwt/claims' +require 'jwt/claims_validator' +require 'jwt/verify' + # JSON Web Token implementation # # Should be up to date with the latest spec: diff --git a/lib/jwt/claims.rb b/lib/jwt/claims.rb index 9bb71488..8ae74299 100644 --- a/lib/jwt/claims.rb +++ b/lib/jwt/claims.rb @@ -28,7 +28,7 @@ module Claims class << self def verify!(payload, options) VERIFIERS.each do |key, verifier_builder| - next unless options[key] + next unless options[key] || options[key.to_s] verifier_builder&.call(options)&.verify!(context: VerificationContext.new(payload: payload)) end diff --git a/lib/jwt/jwa.rb b/lib/jwt/jwa.rb index 8a975824..75edf621 100644 --- a/lib/jwt/jwa.rb +++ b/lib/jwt/jwa.rb @@ -40,6 +40,11 @@ def resolve(algorithm) algorithm end + + def create(algorithm) + Deprecations.warning('The ::JWT::JWA.create method is deprecated and is going to be removed in future ruby-jwt versions') + resolve(algorithm) + end end end end