internetdata 2.6.4 → 2.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd47ed11a5c7584109ee4cd24d9a80355735d93ab75f34b2e259d00c7bf5a1c
4
- data.tar.gz: b1e54653b61eecfc115d38f31479419189ceef73892117c392340c07edfd7b7d
3
+ metadata.gz: 53157834d0e85447843c18f5d10576a062df513f1f04f2d16b65f80eb59c7bc7
4
+ data.tar.gz: e48e8161d4bc0ae3221fdcb0077c7096e313e8ae8bfb5c0a1ef368afc57037dd
5
5
  SHA512:
6
- metadata.gz: 2103eda9f58619d97eea99a26cba2eabdb00f766a4a2baaa2b71c17f1bffb5bc10f34ea322e5614010d8e8a65d27afb7b9371d2cbe4249187363aabb225e7581
7
- data.tar.gz: e2997411f2e09d36b335c0c55ad1a2e8a9df52e1b413ad686502c712536d587cd16f50b391b07d7500602e0bfd90733a4148c69109cc6cb5a5798139125ac417
6
+ metadata.gz: 42a0b3bc5ac34cfb412a378bedf9c84a95c328b0805d4fad161ac53b0041b478a384787f8863323a78d1eb8b68b694071ef389acf7bd3e0f9e1ae83e526578ef
7
+ data.tar.gz: d4038ce5a7d0b51678d17349c7c856231b171b54f6d155017efb47fa7ec7cf2a5d71a491cddc27db98caae33a348c008bf24e9e2c5d763443eb5879247ee43ac
data/README.md CHANGED
@@ -154,6 +154,18 @@ token = client.oauth.exchange_authorization_code('your-client-id', code, pkce.ve
154
154
 
155
155
  Check that `state` came back as you sent it before you exchange `code`, which works once. The client ID can also be the https URL of a client metadata document your app serves, and such an app is never handed a key, so `token.apikey` stays `nil`.
156
156
 
157
+ ### Register a client
158
+
159
+ An app with no client ID, and no client metadata document to use as one, registers itself and signs in with the `client_id` it gets back:
160
+
161
+ ```ruby
162
+ client = InternetData::Client.new
163
+ registration = client.oauth.register(['http://127.0.0.1:8765/callback'], client_name: 'Your App')
164
+ # registration.client_id is the client ID for authorization_url and exchange_authorization_code.
165
+ ```
166
+
167
+ Each redirect URI must be https on a public host name, or http on a loopback address, which then matches any port. Nothing is kept until a person approves the client, so an app with no client ID saved can simply register again.
168
+
157
169
  ## Other Libraries
158
170
 
159
171
  There are official InternetData client libraries available for many languages including PHP, Python, Go, Java, and Ruby. See our GitHub at https://github.com/internetdata for more.
@@ -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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -0,0 +1,306 @@
1
+ =begin
2
+ #InternetData API
3
+
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
+
6
+ The version of the OpenAPI document: 2026.10.16
7
+ Contact: support@internetdata.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module InternetData
17
+ class ClientRegistration < ApiModelBase
18
+ attr_accessor :client_id
19
+
20
+ # Unix seconds.
21
+ attr_accessor :client_id_issued_at
22
+
23
+ # As the person will see it.
24
+ attr_accessor :client_name
25
+
26
+ attr_accessor :redirect_uris
27
+
28
+ # `authorization_code` and `refresh_token`.
29
+ attr_accessor :grant_types
30
+
31
+ attr_accessor :response_types
32
+
33
+ # Always `none`.
34
+ attr_accessor :token_endpoint_auth_method
35
+
36
+ # The most this client may be granted: `apikeys.use`.
37
+ attr_accessor :scope
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'client_id' => :'client_id',
43
+ :'client_id_issued_at' => :'client_id_issued_at',
44
+ :'client_name' => :'client_name',
45
+ :'redirect_uris' => :'redirect_uris',
46
+ :'grant_types' => :'grant_types',
47
+ :'response_types' => :'response_types',
48
+ :'token_endpoint_auth_method' => :'token_endpoint_auth_method',
49
+ :'scope' => :'scope'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'client_id' => :'String',
67
+ :'client_id_issued_at' => :'Integer',
68
+ :'client_name' => :'String',
69
+ :'redirect_uris' => :'Array<String>',
70
+ :'grant_types' => :'Array<String>',
71
+ :'response_types' => :'Array<String>',
72
+ :'token_endpoint_auth_method' => :'String',
73
+ :'scope' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::ClientRegistration` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::ClientRegistration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'client_id')
100
+ self.client_id = attributes[:'client_id']
101
+ else
102
+ self.client_id = nil
103
+ end
104
+
105
+ if attributes.key?(:'client_id_issued_at')
106
+ self.client_id_issued_at = attributes[:'client_id_issued_at']
107
+ else
108
+ self.client_id_issued_at = nil
109
+ end
110
+
111
+ if attributes.key?(:'client_name')
112
+ self.client_name = attributes[:'client_name']
113
+ else
114
+ self.client_name = nil
115
+ end
116
+
117
+ if attributes.key?(:'redirect_uris')
118
+ if (value = attributes[:'redirect_uris']).is_a?(Array)
119
+ self.redirect_uris = value
120
+ end
121
+ else
122
+ self.redirect_uris = nil
123
+ end
124
+
125
+ if attributes.key?(:'grant_types')
126
+ if (value = attributes[:'grant_types']).is_a?(Array)
127
+ self.grant_types = value
128
+ end
129
+ end
130
+
131
+ if attributes.key?(:'response_types')
132
+ if (value = attributes[:'response_types']).is_a?(Array)
133
+ self.response_types = value
134
+ end
135
+ end
136
+
137
+ if attributes.key?(:'token_endpoint_auth_method')
138
+ self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method']
139
+ else
140
+ self.token_endpoint_auth_method = nil
141
+ end
142
+
143
+ if attributes.key?(:'scope')
144
+ self.scope = attributes[:'scope']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ if @client_id.nil?
154
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
155
+ end
156
+
157
+ if @client_id_issued_at.nil?
158
+ invalid_properties.push('invalid value for "client_id_issued_at", client_id_issued_at cannot be nil.')
159
+ end
160
+
161
+ if @client_name.nil?
162
+ invalid_properties.push('invalid value for "client_name", client_name cannot be nil.')
163
+ end
164
+
165
+ if @redirect_uris.nil?
166
+ invalid_properties.push('invalid value for "redirect_uris", redirect_uris cannot be nil.')
167
+ end
168
+
169
+ if @token_endpoint_auth_method.nil?
170
+ invalid_properties.push('invalid value for "token_endpoint_auth_method", token_endpoint_auth_method cannot be nil.')
171
+ end
172
+
173
+ invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ warn '[DEPRECATED] the `valid?` method is obsolete'
180
+ return false if @client_id.nil?
181
+ return false if @client_id_issued_at.nil?
182
+ return false if @client_name.nil?
183
+ return false if @redirect_uris.nil?
184
+ return false if @token_endpoint_auth_method.nil?
185
+ true
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] client_id Value to be assigned
190
+ def client_id=(client_id)
191
+ if client_id.nil?
192
+ fail ArgumentError, 'client_id cannot be nil'
193
+ end
194
+
195
+ @client_id = client_id
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] client_id_issued_at Value to be assigned
200
+ def client_id_issued_at=(client_id_issued_at)
201
+ if client_id_issued_at.nil?
202
+ fail ArgumentError, 'client_id_issued_at cannot be nil'
203
+ end
204
+
205
+ @client_id_issued_at = client_id_issued_at
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] client_name Value to be assigned
210
+ def client_name=(client_name)
211
+ if client_name.nil?
212
+ fail ArgumentError, 'client_name cannot be nil'
213
+ end
214
+
215
+ @client_name = client_name
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] redirect_uris Value to be assigned
220
+ def redirect_uris=(redirect_uris)
221
+ if redirect_uris.nil?
222
+ fail ArgumentError, 'redirect_uris cannot be nil'
223
+ end
224
+
225
+ @redirect_uris = redirect_uris
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] token_endpoint_auth_method Value to be assigned
230
+ def token_endpoint_auth_method=(token_endpoint_auth_method)
231
+ if token_endpoint_auth_method.nil?
232
+ fail ArgumentError, 'token_endpoint_auth_method cannot be nil'
233
+ end
234
+
235
+ @token_endpoint_auth_method = token_endpoint_auth_method
236
+ end
237
+
238
+ # Checks equality by comparing each attribute.
239
+ # @param [Object] Object to be compared
240
+ def ==(o)
241
+ return true if self.equal?(o)
242
+ self.class == o.class &&
243
+ client_id == o.client_id &&
244
+ client_id_issued_at == o.client_id_issued_at &&
245
+ client_name == o.client_name &&
246
+ redirect_uris == o.redirect_uris &&
247
+ grant_types == o.grant_types &&
248
+ response_types == o.response_types &&
249
+ token_endpoint_auth_method == o.token_endpoint_auth_method &&
250
+ scope == o.scope
251
+ end
252
+
253
+ # @see the `==` method
254
+ # @param [Object] Object to be compared
255
+ def eql?(o)
256
+ self == o
257
+ end
258
+
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Integer] Hash code
261
+ def hash
262
+ [client_id, client_id_issued_at, client_name, redirect_uris, grant_types, response_types, token_endpoint_auth_method, scope].hash
263
+ end
264
+
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
268
+ def self.build_from_hash(attributes)
269
+ return nil unless attributes.is_a?(Hash)
270
+ attributes = attributes.transform_keys(&:to_sym)
271
+ transformed_hash = {}
272
+ openapi_types.each_pair do |key, type|
273
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = nil
275
+ elsif type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[attribute_map[key]].is_a?(Array)
279
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
280
+ end
281
+ elsif !attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
283
+ end
284
+ end
285
+ new(transformed_hash)
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ end
305
+
306
+ end
@@ -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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -36,6 +36,9 @@ module InternetData
36
36
  # Any client may sign in with an https `client_id` serving its own metadata.
37
37
  attr_accessor :client_id_metadata_document_supported
38
38
 
39
+ # RFC 7591 dynamic client registration, for a client that cannot serve its own metadata.
40
+ attr_accessor :registration_endpoint
41
+
39
42
  # Always `none`. Every client is public and has no secret.
40
43
  attr_accessor :token_endpoint_auth_methods_supported
41
44
 
@@ -57,6 +60,7 @@ module InternetData
57
60
  :'grant_types_supported' => :'grant_types_supported',
58
61
  :'code_challenge_methods_supported' => :'code_challenge_methods_supported',
59
62
  :'client_id_metadata_document_supported' => :'client_id_metadata_document_supported',
63
+ :'registration_endpoint' => :'registration_endpoint',
60
64
  :'token_endpoint_auth_methods_supported' => :'token_endpoint_auth_methods_supported',
61
65
  :'authorization_response_iss_parameter_supported' => :'authorization_response_iss_parameter_supported',
62
66
  :'service_documentation' => :'service_documentation'
@@ -86,6 +90,7 @@ module InternetData
86
90
  :'grant_types_supported' => :'Array<String>',
87
91
  :'code_challenge_methods_supported' => :'Array<String>',
88
92
  :'client_id_metadata_document_supported' => :'Boolean',
93
+ :'registration_endpoint' => :'String',
89
94
  :'token_endpoint_auth_methods_supported' => :'Array<String>',
90
95
  :'authorization_response_iss_parameter_supported' => :'Boolean',
91
96
  :'service_documentation' => :'String'
@@ -168,6 +173,10 @@ module InternetData
168
173
  self.client_id_metadata_document_supported = attributes[:'client_id_metadata_document_supported']
169
174
  end
170
175
 
176
+ if attributes.key?(:'registration_endpoint')
177
+ self.registration_endpoint = attributes[:'registration_endpoint']
178
+ end
179
+
171
180
  if attributes.key?(:'token_endpoint_auth_methods_supported')
172
181
  if (value = attributes[:'token_endpoint_auth_methods_supported']).is_a?(Array)
173
182
  self.token_endpoint_auth_methods_supported = value
@@ -258,6 +267,7 @@ module InternetData
258
267
  grant_types_supported == o.grant_types_supported &&
259
268
  code_challenge_methods_supported == o.code_challenge_methods_supported &&
260
269
  client_id_metadata_document_supported == o.client_id_metadata_document_supported &&
270
+ registration_endpoint == o.registration_endpoint &&
261
271
  token_endpoint_auth_methods_supported == o.token_endpoint_auth_methods_supported &&
262
272
  authorization_response_iss_parameter_supported == o.authorization_response_iss_parameter_supported &&
263
273
  service_documentation == o.service_documentation
@@ -272,7 +282,7 @@ module InternetData
272
282
  # Calculates hash code according to all attributes.
273
283
  # @return [Integer] Hash code
274
284
  def 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
285
+ [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, registration_endpoint, token_endpoint_auth_methods_supported, authorization_response_iss_parameter_supported, service_documentation].hash
276
286
  end
277
287
 
278
288
  # 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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
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.10.15
6
+ The version of the OpenAPI document: 2026.10.16
7
7
  Contact: support@internetdata.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -32,7 +32,7 @@ module InternetData
32
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, 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.
35
+ # Not part of OAuth, and only for our own clients: a client that signed in with a Client ID Metadata Document or registered itself 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.
@@ -36,6 +36,7 @@ module InternetData
36
36
  TOKEN_PATH = '/oauth/token'
37
37
  REVOKE_PATH = '/oauth/revoke'
38
38
  AUTHORIZE_PATH = '/oauth/authorize'
39
+ REGISTER_PATH = '/oauth/register'
39
40
  DEVICE_CODE_GRANT = 'urn:ietf:params:oauth:grant-type:device_code'
40
41
  # The longest single `sleep` the poll asks Ruby for, in seconds.
41
42
  LONGEST_SLEEP = 2**31 - 1
@@ -45,6 +46,7 @@ module InternetData
45
46
  OauthMetadata => %i[issuer authorization_endpoint token_endpoint],
46
47
  DeviceAuthorization => %i[device_code user_code verification_uri expires_in interval],
47
48
  TokenResponse => %i[access_token token_type expires_in],
49
+ ClientRegistration => %i[client_id client_id_issued_at client_name redirect_uris token_endpoint_auth_method],
48
50
  }.freeze
49
51
 
50
52
  def initialize(transport, retries:)
@@ -151,6 +153,31 @@ module InternetData
151
153
  [Digest::SHA256.digest(verifier)].pack('m0').tr('+/', '-_').delete('=')
152
154
  end
153
155
 
156
+ # Register a client for the authorization code flow, for an app that cannot
157
+ # serve a Client ID Metadata Document, and get its `client_id` for
158
+ # {#authorization_url} and {#exchange_authorization_code}.
159
+ #
160
+ # Each redirect URI must be https on a public host name, or http on a
161
+ # loopback address, which then matches on any port; the server refuses any
162
+ # other with {OauthRequestError} coded `invalid_redirect_uri`. Nothing is kept
163
+ # until a person approves the client, so registering again costs nothing, and
164
+ # this is retried like a read. No URI at all, or one that is empty or not
165
+ # UTF-8, raises ArgumentError before anything is sent.
166
+ #
167
+ # @param client_name [String, nil] shown to the person as the client's own
168
+ # claim; left out when empty.
169
+ # @return [ClientRegistration]
170
+ def register(redirect_uris, client_name: nil, timeout: nil)
171
+ raise ArgumentError, 'redirect_uris must list at least one URI' unless redirect_uris.is_a?(Array) && !redirect_uris.empty?
172
+
173
+ body = { 'redirect_uris' => redirect_uris.each_with_index.map { |uri, i| utf8!("redirect_uris[#{i}]", uri) } }
174
+ name = client_name.nil? ? '' : utf8!('client_name', client_name, empty: true)
175
+ body['client_name'] = name unless name.empty?
176
+ Retries.with_retries(@retries) do
177
+ decode(ClientRegistration, @transport.oauth_request(:POST, REGISTER_PATH, json: body, timeout: timeout).run)
178
+ end
179
+ end
180
+
154
181
  # Revoke an access or refresh token. A refresh token ends the whole grant and
155
182
  # every token it issued, which is how a machine signs out.
156
183
  #
@@ -226,6 +253,18 @@ module InternetData
226
253
  raise ArgumentError, "#{name} is not valid UTF-8"
227
254
  end
228
255
 
256
+ def utf8!(name, value, empty: false)
257
+ raise ArgumentError, "#{name} must be a String" unless value.is_a?(String)
258
+ raise ArgumentError, "#{name} must not be empty" if value.empty? && !empty
259
+
260
+ utf8 = value.encode(Encoding::UTF_8)
261
+ raise ArgumentError, "#{name} is not valid UTF-8" unless utf8.valid_encoding?
262
+
263
+ utf8
264
+ rescue EncodingError
265
+ raise ArgumentError, "#{name} is not valid UTF-8"
266
+ end
267
+
229
268
  def exchange(form, timeout)
230
269
  decode(TokenResponse, @transport.oauth_request(:POST, TOKEN_PATH, form: form, timeout: timeout).run)
231
270
  end
@@ -141,11 +141,13 @@ module InternetData
141
141
  #
142
142
  # The form is encoded here rather than by curl, so a `+` in a value leaves as
143
143
  # `%2B` and never arrives as a space.
144
- def oauth_request(http_method, path, form: nil, timeout: nil)
144
+ def oauth_request(http_method, path, form: nil, json: nil, timeout: nil)
145
145
  headers = { 'Accept' => 'application/json' }
146
146
  headers['Content-Type'] = 'application/x-www-form-urlencoded' unless form.nil?
147
+ headers['Content-Type'] = 'application/json' unless json.nil?
147
148
  request = build_request(http_method, path, header_params: headers, auth_names: [], timeout: timeout)
148
149
  request.options[:body] = URI.encode_www_form(form) unless form.nil?
150
+ request.options[:body] = JSON.generate(json) unless json.nil?
149
151
  request
150
152
  end
151
153
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InternetData
4
- VERSION = '2.6.4'
4
+ VERSION = '2.8.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: internetdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mslm Dev
@@ -42,6 +42,7 @@ files:
42
42
  - lib/internetdata/configuration.rb
43
43
  - lib/internetdata/database_api.rb
44
44
  - lib/internetdata/errors.rb
45
+ - lib/internetdata/models/client_registration.rb
45
46
  - lib/internetdata/models/database.rb
46
47
  - lib/internetdata/models/database_checksums_response.rb
47
48
  - lib/internetdata/models/database_format.rb