Skip to content

Commit 6b9c86e

Browse files
committed
Support Rails 8.1, drop support for EOL Ruby/Rails
1 parent d40c7c3 commit 6b9c86e

File tree

16 files changed

+231
-233
lines changed

16 files changed

+231
-233
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
name: gha-workflow-authlogic-test
1+
name: CI
22
on: [push, pull_request]
33
jobs:
44
# Linting is a separate job, primary because it only needs to be done once,
55
# and secondarily because jobs are performed concurrently.
6-
gha-job-authlogic-lint:
6+
lint:
77
name: Lint
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout source
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v5
1212
- name: Setup ruby
1313
uses: ruby/setup-ruby@v1
1414
with:
1515
# Set to `TargetRubyVersion` in `.rubocop.yml`
16-
ruby-version: 2.6
16+
ruby-version: 3.2
1717
- name: Bundle
1818
run: |
19-
gem install bundler -v 2.4.22
19+
gem install bundler
2020
bundle install --jobs 4 --retry 3
2121
- name: Lint
2222
run: bundle exec rubocop
2323

2424
# The test job is a matrix of ruby/rails versions.
25-
gha-job-authlogic-test:
25+
test:
2626
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
2727
runs-on: ubuntu-latest
2828
services:
29-
gha-service-authlogic-mysql:
29+
mysql:
3030
env:
3131
MYSQL_ALLOW_EMPTY_PASSWORD: yes
3232
MYSQL_DATABASE: authlogic
3333
image: mysql:8.0
3434
options: >-
35-
--health-cmd="mysqladmin ping"
36-
--health-interval=10s
37-
--health-timeout=5s
38-
--health-retries=3
35+
--health-cmd "mysqladmin ping"
36+
--health-interval 10s
37+
--health-timeout 5s
38+
--health-retries 3
3939
ports:
4040
- 3306:3306
41-
gha-service-authlogic-postgres:
41+
postgres:
4242
env:
4343
POSTGRES_PASSWORD: asdfasdf
4444
image: postgres
@@ -56,28 +56,15 @@ jobs:
5656
# have set this up with each database as a separate job, but then we'd be
5757
# duplicating the matrix configuration three times.
5858
matrix:
59-
# To keep matrix size down, only test highest and lowest rubies. In
60-
# `.rubocop.yml`, set `TargetRubyVersion`, to the lowest ruby version
59+
# In `.rubocop.yml`, set `TargetRubyVersion`, to the lowest Ruby version
6160
# tested here.
62-
ruby: ["3.1", "3.2", "3.3", "3.4"]
63-
rails: ["7.0", "7.1", "7.2", "8.0"]
64-
exclude:
65-
# rails 7 requires ruby >= 2.7.0
66-
- rails: "7.0"
67-
ruby: "3.1"
68-
- rails: "7.0"
69-
ruby: "3.2"
70-
- rails: "7.0"
71-
ruby: "3.3"
72-
- rails: "7.0"
73-
ruby: "3.4"
74-
- rails: "8.0"
75-
ruby: "3.1"
61+
ruby: ["3.2", "3.3", "3.4"]
62+
rails: ["7.2", "8.0", "8.1"]
7663
env:
7764
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb
7865
steps:
7966
- name: Checkout source
80-
uses: actions/checkout@v4
67+
uses: actions/checkout@v5
8168
- name: Setup ruby
8269
uses: ruby/setup-ruby@v1
8370
with:

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AllCops:
1212
# rubies on CI.
1313
#
1414
# Should be same as `ruby-version` in `.github/workflows/test.yml`
15-
TargetRubyVersion: 2.6
15+
TargetRubyVersion: 3.2
1616

1717
# Avoid empty lines in methods, they are a sign the method is too big.
1818
Layout/EmptyLineAfterGuardClause:

.rubocop_todo.yml

Lines changed: 131 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --exclude-limit 1000`
3-
# on 2020-03-24 00:02:43 -0400 using RuboCop version 0.80.1.
3+
# on 2025-10-16 20:21:05 UTC using RuboCop version 1.81.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

99
# Offense count: 7
10-
# Cop supports --auto-correct.
10+
# This cop supports safe autocorrection (--autocorrect).
1111
# Configuration parameters: EnforcedStyle, IndentationWidth.
1212
# SupportedStyles: with_first_argument, with_fixed_indentation
1313
Layout/ArgumentAlignment:
@@ -16,49 +16,155 @@ Layout/ArgumentAlignment:
1616
- 'lib/authlogic/acts_as_authentic/single_access_token.rb'
1717
- 'test/libs/user.rb'
1818

19-
# Offense count: 14
20-
# Cop supports --auto-correct.
21-
Lint/SendWithMixinArgument:
19+
# Offense count: 1
20+
# This cop supports safe autocorrection (--autocorrect).
21+
# Configuration parameters: Severity.
22+
# SupportedStylesAlignWith: start_of_line, begin
23+
Layout/BeginEndAlignment:
24+
EnforcedStyleAlignWith: begin
25+
26+
# Offense count: 2
27+
# This cop supports safe autocorrection (--autocorrect).
28+
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
29+
# AllowedMethods: alias_method, public, protected, private
30+
Layout/EmptyLinesAroundAttributeAccessor:
31+
Exclude:
32+
- 'lib/authlogic/crypto_providers/scrypt.rb'
33+
- 'test/libs/user_session.rb'
34+
35+
# Offense count: 1
36+
# This cop supports safe autocorrection (--autocorrect).
37+
Layout/RescueEnsureAlignment:
38+
Exclude:
39+
- 'lib/authlogic/acts_as_authentic/session_maintenance.rb'
40+
41+
# Offense count: 1
42+
# This cop supports safe autocorrection (--autocorrect).
43+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
44+
# SupportedStylesForExponentOperator: space, no_space
45+
# SupportedStylesForRationalLiterals: space, no_space
46+
Layout/SpaceAroundOperators:
2247
Exclude:
23-
- 'lib/authlogic/acts_as_authentic/base.rb'
24-
- 'lib/authlogic/controller_adapters/sinatra_adapter.rb'
2548
- 'lib/authlogic/test_case.rb'
2649

27-
# Offense count: 3
50+
# Offense count: 1
51+
# Configuration parameters: AllowComments.
52+
Lint/EmptyFile:
53+
Exclude:
54+
- 'test/session_test/credentials_test.rb'
55+
56+
# Offense count: 4
57+
# Configuration parameters: AllowedParentClasses.
58+
Lint/MissingSuper:
59+
Exclude:
60+
- 'lib/authlogic/test_case/mock_api_controller.rb'
61+
- 'lib/authlogic/test_case/mock_controller.rb'
62+
- 'lib/authlogic/test_case/mock_cookie_jar.rb'
63+
64+
# Offense count: 1
65+
# This cop supports unsafe autocorrection (--autocorrect-all).
66+
# Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
67+
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
68+
# AdditionalNilMethods: present?, blank?, try, try!
69+
Lint/RedundantSafeNavigation:
70+
Exclude:
71+
- 'lib/authlogic/test_case/mock_request.rb'
72+
73+
# Offense count: 1
74+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
2875
Metrics/AbcSize:
29-
Max: 16.03
76+
Max: 21
77+
78+
# Offense count: 2
79+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
80+
# SupportedStyles: snake_case, normalcase, non_integer
81+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
82+
Naming/VariableNumber:
83+
Exclude:
84+
- 'test/acts_as_authentic_test/perishable_token_test.rb'
85+
- 'test/session_test/session_test.rb'
86+
87+
# Offense count: 4
88+
# This cop supports safe autocorrection (--autocorrect).
89+
# Configuration parameters: EnforcedStyle.
90+
# SupportedStyles: separated, grouped
91+
Style/AccessorGrouping:
92+
Exclude:
93+
- 'lib/authlogic/crypto_providers/sha1.rb'
94+
- 'lib/authlogic/crypto_providers/sha1/v2.rb'
95+
96+
# Offense count: 1
97+
# This cop supports unsafe autocorrection (--autocorrect-all).
98+
# Configuration parameters: AllowedMethods, AllowedPatterns.
99+
# AllowedMethods: ==, equal?, eql?
100+
Style/ClassEqualityComparison:
101+
Exclude:
102+
- 'lib/authlogic/session/base.rb'
30103

31104
# Offense count: 5
32105
Style/ClassVars:
33106
Exclude:
34107
- 'lib/authlogic/i18n.rb'
35108

36-
# Offense count: 4
37-
Style/MethodMissingSuper:
109+
# Offense count: 1
110+
# This cop supports unsafe autocorrection (--autocorrect-all).
111+
Style/GlobalStdStream:
38112
Exclude:
39-
- 'lib/authlogic/controller_adapters/abstract_adapter.rb'
40-
- 'lib/authlogic/controller_adapters/sinatra_adapter.rb'
41-
- 'lib/authlogic/test_case/mock_request.rb'
113+
- 'test/test_helper.rb'
42114

43115
# Offense count: 3
44116
Style/MissingRespondToMissing:
45117
Exclude:
46118
- 'lib/authlogic/controller_adapters/sinatra_adapter.rb'
47119
- 'lib/authlogic/test_case/mock_request.rb'
48120

49-
# Offense count: 6
50-
# Cop supports --auto-correct.
51-
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
52-
# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
53-
Style/TrivialAccessors:
121+
# Offense count: 5
122+
# This cop supports safe autocorrection (--autocorrect).
123+
# Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
124+
Style/MultipleComparison:
54125
Exclude:
55126
- 'lib/authlogic/session/base.rb'
56127

57-
Style/HashEachMethods:
58-
Enabled: false
128+
# Offense count: 2
129+
# This cop supports safe autocorrection (--autocorrect).
130+
Style/RedundantFreeze:
131+
Exclude:
132+
- 'test/libs/user.rb'
59133

60-
Style/HashTransformKeys:
61-
Enabled: false
134+
# Offense count: 2
135+
# This cop supports safe autocorrection (--autocorrect).
136+
Style/RedundantRegexpEscape:
137+
Exclude:
138+
- 'test/libs/user.rb'
139+
140+
# Offense count: 3
141+
# This cop supports unsafe autocorrection (--autocorrect-all).
142+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
143+
# AllowedMethods: present?, blank?, presence, try, try!
144+
Style/SafeNavigation:
145+
Exclude:
146+
- 'lib/authlogic/acts_as_authentic/session_maintenance.rb'
147+
- 'lib/authlogic/session/base.rb'
62148

63-
Style/HashTransformValues:
64-
Enabled: false
149+
# Offense count: 1
150+
# This cop supports safe autocorrection (--autocorrect).
151+
# Configuration parameters: AllowModifier.
152+
Style/SoleNestedConditional:
153+
Exclude:
154+
- 'lib/authlogic/session/base.rb'
155+
156+
# Offense count: 3
157+
# This cop supports unsafe autocorrection (--autocorrect-all).
158+
# Configuration parameters: Mode.
159+
Style/StringConcatenation:
160+
Exclude:
161+
- 'test/session_test/existence_test.rb'
162+
- 'test/test_helper.rb'
163+
164+
# Offense count: 7
165+
# This cop supports safe autocorrection (--autocorrect).
166+
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
167+
# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
168+
Style/TrivialAccessors:
169+
Exclude:
170+
- 'lib/authlogic/session/base.rb'

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10+
- Breaking Changes
11+
- Dropped support for EOL Ruby versions (< 3.2)
12+
- Dropped support for EOL Rails versions (< 7.2)
13+
- Added
14+
- Added support for Rails 8.1
15+
- Fixed
16+
- None
17+
1018
## 6.5.0 (2025-04-10)
1119

1220
- Breaking Changes
@@ -46,7 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4654
- Added
4755
- `Authlogic::Session::Base.session_fixation_defense` - Reset the Rack
4856
session ID after authentication, to protect against Session Fixation
49-
attacks. (https://guides.rubyonrails.org/security.html#session-fixation)
57+
attacks. (<https://guides.rubyonrails.org/security.html#session-fixation>)
5058
Default: true
5159
- Fixed
5260
- None
@@ -135,5 +143,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
135143
## Previous major version
136144

137145
See eg. the `5-1-stable` branch
138-
139-
[1]: https://github.com/binarylogic/authlogic/blob/master/doc/use_normal_rails_validation.md

0 commit comments

Comments
 (0)