vpndetection 4.0.1 → 5.1.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 +24 -4
- data/lib/vpndetection/api/account_wire_api.rb +16 -16
- data/lib/vpndetection/api/api_keys_wire_api.rb +336 -0
- data/lib/vpndetection/api/authorization_wire_api.rb +421 -0
- data/lib/vpndetection/api/database_wire_api.rb +1 -1
- data/lib/vpndetection/api/entitlement_wire_api.rb +79 -0
- data/lib/vpndetection/api/lookup_wire_api.rb +71 -3
- data/lib/vpndetection/api/organization_wire_api.rb +136 -0
- 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 +57 -26
- data/lib/vpndetection/configuration.rb +1 -1
- data/lib/vpndetection/errors.rb +7 -0
- data/lib/vpndetection/models/account_create_apikey_request.rb +177 -0
- data/lib/vpndetection/models/account_created_apikey.rb +257 -0
- data/lib/vpndetection/models/account_org.rb +183 -0
- data/lib/vpndetection/models/account_org_ref.rb +164 -0
- data/lib/vpndetection/models/account_org_wrap.rb +190 -0
- data/lib/vpndetection/models/account_rc.rb +165 -0
- data/lib/vpndetection/models/account_revealed_apikey.rb +191 -0
- data/lib/vpndetection/models/account_user.rb +182 -0
- data/lib/vpndetection/models/apikey_detail.rb +307 -0
- data/lib/vpndetection/models/apikey_list.rb +192 -0
- data/lib/vpndetection/models/batch_lookup_error.rb +193 -0
- data/lib/vpndetection/models/batch_lookup_request.rb +185 -0
- data/lib/vpndetection/models/batch_lookup_response.rb +196 -0
- 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 +2 -2
- 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 +281 -0
- data/lib/vpndetection/models/download.rb +2 -2
- data/lib/vpndetection/models/download_list.rb +1 -1
- data/lib/vpndetection/models/{account_me.rb → entitlement.rb} +7 -7
- data/lib/vpndetection/models/{account_apikey.rb → entitlement_apikey.rb} +4 -4
- data/lib/vpndetection/models/{account_error.rb → entitlement_error.rb} +4 -4
- data/lib/vpndetection/models/{account_plan.rb → entitlement_plan.rb} +4 -4
- data/lib/vpndetection/models/{account_usage.rb → entitlement_usage.rb} +4 -4
- data/lib/vpndetection/models/error_envelope.rb +1 -1
- data/lib/vpndetection/models/identity.rb +245 -0
- 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 +173 -0
- data/lib/vpndetection/models/oauth_metadata.rb +288 -0
- data/lib/vpndetection/models/proxy_detail.rb +1 -1
- data/lib/vpndetection/models/standing.rb +1 -1
- data/lib/vpndetection/models/token_response.rb +235 -0
- data/lib/vpndetection/models/vpn_detail.rb +1 -1
- data/lib/vpndetection/transport.rb +28 -5
- data/lib/vpndetection/version.rb +1 -1
- metadata +28 -6
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.15
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module VPNDetection
|
|
16
|
+
class AuthorizationWireApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Authorize
|
|
23
|
+
# 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`.
|
|
24
|
+
# @param client_id [String]
|
|
25
|
+
# @param redirect_uri [String]
|
|
26
|
+
# @param response_type [String]
|
|
27
|
+
# @param code_challenge [String]
|
|
28
|
+
# @param [Hash] opts the optional parameters
|
|
29
|
+
# @option opts [String] :code_challenge_method S256 only. `plain` is refused rather than downgraded.
|
|
30
|
+
# @option opts [String] :scope
|
|
31
|
+
# @option opts [String] :state Returned unchanged. Use it to bind the response to your request.
|
|
32
|
+
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere.
|
|
33
|
+
# @return [nil]
|
|
34
|
+
def oauth_authorize(client_id, redirect_uri, response_type, code_challenge, opts = {})
|
|
35
|
+
oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, opts)
|
|
36
|
+
nil
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Authorize
|
|
40
|
+
# 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`.
|
|
41
|
+
# @param client_id [String]
|
|
42
|
+
# @param redirect_uri [String]
|
|
43
|
+
# @param response_type [String]
|
|
44
|
+
# @param code_challenge [String]
|
|
45
|
+
# @param [Hash] opts the optional parameters
|
|
46
|
+
# @option opts [String] :code_challenge_method S256 only. `plain` is refused rather than downgraded.
|
|
47
|
+
# @option opts [String] :scope
|
|
48
|
+
# @option opts [String] :state Returned unchanged. Use it to bind the response to your request.
|
|
49
|
+
# @option opts [String] :resource RFC 8707. What the token is FOR, so it cannot be replayed elsewhere.
|
|
50
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
51
|
+
def oauth_authorize_with_http_info(client_id, redirect_uri, response_type, code_challenge, opts = {})
|
|
52
|
+
if @api_client.config.debugging
|
|
53
|
+
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_authorize ...'
|
|
54
|
+
end
|
|
55
|
+
# verify the required parameter 'client_id' is set
|
|
56
|
+
if @api_client.config.client_side_validation && client_id.nil?
|
|
57
|
+
fail ArgumentError, "Missing the required parameter 'client_id' when calling AuthorizationWireApi.oauth_authorize"
|
|
58
|
+
end
|
|
59
|
+
# verify the required parameter 'redirect_uri' is set
|
|
60
|
+
if @api_client.config.client_side_validation && redirect_uri.nil?
|
|
61
|
+
fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling AuthorizationWireApi.oauth_authorize"
|
|
62
|
+
end
|
|
63
|
+
# verify the required parameter 'response_type' is set
|
|
64
|
+
if @api_client.config.client_side_validation && response_type.nil?
|
|
65
|
+
fail ArgumentError, "Missing the required parameter 'response_type' when calling AuthorizationWireApi.oauth_authorize"
|
|
66
|
+
end
|
|
67
|
+
# verify enum value
|
|
68
|
+
allowable_values = ["code"]
|
|
69
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(response_type)
|
|
70
|
+
fail ArgumentError, "invalid value for \"response_type\", must be one of #{allowable_values}"
|
|
71
|
+
end
|
|
72
|
+
# verify the required parameter 'code_challenge' is set
|
|
73
|
+
if @api_client.config.client_side_validation && code_challenge.nil?
|
|
74
|
+
fail ArgumentError, "Missing the required parameter 'code_challenge' when calling AuthorizationWireApi.oauth_authorize"
|
|
75
|
+
end
|
|
76
|
+
allowable_values = ["S256"]
|
|
77
|
+
if @api_client.config.client_side_validation && opts[:'code_challenge_method'] && !allowable_values.include?(opts[:'code_challenge_method'])
|
|
78
|
+
fail ArgumentError, "invalid value for \"code_challenge_method\", must be one of #{allowable_values}"
|
|
79
|
+
end
|
|
80
|
+
# resource path
|
|
81
|
+
local_var_path = '/oauth/authorize'
|
|
82
|
+
|
|
83
|
+
# query parameters
|
|
84
|
+
query_params = opts[:query_params] || {}
|
|
85
|
+
query_params[:'client_id'] = client_id
|
|
86
|
+
query_params[:'redirect_uri'] = redirect_uri
|
|
87
|
+
query_params[:'response_type'] = response_type
|
|
88
|
+
query_params[:'code_challenge'] = code_challenge
|
|
89
|
+
query_params[:'code_challenge_method'] = opts[:'code_challenge_method'] if !opts[:'code_challenge_method'].nil?
|
|
90
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
91
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
92
|
+
query_params[:'resource'] = opts[:'resource'] if !opts[:'resource'].nil?
|
|
93
|
+
|
|
94
|
+
# header parameters
|
|
95
|
+
header_params = opts[:header_params] || {}
|
|
96
|
+
|
|
97
|
+
# form parameters
|
|
98
|
+
form_params = opts[:form_params] || {}
|
|
99
|
+
|
|
100
|
+
# http body (model)
|
|
101
|
+
post_body = opts[:debug_body]
|
|
102
|
+
|
|
103
|
+
# return_type
|
|
104
|
+
return_type = opts[:debug_return_type]
|
|
105
|
+
|
|
106
|
+
# auth_names
|
|
107
|
+
auth_names = opts[:debug_auth_names] || []
|
|
108
|
+
|
|
109
|
+
new_options = opts.merge(
|
|
110
|
+
:operation => :"AuthorizationWireApi.oauth_authorize",
|
|
111
|
+
:header_params => header_params,
|
|
112
|
+
:query_params => query_params,
|
|
113
|
+
:form_params => form_params,
|
|
114
|
+
:body => post_body,
|
|
115
|
+
:auth_names => auth_names,
|
|
116
|
+
:return_type => return_type
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
120
|
+
if @api_client.config.debugging
|
|
121
|
+
@api_client.config.logger.debug "API called: AuthorizationWireApi#oauth_authorize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
122
|
+
end
|
|
123
|
+
return data, status_code, headers
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Device authorization
|
|
127
|
+
# Starts the device flow. Show the `user_code` to the person and send them to `verification_uri`; `verification_uri_complete` has the code already embedded, which is what to open if you can open a browser at all. Then poll `/oauth/token`, no faster than `interval` seconds.
|
|
128
|
+
# @param client_id [String]
|
|
129
|
+
# @param [Hash] opts the optional parameters
|
|
130
|
+
# @option opts [String] :scope Space-delimited. Anything your client is not registered for is dropped rather than refused.
|
|
131
|
+
# @option opts [String] :resource RFC 8707: what the token is for.
|
|
132
|
+
# @return [DeviceAuthorization]
|
|
133
|
+
def oauth_device_authorization(client_id, opts = {})
|
|
134
|
+
data, _status_code, _headers = oauth_device_authorization_with_http_info(client_id, opts)
|
|
135
|
+
data
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Device authorization
|
|
139
|
+
# Starts the device flow. Show the `user_code` to the person and send them to `verification_uri`; `verification_uri_complete` has the code already embedded, which is what to open if you can open a browser at all. Then poll `/oauth/token`, no faster than `interval` seconds.
|
|
140
|
+
# @param client_id [String]
|
|
141
|
+
# @param [Hash] opts the optional parameters
|
|
142
|
+
# @option opts [String] :scope Space-delimited. Anything your client is not registered for is dropped rather than refused.
|
|
143
|
+
# @option opts [String] :resource RFC 8707: what the token is for.
|
|
144
|
+
# @return [Array<(DeviceAuthorization, Integer, Hash)>] DeviceAuthorization data, response status code and response headers
|
|
145
|
+
def oauth_device_authorization_with_http_info(client_id, opts = {})
|
|
146
|
+
if @api_client.config.debugging
|
|
147
|
+
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_device_authorization ...'
|
|
148
|
+
end
|
|
149
|
+
# verify the required parameter 'client_id' is set
|
|
150
|
+
if @api_client.config.client_side_validation && client_id.nil?
|
|
151
|
+
fail ArgumentError, "Missing the required parameter 'client_id' when calling AuthorizationWireApi.oauth_device_authorization"
|
|
152
|
+
end
|
|
153
|
+
# resource path
|
|
154
|
+
local_var_path = '/oauth/device_authorization'
|
|
155
|
+
|
|
156
|
+
# query parameters
|
|
157
|
+
query_params = opts[:query_params] || {}
|
|
158
|
+
|
|
159
|
+
# header parameters
|
|
160
|
+
header_params = opts[:header_params] || {}
|
|
161
|
+
# HTTP header 'Accept' (if needed)
|
|
162
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
163
|
+
# HTTP header 'Content-Type'
|
|
164
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
165
|
+
if !content_type.nil?
|
|
166
|
+
header_params['Content-Type'] = content_type
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# form parameters
|
|
170
|
+
form_params = opts[:form_params] || {}
|
|
171
|
+
form_params['client_id'] = client_id
|
|
172
|
+
form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
|
173
|
+
form_params['resource'] = opts[:'resource'] if !opts[:'resource'].nil?
|
|
174
|
+
|
|
175
|
+
# http body (model)
|
|
176
|
+
post_body = opts[:debug_body]
|
|
177
|
+
|
|
178
|
+
# return_type
|
|
179
|
+
return_type = opts[:debug_return_type] || 'DeviceAuthorization'
|
|
180
|
+
|
|
181
|
+
# auth_names
|
|
182
|
+
auth_names = opts[:debug_auth_names] || []
|
|
183
|
+
|
|
184
|
+
new_options = opts.merge(
|
|
185
|
+
:operation => :"AuthorizationWireApi.oauth_device_authorization",
|
|
186
|
+
:header_params => header_params,
|
|
187
|
+
:query_params => query_params,
|
|
188
|
+
:form_params => form_params,
|
|
189
|
+
:body => post_body,
|
|
190
|
+
:auth_names => auth_names,
|
|
191
|
+
:return_type => return_type
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
195
|
+
if @api_client.config.debugging
|
|
196
|
+
@api_client.config.logger.debug "API called: AuthorizationWireApi#oauth_device_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
197
|
+
end
|
|
198
|
+
return data, status_code, headers
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Discovery
|
|
202
|
+
# RFC 8414 authorization server metadata: the endpoints, the grant types and the scopes this server supports. Read this rather than hardcoding endpoints. It is also served at `/.well-known/openid-configuration`, identically, because several clients probe that path first.
|
|
203
|
+
# @param [Hash] opts the optional parameters
|
|
204
|
+
# @return [OauthMetadata]
|
|
205
|
+
def oauth_metadata(opts = {})
|
|
206
|
+
data, _status_code, _headers = oauth_metadata_with_http_info(opts)
|
|
207
|
+
data
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Discovery
|
|
211
|
+
# RFC 8414 authorization server metadata: the endpoints, the grant types and the scopes this server supports. Read this rather than hardcoding endpoints. It is also served at `/.well-known/openid-configuration`, identically, because several clients probe that path first.
|
|
212
|
+
# @param [Hash] opts the optional parameters
|
|
213
|
+
# @return [Array<(OauthMetadata, Integer, Hash)>] OauthMetadata data, response status code and response headers
|
|
214
|
+
def oauth_metadata_with_http_info(opts = {})
|
|
215
|
+
if @api_client.config.debugging
|
|
216
|
+
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_metadata ...'
|
|
217
|
+
end
|
|
218
|
+
# resource path
|
|
219
|
+
local_var_path = '/.well-known/oauth-authorization-server'
|
|
220
|
+
|
|
221
|
+
# query parameters
|
|
222
|
+
query_params = opts[:query_params] || {}
|
|
223
|
+
|
|
224
|
+
# header parameters
|
|
225
|
+
header_params = opts[:header_params] || {}
|
|
226
|
+
# HTTP header 'Accept' (if needed)
|
|
227
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
228
|
+
|
|
229
|
+
# form parameters
|
|
230
|
+
form_params = opts[:form_params] || {}
|
|
231
|
+
|
|
232
|
+
# http body (model)
|
|
233
|
+
post_body = opts[:debug_body]
|
|
234
|
+
|
|
235
|
+
# return_type
|
|
236
|
+
return_type = opts[:debug_return_type] || 'OauthMetadata'
|
|
237
|
+
|
|
238
|
+
# auth_names
|
|
239
|
+
auth_names = opts[:debug_auth_names] || []
|
|
240
|
+
|
|
241
|
+
new_options = opts.merge(
|
|
242
|
+
:operation => :"AuthorizationWireApi.oauth_metadata",
|
|
243
|
+
:header_params => header_params,
|
|
244
|
+
:query_params => query_params,
|
|
245
|
+
:form_params => form_params,
|
|
246
|
+
:body => post_body,
|
|
247
|
+
:auth_names => auth_names,
|
|
248
|
+
:return_type => return_type
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
252
|
+
if @api_client.config.debugging
|
|
253
|
+
@api_client.config.logger.debug "API called: AuthorizationWireApi#oauth_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
254
|
+
end
|
|
255
|
+
return data, status_code, headers
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Revoke
|
|
259
|
+
# RFC 7009. Always answers 200, including for a token that was never valid - an endpoint that distinguished the two would be a way to test whether a stolen string is a live credential. Revoking a REFRESH token ends the whole authorization and takes its access tokens with it. Revoking an access token affects only that token.
|
|
260
|
+
# @param token [String]
|
|
261
|
+
# @param [Hash] opts the optional parameters
|
|
262
|
+
# @option opts [String] :client_id
|
|
263
|
+
# @return [Object]
|
|
264
|
+
def oauth_revoke(token, opts = {})
|
|
265
|
+
data, _status_code, _headers = oauth_revoke_with_http_info(token, opts)
|
|
266
|
+
data
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Revoke
|
|
270
|
+
# RFC 7009. Always answers 200, including for a token that was never valid - an endpoint that distinguished the two would be a way to test whether a stolen string is a live credential. Revoking a REFRESH token ends the whole authorization and takes its access tokens with it. Revoking an access token affects only that token.
|
|
271
|
+
# @param token [String]
|
|
272
|
+
# @param [Hash] opts the optional parameters
|
|
273
|
+
# @option opts [String] :client_id
|
|
274
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
275
|
+
def oauth_revoke_with_http_info(token, opts = {})
|
|
276
|
+
if @api_client.config.debugging
|
|
277
|
+
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_revoke ...'
|
|
278
|
+
end
|
|
279
|
+
# verify the required parameter 'token' is set
|
|
280
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
281
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling AuthorizationWireApi.oauth_revoke"
|
|
282
|
+
end
|
|
283
|
+
# resource path
|
|
284
|
+
local_var_path = '/oauth/revoke'
|
|
285
|
+
|
|
286
|
+
# query parameters
|
|
287
|
+
query_params = opts[:query_params] || {}
|
|
288
|
+
|
|
289
|
+
# header parameters
|
|
290
|
+
header_params = opts[:header_params] || {}
|
|
291
|
+
# HTTP header 'Accept' (if needed)
|
|
292
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
293
|
+
# HTTP header 'Content-Type'
|
|
294
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
295
|
+
if !content_type.nil?
|
|
296
|
+
header_params['Content-Type'] = content_type
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# form parameters
|
|
300
|
+
form_params = opts[:form_params] || {}
|
|
301
|
+
form_params['token'] = token
|
|
302
|
+
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
|
303
|
+
|
|
304
|
+
# http body (model)
|
|
305
|
+
post_body = opts[:debug_body]
|
|
306
|
+
|
|
307
|
+
# return_type
|
|
308
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
309
|
+
|
|
310
|
+
# auth_names
|
|
311
|
+
auth_names = opts[:debug_auth_names] || []
|
|
312
|
+
|
|
313
|
+
new_options = opts.merge(
|
|
314
|
+
:operation => :"AuthorizationWireApi.oauth_revoke",
|
|
315
|
+
:header_params => header_params,
|
|
316
|
+
:query_params => query_params,
|
|
317
|
+
:form_params => form_params,
|
|
318
|
+
:body => post_body,
|
|
319
|
+
:auth_names => auth_names,
|
|
320
|
+
:return_type => return_type
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
324
|
+
if @api_client.config.debugging
|
|
325
|
+
@api_client.config.logger.debug "API called: AuthorizationWireApi#oauth_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
326
|
+
end
|
|
327
|
+
return data, status_code, headers
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
# Token
|
|
331
|
+
# 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.
|
|
332
|
+
# @param grant_type [String]
|
|
333
|
+
# @param client_id [String]
|
|
334
|
+
# @param [Hash] opts the optional parameters
|
|
335
|
+
# @option opts [String] :device_code
|
|
336
|
+
# @option opts [String] :code
|
|
337
|
+
# @option opts [String] :code_verifier
|
|
338
|
+
# @option opts [String] :redirect_uri
|
|
339
|
+
# @option opts [String] :refresh_token
|
|
340
|
+
# @return [TokenResponse]
|
|
341
|
+
def oauth_token(grant_type, client_id, opts = {})
|
|
342
|
+
data, _status_code, _headers = oauth_token_with_http_info(grant_type, client_id, opts)
|
|
343
|
+
data
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Token
|
|
347
|
+
# 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.
|
|
348
|
+
# @param grant_type [String]
|
|
349
|
+
# @param client_id [String]
|
|
350
|
+
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @option opts [String] :device_code
|
|
352
|
+
# @option opts [String] :code
|
|
353
|
+
# @option opts [String] :code_verifier
|
|
354
|
+
# @option opts [String] :redirect_uri
|
|
355
|
+
# @option opts [String] :refresh_token
|
|
356
|
+
# @return [Array<(TokenResponse, Integer, Hash)>] TokenResponse data, response status code and response headers
|
|
357
|
+
def oauth_token_with_http_info(grant_type, client_id, opts = {})
|
|
358
|
+
if @api_client.config.debugging
|
|
359
|
+
@api_client.config.logger.debug 'Calling API: AuthorizationWireApi.oauth_token ...'
|
|
360
|
+
end
|
|
361
|
+
# verify the required parameter 'grant_type' is set
|
|
362
|
+
if @api_client.config.client_side_validation && grant_type.nil?
|
|
363
|
+
fail ArgumentError, "Missing the required parameter 'grant_type' when calling AuthorizationWireApi.oauth_token"
|
|
364
|
+
end
|
|
365
|
+
# verify the required parameter 'client_id' is set
|
|
366
|
+
if @api_client.config.client_side_validation && client_id.nil?
|
|
367
|
+
fail ArgumentError, "Missing the required parameter 'client_id' when calling AuthorizationWireApi.oauth_token"
|
|
368
|
+
end
|
|
369
|
+
# resource path
|
|
370
|
+
local_var_path = '/oauth/token'
|
|
371
|
+
|
|
372
|
+
# query parameters
|
|
373
|
+
query_params = opts[:query_params] || {}
|
|
374
|
+
|
|
375
|
+
# header parameters
|
|
376
|
+
header_params = opts[:header_params] || {}
|
|
377
|
+
# HTTP header 'Accept' (if needed)
|
|
378
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
379
|
+
# HTTP header 'Content-Type'
|
|
380
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
381
|
+
if !content_type.nil?
|
|
382
|
+
header_params['Content-Type'] = content_type
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# form parameters
|
|
386
|
+
form_params = opts[:form_params] || {}
|
|
387
|
+
form_params['grant_type'] = grant_type
|
|
388
|
+
form_params['client_id'] = client_id
|
|
389
|
+
form_params['device_code'] = opts[:'device_code'] if !opts[:'device_code'].nil?
|
|
390
|
+
form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
|
|
391
|
+
form_params['code_verifier'] = opts[:'code_verifier'] if !opts[:'code_verifier'].nil?
|
|
392
|
+
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
|
393
|
+
form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?
|
|
394
|
+
|
|
395
|
+
# http body (model)
|
|
396
|
+
post_body = opts[:debug_body]
|
|
397
|
+
|
|
398
|
+
# return_type
|
|
399
|
+
return_type = opts[:debug_return_type] || 'TokenResponse'
|
|
400
|
+
|
|
401
|
+
# auth_names
|
|
402
|
+
auth_names = opts[:debug_auth_names] || []
|
|
403
|
+
|
|
404
|
+
new_options = opts.merge(
|
|
405
|
+
:operation => :"AuthorizationWireApi.oauth_token",
|
|
406
|
+
:header_params => header_params,
|
|
407
|
+
:query_params => query_params,
|
|
408
|
+
:form_params => form_params,
|
|
409
|
+
:body => post_body,
|
|
410
|
+
:auth_names => auth_names,
|
|
411
|
+
:return_type => return_type
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
415
|
+
if @api_client.config.debugging
|
|
416
|
+
@api_client.config.logger.debug "API called: AuthorizationWireApi#oauth_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
417
|
+
end
|
|
418
|
+
return data, status_code, headers
|
|
419
|
+
end
|
|
420
|
+
end
|
|
421
|
+
end
|
|
@@ -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.15
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
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
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.15
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module VPNDetection
|
|
16
|
+
class EntitlementWireApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Plan and usage
|
|
23
|
+
# Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Entitlement]
|
|
26
|
+
def my_entitlement(opts = {})
|
|
27
|
+
data, _status_code, _headers = my_entitlement_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Plan and usage
|
|
32
|
+
# Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Entitlement, Integer, Hash)>] Entitlement data, response status code and response headers
|
|
35
|
+
def my_entitlement_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: EntitlementWireApi.my_entitlement ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/api/v1/entitlement'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
|
|
50
|
+
# form parameters
|
|
51
|
+
form_params = opts[:form_params] || {}
|
|
52
|
+
|
|
53
|
+
# http body (model)
|
|
54
|
+
post_body = opts[:debug_body]
|
|
55
|
+
|
|
56
|
+
# return_type
|
|
57
|
+
return_type = opts[:debug_return_type] || 'Entitlement'
|
|
58
|
+
|
|
59
|
+
# auth_names
|
|
60
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
61
|
+
|
|
62
|
+
new_options = opts.merge(
|
|
63
|
+
:operation => :"EntitlementWireApi.my_entitlement",
|
|
64
|
+
:header_params => header_params,
|
|
65
|
+
:query_params => query_params,
|
|
66
|
+
:form_params => form_params,
|
|
67
|
+
:body => post_body,
|
|
68
|
+
:auth_names => auth_names,
|
|
69
|
+
:return_type => return_type
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
|
+
if @api_client.config.debugging
|
|
74
|
+
@api_client.config.logger.debug "API called: EntitlementWireApi#my_entitlement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -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.15
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -19,6 +19,74 @@ module VPNDetection
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Batch
|
|
23
|
+
# Answers up to 1000 addresses in one call. Each distinct string in `ips` is one lookup: it costs exactly what `GET /{ip}` costs for that address and comes back with exactly the fields that call would carry for your plan. Exact duplicates collapse to one entry and one lookup. Both maps in the answer are keyed by the string you sent, so nothing has to be lined up by position; the `ip` inside each result is the normalized form. An address that could not be answered sits in `errors` with the status and message the single lookup would have given, and never disturbs the others: a string that is not an address is a `400` there, and an allowance that runs out part way through leaves the remaining entries as `429`s. The call itself fails only for the reasons below, and a `429` on the call always carries `Retry-After`: the batch is admitted or refused whole by the rate limit, so a per-entry `429` is always a spent allowance and never a throttle.
|
|
24
|
+
# @param batch_lookup_request [BatchLookupRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [BatchLookupResponse]
|
|
27
|
+
def lookup_batch(batch_lookup_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = lookup_batch_with_http_info(batch_lookup_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Batch
|
|
33
|
+
# Answers up to 1000 addresses in one call. Each distinct string in `ips` is one lookup: it costs exactly what `GET /{ip}` costs for that address and comes back with exactly the fields that call would carry for your plan. Exact duplicates collapse to one entry and one lookup. Both maps in the answer are keyed by the string you sent, so nothing has to be lined up by position; the `ip` inside each result is the normalized form. An address that could not be answered sits in `errors` with the status and message the single lookup would have given, and never disturbs the others: a string that is not an address is a `400` there, and an allowance that runs out part way through leaves the remaining entries as `429`s. The call itself fails only for the reasons below, and a `429` on the call always carries `Retry-After`: the batch is admitted or refused whole by the rate limit, so a per-entry `429` is always a spent allowance and never a throttle.
|
|
34
|
+
# @param batch_lookup_request [BatchLookupRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(BatchLookupResponse, Integer, Hash)>] BatchLookupResponse data, response status code and response headers
|
|
37
|
+
def lookup_batch_with_http_info(batch_lookup_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: LookupWireApi.lookup_batch ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'batch_lookup_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && batch_lookup_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'batch_lookup_request' when calling LookupWireApi.lookup_batch"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/batch'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_lookup_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'BatchLookupResponse'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"LookupWireApi.lookup_batch",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: LookupWireApi#lookup_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
22
90
|
# Lookup
|
|
23
91
|
# Answers what is known about a single IPv4 or IPv6 address. Which fields come back is decided by the plan behind the presented key; with no key the answer is `ip` and `is_vpn`.
|
|
24
92
|
# @param ip [String] The IPv4 or IPv6 address to classify.
|
|
@@ -82,7 +150,7 @@ module VPNDetection
|
|
|
82
150
|
return data, status_code, headers
|
|
83
151
|
end
|
|
84
152
|
|
|
85
|
-
#
|
|
153
|
+
# My IP
|
|
86
154
|
# Answers what is known about the address this request came from, which is the same answer `GET /{ip}` gives for that address: the plan behind the presented key decides which fields come back, and the request counts against the same allowance. The address is the one our edge observed, so a request through a proxy or a VPN reports the exit it left through rather than the machine that made it. That is usually the point of asking.
|
|
87
155
|
# @param [Hash] opts the optional parameters
|
|
88
156
|
# @return [LookupResponse]
|
|
@@ -91,7 +159,7 @@ module VPNDetection
|
|
|
91
159
|
data
|
|
92
160
|
end
|
|
93
161
|
|
|
94
|
-
#
|
|
162
|
+
# My IP
|
|
95
163
|
# Answers what is known about the address this request came from, which is the same answer `GET /{ip}` gives for that address: the plan behind the presented key decides which fields come back, and the request counts against the same allowance. The address is the one our edge observed, so a request through a proxy or a VPN reports the exit it left through rather than the machine that made it. That is usually the point of asking.
|
|
96
164
|
# @param [Hash] opts the optional parameters
|
|
97
165
|
# @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers
|