vpndetection 5.11.3 → 5.12.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 +10 -3
- data/lib/vpndetection/api/account_wire_api.rb +1 -1
- data/lib/vpndetection/api/api_keys_wire_api.rb +9 -9
- data/lib/vpndetection/api/authorization_wire_api.rb +1 -1
- data/lib/vpndetection/api/database_wire_api.rb +13 -5
- data/lib/vpndetection/api/entitlement_wire_api.rb +1 -1
- data/lib/vpndetection/api/lookup_wire_api.rb +1 -1
- 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/client.rb +19 -7
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/database_api.rb +16 -11
- data/lib/vpndetection/errors.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 +1 -1
- 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 +2 -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 +2 -2
- data/lib/vpndetection/models/db_checksums.rb +1 -1
- data/lib/vpndetection/models/device_authorization.rb +1 -1
- data/lib/vpndetection/models/download.rb +1 -1
- data/lib/vpndetection/models/download_list.rb +1 -1
- data/lib/vpndetection/models/entitlement.rb +1 -1
- data/lib/vpndetection/models/entitlement_apikey.rb +2 -2
- 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 +1 -1
- data/lib/vpndetection/models/lookup_error.rb +1 -1
- data/lib/vpndetection/models/lookup_response.rb +1 -1
- 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 +6 -6
- data/lib/vpndetection/models/pubproxy_detail.rb +4 -4
- data/lib/vpndetection/models/standing.rb +1 -1
- data/lib/vpndetection/models/token_response.rb +1 -1
- data/lib/vpndetection/models/vpn_detail.rb +1 -1
- data/lib/vpndetection/retries.rb +1 -1
- 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: dc7966b57c12cebae2f064198cd2864cdee0c8ef3650bf7800697ee661e0137b
|
|
4
|
+
data.tar.gz: d747ad89b39de9d6b71f633dff7f1f66642676a22e8183761fb48ba001099b31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b0e62f8199cef49cb582bd417f7d6b5645f2f270002b590ded58dcafbf4382f6365454b89c22b06bbb14d6c03e90e453fa3a82ba657e2d9cf22598bee3d12bd
|
|
7
|
+
data.tar.gz: a7ce50c6510a9065dc23ce7c347905527ac3655b5425b89b83db537884d7784bc299aac2f57b7ff839d669a6fa8c766885735677221680348ff5e74e491efb9d
|
data/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
The official Ruby client library for the [VPNDetection](https://vpndetection.io) API.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
It tells you whether an IP address is a VPN, residential proxy, Tor node, relay or hosting server.
|
|
9
9
|
|
|
10
10
|
## Getting Started
|
|
11
11
|
|
|
@@ -161,11 +161,11 @@ client = VPNDetection::Client.new(timeout: 10, retries: 4)
|
|
|
161
161
|
result = client.lookup('45.83.91.1', timeout: 2, retries: 0)
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds, and 0 means no bound; before 5.2.0 the default was 10, so pass `timeout: 10` to keep that bound. The client's values are defaults: `lookup`, `lookup_batch`, `my_ip` and `my_entitlement` each take `timeout:` and `retries:` for that call alone, and every `client.oauth` method and every `client.database` call that is not a transfer takes `timeout:` (from 5.3.0). A database download bounds only its connection with it, because a whole transfer can take minutes. A negative value, anything that isn't a number, and anything past 2147483.647 seconds (the longest curl holds) raise `ArgumentError` where you pass them, before any request. So does a `retries` that isn't an Integer from 0 (from 5.11.3).
|
|
164
|
+
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds, and 0 means no bound; before 5.2.0 the default was 10, so pass `timeout: 10` to keep that bound. The client's values are defaults: `lookup`, `lookup_batch`, `my_ip` and `my_entitlement` each take `timeout:` and `retries:` for that call alone, and every `client.oauth` method and every `client.database` call that is not a transfer takes `timeout:` (from 5.3.0). A database download bounds only its connection with it, because a whole transfer can take minutes. A negative value, anything that isn't a number, and anything past 2147483.647 seconds (the longest curl holds) raise `ArgumentError` where you pass them, before any request. So does a `retries` that isn't an Integer from 0 (from 5.11.3), and a `concurrency` that isn't an Integer from 1 given to `Client.new`, which `lookup_batch` refuses as `:bad_request` (from 5.11.4).
|
|
165
165
|
|
|
166
166
|
### Database downloads
|
|
167
167
|
|
|
168
|
-
If your key carries the `db.download` scope, the licensed databases are available through `client.database`. A license covers a database FAMILY and a download names one of its versions, so the
|
|
168
|
+
If your key carries the `db.download` scope, the licensed databases are available through `client.database`. A license covers a database FAMILY and a download names one of its versions, so the ID comes from `versions`:
|
|
169
169
|
|
|
170
170
|
```ruby
|
|
171
171
|
family = client.database.list.first
|
|
@@ -178,6 +178,13 @@ bytes = client.database.download_bytes('cdn_ip_v1', 'csvgz')
|
|
|
178
178
|
|
|
179
179
|
`download` streams straight to disk, so nothing bigger than a chunk is ever held in memory whatever the database weighs, and it writes through a neighboring `.part` file so a transfer that dies half way leaves no truncated copy behind. `download_url` hands back the time-limited link and follows nothing, for when you want to run the transfer yourself. `download_bytes` holds the whole file in memory, and the catalog runs from `cdn_ip_v1` at 10 KB to `resproxy_ip_90d_v1` at 1.79 GB, so reach for `download` for anything you have not measured.
|
|
180
180
|
|
|
181
|
+
From 5.12.0, each of the three takes `build:`, the build a `database.updated` webhook names, so the file is the one whose `sha256` the webhook carries rather than whatever is live by the time you ask. Without it you get the live build. A build is kept 7 days, and one pruned since is a `:bad_request` with status 410; a value that is no build's name raises `ArgumentError` before any request:
|
|
182
|
+
|
|
183
|
+
```ruby
|
|
184
|
+
data = event.fetch('data') # a database.updated webhook's
|
|
185
|
+
client.database.download(data['dataset'], 'mmdb', "./#{data['dataset']}.mmdb", build: data['build'])
|
|
186
|
+
```
|
|
187
|
+
|
|
181
188
|
From 5.3.0, `list`, `metadata`, `checksums`, `downloads` and `download_url` each take `timeout:` in seconds for that call alone, overriding the client's for one attempt of it:
|
|
182
189
|
|
|
183
190
|
```ruby
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -146,7 +146,7 @@ module VPNDetection
|
|
|
146
146
|
|
|
147
147
|
# Reveal
|
|
148
148
|
# Returns an existing key's secret. Its own scope rather than part of `apikeys.manage`, because the two are different acts: rotating replaces a secret you never see, while this hands one over. Refused with `NOT_RETRIEVABLE` for a key issued before this product stored secrets recoverably - that secret was never kept, so no retry will ever produce it. Rotate the key instead.
|
|
149
|
-
# @param id [String] The key's
|
|
149
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
150
150
|
# @param [Hash] opts the optional parameters
|
|
151
151
|
# @return [AccountRevealedApikey]
|
|
152
152
|
def account_reveal_apikey(id, opts = {})
|
|
@@ -156,7 +156,7 @@ module VPNDetection
|
|
|
156
156
|
|
|
157
157
|
# Reveal
|
|
158
158
|
# Returns an existing key's secret. Its own scope rather than part of `apikeys.manage`, because the two are different acts: rotating replaces a secret you never see, while this hands one over. Refused with `NOT_RETRIEVABLE` for a key issued before this product stored secrets recoverably - that secret was never kept, so no retry will ever produce it. Rotate the key instead.
|
|
159
|
-
# @param id [String] The key's
|
|
159
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
160
160
|
# @param [Hash] opts the optional parameters
|
|
161
161
|
# @return [Array<(AccountRevealedApikey, Integer, Hash)>] AccountRevealedApikey data, response status code and response headers
|
|
162
162
|
def account_reveal_apikey_with_http_info(id, opts = {})
|
|
@@ -209,7 +209,7 @@ module VPNDetection
|
|
|
209
209
|
|
|
210
210
|
# Revoke
|
|
211
211
|
# Stops the key working. Revocation is soft: the key stays listed with a `revoked_at`, because the organization still owns whatever it did while it was alive.
|
|
212
|
-
# @param id [String] The key's
|
|
212
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
213
213
|
# @param [Hash] opts the optional parameters
|
|
214
214
|
# @return [AccountRc]
|
|
215
215
|
def account_revoke_apikey(id, opts = {})
|
|
@@ -219,7 +219,7 @@ module VPNDetection
|
|
|
219
219
|
|
|
220
220
|
# Revoke
|
|
221
221
|
# Stops the key working. Revocation is soft: the key stays listed with a `revoked_at`, because the organization still owns whatever it did while it was alive.
|
|
222
|
-
# @param id [String] The key's
|
|
222
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
223
223
|
# @param [Hash] opts the optional parameters
|
|
224
224
|
# @return [Array<(AccountRc, Integer, Hash)>] AccountRc data, response status code and response headers
|
|
225
225
|
def account_revoke_apikey_with_http_info(id, opts = {})
|
|
@@ -271,8 +271,8 @@ module VPNDetection
|
|
|
271
271
|
end
|
|
272
272
|
|
|
273
273
|
# Rotate
|
|
274
|
-
# Replaces the secret behind a key, keeping its
|
|
275
|
-
# @param id [String] The key's
|
|
274
|
+
# Replaces the secret behind a key, keeping its ID, name and settings. The previous secret stops working immediately. The new secret comes back in the answer, so this needs `apikeys.reveal` as well as `apikeys.manage`.
|
|
275
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
276
276
|
# @param [Hash] opts the optional parameters
|
|
277
277
|
# @return [AccountCreatedApikey]
|
|
278
278
|
def account_rotate_apikey(id, opts = {})
|
|
@@ -281,8 +281,8 @@ module VPNDetection
|
|
|
281
281
|
end
|
|
282
282
|
|
|
283
283
|
# Rotate
|
|
284
|
-
# Replaces the secret behind a key, keeping its
|
|
285
|
-
# @param id [String] The key's
|
|
284
|
+
# Replaces the secret behind a key, keeping its ID, name and settings. The previous secret stops working immediately. The new secret comes back in the answer, so this needs `apikeys.reveal` as well as `apikeys.manage`.
|
|
285
|
+
# @param id [String] The key's ID, as returned by the list endpoint. Never the key itself.
|
|
286
286
|
# @param [Hash] opts the optional parameters
|
|
287
287
|
# @return [Array<(AccountCreatedApikey, Integer, Hash)>] AccountCreatedApikey data, response status code and response headers
|
|
288
288
|
def account_rotate_apikey_with_http_info(id, opts = {})
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -156,9 +156,10 @@ module VPNDetection
|
|
|
156
156
|
|
|
157
157
|
# Download
|
|
158
158
|
# Answers `302` with a time-limited URL pointing straight at object storage. Follow the redirect; the link authorizes the START of a transfer, so one already running is not interrupted when it lapses.
|
|
159
|
-
# @param id [String] Dataset
|
|
160
|
-
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogs are keyed by provider
|
|
159
|
+
# @param id [String] Dataset ID, e.g. vpn_ip_extended_v1
|
|
160
|
+
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogs are keyed by provider ID rather than by IP range, so no MMDB exists for them.
|
|
161
161
|
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @option opts [String] :build One build of the database, by the name a `database.updated` webhook gives it, so the file is the one whose `sha256` the webhook carries. Without it, the build that is live.
|
|
162
163
|
# @return [nil]
|
|
163
164
|
def download_database(id, format, opts = {})
|
|
164
165
|
download_database_with_http_info(id, format, opts)
|
|
@@ -167,9 +168,10 @@ module VPNDetection
|
|
|
167
168
|
|
|
168
169
|
# Download
|
|
169
170
|
# Answers `302` with a time-limited URL pointing straight at object storage. Follow the redirect; the link authorizes the START of a transfer, so one already running is not interrupted when it lapses.
|
|
170
|
-
# @param id [String] Dataset
|
|
171
|
-
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogs are keyed by provider
|
|
171
|
+
# @param id [String] Dataset ID, e.g. vpn_ip_extended_v1
|
|
172
|
+
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogs are keyed by provider ID rather than by IP range, so no MMDB exists for them.
|
|
172
173
|
# @param [Hash] opts the optional parameters
|
|
174
|
+
# @option opts [String] :build One build of the database, by the name a `database.updated` webhook gives it, so the file is the one whose `sha256` the webhook carries. Without it, the build that is live.
|
|
173
175
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
174
176
|
def download_database_with_http_info(id, format, opts = {})
|
|
175
177
|
if @api_client.config.debugging
|
|
@@ -183,6 +185,11 @@ module VPNDetection
|
|
|
183
185
|
if @api_client.config.client_side_validation && format.nil?
|
|
184
186
|
fail ArgumentError, "Missing the required parameter 'format' when calling DatabaseWireApi.download_database"
|
|
185
187
|
end
|
|
188
|
+
pattern = Regexp.new(/^[0-9]{8}\.[a-z0-9]{6}$/)
|
|
189
|
+
if @api_client.config.client_side_validation && !opts[:'build'].nil? && opts[:'build'] !~ pattern
|
|
190
|
+
fail ArgumentError, "invalid value for 'opts[:\"build\"]' when calling DatabaseWireApi.download_database, must conform to the pattern #{pattern}."
|
|
191
|
+
end
|
|
192
|
+
|
|
186
193
|
# resource path
|
|
187
194
|
local_var_path = '/api/v1/database/download'
|
|
188
195
|
|
|
@@ -190,6 +197,7 @@ module VPNDetection
|
|
|
190
197
|
query_params = opts[:query_params] || {}
|
|
191
198
|
query_params[:'id'] = id
|
|
192
199
|
query_params[:'format'] = format
|
|
200
|
+
query_params[:'build'] = opts[:'build'] if !opts[:'build'].nil?
|
|
193
201
|
|
|
194
202
|
# header parameters
|
|
195
203
|
header_params = opts[:header_params] || {}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/client.rb
CHANGED
|
@@ -28,7 +28,7 @@ module VPNDetection
|
|
|
28
28
|
# address. It is trimmed, and a key of blanks alone is no key.
|
|
29
29
|
# @param cache [Boolean] pass false to disable caching.
|
|
30
30
|
# @param cache_ttl [Numeric] how long an answer stays fresh, in seconds.
|
|
31
|
-
# @param concurrency [Integer] batch requests - chunks of up to 1000 addresses - in flight during a batch.
|
|
31
|
+
# @param concurrency [Integer] batch requests - chunks of up to 1000 addresses - in flight during a batch, from 1.
|
|
32
32
|
# @param retries [Integer] extra attempts for a transient failure, from 0. Each
|
|
33
33
|
# waits the server's `Retry-After` when it sent one of at most about 24.8
|
|
34
34
|
# days, and otherwise a backoff of 250 ms that doubles per retry.
|
|
@@ -40,14 +40,19 @@ module VPNDetection
|
|
|
40
40
|
# @raise [ArgumentError] for an `api_key` with a control character in it.
|
|
41
41
|
# @raise [ArgumentError] for a `timeout`, here or on any call, that is
|
|
42
42
|
# negative, not a finite number, or past 2147483.647 seconds (2**31 - 1 ms),
|
|
43
|
-
# the longest curl holds,
|
|
44
|
-
# not an Integer from 0
|
|
43
|
+
# the longest curl holds, for a `retries`, here or on any call, that is
|
|
44
|
+
# not an Integer from 0, and for a `concurrency` that is not an Integer
|
|
45
|
+
# from 1.
|
|
45
46
|
# @param transport [Transport, nil] override the HTTP layer, mostly for tests.
|
|
46
47
|
def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, cache: true,
|
|
47
48
|
cache_max_size: DEFAULT_CACHE_MAX_SIZE, cache_ttl: DEFAULT_CACHE_TTL,
|
|
48
49
|
concurrency: DEFAULT_CONCURRENCY, retries: DEFAULT_RETRIES,
|
|
49
50
|
timeout: DEFAULT_TIMEOUT, transport: nil)
|
|
50
51
|
retries = Retries.checked_count(retries)
|
|
52
|
+
# Refused where it is set: through 5.11.3 each batch refused it instead.
|
|
53
|
+
unless concurrency?(concurrency)
|
|
54
|
+
raise ArgumentError, "concurrency must be an Integer from 1, not #{concurrency.inspect}"
|
|
55
|
+
end
|
|
51
56
|
@transport = transport || Transport.new(
|
|
52
57
|
Transport::Config.new(api_key: api_key, base_url: base_url, timeout: timeout),
|
|
53
58
|
)
|
|
@@ -163,15 +168,16 @@ module VPNDetection
|
|
|
163
168
|
# per-entry failure with the status the single lookup would have answered,
|
|
164
169
|
# and a chunk that fails as a whole marks every address in it.
|
|
165
170
|
#
|
|
166
|
-
# @param concurrency [Integer, nil] chunks in flight, for THIS batch only.
|
|
167
|
-
# is refused as `:bad_request` before any
|
|
171
|
+
# @param concurrency [Integer, nil] chunks in flight, for THIS batch only.
|
|
172
|
+
# Anything but an Integer from 1 is refused as `:bad_request` before any
|
|
173
|
+
# request, and before a bogon or a cached answer is returned.
|
|
168
174
|
# @param retries [Integer, nil] extra attempts for a failed chunk, for THIS batch only.
|
|
169
175
|
# @param timeout [Numeric, nil] seconds each chunk's attempt may take, for THIS batch only.
|
|
170
176
|
# @return [Hash{String => Result, Error}] in the order the addresses were given
|
|
171
177
|
def lookup_batch(ips, concurrency: nil, retries: nil, timeout: nil)
|
|
172
178
|
limit = concurrency || @concurrency
|
|
173
|
-
unless
|
|
174
|
-
raise Error.new(:bad_request, "concurrency must be
|
|
179
|
+
unless concurrency?(limit)
|
|
180
|
+
raise Error.new(:bad_request, "concurrency must be an Integer from 1, not #{limit.inspect}")
|
|
175
181
|
end
|
|
176
182
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
177
183
|
Retries.checked_count(retries) unless retries.nil?
|
|
@@ -216,6 +222,12 @@ module VPNDetection
|
|
|
216
222
|
|
|
217
223
|
private
|
|
218
224
|
|
|
225
|
+
# Whether `value` can be a batch's concurrency: chunks in flight are counted
|
|
226
|
+
# whole, and a hydra allowed fewer than one runs nothing.
|
|
227
|
+
def concurrency?(value)
|
|
228
|
+
value.is_a?(Integer) && value >= 1
|
|
229
|
+
end
|
|
230
|
+
|
|
219
231
|
# Concurrent misses for one address share ONE request: 5.4.2 sent one per
|
|
220
232
|
# calling thread. The first miss boards the
|
|
221
233
|
# address and every miss after it, a batch's included, waits on its Flight.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -22,7 +22,7 @@ module VPNDetection
|
|
|
22
22
|
# The database FAMILIES your organization is licensed to download.
|
|
23
23
|
#
|
|
24
24
|
# A license is held against the family, while a download names one version,
|
|
25
|
-
# so the
|
|
25
|
+
# so the IDs {#download}, {#download_bytes}, {#download_url} and {#checksums}
|
|
26
26
|
# take come from each family's `versions`, not from the family itself.
|
|
27
27
|
#
|
|
28
28
|
# @param timeout [Numeric, nil] seconds this attempt may take, for THIS call only.
|
|
@@ -63,12 +63,16 @@ module VPNDetection
|
|
|
63
63
|
# START of a transfer, so one already running is not interrupted when it
|
|
64
64
|
# lapses.
|
|
65
65
|
#
|
|
66
|
+
# @param build [String, nil] one build of the dataset, by the name a
|
|
67
|
+
# `database.updated` webhook gives it, so the file is the one whose
|
|
68
|
+
# `sha256` the webhook carries; nil, the build that is live. A build is
|
|
69
|
+
# kept 7 days, and one pruned since is a `bad_request` with status 410.
|
|
66
70
|
# @param timeout [Numeric, nil] seconds this attempt may take, for THIS call
|
|
67
71
|
# only. It bounds the request that MINTS the link, which is an ordinary
|
|
68
72
|
# JSON call, and says nothing about the transfer you then run with it.
|
|
69
|
-
def download_url(id, format, timeout: nil)
|
|
73
|
+
def download_url(id, format, build: nil, timeout: nil)
|
|
70
74
|
check_format!(format)
|
|
71
|
-
call { redirect_location(id, format, timeout) }
|
|
75
|
+
call { redirect_location(id, format, build, timeout) }
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
# Download one dataset file to `path`, and return the bytes written.
|
|
@@ -77,11 +81,11 @@ module VPNDetection
|
|
|
77
81
|
# so a transfer that dies half way leaves no truncated file that reads as a
|
|
78
82
|
# whole dataset, and a refresh that fails does not destroy the copy already
|
|
79
83
|
# there. Nothing beyond one chunk is ever held in memory, whatever the
|
|
80
|
-
# dataset weighs.
|
|
81
|
-
def download(id, format, path)
|
|
84
|
+
# dataset weighs. `build` asks for one build, as in {#download_url}.
|
|
85
|
+
def download(id, format, path, build: nil)
|
|
82
86
|
partial = "#{path}.part"
|
|
83
87
|
begin
|
|
84
|
-
url = download_url(id, format)
|
|
88
|
+
url = download_url(id, format, build: build)
|
|
85
89
|
written = File.open(partial, 'wb') { |file| transfer(url) { |chunk| file.write(chunk) } }
|
|
86
90
|
File.rename(partial, path)
|
|
87
91
|
rescue StandardError
|
|
@@ -96,9 +100,10 @@ module VPNDetection
|
|
|
96
100
|
# **This holds the entire file in memory**, and the catalog spans five orders
|
|
97
101
|
# of magnitude: `cdn_ip_v1` is 10 KB while `resproxy_ip_90d_v1` is 1.79 GB.
|
|
98
102
|
# Reach for it at the small end, where the bytes go straight into a parser,
|
|
99
|
-
# and use {#download} for anything you have not measured.
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
# and use {#download} for anything you have not measured. `build` asks for
|
|
104
|
+
# one build, as in {#download_url}.
|
|
105
|
+
def download_bytes(id, format, build: nil)
|
|
106
|
+
url = download_url(id, format, build: build)
|
|
102
107
|
bytes = String.new(encoding: Encoding::BINARY)
|
|
103
108
|
transfer(url) { |chunk| bytes << chunk }
|
|
104
109
|
bytes
|
|
@@ -180,8 +185,8 @@ module VPNDetection
|
|
|
180
185
|
# The 302 is this operation's SUCCESS case, but the generated client treats
|
|
181
186
|
# every non-2xx as a failure, so it arrives as an ApiError carrying the
|
|
182
187
|
# Location header.
|
|
183
|
-
def redirect_location(id, format, timeout)
|
|
184
|
-
_, status, = @api.download_database_with_http_info(id, format, timeout: timeout)
|
|
188
|
+
def redirect_location(id, format, build, timeout)
|
|
189
|
+
_, status, = @api.download_database_with_http_info(id, format, build: build, timeout: timeout)
|
|
185
190
|
raise Error.new(:server_error, 'expected a redirect to object storage', status: status)
|
|
186
191
|
rescue ApiError => e
|
|
187
192
|
raise unless e.code == 302
|
data/lib/vpndetection/errors.rb
CHANGED
|
@@ -53,7 +53,7 @@ module VPNDetection
|
|
|
53
53
|
when 401 then :unauthorized
|
|
54
54
|
when 403 then :forbidden
|
|
55
55
|
# Every other 4xx is a CLIENT error. Classifying on the RANGE rather than
|
|
56
|
-
# on an enumerated list is what keeps a 404 from a bad dataset
|
|
56
|
+
# on an enumerated list is what keeps a 404 from a bad dataset ID falling
|
|
57
57
|
# through to the retryable server_error default and being retried twice
|
|
58
58
|
# before it fails.
|
|
59
59
|
when 400..499 then :bad_request
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
|
-
# One database FAMILY, with your organization's license beside it. A license covers the family, while a download names a specific version, so the
|
|
17
|
+
# One database FAMILY, with your organization's license beside it. A license covers the family, while a download names a specific version, so the IDs you pass to the download and checksum endpoints come from `versions`.
|
|
18
18
|
class Database < ApiModelBase
|
|
19
19
|
# The database family, e.g. `vpn_ip`. What the license is held against.
|
|
20
20
|
attr_accessor :base
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
17
|
class DatabaseVersion < ApiModelBase
|
|
18
|
-
# The versioned database
|
|
18
|
+
# The versioned database ID, e.g. `vpn_ip_v1`. Pass this to download.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
21
|
attr_accessor :version
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
|
-
# The credential itself. The key is never echoed - only its
|
|
17
|
+
# The credential itself. The key is never echoed - only its ID, which is what the console shows and what you can act on.
|
|
18
18
|
class EntitlementApikey < ApiModelBase
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -14,21 +14,21 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
|
-
# The shared detail shape for the residential, datacenter and mobile proxy families, measured over a rolling 90 day window. Every key is present when the object is populated; the object is `{}` when its flag is false.
|
|
17
|
+
# The shared detail shape for the residential, datacenter and mobile proxy families, measured over a rolling 90 day window. An address that leaves the window keeps its flag and the values of its last day in it, so `last_seen` is what says how recent they are. Every key is present when the object is populated; the object is `{}` when its flag is false.
|
|
18
18
|
class ProxyDetail < ApiModelBase
|
|
19
19
|
# The proxy network, or an empty string where unattributed.
|
|
20
20
|
attr_accessor :provider
|
|
21
21
|
|
|
22
|
-
# The earliest date within the window this address was seen in the pool.
|
|
22
|
+
# The earliest date within the window this address was seen in the pool, as of its last day in the window once it has left.
|
|
23
23
|
attr_accessor :first_seen
|
|
24
24
|
|
|
25
|
-
# The most recent date
|
|
25
|
+
# The most recent date this address was seen in the pool. An address that leaves the window keeps its flag, so this date is what says how recent the sighting is.
|
|
26
26
|
attr_accessor :last_seen
|
|
27
27
|
|
|
28
|
-
# How many times the address was observed in the pool during the window.
|
|
28
|
+
# How many times the address was observed in the pool during the window, as of its last day in it once it has left.
|
|
29
29
|
attr_accessor :hits
|
|
30
30
|
|
|
31
|
-
# The
|
|
31
|
+
# The percentage of days in the window on which the address was seen, as of its last day in it once it has left. A high value means a stable pool member rather than a one-off sighting.
|
|
32
32
|
attr_accessor :hits_days_pct
|
|
33
33
|
|
|
34
34
|
# How many distinct proxy networks this address was seen in.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
|
-
# The address in Public Proxy IP, open proxies anyone can connect through, measured over a rolling 90 day window. An address is either end of a proxy, or both: where it listens, and where its traffic leaves from. Every key is present when the object is populated; the object is `{}` when `is_pubproxy` is false.
|
|
17
|
+
# The address in Public Proxy IP, open proxies anyone can connect through, measured over a rolling 90 day window. An address that leaves the window keeps its flag and the values of its last day in it, so `last_seen` is what says how recent they are. An address is either end of a proxy, or both: where it listens, and where its traffic leaves from. Every key is present when the object is populated; the object is `{}` when `is_pubproxy` is false.
|
|
18
18
|
class PubproxyDetail < ApiModelBase
|
|
19
19
|
# Whether a public proxy listens on this address.
|
|
20
20
|
attr_accessor :entry
|
|
@@ -31,10 +31,10 @@ module VPNDetection
|
|
|
31
31
|
# How many distinct public proxies' traffic left from this address; 0 when it is only an entry.
|
|
32
32
|
attr_accessor :num_proxies
|
|
33
33
|
|
|
34
|
-
# The most recent date
|
|
34
|
+
# The most recent date a proxy on this address was seen. An address that leaves the window keeps its flag, so this date is what says how recent the sighting is.
|
|
35
35
|
attr_accessor :last_seen
|
|
36
36
|
|
|
37
|
-
# The most recent date within the window a request through a proxy on this address was answered, as YYYY-MM-DD, or an empty string when none was.
|
|
37
|
+
# The most recent date within the window a request through a proxy on this address was answered, as YYYY-MM-DD, or an empty string when none was, as of its last day in the window once it has left.
|
|
38
38
|
attr_accessor :last_usable
|
|
39
39
|
|
|
40
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.05
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/retries.rb
CHANGED
|
@@ -5,7 +5,7 @@ module VPNDetection
|
|
|
5
5
|
#
|
|
6
6
|
# Only a 5xx, a transport failure and a 429 that carried `Retry-After` are
|
|
7
7
|
# worth another attempt. Every other 4xx is a client error and fails on the
|
|
8
|
-
# first try, so a bad dataset
|
|
8
|
+
# first try, so a bad dataset ID is not asked for three times.
|
|
9
9
|
module Retries
|
|
10
10
|
BACKOFF_SECONDS = 0.25
|
|
11
11
|
|
data/lib/vpndetection/version.rb
CHANGED