vpndetection-rails 2.0.11 → 2.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 212da0b891fcf091b7435cd63573d9f828cca9c1a3b69e8bda3b0d7c3238bdab
4
- data.tar.gz: 94c10c18aa4f25dec95ffe8e89d92f203f9544e8c349f2562441f5c2e1f130e3
3
+ metadata.gz: 5d511872aa8a56af6ea3c30fb1eb836ed375675ea33a0b42034a2d2994fd0b5b
4
+ data.tar.gz: 6584b5f34d60360fa5238861dded3d02fd18b354294cb30f353a2d984c6e7d73
5
5
  SHA512:
6
- metadata.gz: 315926ec3c3e853187f414f21dfa4782b7db61738500b9971fa148bb6d3a1637e01c1512863e8373272cf367ac2545d6fcd76e93f7ba90abd007c356453f82f6
7
- data.tar.gz: 21854c3b4784d6f255db5aae81b03f13af63ac3a89bbf559a1b736eca28d2dba2129c7c5545317a8d53c1db3962522d6438a4c3bfd13674fc84c243d65c769c9
6
+ metadata.gz: d451eb799f2ff065469f7e04d4ea256304fd0779da596f89e6388f94c6da2dcd3505bb179d88f6b9053067ffe10348e7261cd1365b3910ef94ca6a6d9dc16266
7
+ data.tar.gz: f0eb5bc90e4e58172d99f12e71b27817c41677b205d80de1f143f8cc32ce50aabc3022dbb5dc37cf3fb73fda7b74e1481e21ac4b7a534ad1075dea9303779f7a
data/README.md CHANGED
@@ -70,9 +70,9 @@ on_blocked: ->(request, lookup) { [303, { "location" => "/no-vpn" }, []] }
70
70
 
71
71
  This is the setting that decides whether any of the above works, and it is the one thing only you can get right.
72
72
 
73
- **In Rails**, the default reads `env["action_dispatch.remote_ip"]` — the answer `ActionDispatch::RemoteIp` computed from `X-Forwarded-For` minus your `config.action_dispatch.trusted_proxies`. That is the right fix behind a load balancer: tell Rails which proxies are yours and it resolves the visitor for you. `Rack::Request#ip` does *not* read that entry, so reading Rails' own is what makes your `trusted_proxies` mean anything here.
73
+ **In Rails**, the default reads `env["action_dispatch.remote_ip"]` — the answer `ActionDispatch::RemoteIp` computed from `X-Forwarded-For` minus your `config.action_dispatch.trusted_proxies`. That is the right fix behind a load balancer: tell Rails which proxies are yours and it resolves the visitor for you. `Rack::Request#ip` does *not* read that entry, so reading Rails' own is what makes your `trusted_proxies` mean anything here. **With nothing in front of the app server, that default can be forged**: `RemoteIp` believes `X-Forwarded-For` without checking that the connection came from a proxy, so any visitor picks the address that gets looked up. There, pass `ip_selector: ->(request) { request.ip }`.
74
74
 
75
- **In a bare Rack app** there is no such entry and the default falls back to `Rack::Request#ip`. Be aware that Rack's `ip` **already trusts `X-Forwarded-For`**: it returns the left-most entry once private and loopback addresses are dropped, which is whatever the caller sent. That is measured, not assumed, and the test suite pins it. Behind nothing, or behind an edge that appends rather than overwrites, name your edge's header instead:
75
+ **In a bare Rack app** there is no such entry and the default falls back to `Rack::Request#ip`. Rack's `ip` returns the connecting address, `REMOTE_ADDR`, unless that is a trusted proxy, which by default means a loopback or private address. Only then does it read `X-Forwarded-For`, and it takes the right-most entry that is not a trusted proxy. The test suite pins both. Behind an edge on a public address, or one that appends rather than overwrites, name your edge's header instead:
76
76
 
77
77
  ```ruby
78
78
  ip_selector: VPNDetection::Rails.header_ip_selector("CF-Connecting-IP")
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VPNDetection
4
4
  module Rails
5
- VERSION = '2.0.11'
5
+ VERSION = '2.0.12'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpndetection-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mslm Dev
@@ -29,7 +29,7 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.6.2
32
+ version: 5.6.3
33
33
  - - "<"
34
34
  - !ruby/object:Gem::Version
35
35
  version: '6'
@@ -39,7 +39,7 @@ dependencies:
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 5.6.2
42
+ version: 5.6.3
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
45
  version: '6'