vpndetection 5.11.2 → 5.11.4
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 +3 -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 +5 -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 +27 -9
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/database_api.rb +1 -1
- data/lib/vpndetection/errors.rb +1 -1
- data/lib/vpndetection/middleware/core.rb +1 -0
- 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 +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 +1 -1
- data/lib/vpndetection/retries.rb +10 -1
- data/lib/vpndetection/transport.rb +3 -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: a47a7c7b2838b48e5c03f88bcf23f32aa5ded757e0a0456a690f7062d76f5246
|
|
4
|
+
data.tar.gz: 18d367fb37429592a2554219878de911142712c3a499b4b271c7830638eeed9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c20ec207aef30b6204342f3fced3fc7d1a8c9cdafb79b071194a13c1fb6ce91ac3b43806ec258a1eb9028e7235ce8bfeeca3119ca498bbb07acc007bd27f642b
|
|
7
|
+
data.tar.gz: 9b15d2d5c30082b861b2e50c070d07a0b343662af736115b1fdfbcffd5359f67fa809c61e3956a7f5a80bef76a8b4cb7373e311806a88bb413a1a36f72418518
|
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.
|
|
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
|
|
@@ -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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -156,8 +156,8 @@ 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
162
|
# @return [nil]
|
|
163
163
|
def download_database(id, format, opts = {})
|
|
@@ -167,8 +167,8 @@ module VPNDetection
|
|
|
167
167
|
|
|
168
168
|
# Download
|
|
169
169
|
# 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
|
|
170
|
+
# @param id [String] Dataset ID, e.g. vpn_ip_extended_v1
|
|
171
|
+
# @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
172
|
# @param [Hash] opts the optional parameters
|
|
173
173
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
174
174
|
def download_database_with_http_info(id, format, 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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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,10 +28,10 @@ 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.
|
|
32
|
-
# @param retries [Integer] extra attempts for a transient failure. Each
|
|
33
|
-
# the server's `Retry-After` when it sent one of at most about 24.8
|
|
34
|
-
# and otherwise a backoff of 250 ms that doubles per retry.
|
|
31
|
+
# @param concurrency [Integer] batch requests - chunks of up to 1000 addresses - in flight during a batch, from 1.
|
|
32
|
+
# @param retries [Integer] extra attempts for a transient failure, from 0. Each
|
|
33
|
+
# waits the server's `Retry-After` when it sent one of at most about 24.8
|
|
34
|
+
# days, and otherwise a backoff of 250 ms that doubles per retry.
|
|
35
35
|
# @param timeout [Numeric] seconds one request may take before it is
|
|
36
36
|
# abandoned, 0 for no bound. Applies per ATTEMPT, so a retried call may take
|
|
37
37
|
# longer in total, and every call that takes `retries:` also takes
|
|
@@ -40,12 +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
|
|
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.
|
|
44
46
|
# @param transport [Transport, nil] override the HTTP layer, mostly for tests.
|
|
45
47
|
def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, cache: true,
|
|
46
48
|
cache_max_size: DEFAULT_CACHE_MAX_SIZE, cache_ttl: DEFAULT_CACHE_TTL,
|
|
47
49
|
concurrency: DEFAULT_CONCURRENCY, retries: DEFAULT_RETRIES,
|
|
48
50
|
timeout: DEFAULT_TIMEOUT, transport: nil)
|
|
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
|
|
49
56
|
@transport = transport || Transport.new(
|
|
50
57
|
Transport::Config.new(api_key: api_key, base_url: base_url, timeout: timeout),
|
|
51
58
|
)
|
|
@@ -80,6 +87,7 @@ module VPNDetection
|
|
|
80
87
|
def lookup(ip, retries: nil, timeout: nil)
|
|
81
88
|
# Here as well as in the transport: a bogon or a cached answer returns before any request.
|
|
82
89
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
90
|
+
Retries.checked_count(retries) unless retries.nil?
|
|
83
91
|
# Judged, cached and sent as the IPv4 address it carries, if it is mapped.
|
|
84
92
|
ip = Bogon.unmapped(ip)
|
|
85
93
|
return Bogon.result(ip) if Bogon.bogon?(ip)
|
|
@@ -117,6 +125,7 @@ module VPNDetection
|
|
|
117
125
|
# this is IS the question: a machine that moves between networks would
|
|
118
126
|
# otherwise be told where it used to be.
|
|
119
127
|
def my_ip(retries: nil, timeout: nil)
|
|
128
|
+
Retries.checked_count(retries) unless retries.nil?
|
|
120
129
|
Retries.with_retries(retries || @retries) do
|
|
121
130
|
Transport.lookup_result(@transport.myip_request(timeout: timeout).run)
|
|
122
131
|
end
|
|
@@ -142,6 +151,7 @@ module VPNDetection
|
|
|
142
151
|
#
|
|
143
152
|
# @return [Entitlement]
|
|
144
153
|
def my_entitlement(retries: nil, timeout: nil)
|
|
154
|
+
Retries.checked_count(retries) unless retries.nil?
|
|
145
155
|
Retries.with_retries(retries || @retries) do
|
|
146
156
|
Transport.entitlement_result(@transport.entitlement_request(timeout: timeout).run)
|
|
147
157
|
end
|
|
@@ -158,17 +168,19 @@ module VPNDetection
|
|
|
158
168
|
# per-entry failure with the status the single lookup would have answered,
|
|
159
169
|
# and a chunk that fails as a whole marks every address in it.
|
|
160
170
|
#
|
|
161
|
-
# @param concurrency [Integer, nil] chunks in flight, for THIS batch only.
|
|
162
|
-
# 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.
|
|
163
174
|
# @param retries [Integer, nil] extra attempts for a failed chunk, for THIS batch only.
|
|
164
175
|
# @param timeout [Numeric, nil] seconds each chunk's attempt may take, for THIS batch only.
|
|
165
176
|
# @return [Hash{String => Result, Error}] in the order the addresses were given
|
|
166
177
|
def lookup_batch(ips, concurrency: nil, retries: nil, timeout: nil)
|
|
167
178
|
limit = concurrency || @concurrency
|
|
168
|
-
unless
|
|
169
|
-
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}")
|
|
170
181
|
end
|
|
171
182
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
183
|
+
Retries.checked_count(retries) unless retries.nil?
|
|
172
184
|
|
|
173
185
|
# An IPv4-mapped address is sent as the address it carries, once however
|
|
174
186
|
# many of its spellings were asked, and answered under each one asked.
|
|
@@ -210,6 +222,12 @@ module VPNDetection
|
|
|
210
222
|
|
|
211
223
|
private
|
|
212
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
|
+
|
|
213
231
|
# Concurrent misses for one address share ONE request: 5.4.2 sent one per
|
|
214
232
|
# calling thread. The first miss boards the
|
|
215
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.02
|
|
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.
|
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
|
|
@@ -40,6 +40,7 @@ module VPNDetection
|
|
|
40
40
|
@skip = options[:skip]
|
|
41
41
|
@on_warn = options[:on_warn]
|
|
42
42
|
@retries = options.fetch(:retries, DEFAULT_RETRIES)
|
|
43
|
+
Retries.checked_count(@retries) unless @retries.nil?
|
|
43
44
|
@warned = {}
|
|
44
45
|
@client = options[:client] || Client.new(
|
|
45
46
|
api_key: options[:api_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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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.02
|
|
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
|
|
|
@@ -15,6 +15,15 @@ module VPNDetection
|
|
|
15
15
|
|
|
16
16
|
module_function
|
|
17
17
|
|
|
18
|
+
# `retries`, once it is a count. Refused where it is set: unchecked, -1 and
|
|
19
|
+
# NaN read as none, 1.5 as two, Infinity retried a failing call for good, and
|
|
20
|
+
# a String or nil raised a raw ArgumentError out of every failing call.
|
|
21
|
+
def checked_count(retries)
|
|
22
|
+
return retries if retries.is_a?(Integer) && retries >= 0
|
|
23
|
+
|
|
24
|
+
raise ArgumentError, "retries must be an Integer from 0, not #{retries.inspect}"
|
|
25
|
+
end
|
|
26
|
+
|
|
18
27
|
# `retry_if`, when given, is asked after each retryable failure, and a false
|
|
19
28
|
# answer ends the attempts there.
|
|
20
29
|
def with_retries(retries, retry_if: nil)
|
|
@@ -367,7 +367,9 @@ module VPNDetection
|
|
|
367
367
|
when 'Integer' then value.is_a?(Integer)
|
|
368
368
|
when 'Float' then value.is_a?(Numeric)
|
|
369
369
|
when 'Boolean' then [true, false].include?(value)
|
|
370
|
-
|
|
370
|
+
# The spec's `type: object`, a sample row: through 5.11.2 a row of 1, "x"
|
|
371
|
+
# or [] came back as the answer.
|
|
372
|
+
when 'Object' then value.is_a?(Hash)
|
|
371
373
|
when /\AArray<(?<inner>.+)>\z/
|
|
372
374
|
inner = Regexp.last_match(:inner)
|
|
373
375
|
value.is_a?(Array) && value.each_with_index.all? { |v, i| check_type!(v, inner, "#{where}[#{i}]") }
|
data/lib/vpndetection/version.rb
CHANGED