From 2edde84dfd67b51606d27994bb993005cebad0b5 Mon Sep 17 00:00:00 2001 From: Julija Alieckaja Date: Tue, 5 Mar 2024 12:14:57 +0100 Subject: [PATCH] Update deps versions --- jwt_sessions.gemspec | 9 +++++---- lib/jwt_sessions.rb | 2 +- test/support/dummy_sinatra_api/Gemfile | 3 ++- .../store_adapters/test_redis_store_adapter.rb | 12 ++++++------ test/units/test_token_store.rb | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/jwt_sessions.gemspec b/jwt_sessions.gemspec index 65f630c..c98c259 100644 --- a/jwt_sessions.gemspec +++ b/jwt_sessions.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + $LOAD_PATH.push File.expand_path("../lib", __FILE__) require "jwt_sessions/version" @@ -25,9 +26,9 @@ Gem::Specification.new do |s| "bug_tracker_uri" => "https://github.com/tuwukee/jwt_sessions/issues" } - s.add_dependency "jwt", "~> 2.6", "< 3" + s.add_dependency "jwt", ">= 2.8", "< 3" - s.add_development_dependency "bundler", ">= 1.16" - s.add_development_dependency "rake", "~> 12.3" - s.add_development_dependency "rspec", "~> 3.11" + s.add_development_dependency "bundler", ">= 2" + s.add_development_dependency "rake", "~> 13.1" + s.add_development_dependency "rspec", "~> 3.13" end diff --git a/lib/jwt_sessions.rb b/lib/jwt_sessions.rb index 77bc7cd..cf49928 100644 --- a/lib/jwt_sessions.rb +++ b/lib/jwt_sessions.rb @@ -155,7 +155,7 @@ def cookie_by(token_type) private def supported_algos - algos = JWT::Algos::ALGOS - [JWT::Algos::Unsupported] + algos = JWT::JWA::ALGOS - [JWT::JWA::Unsupported] algos.map { |algo| algo::SUPPORTED }.flatten + [NONE] end end diff --git a/test/support/dummy_sinatra_api/Gemfile b/test/support/dummy_sinatra_api/Gemfile index 4fb56b5..1a60b24 100644 --- a/test/support/dummy_sinatra_api/Gemfile +++ b/test/support/dummy_sinatra_api/Gemfile @@ -1,10 +1,11 @@ +# frozen_string_literal: true + source "https://rubygems.org" gem "redis" gem "sinatra" gem "sinatra-contrib", require: false gem "jwt" -gem "pry-byebug", "~> 3.4" group :test do gem "rspec" diff --git a/test/units/jwt_sessions/store_adapters/test_redis_store_adapter.rb b/test/units/jwt_sessions/store_adapters/test_redis_store_adapter.rb index fd651d7..757be13 100644 --- a/test/units/jwt_sessions/store_adapters/test_redis_store_adapter.rb +++ b/test/units/jwt_sessions/store_adapters/test_redis_store_adapter.rb @@ -35,17 +35,17 @@ def test_support_of_extra_options def test_default_url adapter = JWTSessions::StoreAdapters::RedisStoreAdapter.new - assert_equal "redis://127.0.0.1:6379/0", adapter.storage.config.server_url + assert_equal "redis://127.0.0.1:6379", adapter.storage.config.server_url end def test_url_with_env_var ENV["REDIS_URL"] = "redis://locallol:2018/" adapter = JWTSessions::StoreAdapters::RedisStoreAdapter.new - assert_equal "redis://locallol:2018/0", adapter.storage.config.server_url + assert_equal "redis://locallol:2018", adapter.storage.config.server_url ENV.delete("REDIS_URL") adapter = JWTSessions::StoreAdapters::RedisStoreAdapter.new - assert_equal "redis://127.0.0.1:6379/0", adapter.storage.config.server_url + assert_equal "redis://127.0.0.1:6379", adapter.storage.config.server_url end def test_configuration_via_host_port_and_db @@ -68,13 +68,13 @@ def test_configuration_via_host_port_and_db_in_module def test_configuration_via_redis_url adapter = JWTSessions::StoreAdapters::RedisStoreAdapter.new(redis_url: "redis://127.0.0.2:6322") - assert_equal "redis://127.0.0.2:6322/0", adapter.storage.config.server_url + assert_equal "redis://127.0.0.2:6322", adapter.storage.config.server_url end def test_configuration_via_redis_url_in_module - JWTSessions.redis_url = "redis://127.0.0.2:6322" + JWTSessions.redis_url = "redis://127.0.0.2:6323" adapter = JWTSessions::StoreAdapters::RedisStoreAdapter.new - assert_equal "redis://127.0.0.2:6322/0", adapter.storage.config.server_url + assert_equal "redis://127.0.0.2:6323", adapter.storage.config.server_url end def test_configuration_via_redis_client diff --git a/test/units/test_token_store.rb b/test/units/test_token_store.rb index 0e176cd..73cd5ab 100644 --- a/test/units/test_token_store.rb +++ b/test/units/test_token_store.rb @@ -30,7 +30,7 @@ def test_setting_redis_token_store_along_with_module_configuration JWTSessions.redis_port = 6378 JWTSessions.token_store = :redis - assert_equal "redis://127.0.0.1:6378/0", JWTSessions.token_store.storage.config.server_url + assert_equal "redis://127.0.0.1:6378", JWTSessions.token_store.storage.config.server_url end def test_setting_redis_token_store_without_options