internetdata 2.3.1 → 2.4.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 +3 -3
- data/lib/internetdata/api/database_v2_api.rb +1 -1
- data/lib/internetdata/api_client.rb +1 -1
- data/lib/internetdata/api_error.rb +1 -1
- data/lib/internetdata/api_model_base.rb +1 -1
- data/lib/internetdata/client.rb +7 -3
- data/lib/internetdata/configuration.rb +1 -1
- data/lib/internetdata/database_api.rb +2 -1
- data/lib/internetdata/models/database.rb +1 -1
- data/lib/internetdata/models/database_checksums_response.rb +1 -1
- data/lib/internetdata/models/database_format.rb +1 -1
- data/lib/internetdata/models/database_list.rb +1 -1
- data/lib/internetdata/models/database_metadata.rb +27 -5
- data/lib/internetdata/models/database_metadata_column.rb +1 -1
- data/lib/internetdata/models/database_version.rb +17 -5
- data/lib/internetdata/models/db_checksums.rb +1 -1
- data/lib/internetdata/models/device_authorization.rb +1 -1
- data/lib/internetdata/models/download.rb +29 -2
- data/lib/internetdata/models/download_list.rb +1 -1
- data/lib/internetdata/models/error_envelope.rb +1 -1
- data/lib/internetdata/models/oauth_metadata.rb +12 -2
- data/lib/internetdata/models/standing.rb +1 -1
- data/lib/internetdata/models/token_response.rb +3 -3
- data/lib/internetdata/oauth_api.rb +21 -3
- data/lib/internetdata/retries.rb +13 -3
- data/lib/internetdata/transport.rb +19 -2
- data/lib/internetdata/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: f63ce81a04c9374b72693f32c6c246ca19a77da3891980f40170c4065faafd14
|
|
4
|
+
data.tar.gz: 12aa236085aaebf96288876dac1a91c60e4947e6a5cb5fced7c0440f13d0ef8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 367c9cfc6352638a61ae4249e67135e6ce794f5e59baa32eb9239ca17d891758e098d914fef6fb7460a2f4839746cc0171d2d15ab51bf186cf3cc1bf32b66798
|
|
7
|
+
data.tar.gz: a0bd89ba6440166e54e79d52e384b982799a3b4282ddbe492ab7a268d90396f1c8b931d6487903c983592185a78f2fee281ea55f88f7f7b1eeaa1595d6ff7d4a
|
data/README.md
CHANGED
|
@@ -100,7 +100,7 @@ client = InternetData::Client.new(api_key: ENV['INTERNETDATA_API_KEY'], timeout:
|
|
|
100
100
|
catalog = client.database.list(timeout: 5)
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds. The client's value is the default: from 2.1.0, `list`, `metadata`, `checksums`, `downloads` and `download_url` each take `timeout:` for that call alone.
|
|
103
|
+
`timeout` is in seconds and bounds each attempt, body included, so a call that is retried can take longer in total. It defaults to 30 seconds, and 0 means no bound. The client's value is the default: from 2.1.0, `list`, `metadata`, `checksums`, `downloads` and `download_url` each take `timeout:` for that call alone. A negative value, anything that isn't a number, and anything past 2147483.647 seconds (the longest curl holds) raise `ArgumentError` where you pass them, before any request.
|
|
104
104
|
|
|
105
105
|
`download` and `download_bytes` take no `timeout:` and raise `ArgumentError` if handed one, rather than accepting it and quietly doing nothing: a transfer runs to gigabytes and minutes, so any bound that suits a JSON call would abandon a healthy download. They bound only their connection with the client's value. `download_url` does take one, because minting the link is an ordinary API request - it bounds that request, not whatever you do with the link afterwards.
|
|
106
106
|
|
|
@@ -118,7 +118,7 @@ end
|
|
|
118
118
|
|
|
119
119
|
`kind` is one of `:bad_request`, `:unauthorized`, `:forbidden`, `:rate_limited`, `:quota_exceeded`, `:server_error` or `:network`. `rc` is the API's own result code, such as `NOT_LICENSED` or `LICENSE_EXPIRED`, which is usually the specific thing you want to read.
|
|
120
120
|
|
|
121
|
-
Note that `:rate_limited` and `:quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is the API facing a burst, so retrying later works; a spent quota needs your allowance raised or the window to roll over. The library retries the first for you and never the second.
|
|
121
|
+
Note that `:rate_limited` and `:quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is the API facing a burst, so retrying later works; a spent quota needs your allowance raised or the window to roll over. The library retries the first for you and never the second. It waits the `Retry-After` the API sent, or its own backoff from 250 ms when that's past about 24.8 days.
|
|
122
122
|
|
|
123
123
|
### Sign in with OAuth (device flow)
|
|
124
124
|
|
|
@@ -145,7 +145,7 @@ There are official InternetData client libraries available for many languages in
|
|
|
145
145
|
|
|
146
146
|
IP intelligence databases: VPN, proxy, hosting, CDN and relay address space, provider catalogs and network metadata, published as CSV and MMDB.
|
|
147
147
|
|
|
148
|
-
[<img src="https://s3.internetdata.io/internetdata-public/brand/mark.svg" alt="InternetData"
|
|
148
|
+
[<img src="https://s3.internetdata.io/internetdata-public/brand/mark.svg" alt="InternetData" height="64"/>](https://internetdata.io/)
|
|
149
149
|
|
|
150
150
|
## License
|
|
151
151
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/internetdata/client.rb
CHANGED
|
@@ -21,9 +21,13 @@ module InternetData
|
|
|
21
21
|
|
|
22
22
|
# @param api_key [String, nil] a key carrying the `db.download` scope. Omit
|
|
23
23
|
# it and no credential is sent; every database published today answers 401.
|
|
24
|
-
# @param retries [Integer] extra attempts for a transient failure.
|
|
25
|
-
#
|
|
26
|
-
#
|
|
24
|
+
# @param retries [Integer] extra attempts for a transient failure. Each waits
|
|
25
|
+
# the server's `Retry-After` when it sent one of at most about 24.8 days,
|
|
26
|
+
# and otherwise a backoff of 250 ms that doubles per retry.
|
|
27
|
+
# @param timeout [Numeric] seconds allowed for one API call, 0 for no bound. It
|
|
28
|
+
# also bounds the CONNECT phase of a transfer, which is otherwise unlimited.
|
|
29
|
+
# @raise [ArgumentError] for a `timeout` that is negative, not a finite number,
|
|
30
|
+
# or past 2147483.647 seconds (2**31 - 1 ms), the longest curl holds.
|
|
27
31
|
# @param transport [Transport, nil] override the HTTP layer, mostly for tests.
|
|
28
32
|
def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, retries: DEFAULT_RETRIES,
|
|
29
33
|
timeout: DEFAULT_TIMEOUT, transport: nil)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -7,7 +7,8 @@ module InternetData
|
|
|
7
7
|
# the generated {DatabaseV2Api} underneath, which speaks the wire.
|
|
8
8
|
#
|
|
9
9
|
# Every JSON call here takes `timeout:`, in seconds, bounding each ATTEMPT of
|
|
10
|
-
# that call alone and overriding the bound the client was built with
|
|
10
|
+
# that call alone and overriding the bound the client was built with; one the
|
|
11
|
+
# client would refuse raises ArgumentError before any request. The two
|
|
11
12
|
# transfers take none, and are refused it rather than ignoring it: a database
|
|
12
13
|
# runs to gigabytes and minutes, so a bound that suits a JSON call would
|
|
13
14
|
# abandon a healthy download.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -36,6 +36,12 @@ module InternetData
|
|
|
36
36
|
# Bytes per format.
|
|
37
37
|
attr_accessor :size
|
|
38
38
|
|
|
39
|
+
# Bytes per format of the evaluation sample, where one is published.
|
|
40
|
+
attr_accessor :sample_size
|
|
41
|
+
|
|
42
|
+
# Row count in the evaluation sample.
|
|
43
|
+
attr_accessor :sample_entries
|
|
44
|
+
|
|
39
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
46
|
def self.attribute_map
|
|
41
47
|
{
|
|
@@ -45,7 +51,9 @@ module InternetData
|
|
|
45
51
|
:'entries' => :'entries',
|
|
46
52
|
:'schema' => :'schema',
|
|
47
53
|
:'sample' => :'sample',
|
|
48
|
-
:'size' => :'size'
|
|
54
|
+
:'size' => :'size',
|
|
55
|
+
:'sample_size' => :'sample_size',
|
|
56
|
+
:'sample_entries' => :'sample_entries'
|
|
49
57
|
}
|
|
50
58
|
end
|
|
51
59
|
|
|
@@ -68,7 +76,9 @@ module InternetData
|
|
|
68
76
|
:'entries' => :'Integer',
|
|
69
77
|
:'schema' => :'Hash<String, Array<DatabaseMetadataColumn>>',
|
|
70
78
|
:'sample' => :'Hash<String, Array<Object>>',
|
|
71
|
-
:'size' => :'Hash<String, Integer>'
|
|
79
|
+
:'size' => :'Hash<String, Integer>',
|
|
80
|
+
:'sample_size' => :'Hash<String, Integer>',
|
|
81
|
+
:'sample_entries' => :'Integer'
|
|
72
82
|
}
|
|
73
83
|
end
|
|
74
84
|
|
|
@@ -137,6 +147,16 @@ module InternetData
|
|
|
137
147
|
else
|
|
138
148
|
self.size = nil
|
|
139
149
|
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'sample_size')
|
|
152
|
+
if (value = attributes[:'sample_size']).is_a?(Hash)
|
|
153
|
+
self.sample_size = value
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'sample_entries')
|
|
158
|
+
self.sample_entries = attributes[:'sample_entries']
|
|
159
|
+
end
|
|
140
160
|
end
|
|
141
161
|
|
|
142
162
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -240,7 +260,9 @@ module InternetData
|
|
|
240
260
|
entries == o.entries &&
|
|
241
261
|
schema == o.schema &&
|
|
242
262
|
sample == o.sample &&
|
|
243
|
-
size == o.size
|
|
263
|
+
size == o.size &&
|
|
264
|
+
sample_size == o.sample_size &&
|
|
265
|
+
sample_entries == o.sample_entries
|
|
244
266
|
end
|
|
245
267
|
|
|
246
268
|
# @see the `==` method
|
|
@@ -252,7 +274,7 @@ module InternetData
|
|
|
252
274
|
# Calculates hash code according to all attributes.
|
|
253
275
|
# @return [Integer] Hash code
|
|
254
276
|
def hash
|
|
255
|
-
[id, update_freq, updated, entries, schema, sample, size].hash
|
|
277
|
+
[id, update_freq, updated, entries, schema, sample, size, sample_size, sample_entries].hash
|
|
256
278
|
end
|
|
257
279
|
|
|
258
280
|
# Builds the object from hash
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -25,13 +25,17 @@ module InternetData
|
|
|
25
25
|
# The formats this version is BUILT in. Asking for another is a 400, not a gap - the `_provider` catalogs are keyed by provider id, so no MMDB exists for them.
|
|
26
26
|
attr_accessor :formats
|
|
27
27
|
|
|
28
|
+
# The formats an evaluation sample is published in, if any.
|
|
29
|
+
attr_accessor :sample_formats
|
|
30
|
+
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
32
|
def self.attribute_map
|
|
30
33
|
{
|
|
31
34
|
:'id' => :'id',
|
|
32
35
|
:'version' => :'version',
|
|
33
36
|
:'summary' => :'summary',
|
|
34
|
-
:'formats' => :'formats'
|
|
37
|
+
:'formats' => :'formats',
|
|
38
|
+
:'sample_formats' => :'sample_formats'
|
|
35
39
|
}
|
|
36
40
|
end
|
|
37
41
|
|
|
@@ -51,7 +55,8 @@ module InternetData
|
|
|
51
55
|
:'id' => :'String',
|
|
52
56
|
:'version' => :'Integer',
|
|
53
57
|
:'summary' => :'String',
|
|
54
|
-
:'formats' => :'Array<DatabaseFormat>'
|
|
58
|
+
:'formats' => :'Array<DatabaseFormat>',
|
|
59
|
+
:'sample_formats' => :'Array<DatabaseFormat>'
|
|
55
60
|
}
|
|
56
61
|
end
|
|
57
62
|
|
|
@@ -102,6 +107,12 @@ module InternetData
|
|
|
102
107
|
else
|
|
103
108
|
self.formats = nil
|
|
104
109
|
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'sample_formats')
|
|
112
|
+
if (value = attributes[:'sample_formats']).is_a?(Array)
|
|
113
|
+
self.sample_formats = value
|
|
114
|
+
end
|
|
115
|
+
end
|
|
105
116
|
end
|
|
106
117
|
|
|
107
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -187,7 +198,8 @@ module InternetData
|
|
|
187
198
|
id == o.id &&
|
|
188
199
|
version == o.version &&
|
|
189
200
|
summary == o.summary &&
|
|
190
|
-
formats == o.formats
|
|
201
|
+
formats == o.formats &&
|
|
202
|
+
sample_formats == o.sample_formats
|
|
191
203
|
end
|
|
192
204
|
|
|
193
205
|
# @see the `==` method
|
|
@@ -199,7 +211,7 @@ module InternetData
|
|
|
199
211
|
# Calculates hash code according to all attributes.
|
|
200
212
|
# @return [Integer] Hash code
|
|
201
213
|
def hash
|
|
202
|
-
[id, version, summary, formats].hash
|
|
214
|
+
[id, version, summary, formats, sample_formats].hash
|
|
203
215
|
end
|
|
204
216
|
|
|
205
217
|
# Builds the object from hash
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -22,6 +22,9 @@ module InternetData
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :outcome
|
|
24
24
|
|
|
25
|
+
# The evaluation sample rather than the database itself.
|
|
26
|
+
attr_accessor :sample
|
|
27
|
+
|
|
25
28
|
# Object size at redirect time, NOT bytes delivered: the transfer is a presigned redirect straight to object storage, so we never observe how much of it was taken.
|
|
26
29
|
attr_accessor :bytes
|
|
27
30
|
|
|
@@ -64,6 +67,7 @@ module InternetData
|
|
|
64
67
|
:'dataset_id' => :'dataset_id',
|
|
65
68
|
:'format' => :'format',
|
|
66
69
|
:'outcome' => :'outcome',
|
|
70
|
+
:'sample' => :'sample',
|
|
67
71
|
:'bytes' => :'bytes',
|
|
68
72
|
:'http_status' => :'http_status',
|
|
69
73
|
:'apikey_id' => :'apikey_id',
|
|
@@ -89,6 +93,7 @@ module InternetData
|
|
|
89
93
|
:'dataset_id' => :'String',
|
|
90
94
|
:'format' => :'String',
|
|
91
95
|
:'outcome' => :'String',
|
|
96
|
+
:'sample' => :'Boolean',
|
|
92
97
|
:'bytes' => :'Integer',
|
|
93
98
|
:'http_status' => :'Integer',
|
|
94
99
|
:'apikey_id' => :'String',
|
|
@@ -143,6 +148,12 @@ module InternetData
|
|
|
143
148
|
self.outcome = nil
|
|
144
149
|
end
|
|
145
150
|
|
|
151
|
+
if attributes.key?(:'sample')
|
|
152
|
+
self.sample = attributes[:'sample']
|
|
153
|
+
else
|
|
154
|
+
self.sample = nil
|
|
155
|
+
end
|
|
156
|
+
|
|
146
157
|
if attributes.key?(:'bytes')
|
|
147
158
|
self.bytes = attributes[:'bytes']
|
|
148
159
|
else
|
|
@@ -197,6 +208,10 @@ module InternetData
|
|
|
197
208
|
invalid_properties.push('invalid value for "outcome", outcome cannot be nil.')
|
|
198
209
|
end
|
|
199
210
|
|
|
211
|
+
if @sample.nil?
|
|
212
|
+
invalid_properties.push('invalid value for "sample", sample cannot be nil.')
|
|
213
|
+
end
|
|
214
|
+
|
|
200
215
|
if @created.nil?
|
|
201
216
|
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
|
202
217
|
end
|
|
@@ -213,6 +228,7 @@ module InternetData
|
|
|
213
228
|
return false if @outcome.nil?
|
|
214
229
|
outcome_validator = EnumAttributeValidator.new('String', ["ok", "unauthorized", "denied", "expired", "unknown", "unavailable"])
|
|
215
230
|
return false unless outcome_validator.valid?(@outcome)
|
|
231
|
+
return false if @sample.nil?
|
|
216
232
|
return false if @created.nil?
|
|
217
233
|
true
|
|
218
234
|
end
|
|
@@ -247,6 +263,16 @@ module InternetData
|
|
|
247
263
|
@outcome = outcome
|
|
248
264
|
end
|
|
249
265
|
|
|
266
|
+
# Custom attribute writer method with validation
|
|
267
|
+
# @param [Object] sample Value to be assigned
|
|
268
|
+
def sample=(sample)
|
|
269
|
+
if sample.nil?
|
|
270
|
+
fail ArgumentError, 'sample cannot be nil'
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
@sample = sample
|
|
274
|
+
end
|
|
275
|
+
|
|
250
276
|
# Custom attribute writer method with validation
|
|
251
277
|
# @param [Object] created Value to be assigned
|
|
252
278
|
def created=(created)
|
|
@@ -265,6 +291,7 @@ module InternetData
|
|
|
265
291
|
dataset_id == o.dataset_id &&
|
|
266
292
|
format == o.format &&
|
|
267
293
|
outcome == o.outcome &&
|
|
294
|
+
sample == o.sample &&
|
|
268
295
|
bytes == o.bytes &&
|
|
269
296
|
http_status == o.http_status &&
|
|
270
297
|
apikey_id == o.apikey_id &&
|
|
@@ -282,7 +309,7 @@ module InternetData
|
|
|
282
309
|
# Calculates hash code according to all attributes.
|
|
283
310
|
# @return [Integer] Hash code
|
|
284
311
|
def hash
|
|
285
|
-
[dataset_id, format, outcome, bytes, http_status, apikey_id, client_ip, user_agent, created].hash
|
|
312
|
+
[dataset_id, format, outcome, sample, bytes, http_status, apikey_id, client_ip, user_agent, created].hash
|
|
286
313
|
end
|
|
287
314
|
|
|
288
315
|
# Builds the object from hash
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -33,6 +33,9 @@ module InternetData
|
|
|
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 InternetData
|
|
|
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 InternetData
|
|
|
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 InternetData
|
|
|
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 InternetData
|
|
|
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 InternetData
|
|
|
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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.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 InternetData API: download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata 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@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -29,10 +29,10 @@ module InternetData
|
|
|
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.
|
|
@@ -17,6 +17,8 @@ module InternetData
|
|
|
17
17
|
TOKEN_PATH = '/oauth/token'
|
|
18
18
|
REVOKE_PATH = '/oauth/revoke'
|
|
19
19
|
DEVICE_CODE_GRANT = 'urn:ietf:params:oauth:grant-type:device_code'
|
|
20
|
+
# The longest single `sleep` the poll asks Ruby for, in seconds.
|
|
21
|
+
LONGEST_SLEEP = 2**31 - 1
|
|
20
22
|
|
|
21
23
|
# The members a 2xx must carry for its type to mean anything.
|
|
22
24
|
REQUIRED = {
|
|
@@ -29,7 +31,7 @@ module InternetData
|
|
|
29
31
|
@transport = transport
|
|
30
32
|
@retries = retries
|
|
31
33
|
# The poll's wait and its monotonic clock, which a test replaces together.
|
|
32
|
-
@wait = ->(seconds) {
|
|
34
|
+
@wait = ->(seconds) { sleep_in_parts(seconds) }
|
|
33
35
|
@now = -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) }
|
|
34
36
|
end
|
|
35
37
|
|
|
@@ -96,7 +98,8 @@ module InternetData
|
|
|
96
98
|
# Wait for the person to approve a device sign-in, and return its tokens.
|
|
97
99
|
#
|
|
98
100
|
# Waits `device.interval` seconds before EVERY exchange, the first included,
|
|
99
|
-
# and five seconds longer for good each time the server answers `slow_down
|
|
101
|
+
# and five seconds longer for good each time the server answers `slow_down`,
|
|
102
|
+
# but never past `device.expires_in`: a wait that would end later ends then.
|
|
100
103
|
# Raises {OauthAccessDeniedError} when the person refuses and
|
|
101
104
|
# {OauthExpiredTokenError} when the code expires, including locally, with no
|
|
102
105
|
# status, once `device.expires_in` seconds have passed since this call. Any
|
|
@@ -109,10 +112,14 @@ module InternetData
|
|
|
109
112
|
# @param timeout [Numeric, nil] bounds each exchange, never the whole wait.
|
|
110
113
|
# @return [TokenResponse]
|
|
111
114
|
def poll_device_token(client_id, device, timeout: nil)
|
|
115
|
+
Transport.checked_timeout(timeout) unless timeout.nil?
|
|
112
116
|
interval = device.interval >= 1 ? device.interval : 5
|
|
113
117
|
deadline = @now.call + device.expires_in
|
|
114
118
|
loop do
|
|
115
|
-
|
|
119
|
+
# A wait that would end past the deadline waits only the time left, never
|
|
120
|
+
# a negative remainder, and the local expiry below follows with no request.
|
|
121
|
+
left = deadline - @now.call
|
|
122
|
+
@wait.call(interval < left ? interval : [left, 0].max)
|
|
116
123
|
raise OauthExpiredTokenError, 'expired_token' if @now.call >= deadline
|
|
117
124
|
|
|
118
125
|
begin
|
|
@@ -129,6 +136,17 @@ module InternetData
|
|
|
129
136
|
|
|
130
137
|
private
|
|
131
138
|
|
|
139
|
+
# `sleep` raises RangeError for a Float from about 9.2e18 s and an Integer
|
|
140
|
+
# past 2**63 - 1, and a server's `expires_in` can leave a wait longer than
|
|
141
|
+
# either, so a long one is slept in parts rather than ending the poll.
|
|
142
|
+
def sleep_in_parts(seconds)
|
|
143
|
+
while seconds.positive?
|
|
144
|
+
part = [seconds, LONGEST_SLEEP].min
|
|
145
|
+
sleep(part)
|
|
146
|
+
seconds -= part
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
132
150
|
def exchange(form, timeout)
|
|
133
151
|
decode(TokenResponse, @transport.oauth_request(:POST, TOKEN_PATH, form: form, timeout: timeout).run)
|
|
134
152
|
end
|
data/lib/internetdata/retries.rb
CHANGED
|
@@ -9,6 +9,10 @@ module InternetData
|
|
|
9
9
|
module Retries
|
|
10
10
|
BACKOFF_SECONDS = 0.25
|
|
11
11
|
|
|
12
|
+
# The longest `Retry-After` honored, in seconds: 2**31 - 1 ms, about 24.8
|
|
13
|
+
# days, the same bound as the .NET, erlang and perl SDKs'.
|
|
14
|
+
LONGEST_WAIT = 2_147_483.647
|
|
15
|
+
|
|
12
16
|
module_function
|
|
13
17
|
|
|
14
18
|
# `retry_if`, when given, is asked after each retryable failure, and a false
|
|
@@ -26,10 +30,16 @@ module InternetData
|
|
|
26
30
|
end
|
|
27
31
|
end
|
|
28
32
|
|
|
29
|
-
# A server-supplied delay
|
|
30
|
-
#
|
|
33
|
+
# A server-supplied delay wins, including a `Retry-After: 0`, which is the
|
|
34
|
+
# server saying "immediately" rather than saying nothing. One past
|
|
35
|
+
# LONGEST_WAIT is waited out on the backoff instead, still rate_limited:
|
|
36
|
+
# honored, `2147483648` held the call for 68 years, and `sleep` raised a raw
|
|
37
|
+
# RangeError for `9223372036854775807`.
|
|
31
38
|
def delay_for(error, attempt)
|
|
32
|
-
error.retry_after_seconds
|
|
39
|
+
asked = error.retry_after_seconds
|
|
40
|
+
return asked if asked && asked <= LONGEST_WAIT
|
|
41
|
+
|
|
42
|
+
BACKOFF_SECONDS * (2**(attempt - 1))
|
|
33
43
|
end
|
|
34
44
|
end
|
|
35
45
|
end
|
|
@@ -7,6 +7,23 @@ module InternetData
|
|
|
7
7
|
# The generated wire client, with the three things it gets wrong for this API
|
|
8
8
|
# corrected in one place.
|
|
9
9
|
class Transport < ApiClient
|
|
10
|
+
# The longest `timeout` curl holds, in seconds: 2**31 - 1 ms, about 24.8 days.
|
|
11
|
+
# libcurl refuses a longer one, and any negative, and Ethon ignores the
|
|
12
|
+
# refusal, so the call would run with no bound at all.
|
|
13
|
+
LONGEST_TIMEOUT = 2_147_483.647
|
|
14
|
+
|
|
15
|
+
# `timeout`, once it is a bound curl can hold: seconds, 0 for none. Refused
|
|
16
|
+
# where it is set, because nothing downstream refuses it: a negative ran with
|
|
17
|
+
# no bound, and NaN, Infinity, a number past curl's ceiling or a string failed
|
|
18
|
+
# every call with an error from Ruby, FFI or Ethon that names none of this.
|
|
19
|
+
# NaN fails both comparisons, and an infinity one of them.
|
|
20
|
+
def self.checked_timeout(timeout)
|
|
21
|
+
return timeout if timeout.is_a?(Numeric) && timeout.real? && timeout >= 0 && timeout <= LONGEST_TIMEOUT
|
|
22
|
+
|
|
23
|
+
raise ArgumentError,
|
|
24
|
+
"timeout must be a number of seconds from 0 (no bound) to #{LONGEST_TIMEOUT}, not #{timeout.inspect}"
|
|
25
|
+
end
|
|
26
|
+
|
|
10
27
|
# The generated Configuration applies a security scheme whatever it holds, so
|
|
11
28
|
# a keyless client would send `Authorization: Bearer ` - an empty credential,
|
|
12
29
|
# which the API answers 401 to rather than treating as no credential at all.
|
|
@@ -19,7 +36,7 @@ module InternetData
|
|
|
19
36
|
self.host = uri.port == uri.default_port ? uri.host : "#{uri.host}:#{uri.port}"
|
|
20
37
|
self.base_path = uri.path
|
|
21
38
|
self.access_token = api_key
|
|
22
|
-
self.timeout = timeout
|
|
39
|
+
self.timeout = timeout.nil? ? nil : Transport.checked_timeout(timeout)
|
|
23
40
|
end
|
|
24
41
|
|
|
25
42
|
# ONLY the bearer scheme, never `super`.
|
|
@@ -59,7 +76,7 @@ module InternetData
|
|
|
59
76
|
def build_request(http_method, path, opts = {})
|
|
60
77
|
request = super
|
|
61
78
|
request.options[:followlocation] = false
|
|
62
|
-
request.options[:timeout] = opts[:timeout] unless opts[:timeout].nil?
|
|
79
|
+
request.options[:timeout] = Transport.checked_timeout(opts[:timeout]) unless opts[:timeout].nil?
|
|
63
80
|
request
|
|
64
81
|
end
|
|
65
82
|
|
data/lib/internetdata/version.rb
CHANGED