Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.3']
rails: ['6.1', '7.0']
ruby: ['3.3', '4.0']
rails: ['7.0', '8.1']
# exclude:
# - ruby: '3.1'
# rails: '6.0'
Expand All @@ -26,7 +26,7 @@ jobs:
options: --entrypoint redis-server

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
15 changes: 4 additions & 11 deletions test/support/dummy_api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ end


# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", ENV.fetch("RAILS_VERSION", "~> 6.0")
gem "rails", ENV.fetch("RAILS_VERSION", "~> 8.0")
# Use sqlite3 as the database for Active Record
gem "sqlite3", "~> 1.4"
gem "sqlite3", ">= 2.1"
# Use Puma as the app server
gem "puma", ">= 4.0"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand All @@ -31,21 +31,14 @@ gem "redis"
eval_gemfile "../dummy_sinatra_api/Gemfile"

group :development, :test do
gem "rspec-rails", ">= 4.0"
gem "factory_bot_rails", "~> 4.8"
gem "rspec-rails", ">= 7.0"
gem "factory_bot_rails", "~> 6.4"
gem "capybara"
gem "rb-readline"
gem "minitest"
gem "rack-test"
end

group :development do
gem "listen", ">= 3.0.5", "< 3.2"
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
end

group :test do
gem "rbnacl"
end
2 changes: 1 addition & 1 deletion test/support/dummy_api/spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def process(action, method, params: {}, **args)

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]

# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
Expand Down
16 changes: 8 additions & 8 deletions test/support/dummy_sinatra_api/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,28 @@ def request_method

post "/refresh" do
authorize_refresh_request!
access_payload = payload.merge({ key: "reloaded access value" })
access_payload = payload.merge({ "key" => "reloaded access value" })
session = JWTSessions::Session.new(payload: access_payload, refresh_payload: payload)
session.refresh(found_token).to_json
end

post "/refresh_by_cookies" do
authorize_by_refresh_cookie!
access_payload = payload.merge({ key: "new access value" })
access_payload = payload.merge({ "key" => "new access value" })
session = JWTSessions::Session.new(payload: access_payload, refresh_payload: payload)
session.refresh(found_token).to_json
end

post "/refresh_by_headers" do
authorize_by_refresh_header!
access_payload = payload.merge({ key: "a little shy access value" })
access_payload = payload.merge({ "key" => "a little shy access value" })
session = JWTSessions::Session.new(payload: access_payload, refresh_payload: payload)
session.refresh(found_token).to_json
end

post "/refresh_by_access" do
authorize_refresh_by_access_request!
access_payload = payload.merge({ key: "a big brave access value" })
access_payload = payload.merge({ "key" => "a big brave access value" })
session = JWTSessions::Session.new(
payload: access_payload,
refresh_payload: payload,
Expand All @@ -90,7 +90,7 @@ def request_method

post "/refresh_by_access_by_cookies" do
authorize_refresh_by_access_cookie!
access_payload = payload.merge({ key: "such many auth methods much wow access value" })
access_payload = payload.merge({ "key" => "such many auth methods much wow access value" })
session = JWTSessions::Session.new(
payload: access_payload,
refresh_payload: payload,
Expand All @@ -101,7 +101,7 @@ def request_method

post "/refresh_by_access_by_headers" do
authorize_refresh_by_access_header!
access_payload = payload.merge({ key: "yet another access value" })
access_payload = payload.merge({ "key" => "yet another access value" })
session = JWTSessions::Session.new(
payload: access_payload,
refresh_payload: payload,
Expand All @@ -126,7 +126,7 @@ def request_method

post "/refresh_namespaced" do
authorize_refresh_request!
access_payload = payload.merge({ key: "reloaded hellooo" })
access_payload = payload.merge({ "key" => "reloaded hellooo" })

namespace = "custom-namespace"
session = JWTSessions::Session.new(
Expand All @@ -153,7 +153,7 @@ def request_method

post "/refresh_by_access_namespaced" do
authorize_refresh_by_access_request!
access_payload = payload.merge({ key: "reloaded guten tag" })
access_payload = payload.merge({ "key" => "reloaded guten tag" })

namespace = "custom-namespace"
session = JWTSessions::Session.new(
Expand Down
Loading