google-apis-core 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/google/apis/core/base_service.rb +23 -4
- data/lib/google/apis/core/storage_download.rb +1 -1
- data/lib/google/apis/core/version.rb +1 -1
- data/lib/google/apis/errors.rb +4 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b83b47db50d58c3a1efc038f62ae64ccf1127d8d038125bbd176c708ff45b43
|
4
|
+
data.tar.gz: 025314f14e0236c308afeee2d72da8e5a853ef9d1f7df9f5465721895fd3170f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3dcadef1c5c684db1d404a73322df1fd6096ddfae645aca4744b0a6517898688695a8728075320d4e7de3443c4865b6dfa5bcdc96a281d890aaa5769c1a0a2c
|
7
|
+
data.tar.gz: ccaf100ec3f25965d0ee7916a0e44646790b90448e205717c94664cb4218a58d599be31201bc805403e53ed791b797c2d9781b06a32787beb4172f18a9158028
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.14.0 (2024-02-23)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Update minimum Ruby version to 2.7 ([#17896](https://github.com/googleapis/google-api-ruby-client/issues/17896))
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* allow BaseService#root_url to be an Addressable::URI ([#17895](https://github.com/googleapis/google-api-ruby-client/issues/17895))
|
11
|
+
|
12
|
+
### 0.13.0 (2024-01-26)
|
13
|
+
|
14
|
+
#### Features
|
15
|
+
|
16
|
+
* Verify credential universe domain against configured universe domain ([#17569](https://github.com/googleapis/google-api-ruby-client/issues/17569))
|
17
|
+
|
3
18
|
### 0.12.0 (2024-01-22)
|
4
19
|
|
5
20
|
#### Features
|
@@ -119,16 +119,16 @@ module Google
|
|
119
119
|
end
|
120
120
|
|
121
121
|
# Root URL (host/port) for the API
|
122
|
-
# @return [Addressable::URI]
|
122
|
+
# @return [Addressable::URI, String]
|
123
123
|
attr_reader :root_url
|
124
124
|
|
125
125
|
# Set the root URL.
|
126
126
|
# If the given url includes a universe domain substitution, it is
|
127
127
|
# resolved in the current universe domain
|
128
128
|
#
|
129
|
-
# @param url_or_template [String] The URL, which can include a universe domain substitution
|
129
|
+
# @param url_or_template [Addressable::URI, String] The URL, which can include a universe domain substitution
|
130
130
|
def root_url= url_or_template
|
131
|
-
if url_or_template.include?
|
131
|
+
if url_or_template.is_a?(String) && url_or_template.include?(ENDPOINT_SUBSTITUTION)
|
132
132
|
@root_url_template = url_or_template
|
133
133
|
@root_url = url_or_template.gsub ENDPOINT_SUBSTITUTION, universe_domain
|
134
134
|
else
|
@@ -319,7 +319,7 @@ module Google
|
|
319
319
|
# Name of the field in the result containing the items. Defaults to :items
|
320
320
|
# @param [Boolean] cache
|
321
321
|
# True (default) if results should be cached so multiple iterations can be used.
|
322
|
-
# @return [
|
322
|
+
# @return [Enumerable]
|
323
323
|
# @yield [token, service]
|
324
324
|
# Current page token & service instance
|
325
325
|
# @yieldparam [String] token
|
@@ -336,6 +336,20 @@ module Google
|
|
336
336
|
return PagedResults.new(self, max: max, items: items, cache: cache, response_page_token: response_page_token, &block)
|
337
337
|
end
|
338
338
|
|
339
|
+
# Verify that the universe domain setting matches the universe domain
|
340
|
+
# in the credentials, if present.
|
341
|
+
#
|
342
|
+
# @raise [Google::Apis::UniverseDomainError] if there is a mismatch
|
343
|
+
def verify_universe_domain!
|
344
|
+
auth = authorization
|
345
|
+
auth_universe_domain = auth.universe_domain if auth.respond_to? :universe_domain
|
346
|
+
if auth_universe_domain && auth_universe_domain != universe_domain
|
347
|
+
raise UniverseDomainError,
|
348
|
+
"Universe domain is #{universe_domain} but credentials are in #{auth_universe_domain}"
|
349
|
+
end
|
350
|
+
true
|
351
|
+
end
|
352
|
+
|
339
353
|
protected
|
340
354
|
|
341
355
|
# Create a new upload command.
|
@@ -348,6 +362,7 @@ module Google
|
|
348
362
|
# Request-specific options
|
349
363
|
# @return [Google::Apis::Core::UploadCommand]
|
350
364
|
def make_upload_command(method, path, options)
|
365
|
+
verify_universe_domain!
|
351
366
|
template = Addressable::Template.new(root_url + upload_path + path)
|
352
367
|
if batch?
|
353
368
|
command = MultipartUploadCommand.new(method, template, client_version: client_version)
|
@@ -372,6 +387,7 @@ module Google
|
|
372
387
|
# Request-specific options
|
373
388
|
# @return [Google::Apis::Core::StorageUploadCommand]
|
374
389
|
def make_storage_upload_command(method, path, options)
|
390
|
+
verify_universe_domain!
|
375
391
|
template = Addressable::Template.new(root_url + upload_path + path)
|
376
392
|
command = StorageUploadCommand.new(method, template, client_version: client_version)
|
377
393
|
command.options = request_options.merge(options)
|
@@ -389,6 +405,7 @@ module Google
|
|
389
405
|
# Request-specific options
|
390
406
|
# @return [Google::Apis::Core::DownloadCommand]
|
391
407
|
def make_download_command(method, path, options)
|
408
|
+
verify_universe_domain!
|
392
409
|
template = Addressable::Template.new(root_url + base_path + path)
|
393
410
|
command = DownloadCommand.new(method, template, client_version: client_version)
|
394
411
|
command.options = request_options.merge(options)
|
@@ -408,6 +425,7 @@ module Google
|
|
408
425
|
# Request-specific options
|
409
426
|
# @return [Google::Apis::Core::StorageDownloadCommand]
|
410
427
|
def make_storage_download_command(method, path, options)
|
428
|
+
verify_universe_domain!
|
411
429
|
template = Addressable::Template.new(root_url + base_path + path)
|
412
430
|
command = StorageDownloadCommand.new(method, template, client_version: client_version)
|
413
431
|
command.options = request_options.merge(options)
|
@@ -426,6 +444,7 @@ module Google
|
|
426
444
|
# Request-specific options
|
427
445
|
# @return [Google::Apis::Core::DownloadCommand]
|
428
446
|
def make_simple_command(method, path, options)
|
447
|
+
verify_universe_domain!
|
429
448
|
full_path =
|
430
449
|
if path.start_with? "/"
|
431
450
|
path[1..-1]
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
|
26
26
|
# Execute the upload request once. Overrides the default implementation to handle streaming/chunking
|
27
27
|
# of file content.
|
28
|
-
# Note: This method is
|
28
|
+
# Note: This method is overridden from DownloadCommand in order to respond back with
|
29
29
|
# http header. All changes made to `execute_once` of DownloadCommand, should be made
|
30
30
|
# here too.
|
31
31
|
#
|
data/lib/google/apis/errors.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|
@@ -166,7 +166,7 @@ licenses:
|
|
166
166
|
metadata:
|
167
167
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
168
168
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
169
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.
|
169
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.14.0
|
170
170
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
171
171
|
post_install_message:
|
172
172
|
rdoc_options: []
|
@@ -176,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
176
|
requirements:
|
177
177
|
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '2.
|
179
|
+
version: '2.7'
|
180
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
181
|
requirements:
|
182
182
|
- - ">="
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
|
-
rubygems_version: 3.5.
|
186
|
+
rubygems_version: 3.5.6
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Common utility and base classes for legacy Google REST clients
|