Skip to content

Commit

Permalink
Update deps versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tuwukee committed Mar 5, 2024
1 parent e0d12ea commit 2edde84
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
9 changes: 5 additions & 4 deletions jwt_sessions.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.push File.expand_path("../lib", __FILE__)

require "jwt_sessions/version"
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/jwt_sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion test/support/dummy_sinatra_api/Gemfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/units/test_token_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2edde84

Please sign in to comment.