google-apis-core 0.12.0 → 0.13.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 +6 -0
- data/lib/google/apis/core/base_service.rb +19 -0
- data/lib/google/apis/core/version.rb +1 -1
- data/lib/google/apis/errors.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5592cfdc5672ba93edd2d35fdd156fe494910815832851915aa10671280f3819
|
4
|
+
data.tar.gz: 31ff2f0ba25e5aef16a8a328fae87c79f7e3beabf68254b44b5d0ca5c0af48ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c2299ce2530e251f931ac1e5aac2ac4f26a06e24272d4a85dab7f650748ba645149d133c199300bcd4c9931925286f3f5867cb6bf354ff1fc749e84a100a62
|
7
|
+
data.tar.gz: 0def58085570f51b1ea1695d8826a81142e78b03b2cd9508268c2a23d7651d86452390198d853757335b2025c17d8db08fbbbec0d46c969412c20a600b9cf129
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.13.0 (2024-01-26)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Verify credential universe domain against configured universe domain ([#17569](https://github.com/googleapis/google-api-ruby-client/issues/17569))
|
8
|
+
|
3
9
|
### 0.12.0 (2024-01-22)
|
4
10
|
|
5
11
|
#### Features
|
@@ -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]
|
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.13.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-01-
|
11
|
+
date: 2024-01-26 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.13.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: []
|