Skip to content

[backport 1.2.x] Fix Rails 7.1 CSRF token support #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: 1.2-stable
Choose a base branch
from
Open
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
25 changes: 6 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Java CI

on:
push:
branches: [ "master", "*release*", "*stable*" ]
branches: [ "master", "*-stable" ]
pull_request:
branches: [ "master", "*release*", "*stable*" ]
branches: [ "master", "*-stable" ]

env:
# Default versions for canonical release build
DEFAULT_JAVA_VERSION: '8'
DEFAULT_JRUBY_VERSION: '9.4.12.1' # Should match pom.xml <jruby.version> property (AND a version inside the test matrix)
DEFAULT_JRUBY_VERSION: '9.4.13.0' # Should match pom.xml <jruby.version> property (AND a version inside the test matrix)

jobs:
build:
Expand All @@ -18,15 +18,8 @@ jobs:

strategy:
matrix:
jruby_version: [ '9.3.15.0', '9.4.12.1' ] # , '10.0.0.1'
jruby_version: [ '9.3.15.0', '9.4.13.0' ]
java_version: [ '8', '11', '17', '21' ]
exclude:
- jruby_version: '10.0.0.1'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '17' # JRuby 10 requires Java 21
fail-fast: false

steps:
Expand Down Expand Up @@ -54,7 +47,7 @@ jobs:

strategy:
matrix:
jruby_version: [ '9.3.15.0', '9.4.12.1' ] # , '10.0.0.1'
jruby_version: [ '9.3.15.0', '9.4.13.0' ]
java_version: [ '8', '11', '17', '21' ]
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72' ]
exclude:
Expand All @@ -64,12 +57,6 @@ jobs:
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
- jruby_version: '10.0.0.1'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '17' # JRuby 10 requires Java 21
fail-fast: false

env:
Expand All @@ -87,7 +74,7 @@ jobs:
cache: maven

- name: Setup JRuby
uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: jruby-${{ matrix.jruby_version }}
bundler-cache: 'false' # Need to install later so we can vary from Gemfile.lock as required for JRuby version compatibility
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ GEM
rake
thor (>= 0.14.0)
diff-lcs (1.6.2)
rack (2.2.16)
rack (2.2.17)
rake (13.3.0)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.4)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
Expand Down
5 changes: 3 additions & 2 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
## 1.2.4 (UNRELEASED)

- update (bundled) rack to 2.2.16
- update (bundled) rack to 2.2.17
- Fix Rails 7.1 CSRF protection when working with `JavaServletStore` sessions

## 1.2.3

- avoid warnings due usage of `File.exists?`
- avoid warnings due to usage of `File.exists?`
- Fix Rails 7.1 compatibility by ensuring active_support is required before railtie
- Workaround logger require issues with concurrent-ruby 1.3.5 and older Rails versions
- Workaround NameError frozen string literal issues with JRuby 9.3 and Rails 5.2/6.0
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ module JRubyJars
end
require jruby_rack_jar_path if defined?(JRUBY_VERSION)
end
require 'jruby/rack/version' # @deprecated to be removed in 1.2
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails50.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rake", "~> 13.2", group: :test, require: nil
gem "rake", "~> 13.3", group: :test, require: nil
gem "rspec", group: :test
gem "rails", "~> 5.0.0"

Expand Down
22 changes: 11 additions & 11 deletions gemfiles/rails50.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GEM
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.5)
net-imap (0.5.8)
net-imap (0.5.9)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -78,7 +78,7 @@ GEM
nokogiri (1.18.8-java)
racc (~> 1.4)
racc (1.8.1-java)
rack (2.2.15)
rack (2.2.17)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
Expand All @@ -93,7 +93,7 @@ GEM
bundler (>= 1.3.0)
railties (= 5.0.7.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
Expand All @@ -106,20 +106,20 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.2.1)
rspec (3.13.0)
rake (13.3.0)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.4)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.4)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.3)
rspec-support (3.13.4)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
Expand Down Expand Up @@ -147,8 +147,8 @@ DEPENDENCIES
appraisal
rack (~> 2.2)
rails (~> 5.0.0)
rake (~> 13.2)
rake (~> 13.3)
rspec

BUNDLED WITH
2.3.27
2.6.3
2 changes: 1 addition & 1 deletion gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rake", "~> 13.2", group: :test, require: nil
gem "rake", "~> 13.3", group: :test, require: nil
gem "rspec", group: :test
gem "rails", "~> 5.2.0"

Expand Down
26 changes: 13 additions & 13 deletions gemfiles/rails52.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ GEM
rake
thor (>= 0.14.0)
arel (9.0.0)
base64 (0.2.0)
base64 (0.3.0)
builder (3.3.0)
concurrent-ruby (1.3.5)
crass (1.0.6)
Expand All @@ -71,7 +71,7 @@ GEM
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.5)
net-imap (0.5.8)
net-imap (0.5.9)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -84,7 +84,7 @@ GEM
nokogiri (1.18.8-java)
racc (~> 1.4)
racc (1.8.1-java)
rack (2.2.15)
rack (2.2.17)
rack-test (2.2.0)
rack (>= 1.3)
rails (5.2.8.1)
Expand All @@ -100,7 +100,7 @@ GEM
bundler (>= 1.3.0)
railties (= 5.2.8.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
Expand All @@ -113,20 +113,20 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (13.2.1)
rspec (3.13.0)
rake (13.3.0)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.4)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.4)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.3)
rspec-support (3.13.4)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
Expand All @@ -140,7 +140,7 @@ GEM
timeout (0.4.3)
tzinfo (1.2.11)
thread_safe (~> 0.1)
websocket-driver (0.7.7-java)
websocket-driver (0.8.0-java)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -155,8 +155,8 @@ DEPENDENCIES
appraisal
rack (~> 2.2)
rails (~> 5.2.0)
rake (~> 13.2)
rake (~> 13.3)
rspec

BUNDLED WITH
2.3.27
2.6.3
2 changes: 1 addition & 1 deletion gemfiles/rails60.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rake", "~> 13.2", group: :test, require: nil
gem "rake", "~> 13.3", group: :test, require: nil
gem "rspec", group: :test
gem "rails", "~> 6.0.0"

Expand Down
28 changes: 14 additions & 14 deletions gemfiles/rails60.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GEM
bundler
rake
thor (>= 0.14.0)
base64 (0.2.0)
base64 (0.3.0)
builder (3.3.0)
concurrent-ruby (1.3.5)
crass (1.0.6)
Expand All @@ -84,7 +84,7 @@ GEM
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.5)
net-imap (0.5.8)
net-imap (0.5.9)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -97,7 +97,7 @@ GEM
nokogiri (1.18.8-java)
racc (~> 1.4)
racc (1.8.1-java)
rack (2.2.15)
rack (2.2.17)
rack-test (2.2.0)
rack (>= 1.3)
rails (6.0.6.1)
Expand All @@ -115,7 +115,7 @@ GEM
bundler (>= 1.3.0)
railties (= 6.0.6.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
Expand All @@ -128,20 +128,20 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (13.2.1)
rspec (3.13.0)
rake (13.3.0)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.4)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.4)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.3)
rspec-support (3.13.4)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
Expand All @@ -155,11 +155,11 @@ GEM
timeout (0.4.3)
tzinfo (1.2.11)
thread_safe (~> 0.1)
websocket-driver (0.7.7-java)
websocket-driver (0.8.0-java)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.7.2)
zeitwerk (2.6.18)

PLATFORMS
universal-java-1.8
Expand All @@ -171,8 +171,8 @@ DEPENDENCIES
appraisal
rack (~> 2.2)
rails (~> 6.0.0)
rake (~> 13.2)
rake (~> 13.3)
rspec

BUNDLED WITH
2.3.27
2.6.3
2 changes: 1 addition & 1 deletion gemfiles/rails61.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rake", "~> 13.2", group: :test, require: nil
gem "rake", "~> 13.3", group: :test, require: nil
gem "rspec", group: :test
gem "rails", "~> 6.1.0"

Expand Down
Loading