cloudflare-rails 6.2.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -2
- data/.rubocop.yml +3 -2
- data/.rubocop_todo.yml +30 -32
- data/.ruby-version +1 -1
- data/Appraisals +8 -4
- data/CHANGELOG.md +28 -1
- data/README.md +19 -5
- data/cloudflare-rails.gemspec +12 -13
- data/gemfiles/rails_8.0.gemfile +1 -1
- data/gemfiles/{rails_7.1.gemfile → rails_8.1.gemfile} +3 -1
- data/gemfiles/rails_edge.gemfile +9 -0
- data/lib/cloudflare_rails/version.rb +1 -1
- metadata +34 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a32d010d44cf5c3215591be5a9251df83f288d315f5e206dc76d07f44fcf5a05
|
|
4
|
+
data.tar.gz: 285be2b0d9e4acfb7825a0eb06f08c01caa54945205bb09687c924f9f68cf7c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b189a3967f66e6814e14a7c17021f85a9c1a16a6c90926d014f7e2ee9011680f3e9194c58f5a36d0c6e355d6f72c0e909eba984be4aea2f845593ddd9a7b7ac6
|
|
7
|
+
data.tar.gz: e40dc48f59b62edb877ec5d0949e7019cefe313b63d0efb2eb37e98676171f45850b0123b79551f947792eb43ebcdc644ad26efab6de7ac38009ac4fb66347c7
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -14,11 +14,14 @@ on:
|
|
|
14
14
|
jobs:
|
|
15
15
|
test:
|
|
16
16
|
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
ruby: ["3.2", "3.3", "3.4"]
|
|
17
20
|
steps:
|
|
18
21
|
- uses: actions/checkout@v4
|
|
19
22
|
- uses: ruby/setup-ruby@v1
|
|
20
23
|
with:
|
|
21
|
-
ruby-version:
|
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
|
22
25
|
- uses: actions/cache@v3
|
|
23
26
|
with:
|
|
24
27
|
path: vendor/bundle
|
|
@@ -40,7 +43,7 @@ jobs:
|
|
|
40
43
|
- uses: actions/checkout@v4
|
|
41
44
|
- uses: ruby/setup-ruby@v1
|
|
42
45
|
with:
|
|
43
|
-
ruby-version: "3.
|
|
46
|
+
ruby-version: "3.4" # Not needed with a .ruby-version file
|
|
44
47
|
- uses: actions/cache@v3
|
|
45
48
|
with:
|
|
46
49
|
path: vendor/bundle
|
data/.rubocop.yml
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
inherit_from:
|
|
2
2
|
- .rubocop_todo.yml
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
plugins:
|
|
4
5
|
- rubocop-rails
|
|
5
6
|
- rubocop-performance
|
|
6
7
|
- rubocop-rspec
|
|
7
8
|
|
|
8
9
|
AllCops:
|
|
9
10
|
NewCops: enable
|
|
10
|
-
TargetRubyVersion: 3.
|
|
11
|
+
TargetRubyVersion: 3.2
|
|
11
12
|
SuggestExtensions: false
|
|
12
13
|
|
|
13
14
|
Style/Documentation:
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2025-10-15 16:14:50 UTC using RuboCop version 1.81.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -11,21 +11,22 @@
|
|
|
11
11
|
# AllowedMethods: enums
|
|
12
12
|
Lint/ConstantDefinitionInBlock:
|
|
13
13
|
Exclude:
|
|
14
|
-
-
|
|
14
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
15
15
|
|
|
16
16
|
# Offense count: 1
|
|
17
17
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
18
|
-
# Configuration parameters: AllowedMethods.
|
|
18
|
+
# Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
|
|
19
19
|
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?, presence, present?
|
|
20
|
+
# AdditionalNilMethods: present?, blank?, try, try!
|
|
20
21
|
Lint/RedundantSafeNavigation:
|
|
21
22
|
Exclude:
|
|
22
|
-
-
|
|
23
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
23
24
|
|
|
24
25
|
# Offense count: 1
|
|
25
26
|
# Configuration parameters: AllowComments, AllowNil.
|
|
26
27
|
Lint/SuppressedException:
|
|
27
28
|
Exclude:
|
|
28
|
-
-
|
|
29
|
+
- 'lib/cloudflare_rails/check_trusted_proxies.rb'
|
|
29
30
|
|
|
30
31
|
# Offense count: 1
|
|
31
32
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
@@ -43,26 +44,26 @@ Metrics/MethodLength:
|
|
|
43
44
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
|
44
45
|
Naming/FileName:
|
|
45
46
|
Exclude:
|
|
46
|
-
-
|
|
47
|
+
- 'lib/cloudflare-rails.rb'
|
|
47
48
|
|
|
48
49
|
# Offense count: 2
|
|
49
50
|
# Configuration parameters: ForbiddenDelimiters.
|
|
50
51
|
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
|
|
51
52
|
Naming/HeredocDelimiterNaming:
|
|
52
53
|
Exclude:
|
|
53
|
-
-
|
|
54
|
+
- 'lib/cloudflare_rails/fallback_ips.rb'
|
|
54
55
|
|
|
55
56
|
# Offense count: 3
|
|
56
57
|
RSpec/AnyInstance:
|
|
57
58
|
Exclude:
|
|
58
|
-
-
|
|
59
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
59
60
|
|
|
60
61
|
# Offense count: 1
|
|
61
62
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
|
62
63
|
# Prefixes: when, with, without
|
|
63
64
|
RSpec/ContextWording:
|
|
64
65
|
Exclude:
|
|
65
|
-
-
|
|
66
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
66
67
|
|
|
67
68
|
# Offense count: 2
|
|
68
69
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -70,12 +71,12 @@ RSpec/ContextWording:
|
|
|
70
71
|
# DisallowedExamples: works
|
|
71
72
|
RSpec/ExampleWording:
|
|
72
73
|
Exclude:
|
|
73
|
-
-
|
|
74
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
74
75
|
|
|
75
76
|
# Offense count: 1
|
|
76
77
|
RSpec/LeakyConstantDeclaration:
|
|
77
78
|
Exclude:
|
|
78
|
-
-
|
|
79
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
79
80
|
|
|
80
81
|
# Offense count: 5
|
|
81
82
|
RSpec/MultipleExpectations:
|
|
@@ -91,75 +92,72 @@ RSpec/MultipleMemoizedHelpers:
|
|
|
91
92
|
# SupportedStyles: always, named_only
|
|
92
93
|
RSpec/NamedSubject:
|
|
93
94
|
Exclude:
|
|
94
|
-
-
|
|
95
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
95
96
|
|
|
96
|
-
# Offense count:
|
|
97
|
+
# Offense count: 18
|
|
97
98
|
# Configuration parameters: AllowedGroups.
|
|
98
99
|
RSpec/NestedGroups:
|
|
99
100
|
Max: 6
|
|
100
101
|
|
|
101
102
|
# Offense count: 1
|
|
102
|
-
# Configuration parameters:
|
|
103
|
-
# Include: **/*_spec.rb
|
|
103
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
|
|
104
104
|
RSpec/SpecFilePathFormat:
|
|
105
105
|
Exclude:
|
|
106
|
-
-
|
|
106
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
107
107
|
|
|
108
108
|
# Offense count: 1
|
|
109
109
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
110
110
|
Rails/ApplicationController:
|
|
111
111
|
Exclude:
|
|
112
|
-
-
|
|
112
|
+
- 'spec/cloudflare/rails_spec.rb'
|
|
113
113
|
|
|
114
114
|
# Offense count: 1
|
|
115
115
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
116
116
|
Rails/CompactBlank:
|
|
117
117
|
Exclude:
|
|
118
|
-
-
|
|
118
|
+
- 'lib/cloudflare_rails/importer.rb'
|
|
119
119
|
|
|
120
120
|
# Offense count: 3
|
|
121
121
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
122
|
-
# Configuration parameters: Include.
|
|
123
|
-
# Include: **/Rakefile, **/*.rake
|
|
124
122
|
Rails/RakeEnvironment:
|
|
125
123
|
Exclude:
|
|
126
|
-
-
|
|
124
|
+
- 'Rakefile'
|
|
127
125
|
|
|
128
126
|
# Offense count: 1
|
|
129
127
|
# This cop supports safe autocorrection (--autocorrect).
|
|
130
128
|
# Configuration parameters: AllowOnConstant, AllowOnSelfClass.
|
|
131
129
|
Style/CaseEquality:
|
|
132
130
|
Exclude:
|
|
133
|
-
-
|
|
131
|
+
- 'lib/cloudflare_rails/check_trusted_proxies.rb'
|
|
134
132
|
|
|
135
133
|
# Offense count: 2
|
|
136
134
|
# This cop supports safe autocorrection (--autocorrect).
|
|
137
|
-
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
|
|
135
|
+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
|
|
138
136
|
# SupportedStyles: annotated, template, unannotated
|
|
139
137
|
# AllowedMethods: redirect
|
|
140
138
|
Style/FormatStringToken:
|
|
141
139
|
EnforcedStyle: unannotated
|
|
142
140
|
|
|
143
|
-
# Offense count:
|
|
141
|
+
# Offense count: 5
|
|
144
142
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
145
143
|
# Configuration parameters: EnforcedStyle.
|
|
146
144
|
# SupportedStyles: always, always_true, never
|
|
147
145
|
Style/FrozenStringLiteralComment:
|
|
148
146
|
Exclude:
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
147
|
+
- 'Appraisals'
|
|
148
|
+
- 'Gemfile'
|
|
149
|
+
- 'Rakefile'
|
|
150
|
+
- 'cloudflare-rails.gemspec'
|
|
151
|
+
- 'gemfiles/rails_7.1.gemfile'
|
|
154
152
|
|
|
155
153
|
# Offense count: 1
|
|
156
154
|
Style/MultilineBlockChain:
|
|
157
155
|
Exclude:
|
|
158
|
-
-
|
|
156
|
+
- 'lib/cloudflare_rails/railtie.rb'
|
|
159
157
|
|
|
160
|
-
# Offense count:
|
|
158
|
+
# Offense count: 5
|
|
161
159
|
# This cop supports safe autocorrection (--autocorrect).
|
|
162
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
|
160
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
163
161
|
# URISchemes: http, https
|
|
164
162
|
Layout/LineLength:
|
|
165
163
|
Max: 126
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.2
|
data/Appraisals
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
appraise 'rails-7.1' do
|
|
2
|
-
gem 'rails', '~> 7.1.0'
|
|
3
|
-
end
|
|
4
|
-
|
|
5
1
|
appraise 'rails-7.2' do
|
|
6
2
|
gem 'rails', '~> 7.2.0'
|
|
7
3
|
end
|
|
8
4
|
|
|
9
5
|
appraise 'rails-8.0' do
|
|
6
|
+
gem 'rails', '~> 8.0.2'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
appraise 'rails-8.1' do
|
|
10
|
+
gem 'rails', '~> 8.1.0'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
appraise 'rails-edge' do
|
|
10
14
|
gem 'rails', github: 'rails/rails'
|
|
11
15
|
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
|
|
2
3
|
All notable changes to this project will be documented in this file.
|
|
3
4
|
|
|
4
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [7.0.0]
|
|
9
|
+
|
|
10
|
+
- Add support for `rails` version `8.1` (https://github.com/modosc/cloudflare-rails/pull/227)
|
|
11
|
+
- Drop support for `rails` version `7.1` (https://github.com/modosc/cloudflare-rails/pull/224)
|
|
12
|
+
- Drop support for `ruby` version `3.1` (https://github.com/modosc/cloudflare-rails/pull/191)
|
|
13
|
+
|
|
6
14
|
## [6.2.0]
|
|
15
|
+
|
|
7
16
|
- Trust X-Forwarded-For from the right to the left (https://github.com/modosc/cloudflare-rails/pull/162)
|
|
8
17
|
|
|
9
18
|
## [6.1.0]
|
|
19
|
+
|
|
10
20
|
- Add cloudflare? method to determine if request passed through CF (https://github.com/modosc/cloudflare-rails/pull/149)
|
|
11
21
|
|
|
12
22
|
## [6.0.0] - 2024-06-12
|
|
23
|
+
|
|
13
24
|
- Drop support for `rails` version `6.1` and `7.0`, new minimum version is `7.1.0` (https://github.com/modosc/cloudflare-rails/pull/142)
|
|
14
25
|
- Bump minimum ruby version to `3.1.0` in preparation for `rails` version `7.2` (https://github.com/modosc/cloudflare-rails/pull/142)
|
|
15
26
|
- Relax `rails` dependencies to allow for `7.2` and `8.0` (https://github.com/modosc/cloudflare-rails/pull/142)
|
|
@@ -17,50 +28,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
28
|
- add `rails` version `8.0` to `Appraisals` (https://github.com/modosc/cloudflare-rails/pull/142)
|
|
18
29
|
|
|
19
30
|
## [5.0.1] - 2023-12-16
|
|
31
|
+
|
|
20
32
|
- Fix `zeitwerk` loading issue (https://github.com/modosc/cloudflare-rails/pull/105)
|
|
21
33
|
|
|
22
34
|
## [5.0.0] - 2023-12-15
|
|
35
|
+
|
|
23
36
|
### Breaking Changes
|
|
37
|
+
|
|
24
38
|
- Change namespace from `Cloudflare::Rails` to `CloudflareRails`. This avoids issues with the [cloudflare](https://github.com/socketry/cloudflare) gem as well as the global `Rails` namespace.
|
|
25
39
|
- A static set of Cloudflare IP addresses will now be used as a fallback value in the case of Cloudflare API failures. These will not be stored in `Rails.cache` so each subsequent result will retry the Cloudflare calls. Once one suceeds the response will be cached and used.
|
|
26
40
|
|
|
27
41
|
### Added
|
|
42
|
+
|
|
28
43
|
- Use `zeitwerk` to manage file loading.
|
|
29
44
|
|
|
30
45
|
## [4.1.0] - 2023-10-06
|
|
46
|
+
|
|
31
47
|
- Add support for `rails` version `7.1.0`
|
|
32
48
|
|
|
33
49
|
## [4.0.0] - 2023-08-06
|
|
50
|
+
|
|
34
51
|
- Fix `appraisal` for ruby `3.x`
|
|
35
52
|
- properly scope railtie initializer (https://github.com/modosc/cloudflare-rails/pull/79)
|
|
36
53
|
- Drop support for unsupported `rails` version `6.0.x`
|
|
37
54
|
|
|
38
55
|
## [3.0.0] - 2023-01-30
|
|
56
|
+
|
|
39
57
|
- Drop support for unsupported `rails` version `5.2.x`
|
|
40
58
|
- Fetch and cache IPs lazily instead of upon initialization (https://github.com/modosc/cloudflare-rails/pull/52)
|
|
41
59
|
|
|
42
60
|
## [2.4.0] - 2022-02-22
|
|
61
|
+
|
|
43
62
|
- Add trailing slashes to reflect Cloudflare API URLs (https://github.com/modosc/cloudflare-rails/pull/53)
|
|
44
63
|
|
|
45
64
|
## [2.3.0] - 2021-10-22
|
|
46
|
-
|
|
65
|
+
|
|
66
|
+
- Better handling of malformed IP addresses (https://github.com/modosc/cloudflare-rails/pull/49)
|
|
47
67
|
|
|
48
68
|
## [2.2.0] - 2021-06-11
|
|
69
|
+
|
|
49
70
|
- Fix typo in `actionpack` dependency
|
|
50
71
|
|
|
51
72
|
## [2.1.0] - 2021-06-11
|
|
73
|
+
|
|
52
74
|
### Breaking Changes
|
|
75
|
+
|
|
53
76
|
- Drop support for unsupported `rails` versions (`5.0.x` and `5.1.x`)
|
|
54
77
|
|
|
55
78
|
### Added
|
|
79
|
+
|
|
56
80
|
- use Net::HTTP instead of httparty ([pr](https://github.com/modosc/cloudflare-rails/pull/44))
|
|
57
81
|
- Add `rails 7.0.0.alpha` support
|
|
58
82
|
|
|
59
83
|
## [2.0.0] - 2021-02-17
|
|
84
|
+
|
|
60
85
|
### Breaking Changes
|
|
86
|
+
|
|
61
87
|
- Removed broad dependency on `rails`, replaced with explicit dependencies for `railties`, `activesupport`, and `actionpack` ( [issue](https://github.com/modosc/cloudflare-rails/issues/34) and [pr](https://github.com/modosc/cloudflare-rails/pull/35))
|
|
62
88
|
|
|
63
89
|
## [1.0.0] - 2020-09-29
|
|
90
|
+
|
|
64
91
|
### Added
|
|
65
92
|
|
|
66
93
|
- Fix various [loading order issues](https://github.com/modosc/cloudflare-rails/pull/25).
|
data/README.md
CHANGED
|
@@ -4,10 +4,11 @@ This gem correctly configures Rails for [CloudFlare](https://www.cloudflare.com)
|
|
|
4
4
|
|
|
5
5
|
## Rails Compatibility
|
|
6
6
|
|
|
7
|
-
This gem requires `railties`, `activesupport`, and `actionpack` >= `7.
|
|
7
|
+
This gem requires `railties`, `activesupport`, and `actionpack` >= `7.2`. For older `rails` versions see the chart below:
|
|
8
8
|
|
|
9
9
|
| `rails` version | `cloudflare-rails` version |
|
|
10
10
|
| --------------- | -------------------------- |
|
|
11
|
+
| 7.1 | 6.2.0 |
|
|
11
12
|
| 7.0 | 5.0.1 |
|
|
12
13
|
| 6.1 | 5.0.1 |
|
|
13
14
|
| 6.0 | 3.0.0 |
|
|
@@ -32,6 +33,19 @@ And then execute:
|
|
|
32
33
|
|
|
33
34
|
$ bundle
|
|
34
35
|
|
|
36
|
+
### If you're using Kamal
|
|
37
|
+
|
|
38
|
+
If you're using Kamal 2 for deployments, `kamal-proxy` [won't forward headers to your Rails app while using SSL](<[url](https://kamal-deploy.org/docs/configuration/proxy/#forward-headers)>), unless you explicitly tell it to. Without this, `cloudflare-rails` won't work in a Kamal-deployed Rails app using SSL.
|
|
39
|
+
|
|
40
|
+
You need to add `forward_headers: true` to your `proxy` section, like this:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
proxy:
|
|
44
|
+
ssl: true
|
|
45
|
+
host: example.com
|
|
46
|
+
forward_headers: true
|
|
47
|
+
```
|
|
48
|
+
|
|
35
49
|
## Problem
|
|
36
50
|
|
|
37
51
|
Using Cloudflare means it's hard to identify the IP address of incoming requests since all requests are proxied through Cloudflare's infrastructure. Cloudflare provides a [CF-Connecting-IP](https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers-) header which can be used to identify the originating IP address of a request. However, this header alone doesn't verify a request is legitimate. If an attacker has found the actual IP address of your server they could spoof this header and masquerade as legitimate traffic.
|
|
@@ -75,10 +89,10 @@ You can use the `#cloudflare?` method from this gem to block all non-Cloudflare
|
|
|
75
89
|
|
|
76
90
|
Note that the request may optionally pass through additional trusted proxies, so it will return `true` for any of these scenarios:
|
|
77
91
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
92
|
+
- `REMOTE_ADDR: CloudFlare`
|
|
93
|
+
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare`
|
|
94
|
+
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: CloudFlare,trusted_proxy2`
|
|
95
|
+
- `REMOTE_ADDR: trusted_proxy`, `X_HTTP_FORWARDED_FOR: untrusted,CloudFlare`
|
|
82
96
|
|
|
83
97
|
but it will return `false` if CloudFlare comes to the left of an untrusted IP in `X-Forwarded-For`.
|
|
84
98
|
|
data/cloudflare-rails.gemspec
CHANGED
|
@@ -20,21 +20,20 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.add_development_dependency 'appraisal', '~> 2.5.0'
|
|
21
21
|
spec.add_development_dependency 'bundler', '>= 2.4.18'
|
|
22
22
|
spec.add_development_dependency 'pry-byebug'
|
|
23
|
-
spec.add_development_dependency 'rack-attack', '~> 6.
|
|
24
|
-
spec.add_development_dependency 'rake', '~> 13.
|
|
23
|
+
spec.add_development_dependency 'rack-attack', '~> 6.8.0'
|
|
24
|
+
spec.add_development_dependency 'rake', '~> 13.3.0'
|
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.13.0'
|
|
26
|
-
spec.add_development_dependency 'rspec-rails', '~>
|
|
27
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
|
28
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
|
29
|
-
spec.add_development_dependency 'rubocop-rails', '~> 2.
|
|
30
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 3.
|
|
31
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
|
32
|
-
spec.add_dependency 'actionpack', '>= 7.
|
|
33
|
-
spec.add_dependency 'activesupport', '>= 7.
|
|
34
|
-
spec.add_dependency 'railties', '>= 7.
|
|
26
|
+
spec.add_development_dependency 'rspec-rails', '~> 8.0.2'
|
|
27
|
+
spec.add_development_dependency 'rubocop', '~> 1.81.1'
|
|
28
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.26.0'
|
|
29
|
+
spec.add_development_dependency 'rubocop-rails', '~> 2.33.4'
|
|
30
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 3.7.0'
|
|
31
|
+
spec.add_development_dependency 'webmock', '~> 3.25.0'
|
|
32
|
+
spec.add_dependency 'actionpack', '>= 7.2.0', '< 8.2.0'
|
|
33
|
+
spec.add_dependency 'activesupport', '>= 7.2.0', '< 8.2.0'
|
|
34
|
+
spec.add_dependency 'railties', '>= 7.2.0', '< 8.2.0'
|
|
35
35
|
spec.add_dependency 'zeitwerk', '>= 2.5.0'
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
spec.required_ruby_version = '>= 3.1.0'
|
|
37
|
+
spec.required_ruby_version = '>= 3.2.0'
|
|
39
38
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
40
39
|
end
|
data/gemfiles/rails_8.0.gemfile
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloudflare-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 7.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- jonathan schatz
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-10-29 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: appraisal
|
|
@@ -58,28 +57,28 @@ dependencies:
|
|
|
58
57
|
requirements:
|
|
59
58
|
- - "~>"
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 6.
|
|
60
|
+
version: 6.8.0
|
|
62
61
|
type: :development
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
65
|
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 6.
|
|
67
|
+
version: 6.8.0
|
|
69
68
|
- !ruby/object:Gem::Dependency
|
|
70
69
|
name: rake
|
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
|
72
71
|
requirements:
|
|
73
72
|
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 13.
|
|
74
|
+
version: 13.3.0
|
|
76
75
|
type: :development
|
|
77
76
|
prerelease: false
|
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
79
|
- - "~>"
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 13.
|
|
81
|
+
version: 13.3.0
|
|
83
82
|
- !ruby/object:Gem::Dependency
|
|
84
83
|
name: rspec
|
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,144 +99,144 @@ dependencies:
|
|
|
100
99
|
requirements:
|
|
101
100
|
- - "~>"
|
|
102
101
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
102
|
+
version: 8.0.2
|
|
104
103
|
type: :development
|
|
105
104
|
prerelease: false
|
|
106
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
106
|
requirements:
|
|
108
107
|
- - "~>"
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
109
|
+
version: 8.0.2
|
|
111
110
|
- !ruby/object:Gem::Dependency
|
|
112
111
|
name: rubocop
|
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
|
114
113
|
requirements:
|
|
115
114
|
- - "~>"
|
|
116
115
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 1.
|
|
116
|
+
version: 1.81.1
|
|
118
117
|
type: :development
|
|
119
118
|
prerelease: false
|
|
120
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
120
|
requirements:
|
|
122
121
|
- - "~>"
|
|
123
122
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 1.
|
|
123
|
+
version: 1.81.1
|
|
125
124
|
- !ruby/object:Gem::Dependency
|
|
126
125
|
name: rubocop-performance
|
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
|
128
127
|
requirements:
|
|
129
128
|
- - "~>"
|
|
130
129
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 1.
|
|
130
|
+
version: 1.26.0
|
|
132
131
|
type: :development
|
|
133
132
|
prerelease: false
|
|
134
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
134
|
requirements:
|
|
136
135
|
- - "~>"
|
|
137
136
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 1.
|
|
137
|
+
version: 1.26.0
|
|
139
138
|
- !ruby/object:Gem::Dependency
|
|
140
139
|
name: rubocop-rails
|
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
|
142
141
|
requirements:
|
|
143
142
|
- - "~>"
|
|
144
143
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 2.
|
|
144
|
+
version: 2.33.4
|
|
146
145
|
type: :development
|
|
147
146
|
prerelease: false
|
|
148
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
148
|
requirements:
|
|
150
149
|
- - "~>"
|
|
151
150
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 2.
|
|
151
|
+
version: 2.33.4
|
|
153
152
|
- !ruby/object:Gem::Dependency
|
|
154
153
|
name: rubocop-rspec
|
|
155
154
|
requirement: !ruby/object:Gem::Requirement
|
|
156
155
|
requirements:
|
|
157
156
|
- - "~>"
|
|
158
157
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 3.
|
|
158
|
+
version: 3.7.0
|
|
160
159
|
type: :development
|
|
161
160
|
prerelease: false
|
|
162
161
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
162
|
requirements:
|
|
164
163
|
- - "~>"
|
|
165
164
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: 3.
|
|
165
|
+
version: 3.7.0
|
|
167
166
|
- !ruby/object:Gem::Dependency
|
|
168
167
|
name: webmock
|
|
169
168
|
requirement: !ruby/object:Gem::Requirement
|
|
170
169
|
requirements:
|
|
171
170
|
- - "~>"
|
|
172
171
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: 3.
|
|
172
|
+
version: 3.25.0
|
|
174
173
|
type: :development
|
|
175
174
|
prerelease: false
|
|
176
175
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
176
|
requirements:
|
|
178
177
|
- - "~>"
|
|
179
178
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: 3.
|
|
179
|
+
version: 3.25.0
|
|
181
180
|
- !ruby/object:Gem::Dependency
|
|
182
181
|
name: actionpack
|
|
183
182
|
requirement: !ruby/object:Gem::Requirement
|
|
184
183
|
requirements:
|
|
185
184
|
- - ">="
|
|
186
185
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 7.
|
|
186
|
+
version: 7.2.0
|
|
188
187
|
- - "<"
|
|
189
188
|
- !ruby/object:Gem::Version
|
|
190
|
-
version: 8.
|
|
189
|
+
version: 8.2.0
|
|
191
190
|
type: :runtime
|
|
192
191
|
prerelease: false
|
|
193
192
|
version_requirements: !ruby/object:Gem::Requirement
|
|
194
193
|
requirements:
|
|
195
194
|
- - ">="
|
|
196
195
|
- !ruby/object:Gem::Version
|
|
197
|
-
version: 7.
|
|
196
|
+
version: 7.2.0
|
|
198
197
|
- - "<"
|
|
199
198
|
- !ruby/object:Gem::Version
|
|
200
|
-
version: 8.
|
|
199
|
+
version: 8.2.0
|
|
201
200
|
- !ruby/object:Gem::Dependency
|
|
202
201
|
name: activesupport
|
|
203
202
|
requirement: !ruby/object:Gem::Requirement
|
|
204
203
|
requirements:
|
|
205
204
|
- - ">="
|
|
206
205
|
- !ruby/object:Gem::Version
|
|
207
|
-
version: 7.
|
|
206
|
+
version: 7.2.0
|
|
208
207
|
- - "<"
|
|
209
208
|
- !ruby/object:Gem::Version
|
|
210
|
-
version: 8.
|
|
209
|
+
version: 8.2.0
|
|
211
210
|
type: :runtime
|
|
212
211
|
prerelease: false
|
|
213
212
|
version_requirements: !ruby/object:Gem::Requirement
|
|
214
213
|
requirements:
|
|
215
214
|
- - ">="
|
|
216
215
|
- !ruby/object:Gem::Version
|
|
217
|
-
version: 7.
|
|
216
|
+
version: 7.2.0
|
|
218
217
|
- - "<"
|
|
219
218
|
- !ruby/object:Gem::Version
|
|
220
|
-
version: 8.
|
|
219
|
+
version: 8.2.0
|
|
221
220
|
- !ruby/object:Gem::Dependency
|
|
222
221
|
name: railties
|
|
223
222
|
requirement: !ruby/object:Gem::Requirement
|
|
224
223
|
requirements:
|
|
225
224
|
- - ">="
|
|
226
225
|
- !ruby/object:Gem::Version
|
|
227
|
-
version: 7.
|
|
226
|
+
version: 7.2.0
|
|
228
227
|
- - "<"
|
|
229
228
|
- !ruby/object:Gem::Version
|
|
230
|
-
version: 8.
|
|
229
|
+
version: 8.2.0
|
|
231
230
|
type: :runtime
|
|
232
231
|
prerelease: false
|
|
233
232
|
version_requirements: !ruby/object:Gem::Requirement
|
|
234
233
|
requirements:
|
|
235
234
|
- - ">="
|
|
236
235
|
- !ruby/object:Gem::Version
|
|
237
|
-
version: 7.
|
|
236
|
+
version: 7.2.0
|
|
238
237
|
- - "<"
|
|
239
238
|
- !ruby/object:Gem::Version
|
|
240
|
-
version: 8.
|
|
239
|
+
version: 8.2.0
|
|
241
240
|
- !ruby/object:Gem::Dependency
|
|
242
241
|
name: zeitwerk
|
|
243
242
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -276,9 +275,10 @@ files:
|
|
|
276
275
|
- bin/setup
|
|
277
276
|
- cloudflare-rails.gemspec
|
|
278
277
|
- gemfiles/.bundle/config
|
|
279
|
-
- gemfiles/rails_7.1.gemfile
|
|
280
278
|
- gemfiles/rails_7.2.gemfile
|
|
281
279
|
- gemfiles/rails_8.0.gemfile
|
|
280
|
+
- gemfiles/rails_8.1.gemfile
|
|
281
|
+
- gemfiles/rails_edge.gemfile
|
|
282
282
|
- lib/cloudflare-rails.rb
|
|
283
283
|
- lib/cloudflare_rails.rb
|
|
284
284
|
- lib/cloudflare_rails/check_trusted_proxies.rb
|
|
@@ -292,7 +292,6 @@ licenses:
|
|
|
292
292
|
- MIT
|
|
293
293
|
metadata:
|
|
294
294
|
rubygems_mfa_required: 'true'
|
|
295
|
-
post_install_message:
|
|
296
295
|
rdoc_options: []
|
|
297
296
|
require_paths:
|
|
298
297
|
- lib
|
|
@@ -300,15 +299,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
300
299
|
requirements:
|
|
301
300
|
- - ">="
|
|
302
301
|
- !ruby/object:Gem::Version
|
|
303
|
-
version: 3.
|
|
302
|
+
version: 3.2.0
|
|
304
303
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
304
|
requirements:
|
|
306
305
|
- - ">="
|
|
307
306
|
- !ruby/object:Gem::Version
|
|
308
307
|
version: '0'
|
|
309
308
|
requirements: []
|
|
310
|
-
rubygems_version: 3.
|
|
311
|
-
signing_key:
|
|
309
|
+
rubygems_version: 3.6.2
|
|
312
310
|
specification_version: 4
|
|
313
311
|
summary: This gem configures Rails for CloudFlare so that request.ip and request.remote_ip
|
|
314
312
|
and work correctly.
|