actionpack-cloudflare 1.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d8a1aa4f1af58d4fdb1c967209af64ddc8fe43f3
4
+ data.tar.gz: 527c6f08d17e82cf023584dfdb2bf9b6749aa89d
5
+ SHA512:
6
+ metadata.gz: 94bc54b801ac305dba981c27afba474bbdf4595679d2246813de2f9c3910139a6deeb66817150a920c6a6280b4016f435713718304b1551dd5c6a0e52f028958
7
+ data.tar.gz: 4a782d65ac105fb9312e62044e385a5aa09f608f524593047854b6651573dc5f527348f689fd4418dbfd8f22655a49711694419cd4d79f8789c33765db3766b6
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,17 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.5
5
+ - 2.3.1
6
+ gemfile:
7
+ - gemfiles/rails32.gemfile
8
+ - gemfiles/rails40.gemfile
9
+ - gemfiles/rails41.gemfile
10
+ - gemfiles/rails42.gemfile
11
+ - gemfiles/rails50.gemfile
12
+ install:
13
+ - gem install bundler
14
+ - bundle --version
15
+ - bundle install
16
+ script:
17
+ - bundle exec rake test
@@ -0,0 +1,23 @@
1
+ # We use git repos so we get test directories and their support.
2
+
3
+ appraise 'rails32' do
4
+ gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v3.2.22.5'
5
+ gem 'test-unit'
6
+ end
7
+
8
+ appraise 'rails40' do
9
+ gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v4.0.13'
10
+ end
11
+
12
+ appraise 'rails41' do
13
+ gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v4.1.16'
14
+ end
15
+
16
+ appraise 'rails42' do
17
+ gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v4.2.2'
18
+ gem 'mocha'
19
+ end
20
+
21
+ appraise 'rails50' do
22
+ gem 'rails', git: 'git://github.com/rails/rails.git', tag: 'v5.0.0.1'
23
+ end
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
4
+ gem 'rails', git: 'git://github.com/rails/rails.git', branch: '5-0-stable'
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 CustomInk.com
4
+ Copyright (c) 2016 Ken Collins
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+
2
+ # Actionpack::Cloudflare
3
+
4
+ [![Build Status](https://travis-ci.org/customink/actionpack-cloudflare.svg?branch=master)](https://travis-ci.org/customink/actionpack-cloudflare)
5
+
6
+ Simple gem that extends Rails `request.remote_ip` to default to Cloudflare's `HTTP_CF_CONNECTING_IP` header. More about [CloudFlare HTTP Headers](https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-CloudFlare-handle-HTTP-Request-headers-) and why we choose to trust `CF-Connecting-IP`.
7
+
8
+
9
+ ## Installation
10
+
11
+ Add this line to your Rails application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'actionpack-cloudflare'
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ None! Just install and feel confident that `request.remote_ip` is doing its job.
20
+
21
+
22
+ ## Alternatives
23
+
24
+
25
+ * [cloudflare-rails](https://github.com/modosc/cloudflare-rails) - Leverages cached HTTP requests to Cloudflare to extend Rails' trusted proxies list.
26
+
27
+
28
+ ## Contributing
29
+
30
+ We use the [Appraisal](https://github.com/thoughtbot/appraisal) gem from Thoughtbot to help us test different versions of Rails. The `appraisal rake test` subcommand runs our test suite against all Rails versions in the `Appraisal` file. So after cloning the repo, running the following commands.
31
+
32
+ ```shell
33
+ $ bundle install
34
+ $ bundle exec appraisal update
35
+ $ bundle exec appraisal rake test
36
+ ```
37
+
38
+ If you want to run the tests for a specific appraisal, use one of the names found in our `Appraisal` file. For example, the following will run our tests suite for Rails 4.2 only.
39
+
40
+ ```shell
41
+ $ bundle exec appraisal rails42 rake test
42
+ ```
43
+
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
48
+
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'action_pack/cloudflare/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'actionpack-cloudflare'
8
+ spec.version = ActionPack::Cloudflare::VERSION
9
+ spec.authors = ['Ken Collins']
10
+ spec.email = ['ken@metaskills.net']
11
+ spec.summary = "Allow Rails request.remote_ip to defer to CloudFlare's connecting IP address."
12
+ spec.description = "Simple gem that extends Rails `request.remote_ip` to default to Cloudflare's `HTTP_CF_CONNECTING_IP` header."
13
+ spec.homepage = 'https://github.com/customink/actionpack-cloudflare'
14
+ spec.license = 'MIT'
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = 'exe'
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ['lib']
19
+ spec.add_runtime_dependency 'actionpack', '>= 3.2'
20
+ spec.add_development_dependency 'appraisal'
21
+ spec.add_development_dependency 'bundler'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'pry'
24
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "actionpack/cloudflare"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", :git => "git://github.com/rails/rails.git", :tag => "v3.2.22.5"
6
+ gem "test-unit"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,120 @@
1
+ GIT
2
+ remote: git://github.com/rails/rails.git
3
+ revision: 29144c0ec720bfd36974bdddfc0d5e0ce5ef3603
4
+ tag: v3.2.22.5
5
+ specs:
6
+ actionmailer (3.2.22.5)
7
+ actionpack (= 3.2.22.5)
8
+ mail (~> 2.5.4)
9
+ actionpack (3.2.22.5)
10
+ activemodel (= 3.2.22.5)
11
+ activesupport (= 3.2.22.5)
12
+ builder (~> 3.0.0)
13
+ erubis (~> 2.7.0)
14
+ journey (~> 1.0.4)
15
+ rack (~> 1.4.5)
16
+ rack-cache (~> 1.2)
17
+ rack-test (~> 0.6.1)
18
+ sprockets (~> 2.2.1)
19
+ activemodel (3.2.22.5)
20
+ activesupport (= 3.2.22.5)
21
+ builder (~> 3.0.0)
22
+ activerecord (3.2.22.5)
23
+ activemodel (= 3.2.22.5)
24
+ activesupport (= 3.2.22.5)
25
+ arel (~> 3.0.2)
26
+ tzinfo (~> 0.3.29)
27
+ activeresource (3.2.22.5)
28
+ activemodel (= 3.2.22.5)
29
+ activesupport (= 3.2.22.5)
30
+ activesupport (3.2.22.5)
31
+ i18n (~> 0.6, >= 0.6.4)
32
+ multi_json (~> 1.0)
33
+ rails (3.2.22.5)
34
+ actionmailer (= 3.2.22.5)
35
+ actionpack (= 3.2.22.5)
36
+ activerecord (= 3.2.22.5)
37
+ activeresource (= 3.2.22.5)
38
+ activesupport (= 3.2.22.5)
39
+ bundler (~> 1.0)
40
+ railties (= 3.2.22.5)
41
+ railties (3.2.22.5)
42
+ actionpack (= 3.2.22.5)
43
+ activesupport (= 3.2.22.5)
44
+ rack-ssl (~> 1.3.2)
45
+ rake (>= 0.8.7)
46
+ rdoc (~> 3.4)
47
+ thor (>= 0.14.6, < 2.0)
48
+
49
+ PATH
50
+ remote: ../
51
+ specs:
52
+ actionpack-cloudflare (1.1.0)
53
+ actionpack (>= 3.2)
54
+
55
+ GEM
56
+ remote: https://rubygems.org/
57
+ specs:
58
+ appraisal (2.1.0)
59
+ bundler
60
+ rake
61
+ thor (>= 0.14.0)
62
+ arel (3.0.3)
63
+ builder (3.0.4)
64
+ coderay (1.1.1)
65
+ erubis (2.7.0)
66
+ hike (1.2.3)
67
+ i18n (0.7.0)
68
+ journey (1.0.4)
69
+ json (1.8.3)
70
+ mail (2.5.4)
71
+ mime-types (~> 1.16)
72
+ treetop (~> 1.4.8)
73
+ method_source (0.8.2)
74
+ mime-types (1.25.1)
75
+ multi_json (1.12.1)
76
+ polyglot (0.3.5)
77
+ power_assert (0.3.1)
78
+ pry (0.10.4)
79
+ coderay (~> 1.1.0)
80
+ method_source (~> 0.8.1)
81
+ slop (~> 3.4)
82
+ rack (1.4.7)
83
+ rack-cache (1.6.1)
84
+ rack (>= 0.4)
85
+ rack-ssl (1.3.4)
86
+ rack
87
+ rack-test (0.6.3)
88
+ rack (>= 1.0)
89
+ rake (11.3.0)
90
+ rdoc (3.12.2)
91
+ json (~> 1.4)
92
+ slop (3.6.0)
93
+ sprockets (2.2.3)
94
+ hike (~> 1.2)
95
+ multi_json (~> 1.0)
96
+ rack (~> 1.0)
97
+ tilt (~> 1.1, != 1.3.0)
98
+ test-unit (3.2.1)
99
+ power_assert
100
+ thor (0.19.1)
101
+ tilt (1.4.1)
102
+ treetop (1.4.15)
103
+ polyglot
104
+ polyglot (>= 0.3.1)
105
+ tzinfo (0.3.51)
106
+
107
+ PLATFORMS
108
+ ruby
109
+
110
+ DEPENDENCIES
111
+ actionpack-cloudflare!
112
+ appraisal
113
+ bundler
114
+ pry
115
+ rails!
116
+ rake
117
+ test-unit
118
+
119
+ BUNDLED WITH
120
+ 1.12.5
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", :git => "git://github.com/rails/rails.git", :tag => "v4.0.13"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,103 @@
1
+ GIT
2
+ remote: git://github.com/rails/rails.git
3
+ revision: 3c194d4a8d585547d1fe45f596d2800c155b1a4c
4
+ tag: v4.0.13
5
+ specs:
6
+ actionmailer (4.0.13)
7
+ actionpack (= 4.0.13)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ actionpack (4.0.13)
10
+ activesupport (= 4.0.13)
11
+ builder (~> 3.1.0)
12
+ erubis (~> 2.7.0)
13
+ rack (~> 1.5.2)
14
+ rack-test (~> 0.6.2)
15
+ activemodel (4.0.13)
16
+ activesupport (= 4.0.13)
17
+ builder (~> 3.1.0)
18
+ activerecord (4.0.13)
19
+ activemodel (= 4.0.13)
20
+ activerecord-deprecated_finders (~> 1.0.2)
21
+ activesupport (= 4.0.13)
22
+ arel (~> 4.0.0)
23
+ activesupport (4.0.13)
24
+ i18n (~> 0.6, >= 0.6.9)
25
+ minitest (~> 4.2)
26
+ multi_json (~> 1.3)
27
+ thread_safe (~> 0.1)
28
+ tzinfo (~> 0.3.37)
29
+ rails (4.0.13)
30
+ actionmailer (= 4.0.13)
31
+ actionpack (= 4.0.13)
32
+ activerecord (= 4.0.13)
33
+ activesupport (= 4.0.13)
34
+ bundler (>= 1.3.0, < 2.0)
35
+ railties (= 4.0.13)
36
+ sprockets-rails (~> 2.0)
37
+ railties (4.0.13)
38
+ actionpack (= 4.0.13)
39
+ activesupport (= 4.0.13)
40
+ rake (>= 0.8.7)
41
+ thor (>= 0.18.1, < 2.0)
42
+
43
+ PATH
44
+ remote: ../
45
+ specs:
46
+ actionpack-cloudflare (1.1.0)
47
+ actionpack (>= 3.2)
48
+
49
+ GEM
50
+ remote: https://rubygems.org/
51
+ specs:
52
+ activerecord-deprecated_finders (1.0.4)
53
+ appraisal (2.1.0)
54
+ bundler
55
+ rake
56
+ thor (>= 0.14.0)
57
+ arel (4.0.2)
58
+ builder (3.1.4)
59
+ coderay (1.1.1)
60
+ concurrent-ruby (1.0.2)
61
+ erubis (2.7.0)
62
+ i18n (0.7.0)
63
+ mail (2.6.4)
64
+ mime-types (>= 1.16, < 4)
65
+ method_source (0.8.2)
66
+ mime-types (3.1)
67
+ mime-types-data (~> 3.2015)
68
+ mime-types-data (3.2016.0521)
69
+ minitest (4.7.5)
70
+ multi_json (1.12.1)
71
+ pry (0.10.4)
72
+ coderay (~> 1.1.0)
73
+ method_source (~> 0.8.1)
74
+ slop (~> 3.4)
75
+ rack (1.5.5)
76
+ rack-test (0.6.3)
77
+ rack (>= 1.0)
78
+ rake (11.3.0)
79
+ slop (3.6.0)
80
+ sprockets (3.7.0)
81
+ concurrent-ruby (~> 1.0)
82
+ rack (> 1, < 3)
83
+ sprockets-rails (2.3.3)
84
+ actionpack (>= 3.0)
85
+ activesupport (>= 3.0)
86
+ sprockets (>= 2.8, < 4.0)
87
+ thor (0.19.1)
88
+ thread_safe (0.3.5)
89
+ tzinfo (0.3.51)
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ actionpack-cloudflare!
96
+ appraisal
97
+ bundler
98
+ pry
99
+ rails!
100
+ rake
101
+
102
+ BUNDLED WITH
103
+ 1.12.5
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", :git => "git://github.com/rails/rails.git", :tag => "v4.1.16"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,108 @@
1
+ GIT
2
+ remote: git://github.com/rails/rails.git
3
+ revision: 93c190ee51730b11b7372f3dde2eaba75ce8a31c
4
+ tag: v4.1.16
5
+ specs:
6
+ actionmailer (4.1.16)
7
+ actionpack (= 4.1.16)
8
+ actionview (= 4.1.16)
9
+ mail (~> 2.5, >= 2.5.4)
10
+ actionpack (4.1.16)
11
+ actionview (= 4.1.16)
12
+ activesupport (= 4.1.16)
13
+ rack (~> 1.5.2)
14
+ rack-test (~> 0.6.2)
15
+ actionview (4.1.16)
16
+ activesupport (= 4.1.16)
17
+ builder (~> 3.1)
18
+ erubis (~> 2.7.0)
19
+ activemodel (4.1.16)
20
+ activesupport (= 4.1.16)
21
+ builder (~> 3.1)
22
+ activerecord (4.1.16)
23
+ activemodel (= 4.1.16)
24
+ activesupport (= 4.1.16)
25
+ arel (~> 5.0.0)
26
+ activesupport (4.1.16)
27
+ i18n (~> 0.6, >= 0.6.9)
28
+ json (~> 1.7, >= 1.7.7)
29
+ minitest (~> 5.1)
30
+ thread_safe (~> 0.1)
31
+ tzinfo (~> 1.1)
32
+ rails (4.1.16)
33
+ actionmailer (= 4.1.16)
34
+ actionpack (= 4.1.16)
35
+ actionview (= 4.1.16)
36
+ activemodel (= 4.1.16)
37
+ activerecord (= 4.1.16)
38
+ activesupport (= 4.1.16)
39
+ bundler (>= 1.3.0, < 2.0)
40
+ railties (= 4.1.16)
41
+ sprockets-rails (~> 2.0)
42
+ railties (4.1.16)
43
+ actionpack (= 4.1.16)
44
+ activesupport (= 4.1.16)
45
+ rake (>= 0.8.7)
46
+ thor (>= 0.18.1, < 2.0)
47
+
48
+ PATH
49
+ remote: ../
50
+ specs:
51
+ actionpack-cloudflare (1.1.0)
52
+ actionpack (>= 3.2)
53
+
54
+ GEM
55
+ remote: https://rubygems.org/
56
+ specs:
57
+ appraisal (2.1.0)
58
+ bundler
59
+ rake
60
+ thor (>= 0.14.0)
61
+ arel (5.0.1.20140414130214)
62
+ builder (3.2.2)
63
+ coderay (1.1.1)
64
+ concurrent-ruby (1.0.2)
65
+ erubis (2.7.0)
66
+ i18n (0.7.0)
67
+ json (1.8.3)
68
+ mail (2.6.4)
69
+ mime-types (>= 1.16, < 4)
70
+ method_source (0.8.2)
71
+ mime-types (3.1)
72
+ mime-types-data (~> 3.2015)
73
+ mime-types-data (3.2016.0521)
74
+ minitest (5.9.1)
75
+ pry (0.10.4)
76
+ coderay (~> 1.1.0)
77
+ method_source (~> 0.8.1)
78
+ slop (~> 3.4)
79
+ rack (1.5.5)
80
+ rack-test (0.6.3)
81
+ rack (>= 1.0)
82
+ rake (11.3.0)
83
+ slop (3.6.0)
84
+ sprockets (3.7.0)
85
+ concurrent-ruby (~> 1.0)
86
+ rack (> 1, < 3)
87
+ sprockets-rails (2.3.3)
88
+ actionpack (>= 3.0)
89
+ activesupport (>= 3.0)
90
+ sprockets (>= 2.8, < 4.0)
91
+ thor (0.19.1)
92
+ thread_safe (0.3.5)
93
+ tzinfo (1.2.2)
94
+ thread_safe (~> 0.1)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ actionpack-cloudflare!
101
+ appraisal
102
+ bundler
103
+ pry
104
+ rails!
105
+ rake
106
+
107
+ BUNDLED WITH
108
+ 1.12.5
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", :git => "git://github.com/rails/rails.git", :tag => "v4.2.2"
6
+ gem "mocha"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,137 @@
1
+ GIT
2
+ remote: git://github.com/rails/rails.git
3
+ revision: 64b2c0cee9e829f73c5ad32b8cc8cb6f3bec65bb
4
+ tag: v4.2.2
5
+ specs:
6
+ actionmailer (4.2.2)
7
+ actionpack (= 4.2.2)
8
+ actionview (= 4.2.2)
9
+ activejob (= 4.2.2)
10
+ mail (~> 2.5, >= 2.5.4)
11
+ rails-dom-testing (~> 1.0, >= 1.0.5)
12
+ actionpack (4.2.2)
13
+ actionview (= 4.2.2)
14
+ activesupport (= 4.2.2)
15
+ rack (~> 1.6)
16
+ rack-test (~> 0.6.2)
17
+ rails-dom-testing (~> 1.0, >= 1.0.5)
18
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
19
+ actionview (4.2.2)
20
+ activesupport (= 4.2.2)
21
+ builder (~> 3.1)
22
+ erubis (~> 2.7.0)
23
+ rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
25
+ activejob (4.2.2)
26
+ activesupport (= 4.2.2)
27
+ globalid (>= 0.3.0)
28
+ activemodel (4.2.2)
29
+ activesupport (= 4.2.2)
30
+ builder (~> 3.1)
31
+ activerecord (4.2.2)
32
+ activemodel (= 4.2.2)
33
+ activesupport (= 4.2.2)
34
+ arel (~> 6.0)
35
+ activesupport (4.2.2)
36
+ i18n (~> 0.7)
37
+ json (~> 1.7, >= 1.7.7)
38
+ minitest (~> 5.1)
39
+ thread_safe (~> 0.3, >= 0.3.4)
40
+ tzinfo (~> 1.1)
41
+ rails (4.2.2)
42
+ actionmailer (= 4.2.2)
43
+ actionpack (= 4.2.2)
44
+ actionview (= 4.2.2)
45
+ activejob (= 4.2.2)
46
+ activemodel (= 4.2.2)
47
+ activerecord (= 4.2.2)
48
+ activesupport (= 4.2.2)
49
+ bundler (>= 1.3.0, < 2.0)
50
+ railties (= 4.2.2)
51
+ sprockets-rails
52
+ railties (4.2.2)
53
+ actionpack (= 4.2.2)
54
+ activesupport (= 4.2.2)
55
+ rake (>= 0.8.7)
56
+ thor (>= 0.18.1, < 2.0)
57
+
58
+ PATH
59
+ remote: ../
60
+ specs:
61
+ actionpack-cloudflare (1.1.0)
62
+ actionpack (>= 3.2)
63
+
64
+ GEM
65
+ remote: https://rubygems.org/
66
+ specs:
67
+ appraisal (2.1.0)
68
+ bundler
69
+ rake
70
+ thor (>= 0.14.0)
71
+ arel (6.0.3)
72
+ builder (3.2.2)
73
+ coderay (1.1.1)
74
+ concurrent-ruby (1.0.2)
75
+ erubis (2.7.0)
76
+ globalid (0.3.7)
77
+ activesupport (>= 4.1.0)
78
+ i18n (0.7.0)
79
+ json (1.8.3)
80
+ loofah (2.0.3)
81
+ nokogiri (>= 1.5.9)
82
+ mail (2.6.4)
83
+ mime-types (>= 1.16, < 4)
84
+ metaclass (0.0.4)
85
+ method_source (0.8.2)
86
+ mime-types (3.1)
87
+ mime-types-data (~> 3.2015)
88
+ mime-types-data (3.2016.0521)
89
+ mini_portile2 (2.1.0)
90
+ minitest (5.9.1)
91
+ mocha (1.2.1)
92
+ metaclass (~> 0.0.1)
93
+ nokogiri (1.6.8.1)
94
+ mini_portile2 (~> 2.1.0)
95
+ pry (0.10.4)
96
+ coderay (~> 1.1.0)
97
+ method_source (~> 0.8.1)
98
+ slop (~> 3.4)
99
+ rack (1.6.4)
100
+ rack-test (0.6.3)
101
+ rack (>= 1.0)
102
+ rails-deprecated_sanitizer (1.0.3)
103
+ activesupport (>= 4.2.0.alpha)
104
+ rails-dom-testing (1.0.7)
105
+ activesupport (>= 4.2.0.beta, < 5.0)
106
+ nokogiri (~> 1.6.0)
107
+ rails-deprecated_sanitizer (>= 1.0.1)
108
+ rails-html-sanitizer (1.0.3)
109
+ loofah (~> 2.0)
110
+ rake (11.3.0)
111
+ slop (3.6.0)
112
+ sprockets (3.7.0)
113
+ concurrent-ruby (~> 1.0)
114
+ rack (> 1, < 3)
115
+ sprockets-rails (3.2.0)
116
+ actionpack (>= 4.0)
117
+ activesupport (>= 4.0)
118
+ sprockets (>= 3.0.0)
119
+ thor (0.19.1)
120
+ thread_safe (0.3.5)
121
+ tzinfo (1.2.2)
122
+ thread_safe (~> 0.1)
123
+
124
+ PLATFORMS
125
+ ruby
126
+
127
+ DEPENDENCIES
128
+ actionpack-cloudflare!
129
+ appraisal
130
+ bundler
131
+ mocha
132
+ pry
133
+ rails!
134
+ rake
135
+
136
+ BUNDLED WITH
137
+ 1.12.5
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", :git => "git://github.com/rails/rails.git", :tag => "v5.0.0.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,137 @@
1
+ GIT
2
+ remote: git://github.com/rails/rails.git
3
+ revision: cdb307294a43eec489f0ea6ffdc6f0a07b16ff5c
4
+ tag: v5.0.0.1
5
+ specs:
6
+ actioncable (5.0.0.1)
7
+ actionpack (= 5.0.0.1)
8
+ nio4r (~> 1.2)
9
+ websocket-driver (~> 0.6.1)
10
+ actionmailer (5.0.0.1)
11
+ actionpack (= 5.0.0.1)
12
+ actionview (= 5.0.0.1)
13
+ activejob (= 5.0.0.1)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ rails-dom-testing (~> 2.0)
16
+ actionpack (5.0.0.1)
17
+ actionview (= 5.0.0.1)
18
+ activesupport (= 5.0.0.1)
19
+ rack (~> 2.0)
20
+ rack-test (~> 0.6.3)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (5.0.0.1)
24
+ activesupport (= 5.0.0.1)
25
+ builder (~> 3.1)
26
+ erubis (~> 2.7.0)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ activejob (5.0.0.1)
30
+ activesupport (= 5.0.0.1)
31
+ globalid (>= 0.3.6)
32
+ activemodel (5.0.0.1)
33
+ activesupport (= 5.0.0.1)
34
+ activerecord (5.0.0.1)
35
+ activemodel (= 5.0.0.1)
36
+ activesupport (= 5.0.0.1)
37
+ arel (~> 7.0)
38
+ activesupport (5.0.0.1)
39
+ concurrent-ruby (~> 1.0, >= 1.0.2)
40
+ i18n (~> 0.7)
41
+ minitest (~> 5.1)
42
+ tzinfo (~> 1.1)
43
+ rails (5.0.0.1)
44
+ actioncable (= 5.0.0.1)
45
+ actionmailer (= 5.0.0.1)
46
+ actionpack (= 5.0.0.1)
47
+ actionview (= 5.0.0.1)
48
+ activejob (= 5.0.0.1)
49
+ activemodel (= 5.0.0.1)
50
+ activerecord (= 5.0.0.1)
51
+ activesupport (= 5.0.0.1)
52
+ bundler (>= 1.3.0, < 2.0)
53
+ railties (= 5.0.0.1)
54
+ sprockets-rails (>= 2.0.0)
55
+ railties (5.0.0.1)
56
+ actionpack (= 5.0.0.1)
57
+ activesupport (= 5.0.0.1)
58
+ method_source
59
+ rake (>= 0.8.7)
60
+ thor (>= 0.18.1, < 2.0)
61
+
62
+ PATH
63
+ remote: ../
64
+ specs:
65
+ actionpack-cloudflare (1.1.0)
66
+ actionpack (>= 3.2)
67
+
68
+ GEM
69
+ remote: https://rubygems.org/
70
+ specs:
71
+ appraisal (2.1.0)
72
+ bundler
73
+ rake
74
+ thor (>= 0.14.0)
75
+ arel (7.1.4)
76
+ builder (3.2.2)
77
+ coderay (1.1.1)
78
+ concurrent-ruby (1.0.2)
79
+ erubis (2.7.0)
80
+ globalid (0.3.7)
81
+ activesupport (>= 4.1.0)
82
+ i18n (0.7.0)
83
+ loofah (2.0.3)
84
+ nokogiri (>= 1.5.9)
85
+ mail (2.6.4)
86
+ mime-types (>= 1.16, < 4)
87
+ method_source (0.8.2)
88
+ mime-types (3.1)
89
+ mime-types-data (~> 3.2015)
90
+ mime-types-data (3.2016.0521)
91
+ mini_portile2 (2.1.0)
92
+ minitest (5.9.1)
93
+ nio4r (1.2.1)
94
+ nokogiri (1.6.8.1)
95
+ mini_portile2 (~> 2.1.0)
96
+ pry (0.10.4)
97
+ coderay (~> 1.1.0)
98
+ method_source (~> 0.8.1)
99
+ slop (~> 3.4)
100
+ rack (2.0.1)
101
+ rack-test (0.6.3)
102
+ rack (>= 1.0)
103
+ rails-dom-testing (2.0.1)
104
+ activesupport (>= 4.2.0, < 6.0)
105
+ nokogiri (~> 1.6.0)
106
+ rails-html-sanitizer (1.0.3)
107
+ loofah (~> 2.0)
108
+ rake (11.3.0)
109
+ slop (3.6.0)
110
+ sprockets (3.7.0)
111
+ concurrent-ruby (~> 1.0)
112
+ rack (> 1, < 3)
113
+ sprockets-rails (3.2.0)
114
+ actionpack (>= 4.0)
115
+ activesupport (>= 4.0)
116
+ sprockets (>= 3.0.0)
117
+ thor (0.19.1)
118
+ thread_safe (0.3.5)
119
+ tzinfo (1.2.2)
120
+ thread_safe (~> 0.1)
121
+ websocket-driver (0.6.4)
122
+ websocket-extensions (>= 0.1.0)
123
+ websocket-extensions (0.1.2)
124
+
125
+ PLATFORMS
126
+ ruby
127
+
128
+ DEPENDENCIES
129
+ actionpack-cloudflare!
130
+ appraisal
131
+ bundler
132
+ pry
133
+ rails!
134
+ rake
135
+
136
+ BUNDLED WITH
137
+ 1.12.5
@@ -0,0 +1,11 @@
1
+ require 'action_pack'
2
+ require 'action_dispatch'
3
+ require 'action_dispatch/http/request'
4
+ require 'action_pack/cloudflare/version'
5
+ require 'action_pack/cloudflare/request'
6
+
7
+ module ActionPack
8
+ module Cloudflare
9
+
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ module ActionPack
2
+ module Cloudflare
3
+ module Request
4
+
5
+ def remote_ip
6
+ remote_ip_cloudflare || super
7
+ end
8
+
9
+ private
10
+
11
+ def remote_ip_cloudflare
12
+ @env['HTTP_CF_CONNECTING_IP']
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+
19
+ ActionDispatch::Request.class_eval do
20
+ prepend ActionPack::Cloudflare::Request
21
+ end
@@ -0,0 +1,5 @@
1
+ module ActionPack
2
+ module Cloudflare
3
+ VERSION = '1.1.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require 'action_pack/cloudflare'
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: actionpack-cloudflare
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ken Collins
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionpack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: appraisal
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Simple gem that extends Rails `request.remote_ip` to default to Cloudflare's
84
+ `HTTP_CF_CONNECTING_IP` header.
85
+ email:
86
+ - ken@metaskills.net
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - ".travis.yml"
93
+ - Appraisals
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - actionpack-cloudflare.gemspec
99
+ - bin/console
100
+ - bin/setup
101
+ - gemfiles/rails32.gemfile
102
+ - gemfiles/rails32.gemfile.lock
103
+ - gemfiles/rails40.gemfile
104
+ - gemfiles/rails40.gemfile.lock
105
+ - gemfiles/rails41.gemfile
106
+ - gemfiles/rails41.gemfile.lock
107
+ - gemfiles/rails42.gemfile
108
+ - gemfiles/rails42.gemfile.lock
109
+ - gemfiles/rails50.gemfile
110
+ - gemfiles/rails50.gemfile.lock
111
+ - lib/action_pack/cloudflare.rb
112
+ - lib/action_pack/cloudflare/request.rb
113
+ - lib/action_pack/cloudflare/version.rb
114
+ - lib/actionpack-cloudflare.rb
115
+ homepage: https://github.com/customink/actionpack-cloudflare
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.4.5.1
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Allow Rails request.remote_ip to defer to CloudFlare's connecting IP address.
139
+ test_files: []