Skip to content

Commit f26fbb3

Browse files
committed
➖ Drop Rails 5.2 and 6.0
1 parent a0c8e5f commit f26fbb3

File tree

7 files changed

+21
-84
lines changed

7 files changed

+21
-84
lines changed

.github/workflows/unsupported.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
include:
39-
# Ruby 2.7, Rails 5.2
40-
- ruby: "ruby-2.7"
41-
appraisal: "rails-5-2"
42-
exec_cmd: "rake test"
43-
gemfile: "Appraisal.root"
44-
rubygems: '3.4.22'
45-
bundler: '2.4.22'
46-
47-
# Ruby 2.7, Rails 6.0
48-
- ruby: "ruby-2.7"
49-
appraisal: "rails-6-0"
50-
exec_cmd: "rake test"
51-
gemfile: "Appraisal.root"
52-
rubygems: '3.4.22'
53-
bundler: '2.4.22'
54-
5539
# Ruby 2.7, Rails 6.1
5640
- ruby: "ruby-2.7"
5741
appraisal: "rails-6-1"

Appraisals

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
11
# frozen_string_literal: true
22

3-
# Compat: Ruby >= 2.2.2
4-
# Test Matrix:
5-
# - Ruby 2.7
6-
appraise "rails-5-2" do
7-
# Load order is very important with combustion!
8-
gem "combustion", "~> 1.5"
9-
gem "sqlite3", "~> 1.4"
10-
11-
gem "rails", "~> 5.2.8.1"
12-
gem "nokogiri"
13-
eval_gemfile "modular/mini_testing.gemfile"
14-
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
15-
end
16-
17-
# Compat: Ruby >= 2.5
18-
# Test Matrix:
19-
# - Ruby 2.7
20-
appraise "rails-6-0" do
21-
# Load order is very important with combustion!
22-
gem "combustion", "~> 1.5"
23-
gem "sqlite3", "~> 1.4"
24-
25-
gem "rails", "~> 6.0.6.1"
26-
eval_gemfile "modular/mini_testing.gemfile"
27-
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
28-
end
29-
303
# Compat: Ruby >= 2.5
314
# Test Matrix:
325
# - Ruby 2.7

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ client-server communication (like requesting simple registration data).
5959
### Introduction
6060

6161
`masq2` adds ORACLE database support, as well as support for
62-
Rails 5.2, 6.0, 6.1, 7.0, 7.1, 7.2, 8.0,
63-
which `masq` never had.
62+
Rails 6.1, 7.0, 7.1, 7.2, 8.0, which `masq` never had.
6463

6564
The main functionality is in the server controller, which is the endpoint for incoming
6665
OpenID requests. The server controller is supposed to only interact with relying parties
@@ -78,7 +77,6 @@ Rails 5.2.8.1 is a security patch release to fix CVE-2022-32224.
7877
See: https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
7978

8079
The patch (Rails v5.2.8.1) causes an error with `masq` v0.3.4
81-
(... actually it doesn't work at all on Rails v5, but some forks have been fixed):
8280

8381
```
8482
Psych::DisallowedClass: Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess
@@ -91,14 +89,15 @@ serialize :parameters, Hash
9189

9290
so we instead switch to serializing as JSON:
9391
```ruby
94-
serialize :parameters, JSON
92+
# serialize :parameters, JSON # Would be for Rails 5.2/6.0, but this gem has already dropped support for Rails 5.2/6.0
93+
serialize :parameters, type: Hash, coder: JSON
9594
```
9695

9796
If an implementation needs to continue using the serialized Hash,
9897
you will need to override the definition by reopening the model, and adding:
9998

10099
```ruby
101-
serialize :parameters, Hash
100+
serialize :parameters, type: Hash, coder: Hash
102101
```
103102

104103
In addition, one of the following is also needed.

app/models/masq/open_id_request.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ module Masq
22
class OpenIdRequest < ActiveRecord::Base
33
validates_presence_of :token, :parameters
44

5-
def make_token
6-
self.token = Digest::SHA1.hexdigest(Time.now.to_s.split("").sort_by { rand }.join)
7-
end
85
before_validation :make_token, on: :create
96

107
serialize :parameters, type: Hash, coder: JSON
@@ -31,5 +28,11 @@ def from_trusted_domain?
3128

3229
Masq::Engine.config.masq["trusted_domains"].find { |domain| host.to_s.ends_with?(domain) }
3330
end
31+
32+
protected
33+
34+
def make_token
35+
self.token = Digest::SHA1.hexdigest(Time.now.to_s.split("").sort_by { rand }.join)
36+
end
3437
end
3538
end

gemfiles/rails_5_2.gemfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

gemfiles/rails_6_0.gemfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/internal/config/database.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
12
test:
2-
adapter: sqlite3
3-
database: db/combustion_test.sqlite
3+
adapter: sqlite3
4+
database: db/test.sqlite3
5+
username:
6+
password:
7+
port:
8+
socket:
9+
host: localhost
10+
encoding: utf8
11+
pool: 5
12+
timeout: 5000

0 commit comments

Comments
 (0)