vpndetection 5.20.1 → 5.21.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/README.md +1 -1
- data/lib/vpndetection/middleware/condition.rb +11 -4
- data/lib/vpndetection/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6fa3bf8879a5ca2b75c4723b1fbae1fab3e6c9d2364ae3f698c5ab14a2a298b4
|
|
4
|
+
data.tar.gz: d4c91265a5556b14d2ddc7f2adbea510bbcf965e18074e7522ed2c5bb3b82532
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 949cc07141631b8a5d81d742effc103be59e58957c19373598a130a6a50382b08e12d428f010515603cd27a49ef55734951c7dae74f437dfb091c3bf465e868b
|
|
7
|
+
data.tar.gz: 454fe612a10c57b5ba861ab6b51bb3475b2ddfdd7056d6e65f6eef2628776e9794cba6a3e3a95fbfc5e397fd78ebfd95e10ae975fb3b7d268e1aeb8f802b62e5
|
data/README.md
CHANGED
|
@@ -276,7 +276,7 @@ There are official VPNDetection client libraries available for many languages in
|
|
|
276
276
|
|
|
277
277
|
VPN Detection API: Accurate anonymity detection identifying VPNs, residential proxies, hosting servers, Tor nodes, CDNs, relays and more.
|
|
278
278
|
|
|
279
|
-
[<img src="https://s3.vpndetection.io/vpndetection-public/brand/
|
|
279
|
+
[<picture><source media="(prefers-color-scheme: dark)" srcset="https://s3.vpndetection.io/vpndetection-public/brand/logo-dark.svg"><img src="https://s3.vpndetection.io/vpndetection-public/brand/logo.svg" alt="VPNDetection" height="40"/></picture>](https://vpndetection.io/)
|
|
280
280
|
|
|
281
281
|
## License
|
|
282
282
|
|
|
@@ -16,10 +16,11 @@ module VPNDetection
|
|
|
16
16
|
#
|
|
17
17
|
# A value may be a scalar (equality, strings without regard to case), an
|
|
18
18
|
# Array meaning any-of, a Hash of `gte`/`gt`/`lte`/`lt` bounding a number,
|
|
19
|
-
# or a nested condition. A member
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
19
|
+
# or a nested condition. A term on a member the answer holds as a list
|
|
20
|
+
# matches when any element matches it. A member set to `false` or `nil` is
|
|
21
|
+
# ignored entirely - a condition states the positive signals you act on, so
|
|
22
|
+
# there is no way to write "block when this is false", which would otherwise
|
|
23
|
+
# read as blocking everybody.
|
|
23
24
|
module Condition
|
|
24
25
|
BOUND_KEYS = %w[gte gt lte lt].freeze
|
|
25
26
|
|
|
@@ -99,7 +100,13 @@ module VPNDetection
|
|
|
99
100
|
# An ABSENT member arrives here as nil, which is exactly what "not in your
|
|
100
101
|
# plan" looks like. Every branch below must therefore reject it, which is
|
|
101
102
|
# what makes an unserved member fail a match rather than pass it.
|
|
103
|
+
#
|
|
104
|
+
# A member the answer holds as a list (`pubproxy.protocols`, a `web` row)
|
|
105
|
+
# matches when any element matches the term, so an object term must match
|
|
106
|
+
# one element whole.
|
|
102
107
|
def matches_value?(want, got)
|
|
108
|
+
return got.any? { |element| matches_value?(want, element) } if got.is_a?(Array)
|
|
109
|
+
|
|
103
110
|
case want
|
|
104
111
|
when Array then want.any? { |entry| matches_value?(entry, got) }
|
|
105
112
|
when Hash
|
data/lib/vpndetection/version.rb
CHANGED