vpndetection 5.9.1 → 5.10.1
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 +7 -6
- data/lib/vpndetection/api/account_wire_api.rb +1 -1
- data/lib/vpndetection/api/api_keys_wire_api.rb +1 -1
- data/lib/vpndetection/api/authorization_wire_api.rb +1 -1
- data/lib/vpndetection/api/database_wire_api.rb +1 -1
- data/lib/vpndetection/api/entitlement_wire_api.rb +1 -1
- data/lib/vpndetection/api/lookup_wire_api.rb +5 -5
- data/lib/vpndetection/api/organization_wire_api.rb +1 -1
- data/lib/vpndetection/api_client.rb +1 -1
- data/lib/vpndetection/api_error.rb +1 -1
- data/lib/vpndetection/api_model_base.rb +1 -1
- data/lib/vpndetection/bogon.rb +4 -1
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/models/account_create_apikey_request.rb +1 -1
- data/lib/vpndetection/models/account_created_apikey.rb +1 -1
- data/lib/vpndetection/models/account_org.rb +1 -1
- data/lib/vpndetection/models/account_org_ref.rb +1 -1
- data/lib/vpndetection/models/account_org_wrap.rb +1 -1
- data/lib/vpndetection/models/account_rc.rb +1 -1
- data/lib/vpndetection/models/account_revealed_apikey.rb +1 -1
- data/lib/vpndetection/models/account_user.rb +1 -1
- data/lib/vpndetection/models/apikey_detail.rb +1 -1
- data/lib/vpndetection/models/apikey_list.rb +1 -1
- data/lib/vpndetection/models/asn.rb +274 -0
- data/lib/vpndetection/models/batch_lookup_error.rb +1 -1
- data/lib/vpndetection/models/batch_lookup_request.rb +1 -1
- data/lib/vpndetection/models/batch_lookup_response.rb +1 -1
- data/lib/vpndetection/models/class_detail.rb +1 -1
- data/lib/vpndetection/models/client_registration.rb +1 -1
- data/lib/vpndetection/models/client_registration_request.rb +1 -1
- data/lib/vpndetection/models/database.rb +29 -2
- data/lib/vpndetection/models/database_checksums_response.rb +1 -1
- data/lib/vpndetection/models/database_format.rb +1 -1
- data/lib/vpndetection/models/database_format_size.rb +1 -1
- data/lib/vpndetection/models/database_list.rb +1 -1
- data/lib/vpndetection/models/database_metadata.rb +1 -1
- data/lib/vpndetection/models/database_metadata_column.rb +1 -1
- data/lib/vpndetection/models/database_version.rb +1 -1
- data/lib/vpndetection/models/db_checksums.rb +1 -1
- data/lib/vpndetection/models/device_authorization.rb +1 -1
- data/lib/vpndetection/models/download.rb +29 -2
- data/lib/vpndetection/models/download_list.rb +1 -1
- data/lib/vpndetection/models/entitlement.rb +1 -1
- data/lib/vpndetection/models/entitlement_apikey.rb +1 -1
- data/lib/vpndetection/models/entitlement_error.rb +1 -1
- data/lib/vpndetection/models/entitlement_plan.rb +1 -1
- data/lib/vpndetection/models/entitlement_usage.rb +1 -1
- data/lib/vpndetection/models/error_envelope.rb +1 -1
- data/lib/vpndetection/models/identity.rb +1 -1
- data/lib/vpndetection/models/location.rb +409 -0
- data/lib/vpndetection/models/lookup_error.rb +1 -1
- data/lib/vpndetection/models/lookup_response.rb +40 -22
- data/lib/vpndetection/models/oauth_error.rb +1 -1
- data/lib/vpndetection/models/oauth_metadata.rb +1 -1
- data/lib/vpndetection/models/proxy_detail.rb +1 -1
- data/lib/vpndetection/models/pubproxy_detail.rb +1 -1
- data/lib/vpndetection/models/standing.rb +1 -1
- data/lib/vpndetection/models/token_response.rb +1 -1
- data/lib/vpndetection/models/vpn_detail.rb +4 -4
- data/lib/vpndetection/result.rb +41 -17
- data/lib/vpndetection/transport.rb +25 -3
- data/lib/vpndetection/version.rb +1 -1
- metadata +3 -1
data/lib/vpndetection/result.rb
CHANGED
|
@@ -24,6 +24,15 @@ module VPNDetection
|
|
|
24
24
|
|
|
25
25
|
DETAILS = %w[vpn hosting relay tor cdn resproxy dcproxy mobproxy pubproxy].freeze
|
|
26
26
|
|
|
27
|
+
# Where the address is, and the AS announcing it: every keyed answer carries
|
|
28
|
+
# both, each member present, an empty string or AS 0 where nothing is known.
|
|
29
|
+
LOCATION = %w[
|
|
30
|
+
continent continent_name country country_name timezone currency_code currency_name currency_symbol
|
|
31
|
+
flag_emoji flag_unicode
|
|
32
|
+
].freeze
|
|
33
|
+
|
|
34
|
+
ASN = %w[asn name domain type prefix].freeze
|
|
35
|
+
|
|
27
36
|
# The response exactly as it came off the wire, with its original names.
|
|
28
37
|
# Frozen, because the cache hands this same object to every later caller of
|
|
29
38
|
# the address.
|
|
@@ -66,7 +75,7 @@ module VPNDetection
|
|
|
66
75
|
end
|
|
67
76
|
|
|
68
77
|
# Whether the address belongs to a hosting or cloud provider, or nil when
|
|
69
|
-
# your plan does not include it.
|
|
78
|
+
# your plan does not include it. Every paid plan.
|
|
70
79
|
def is_hosting
|
|
71
80
|
@raw['is_hosting']
|
|
72
81
|
end
|
|
@@ -77,7 +86,7 @@ module VPNDetection
|
|
|
77
86
|
end
|
|
78
87
|
|
|
79
88
|
# Whether the address is a privacy relay egress, or nil when your plan does
|
|
80
|
-
# not include it.
|
|
89
|
+
# not include it. Free and paid plans.
|
|
81
90
|
def is_relay
|
|
82
91
|
@raw['is_relay']
|
|
83
92
|
end
|
|
@@ -88,7 +97,7 @@ module VPNDetection
|
|
|
88
97
|
end
|
|
89
98
|
|
|
90
99
|
# Whether the address is a Tor node, or nil when your plan does not include
|
|
91
|
-
# it.
|
|
100
|
+
# it. Free and paid plans.
|
|
92
101
|
def is_tor
|
|
93
102
|
@raw['is_tor']
|
|
94
103
|
end
|
|
@@ -99,7 +108,7 @@ module VPNDetection
|
|
|
99
108
|
end
|
|
100
109
|
|
|
101
110
|
# Whether the address belongs to a CDN, or nil when your plan does not
|
|
102
|
-
# include it.
|
|
111
|
+
# include it. Every paid plan.
|
|
103
112
|
def is_cdn
|
|
104
113
|
@raw['is_cdn']
|
|
105
114
|
end
|
|
@@ -110,7 +119,7 @@ module VPNDetection
|
|
|
110
119
|
end
|
|
111
120
|
|
|
112
121
|
# Whether the address was seen in a residential proxy pool, or nil when your
|
|
113
|
-
# plan does not include it.
|
|
122
|
+
# plan does not include it. Every paid plan.
|
|
114
123
|
def is_resproxy
|
|
115
124
|
@raw['is_resproxy']
|
|
116
125
|
end
|
|
@@ -121,7 +130,7 @@ module VPNDetection
|
|
|
121
130
|
end
|
|
122
131
|
|
|
123
132
|
# Whether the address was seen in a datacenter proxy pool, or nil when your
|
|
124
|
-
# plan does not include it.
|
|
133
|
+
# plan does not include it. Every paid plan.
|
|
125
134
|
def is_dcproxy
|
|
126
135
|
@raw['is_dcproxy']
|
|
127
136
|
end
|
|
@@ -132,7 +141,7 @@ module VPNDetection
|
|
|
132
141
|
end
|
|
133
142
|
|
|
134
143
|
# Whether the address was seen in a mobile proxy pool, or nil when your plan
|
|
135
|
-
# does not include it.
|
|
144
|
+
# does not include it. Every paid plan.
|
|
136
145
|
def is_mobproxy
|
|
137
146
|
@raw['is_mobproxy']
|
|
138
147
|
end
|
|
@@ -144,7 +153,7 @@ module VPNDetection
|
|
|
144
153
|
|
|
145
154
|
# Whether a public proxy, one anyone can connect through, listens on the
|
|
146
155
|
# address or sends its traffic out from it, or nil when your plan does not
|
|
147
|
-
# include it.
|
|
156
|
+
# include it. Every paid plan.
|
|
148
157
|
def is_pubproxy
|
|
149
158
|
@raw['is_pubproxy']
|
|
150
159
|
end
|
|
@@ -154,42 +163,43 @@ module VPNDetection
|
|
|
154
163
|
@raw['is_pubproxy'] == true
|
|
155
164
|
end
|
|
156
165
|
|
|
157
|
-
# Detail for `is_vpn`: provider, last_seen
|
|
166
|
+
# Detail for `is_vpn`: provider, last_seen and confidence. Every paid plan.
|
|
167
|
+
# `method` is deprecated: no plan is answered with it since 2026-10-20.
|
|
158
168
|
def vpn
|
|
159
169
|
@raw['vpn']
|
|
160
170
|
end
|
|
161
171
|
|
|
162
|
-
# Detail for `is_hosting`.
|
|
172
|
+
# Detail for `is_hosting`. Every paid plan.
|
|
163
173
|
def hosting
|
|
164
174
|
@raw['hosting']
|
|
165
175
|
end
|
|
166
176
|
|
|
167
|
-
# Detail for `is_relay`.
|
|
177
|
+
# Detail for `is_relay`. Free and paid plans.
|
|
168
178
|
def relay
|
|
169
179
|
@raw['relay']
|
|
170
180
|
end
|
|
171
181
|
|
|
172
|
-
# Detail for `is_tor`.
|
|
182
|
+
# Detail for `is_tor`. Free and paid plans.
|
|
173
183
|
def tor
|
|
174
184
|
@raw['tor']
|
|
175
185
|
end
|
|
176
186
|
|
|
177
|
-
# Detail for `is_cdn`.
|
|
187
|
+
# Detail for `is_cdn`. Every paid plan.
|
|
178
188
|
def cdn
|
|
179
189
|
@raw['cdn']
|
|
180
190
|
end
|
|
181
191
|
|
|
182
|
-
# Detail for `is_resproxy`.
|
|
192
|
+
# Detail for `is_resproxy`. Every paid plan.
|
|
183
193
|
def resproxy
|
|
184
194
|
@raw['resproxy']
|
|
185
195
|
end
|
|
186
196
|
|
|
187
|
-
# Detail for `is_dcproxy`.
|
|
197
|
+
# Detail for `is_dcproxy`. Every paid plan.
|
|
188
198
|
def dcproxy
|
|
189
199
|
@raw['dcproxy']
|
|
190
200
|
end
|
|
191
201
|
|
|
192
|
-
# Detail for `is_mobproxy`.
|
|
202
|
+
# Detail for `is_mobproxy`. Every paid plan.
|
|
193
203
|
def mobproxy
|
|
194
204
|
@raw['mobproxy']
|
|
195
205
|
end
|
|
@@ -198,11 +208,25 @@ module VPNDetection
|
|
|
198
208
|
# num_proxies, last_seen and last_usable. num_ports is 0 when the address
|
|
199
209
|
# is only an exit and num_proxies 0 when it is only an entry; last_usable is
|
|
200
210
|
# an empty string when no request through a proxy on the address was
|
|
201
|
-
# answered.
|
|
211
|
+
# answered. Every paid plan.
|
|
202
212
|
def pubproxy
|
|
203
213
|
@raw['pubproxy']
|
|
204
214
|
end
|
|
205
215
|
|
|
216
|
+
# Where the address is: continent, country, timezone, the country's
|
|
217
|
+
# currency and flag, as a wire hash (`result.location['country']`). Free and
|
|
218
|
+
# paid plans.
|
|
219
|
+
def location
|
|
220
|
+
@raw['location']
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# The AS announcing the address: asn, name, domain, type and prefix, as a
|
|
224
|
+
# wire hash (`result.asn['name']`), with asn 0 where none does. Free and paid
|
|
225
|
+
# plans.
|
|
226
|
+
def asn
|
|
227
|
+
@raw['asn']
|
|
228
|
+
end
|
|
229
|
+
|
|
206
230
|
def to_h
|
|
207
231
|
@raw
|
|
208
232
|
end
|
|
@@ -295,6 +295,9 @@ module VPNDetection
|
|
|
295
295
|
'ClassDetail' => [],
|
|
296
296
|
'ProxyDetail' => [],
|
|
297
297
|
'PubproxyDetail' => [],
|
|
298
|
+
'Location' => %i[continent continent_name country country_name timezone currency_code currency_name
|
|
299
|
+
currency_symbol flag_emoji flag_unicode],
|
|
300
|
+
'Asn' => %i[asn name domain type prefix],
|
|
298
301
|
'BatchLookupError' => %i[status error],
|
|
299
302
|
'Entitlement' => %i[org_id apikey plan usage],
|
|
300
303
|
'EntitlementApikey' => %i[id expires allowed_cidrs],
|
|
@@ -302,7 +305,7 @@ module VPNDetection
|
|
|
302
305
|
'EntitlementUsage' => %i[requests quota hard_limit window_start window_end],
|
|
303
306
|
'DatabaseList' => %i[databases],
|
|
304
307
|
'Database' => %i[base name summary license_type starts expires renews_at notice_due_at in_term standing
|
|
305
|
-
versions],
|
|
308
|
+
open versions],
|
|
306
309
|
'DatabaseVersion' => %i[id version formats],
|
|
307
310
|
'DatabaseFormatSize' => %i[format bytes],
|
|
308
311
|
'DatabaseMetadata' => %i[id updated entries schema],
|
|
@@ -310,9 +313,27 @@ module VPNDetection
|
|
|
310
313
|
'DatabaseChecksumsResponse' => %i[id format checksums],
|
|
311
314
|
'DbChecksums' => %i[md5 sha1 sha256 sha512],
|
|
312
315
|
'DownloadList' => %i[downloads],
|
|
313
|
-
'Download' => %i[dataset_id format outcome sample bytes http_status apikey_id client_ip user_agent
|
|
316
|
+
'Download' => %i[dataset_id format outcome sample open bytes http_status apikey_id client_ip user_agent
|
|
317
|
+
created],
|
|
314
318
|
}.freeze
|
|
315
319
|
|
|
320
|
+
# RFC 3339's full-date, the spec's `date`, and its date-time, the spec's
|
|
321
|
+
# `date-time`, in the upper case the API sends. Anything else reached the
|
|
322
|
+
# generated reader's Date.parse or Time.parse, which read "monday" as this
|
|
323
|
+
# week's, "10:00" as today in the process's zone and 30 February as 2 March,
|
|
324
|
+
# or a lookup's detail handed it back as served (5.10.0, measured 2026-10-21).
|
|
325
|
+
RFC3339_DATE = /\A(\d{4})-(\d{2})-(\d{2})\z/
|
|
326
|
+
RFC3339_DATE_TIME = /\A(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))\z/
|
|
327
|
+
|
|
328
|
+
# A date in the form its type names, on a day and at a time that exist: an
|
|
329
|
+
# hour of 24 rolls over the way a missing day does.
|
|
330
|
+
def self.date?(value, type)
|
|
331
|
+
m = (type == 'Date' ? RFC3339_DATE : RFC3339_DATE_TIME).match(value)
|
|
332
|
+
return false unless m && Date.valid_date?(m[1].to_i, m[2].to_i, m[3].to_i)
|
|
333
|
+
|
|
334
|
+
type == 'Date' || (m[4].to_i < 24 && m[5].to_i < 60 && m[6].to_i < 60 && m[7].to_i < 24 && m[8].to_i < 60)
|
|
335
|
+
end
|
|
336
|
+
|
|
316
337
|
# True when the parsed `value` has the generated `type`, a model's members
|
|
317
338
|
# recursively; raises TypeError naming where it does not. No list entry or
|
|
318
339
|
# map value the spec describes may be null: through 5.9.0 one came back as
|
|
@@ -323,7 +344,8 @@ module VPNDetection
|
|
|
323
344
|
|
|
324
345
|
typed =
|
|
325
346
|
case type
|
|
326
|
-
when 'String'
|
|
347
|
+
when 'String' then value.is_a?(String)
|
|
348
|
+
when 'Date', 'Time' then value.is_a?(String) && date?(value, type)
|
|
327
349
|
when 'Integer' then value.is_a?(Integer)
|
|
328
350
|
when 'Float' then value.is_a?(Numeric)
|
|
329
351
|
when 'Boolean' then [true, false].include?(value)
|
data/lib/vpndetection/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vpndetection
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mslm Dev
|
|
@@ -78,6 +78,7 @@ files:
|
|
|
78
78
|
- lib/vpndetection/models/account_user.rb
|
|
79
79
|
- lib/vpndetection/models/apikey_detail.rb
|
|
80
80
|
- lib/vpndetection/models/apikey_list.rb
|
|
81
|
+
- lib/vpndetection/models/asn.rb
|
|
81
82
|
- lib/vpndetection/models/batch_lookup_error.rb
|
|
82
83
|
- lib/vpndetection/models/batch_lookup_request.rb
|
|
83
84
|
- lib/vpndetection/models/batch_lookup_response.rb
|
|
@@ -103,6 +104,7 @@ files:
|
|
|
103
104
|
- lib/vpndetection/models/entitlement_usage.rb
|
|
104
105
|
- lib/vpndetection/models/error_envelope.rb
|
|
105
106
|
- lib/vpndetection/models/identity.rb
|
|
107
|
+
- lib/vpndetection/models/location.rb
|
|
106
108
|
- lib/vpndetection/models/lookup_error.rb
|
|
107
109
|
- lib/vpndetection/models/lookup_response.rb
|
|
108
110
|
- lib/vpndetection/models/oauth_error.rb
|