vpndetection 5.4.2 → 5.5.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 +2 -2
- data/lib/vpndetection/api/account_wire_api.rb +1 -1
- data/lib/vpndetection/api/api_keys_wire_api.rb +1 -1
- data/lib/vpndetection/api/authorization_wire_api.rb +24 -16
- data/lib/vpndetection/api/database_wire_api.rb +1 -1
- data/lib/vpndetection/api/entitlement_wire_api.rb +1 -1
- data/lib/vpndetection/api/lookup_wire_api.rb +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/bogons.rb +3 -3
- data/lib/vpndetection/client.rb +130 -10
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/models/account_create_apikey_request.rb +1 -1
- data/lib/vpndetection/models/account_created_apikey.rb +1 -1
- data/lib/vpndetection/models/account_org.rb +1 -1
- data/lib/vpndetection/models/account_org_ref.rb +1 -1
- data/lib/vpndetection/models/account_org_wrap.rb +1 -1
- data/lib/vpndetection/models/account_rc.rb +1 -1
- data/lib/vpndetection/models/account_revealed_apikey.rb +1 -1
- data/lib/vpndetection/models/account_user.rb +1 -1
- data/lib/vpndetection/models/apikey_detail.rb +1 -1
- data/lib/vpndetection/models/apikey_list.rb +1 -1
- data/lib/vpndetection/models/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/database.rb +1 -1
- data/lib/vpndetection/models/database_checksums_response.rb +1 -1
- data/lib/vpndetection/models/database_format.rb +1 -1
- data/lib/vpndetection/models/database_format_size.rb +1 -1
- data/lib/vpndetection/models/database_list.rb +1 -1
- data/lib/vpndetection/models/database_metadata.rb +1 -1
- data/lib/vpndetection/models/database_metadata_column.rb +1 -1
- data/lib/vpndetection/models/database_version.rb +1 -1
- data/lib/vpndetection/models/db_checksums.rb +1 -1
- data/lib/vpndetection/models/device_authorization.rb +1 -1
- data/lib/vpndetection/models/download.rb +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 +1 -1
- data/lib/vpndetection/models/entitlement_error.rb +1 -1
- data/lib/vpndetection/models/entitlement_plan.rb +1 -1
- data/lib/vpndetection/models/entitlement_usage.rb +1 -1
- data/lib/vpndetection/models/error_envelope.rb +1 -1
- data/lib/vpndetection/models/identity.rb +1 -1
- data/lib/vpndetection/models/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 +12 -2
- data/lib/vpndetection/models/proxy_detail.rb +1 -1
- data/lib/vpndetection/models/standing.rb +1 -1
- data/lib/vpndetection/models/token_response.rb +3 -3
- data/lib/vpndetection/models/vpn_detail.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: 421b5ad5b26181627790d77ee1399551115e37480c46574220a35513721d631b
|
|
4
|
+
data.tar.gz: 585d8a6143276bb0f1920794963d47fc3a35e077bdead41ba0e3d87e8e9da08d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d499d7612a20b70a85712a7d364178dac45652f6fde6b2df324d3750ca3565d7910aad88d7727b9be8827eead9e61c95fde2e3221474d306ac26bdcae2241b3
|
|
7
|
+
data.tar.gz: f3df262d110d0d314890db27d20b6f1ae681d0a40eb019ab630fb21b7694e416a99ecd97bd9b6347610dbc0e6f3b397e4d302843af811bfdda0af9731be03238
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [<img src="https://s3.vpndetection.io/vpndetection-public/brand/mark.svg" alt="VPNDetection"
|
|
1
|
+
# [<img src="https://s3.vpndetection.io/vpndetection-public/brand/mark.svg" alt="VPNDetection" height="28"/>](https://vpndetection.io/) VPNDetection Ruby Client Library
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/vpndetection)
|
|
4
4
|
[](LICENSE)
|
|
@@ -220,7 +220,7 @@ There are official VPNDetection client libraries available for many languages in
|
|
|
220
220
|
|
|
221
221
|
VPN Detection API: Accurate anonymity detection identifying VPNs, residential proxies, hosting servers, Tor nodes, CDNs, relays and more.
|
|
222
222
|
|
|
223
|
-
[<img src="https://s3.vpndetection.io/vpndetection-public/brand/mark.svg" alt="VPNDetection"
|
|
223
|
+
[<img src="https://s3.vpndetection.io/vpndetection-public/brand/mark.svg" alt="VPNDetection" height="64"/>](https://vpndetection.io/)
|
|
224
224
|
|
|
225
225
|
## License
|
|
226
226
|
|
|
@@ -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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -22,35 +22,35 @@ module VPNDetection
|
|
|
22
22
|
@api_client = api_client
|
|
23
23
|
end
|
|
24
24
|
# Authorize
|
|
25
|
-
# The browser entry point for the authorization-code flow. This is a redirect target, not something to call from code. An unknown `client_id` or an unregistered `redirect_uri` is shown to the USER and never redirected, because sending an error to an address we have not verified belongs to you is how an open redirector works. Everything else comes back to your `redirect_uri` with `error`, your `state`, and `iss`.
|
|
25
|
+
# The browser entry point for the authorization-code flow. This is a redirect target, not something to call from code. Any client may sign in without registering first by using a Client ID Metadata Document: make `client_id` an https URL that serves your client's metadata as JSON, naming that same URL as its `client_id`, with `token_endpoint_auth_method` `none` and your `redirect_uris`. An https redirect URI must be on the same origin as the `client_id`; a loopback one (`http://127.0.0.1`, `http://[::1]`, `http://localhost`) matches on any port. Such a client is granted `apikeys.use` at most. An unknown `client_id` or an unregistered `redirect_uri` is shown to the USER and never redirected, because sending an error to an address we have not verified belongs to you is how an open redirector works. Everything else comes back to your `redirect_uri` with `error`, your `state`, and `iss`.
|
|
26
26
|
# @param client_id [String]
|
|
27
27
|
# @param redirect_uri [String]
|
|
28
28
|
# @param response_type [String]
|
|
29
29
|
# @param code_challenge [String]
|
|
30
|
+
# @param code_challenge_method [String] S256, named explicitly. `plain`, or no method at all, is refused rather than downgraded.
|
|
30
31
|
# @param [Hash] opts the optional parameters
|
|
31
|
-
# @option opts [String] :code_challenge_method S256 only. `plain` is refused rather than downgraded.
|
|
32
32
|
# @option opts [String] :scope
|
|
33
33
|
# @option opts [String] :state Returned unchanged. Use it to bind the response to your request.
|
|
34
|
-
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere.
|
|
34
|
+
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere: this brand's MCP server, the only resource it issues tokens for. Anything else answers `invalid_target`. A client that names none is given that server.
|
|
35
35
|
# @return [nil]
|
|
36
|
-
def oauth_authorize(client_id, redirect_uri, response_type, code_challenge, opts = {})
|
|
37
|
-
oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, opts)
|
|
36
|
+
def oauth_authorize(client_id, redirect_uri, response_type, code_challenge, code_challenge_method, opts = {})
|
|
37
|
+
oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, code_challenge_method, opts)
|
|
38
38
|
nil
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# Authorize
|
|
42
|
-
# The browser entry point for the authorization-code flow. This is a redirect target, not something to call from code. An unknown `client_id` or an unregistered `redirect_uri` is shown to the USER and never redirected, because sending an error to an address we have not verified belongs to you is how an open redirector works. Everything else comes back to your `redirect_uri` with `error`, your `state`, and `iss`.
|
|
42
|
+
# The browser entry point for the authorization-code flow. This is a redirect target, not something to call from code. Any client may sign in without registering first by using a Client ID Metadata Document: make `client_id` an https URL that serves your client's metadata as JSON, naming that same URL as its `client_id`, with `token_endpoint_auth_method` `none` and your `redirect_uris`. An https redirect URI must be on the same origin as the `client_id`; a loopback one (`http://127.0.0.1`, `http://[::1]`, `http://localhost`) matches on any port. Such a client is granted `apikeys.use` at most. An unknown `client_id` or an unregistered `redirect_uri` is shown to the USER and never redirected, because sending an error to an address we have not verified belongs to you is how an open redirector works. Everything else comes back to your `redirect_uri` with `error`, your `state`, and `iss`.
|
|
43
43
|
# @param client_id [String]
|
|
44
44
|
# @param redirect_uri [String]
|
|
45
45
|
# @param response_type [String]
|
|
46
46
|
# @param code_challenge [String]
|
|
47
|
+
# @param code_challenge_method [String] S256, named explicitly. `plain`, or no method at all, is refused rather than downgraded.
|
|
47
48
|
# @param [Hash] opts the optional parameters
|
|
48
|
-
# @option opts [String] :code_challenge_method S256 only. `plain` is refused rather than downgraded.
|
|
49
49
|
# @option opts [String] :scope
|
|
50
50
|
# @option opts [String] :state Returned unchanged. Use it to bind the response to your request.
|
|
51
|
-
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere.
|
|
51
|
+
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere: this brand's MCP server, the only resource it issues tokens for. Anything else answers `invalid_target`. A client that names none is given that server.
|
|
52
52
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
53
|
-
def oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, opts = {})
|
|
53
|
+
def oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, code_challenge_method, opts = {})
|
|
54
54
|
if @api_client.config.debugging
|
|
55
55
|
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_authorize ...'
|
|
56
56
|
end
|
|
@@ -75,8 +75,13 @@ module VPNDetection
|
|
|
75
75
|
if @api_client.config.client_side_validation && code_challenge.nil?
|
|
76
76
|
fail ArgumentError, "Missing the required parameter 'code_challenge' when calling AuthorizationWireApi.oauth_authorize"
|
|
77
77
|
end
|
|
78
|
+
# verify the required parameter 'code_challenge_method' is set
|
|
79
|
+
if @api_client.config.client_side_validation && code_challenge_method.nil?
|
|
80
|
+
fail ArgumentError, "Missing the required parameter 'code_challenge_method' when calling AuthorizationWireApi.oauth_authorize"
|
|
81
|
+
end
|
|
82
|
+
# verify enum value
|
|
78
83
|
allowable_values = ["S256"]
|
|
79
|
-
if @api_client.config.client_side_validation &&
|
|
84
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(code_challenge_method)
|
|
80
85
|
fail ArgumentError, "invalid value for \"code_challenge_method\", must be one of #{allowable_values}"
|
|
81
86
|
end
|
|
82
87
|
# resource path
|
|
@@ -88,7 +93,7 @@ module VPNDetection
|
|
|
88
93
|
query_params[:'redirect_uri'] = redirect_uri
|
|
89
94
|
query_params[:'response_type'] = response_type
|
|
90
95
|
query_params[:'code_challenge'] = code_challenge
|
|
91
|
-
query_params[:'code_challenge_method'] =
|
|
96
|
+
query_params[:'code_challenge_method'] = code_challenge_method
|
|
92
97
|
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
93
98
|
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
94
99
|
query_params[:'resource'] = opts[:'resource'] if !opts[:'resource'].nil?
|
|
@@ -330,14 +335,15 @@ module VPNDetection
|
|
|
330
335
|
end
|
|
331
336
|
|
|
332
337
|
# Token
|
|
333
|
-
# Three grant types. `urn:ietf:params:oauth:grant-type:device_code` polls a device authorization. Until the person approves it answers `authorization_pending`; poll faster than `interval` and it answers `slow_down`, which means widen your interval and keep it widened. `authorization_code` exchanges a code from `/oauth/authorize`, with the `code_verifier` matching the challenge you sent. `refresh_token` exchanges a refresh token. The presented token is consumed whatever happens next, so store the new one before using it.
|
|
338
|
+
# Three grant types. `urn:ietf:params:oauth:grant-type:device_code` polls a device authorization. Until the person approves it answers `authorization_pending`; poll faster than `interval` and it answers `slow_down`, which means widen your interval and keep it widened. `authorization_code` exchanges a code from `/oauth/authorize`, with the `code_verifier` matching the challenge you sent and the same `redirect_uri`. A code works once: presenting it again also revokes what the first exchange issued. `refresh_token` exchanges a refresh token. The presented token is consumed whatever happens next, so store the new one before using it. Presenting a consumed refresh token again ends the whole authorization, since it means the token was copied.
|
|
334
339
|
# @param grant_type [String] `urn:ietf:params:oauth:grant-type:device_code`, `authorization_code` or `refresh_token`.
|
|
335
340
|
# @param client_id [String]
|
|
336
341
|
# @param [Hash] opts the optional parameters
|
|
337
342
|
# @option opts [String] :device_code Required by the device code grant.
|
|
338
343
|
# @option opts [String] :code Required by the authorization code grant.
|
|
339
344
|
# @option opts [String] :code_verifier Required by the authorization code grant.
|
|
340
|
-
# @option opts [String] :redirect_uri
|
|
345
|
+
# @option opts [String] :redirect_uri Required by the authorization code grant: the `redirect_uri` the code was issued against, exactly.
|
|
346
|
+
# @option opts [String] :resource Authorization code grant, optional: RFC 8707, and it must name what was authorized.
|
|
341
347
|
# @option opts [String] :refresh_token Required by the refresh token grant.
|
|
342
348
|
# @return [TokenResponse]
|
|
343
349
|
def oauth_token(grant_type, client_id, opts = {})
|
|
@@ -346,14 +352,15 @@ module VPNDetection
|
|
|
346
352
|
end
|
|
347
353
|
|
|
348
354
|
# Token
|
|
349
|
-
# Three grant types. `urn:ietf:params:oauth:grant-type:device_code` polls a device authorization. Until the person approves it answers `authorization_pending`; poll faster than `interval` and it answers `slow_down`, which means widen your interval and keep it widened. `authorization_code` exchanges a code from `/oauth/authorize`, with the `code_verifier` matching the challenge you sent. `refresh_token` exchanges a refresh token. The presented token is consumed whatever happens next, so store the new one before using it.
|
|
355
|
+
# Three grant types. `urn:ietf:params:oauth:grant-type:device_code` polls a device authorization. Until the person approves it answers `authorization_pending`; poll faster than `interval` and it answers `slow_down`, which means widen your interval and keep it widened. `authorization_code` exchanges a code from `/oauth/authorize`, with the `code_verifier` matching the challenge you sent and the same `redirect_uri`. A code works once: presenting it again also revokes what the first exchange issued. `refresh_token` exchanges a refresh token. The presented token is consumed whatever happens next, so store the new one before using it. Presenting a consumed refresh token again ends the whole authorization, since it means the token was copied.
|
|
350
356
|
# @param grant_type [String] `urn:ietf:params:oauth:grant-type:device_code`, `authorization_code` or `refresh_token`.
|
|
351
357
|
# @param client_id [String]
|
|
352
358
|
# @param [Hash] opts the optional parameters
|
|
353
359
|
# @option opts [String] :device_code Required by the device code grant.
|
|
354
360
|
# @option opts [String] :code Required by the authorization code grant.
|
|
355
361
|
# @option opts [String] :code_verifier Required by the authorization code grant.
|
|
356
|
-
# @option opts [String] :redirect_uri
|
|
362
|
+
# @option opts [String] :redirect_uri Required by the authorization code grant: the `redirect_uri` the code was issued against, exactly.
|
|
363
|
+
# @option opts [String] :resource Authorization code grant, optional: RFC 8707, and it must name what was authorized.
|
|
357
364
|
# @option opts [String] :refresh_token Required by the refresh token grant.
|
|
358
365
|
# @return [Array<(TokenResponse, Integer, Hash)>] TokenResponse data, response status code and response headers
|
|
359
366
|
def oauth_token_with_http_info(grant_type, client_id, opts = {})
|
|
@@ -392,6 +399,7 @@ module VPNDetection
|
|
|
392
399
|
form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
|
|
393
400
|
form_params['code_verifier'] = opts[:'code_verifier'] if !opts[:'code_verifier'].nil?
|
|
394
401
|
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
|
402
|
+
form_params['resource'] = opts[:'resource'] if !opts[:'resource'].nil?
|
|
395
403
|
form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?
|
|
396
404
|
|
|
397
405
|
# http body (model)
|
|
@@ -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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/bogons.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Generated
|
|
2
|
-
# The
|
|
3
|
-
#
|
|
1
|
+
# Generated. Do not edit: a regeneration overwrites it.
|
|
2
|
+
# The list is checked against both upstream definitions on every
|
|
3
|
+
# regeneration.
|
|
4
4
|
|
|
5
5
|
module VPNDetection
|
|
6
6
|
module Bogons
|
data/lib/vpndetection/client.rb
CHANGED
|
@@ -49,6 +49,9 @@ module VPNDetection
|
|
|
49
49
|
Transport::Config.new(api_key: api_key, base_url: base_url, timeout: timeout),
|
|
50
50
|
)
|
|
51
51
|
@cache = cache ? Cache.new(max_size: cache_max_size, ttl: cache_ttl) : nil
|
|
52
|
+
# The addresses with a request in flight, each a Flight its waiters block on.
|
|
53
|
+
@flights = {}
|
|
54
|
+
@flights_lock = Mutex.new
|
|
52
55
|
@concurrency = concurrency
|
|
53
56
|
@retries = retries
|
|
54
57
|
@database = DatabaseApi.new(@transport, retries: retries)
|
|
@@ -78,14 +81,26 @@ module VPNDetection
|
|
|
78
81
|
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
79
82
|
return Bogon.result(ip) if Bogon.bogon?(ip)
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
loop do
|
|
85
|
+
hit = @cache&.get(ip)
|
|
86
|
+
return hit unless hit.nil?
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
flight, leader = board(ip)
|
|
89
|
+
return fetch(ip, retries, timeout) if flight.nil?
|
|
90
|
+
|
|
91
|
+
if leader
|
|
92
|
+
# Read once more now the address is boarded: a leader that landed
|
|
93
|
+
# between the miss above and boarding has already cached its answer.
|
|
94
|
+
hit = @cache.get(ip)
|
|
95
|
+
return unboard(ip, flight, :served, hit) unless hit.nil?
|
|
96
|
+
|
|
97
|
+
return lead(ip, flight) { fetch(ip, retries, timeout) }
|
|
98
|
+
end
|
|
99
|
+
state, value = flight.wait
|
|
100
|
+
return value if state == :served
|
|
101
|
+
raise value if state == :failed
|
|
102
|
+
# :abandoned - its leader never finished, so this caller asks again.
|
|
86
103
|
end
|
|
87
|
-
@cache&.set(ip, result)
|
|
88
|
-
result
|
|
89
104
|
end
|
|
90
105
|
|
|
91
106
|
# Classify the address this client is calling from.
|
|
@@ -160,9 +175,27 @@ module VPNDetection
|
|
|
160
175
|
hit = Bogon.bogon?(ip) ? Bogon.result(ip) : @cache&.get(ip)
|
|
161
176
|
hit.nil? ? pending << ip : answers[ip] = hit
|
|
162
177
|
end
|
|
163
|
-
|
|
164
|
-
|
|
178
|
+
# Boarded before any chunk is built, so a lookup arriving meanwhile waits
|
|
179
|
+
# for this batch; an address already in flight is not sent again.
|
|
180
|
+
boarded = {}
|
|
181
|
+
joined = {}
|
|
182
|
+
pending.each do |ip|
|
|
183
|
+
flight, leader = board(ip)
|
|
184
|
+
if leader == false
|
|
185
|
+
joined[ip] = flight
|
|
186
|
+
else
|
|
187
|
+
boarded[ip] = flight
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
begin
|
|
191
|
+
unless boarded.empty?
|
|
192
|
+
chunks = boarded.keys.each_slice(BATCH_MAX).to_a
|
|
193
|
+
run_batch(chunks, answers, limit, retries || @retries, timeout, boarded)
|
|
194
|
+
end
|
|
195
|
+
ensure
|
|
196
|
+
boarded.each { |ip, flight| unboard(ip, flight, :abandoned) unless flight.nil? }
|
|
165
197
|
end
|
|
198
|
+
joined.each { |ip, flight| answers[ip] = joined_answer(ip, flight, retries, timeout) }
|
|
166
199
|
|
|
167
200
|
# Reinstated in input order: a hydra settles in completion order, and a
|
|
168
201
|
# caller iterating the hash should see what they passed in.
|
|
@@ -171,11 +204,83 @@ module VPNDetection
|
|
|
171
204
|
|
|
172
205
|
private
|
|
173
206
|
|
|
207
|
+
# Concurrent misses for one address share ONE request: 5.4.2 sent one per
|
|
208
|
+
# calling thread. The first miss boards the
|
|
209
|
+
# address and every miss after it, a batch's included, waits on its Flight.
|
|
210
|
+
class Flight
|
|
211
|
+
def initialize
|
|
212
|
+
@lock = Mutex.new
|
|
213
|
+
@landed = ConditionVariable.new
|
|
214
|
+
@state = :pending
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Settles the flight once, for every waiter: :served with a Result,
|
|
218
|
+
# :failed with an Error, or :abandoned when its leader never finished.
|
|
219
|
+
def land(state, value = nil)
|
|
220
|
+
@lock.synchronize do
|
|
221
|
+
next unless @state == :pending
|
|
222
|
+
|
|
223
|
+
@state = state
|
|
224
|
+
@value = value
|
|
225
|
+
@landed.broadcast
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Blocks until the flight lands, then [state, value].
|
|
230
|
+
def wait
|
|
231
|
+
@lock.synchronize do
|
|
232
|
+
@landed.wait(@lock) while @state == :pending
|
|
233
|
+
[@state, @value]
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# [flight, true] when this caller leads the request for `ip`, [flight,
|
|
239
|
+
# false] when one is already in flight, and nil without a cache: every
|
|
240
|
+
# lookup is then served, so nothing is shared.
|
|
241
|
+
def board(ip)
|
|
242
|
+
return nil if @cache.nil?
|
|
243
|
+
|
|
244
|
+
@flights_lock.synchronize do
|
|
245
|
+
existing = @flights[ip]
|
|
246
|
+
existing ? [existing, false] : [@flights[ip] = Flight.new, true]
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Takes `ip` off the board and lands its flight. Returns `value`.
|
|
251
|
+
def unboard(ip, flight, state, value = nil)
|
|
252
|
+
@flights_lock.synchronize { @flights.delete(ip) if @flights[ip].equal?(flight) }
|
|
253
|
+
flight.land(state, value)
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Runs the request a flight is waiting on, under the options of the call
|
|
258
|
+
# that leads it. A served answer is cached before it lands; a failure
|
|
259
|
+
# reaches every waiter and is cached for none; and a leader that never
|
|
260
|
+
# finishes - a killed thread, a Timeout.timeout - abandons the flight, so
|
|
261
|
+
# its waiters ask again rather than failing with it.
|
|
262
|
+
def lead(ip, flight)
|
|
263
|
+
unboard(ip, flight, :served, yield)
|
|
264
|
+
rescue Error => e
|
|
265
|
+
unboard(ip, flight, :failed, e)
|
|
266
|
+
raise
|
|
267
|
+
ensure
|
|
268
|
+
unboard(ip, flight, :abandoned)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
def fetch(ip, retries, timeout)
|
|
272
|
+
result = Retries.with_retries(retries || @retries) do
|
|
273
|
+
Transport.lookup_result(@transport.lookup_request(ip, timeout: timeout).run)
|
|
274
|
+
end
|
|
275
|
+
@cache&.set(ip, result)
|
|
276
|
+
result
|
|
277
|
+
end
|
|
278
|
+
|
|
174
279
|
# One hydra per call, sized for THIS call. Reusing an instance-level hydra
|
|
175
280
|
# would silently cap a per-call concurrency at the client's setting, and
|
|
176
281
|
# would not be safe to drive from two threads either. Each request is one
|
|
177
282
|
# chunk of up to 1000 addresses.
|
|
178
|
-
def run_batch(chunks, answers, concurrency, retries, timeout)
|
|
283
|
+
def run_batch(chunks, answers, concurrency, retries, timeout, boarded)
|
|
179
284
|
hydra = Typhoeus::Hydra.new(max_concurrency: concurrency)
|
|
180
285
|
attempts = Hash.new(0)
|
|
181
286
|
|
|
@@ -183,7 +288,11 @@ module VPNDetection
|
|
|
183
288
|
request = @transport.batch_request(chunk, timeout: timeout)
|
|
184
289
|
request.on_complete do |response|
|
|
185
290
|
outcome = settle(chunk, response, attempts, retries, enqueue)
|
|
186
|
-
|
|
291
|
+
outcome&.each do |ip, answer|
|
|
292
|
+
answers[ip] = answer
|
|
293
|
+
flight = boarded[ip]
|
|
294
|
+
unboard(ip, flight, answer.is_a?(Result) ? :served : :failed, answer) unless flight.nil?
|
|
295
|
+
end
|
|
187
296
|
end
|
|
188
297
|
hydra.queue(request)
|
|
189
298
|
end
|
|
@@ -214,6 +323,17 @@ module VPNDetection
|
|
|
214
323
|
nil
|
|
215
324
|
end
|
|
216
325
|
|
|
326
|
+
# What a batch takes for an address another call was fetching: that call's
|
|
327
|
+
# answer or error, or, when its leader never finished, its own lookup.
|
|
328
|
+
def joined_answer(ip, flight, retries, timeout)
|
|
329
|
+
state, value = flight.wait
|
|
330
|
+
return value unless state == :abandoned
|
|
331
|
+
|
|
332
|
+
lookup(ip, retries: retries, timeout: timeout)
|
|
333
|
+
rescue Error => e
|
|
334
|
+
e
|
|
335
|
+
end
|
|
336
|
+
|
|
217
337
|
# Every address lands in exactly one of `results` and `errors`; an address in
|
|
218
338
|
# neither is the server breaking its own contract, and is reported as such
|
|
219
339
|
# rather than lost.
|
|
@@ -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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -33,6 +33,9 @@ module VPNDetection
|
|
|
33
33
|
|
|
34
34
|
attr_accessor :code_challenge_methods_supported
|
|
35
35
|
|
|
36
|
+
# Any client may sign in with an https `client_id` serving its own metadata.
|
|
37
|
+
attr_accessor :client_id_metadata_document_supported
|
|
38
|
+
|
|
36
39
|
# Always `none`. Every client is public and has no secret.
|
|
37
40
|
attr_accessor :token_endpoint_auth_methods_supported
|
|
38
41
|
|
|
@@ -53,6 +56,7 @@ module VPNDetection
|
|
|
53
56
|
:'response_types_supported' => :'response_types_supported',
|
|
54
57
|
:'grant_types_supported' => :'grant_types_supported',
|
|
55
58
|
:'code_challenge_methods_supported' => :'code_challenge_methods_supported',
|
|
59
|
+
:'client_id_metadata_document_supported' => :'client_id_metadata_document_supported',
|
|
56
60
|
:'token_endpoint_auth_methods_supported' => :'token_endpoint_auth_methods_supported',
|
|
57
61
|
:'authorization_response_iss_parameter_supported' => :'authorization_response_iss_parameter_supported',
|
|
58
62
|
:'service_documentation' => :'service_documentation'
|
|
@@ -81,6 +85,7 @@ module VPNDetection
|
|
|
81
85
|
:'response_types_supported' => :'Array<String>',
|
|
82
86
|
:'grant_types_supported' => :'Array<String>',
|
|
83
87
|
:'code_challenge_methods_supported' => :'Array<String>',
|
|
88
|
+
:'client_id_metadata_document_supported' => :'Boolean',
|
|
84
89
|
:'token_endpoint_auth_methods_supported' => :'Array<String>',
|
|
85
90
|
:'authorization_response_iss_parameter_supported' => :'Boolean',
|
|
86
91
|
:'service_documentation' => :'String'
|
|
@@ -159,6 +164,10 @@ module VPNDetection
|
|
|
159
164
|
end
|
|
160
165
|
end
|
|
161
166
|
|
|
167
|
+
if attributes.key?(:'client_id_metadata_document_supported')
|
|
168
|
+
self.client_id_metadata_document_supported = attributes[:'client_id_metadata_document_supported']
|
|
169
|
+
end
|
|
170
|
+
|
|
162
171
|
if attributes.key?(:'token_endpoint_auth_methods_supported')
|
|
163
172
|
if (value = attributes[:'token_endpoint_auth_methods_supported']).is_a?(Array)
|
|
164
173
|
self.token_endpoint_auth_methods_supported = value
|
|
@@ -248,6 +257,7 @@ module VPNDetection
|
|
|
248
257
|
response_types_supported == o.response_types_supported &&
|
|
249
258
|
grant_types_supported == o.grant_types_supported &&
|
|
250
259
|
code_challenge_methods_supported == o.code_challenge_methods_supported &&
|
|
260
|
+
client_id_metadata_document_supported == o.client_id_metadata_document_supported &&
|
|
251
261
|
token_endpoint_auth_methods_supported == o.token_endpoint_auth_methods_supported &&
|
|
252
262
|
authorization_response_iss_parameter_supported == o.authorization_response_iss_parameter_supported &&
|
|
253
263
|
service_documentation == o.service_documentation
|
|
@@ -262,7 +272,7 @@ module VPNDetection
|
|
|
262
272
|
# Calculates hash code according to all attributes.
|
|
263
273
|
# @return [Integer] Hash code
|
|
264
274
|
def hash
|
|
265
|
-
[issuer, authorization_endpoint, token_endpoint, device_authorization_endpoint, revocation_endpoint, scopes_supported, response_types_supported, grant_types_supported, code_challenge_methods_supported, token_endpoint_auth_methods_supported, authorization_response_iss_parameter_supported, service_documentation].hash
|
|
275
|
+
[issuer, authorization_endpoint, token_endpoint, device_authorization_endpoint, revocation_endpoint, scopes_supported, response_types_supported, grant_types_supported, code_challenge_methods_supported, client_id_metadata_document_supported, token_endpoint_auth_methods_supported, authorization_response_iss_parameter_supported, service_documentation].hash
|
|
266
276
|
end
|
|
267
277
|
|
|
268
278
|
# Builds the object from hash
|
|
@@ -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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -29,10 +29,10 @@ module VPNDetection
|
|
|
29
29
|
# What was actually granted, which may be narrower than what was asked for.
|
|
30
30
|
attr_accessor :scope
|
|
31
31
|
|
|
32
|
-
# Not part of OAuth. The ID of the API key the person picked when they approved, returned by every grant while this authorization may still read that key back. Absent when no key was picked, or when the person's role no longer allows reading keys back.
|
|
32
|
+
# Not part of OAuth, and only for our own clients. The ID of the API key the person picked when they approved, returned by every grant while this authorization may still read that key back. Absent when no key was picked, or when the person's role no longer allows reading keys back.
|
|
33
33
|
attr_accessor :apikey_id
|
|
34
34
|
|
|
35
|
-
# Not part of OAuth. The API key itself, so a device ends up holding an ordinary key. Returned by the device code and authorization code grants only, never by a refresh, and only alongside `mslm:apikey_id`. Absent when that key's secret cannot be read back, which is the case for a key created before keys could be shown again in the console; a rotated key can be.
|
|
35
|
+
# Not part of OAuth, and only for our own clients: a client that signed in with a Client ID Metadata Document never receives a key. The API key itself, so a device ends up holding an ordinary key. Returned by the device code and authorization code grants only, never by a refresh, and only alongside `mslm:apikey_id`. Absent when that key's secret cannot be read back, which is the case for a key created before keys could be shown again in the console; a rotated key can be.
|
|
36
36
|
attr_accessor :apikey
|
|
37
37
|
|
|
38
38
|
# 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.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.26
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/version.rb
CHANGED