google-apis-core 1.0.2 → 1.2.3
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/CHANGELOG.md +30 -0
- data/lib/google/api_client/auth/storage.rb +5 -0
- data/lib/google/api_client/auth/storages/file_store.rb +5 -0
- data/lib/google/api_client/auth/storages/redis_store.rb +6 -0
- data/lib/google/apis/core/base_service.rb +8 -0
- data/lib/google/apis/core/storage_upload.rb +29 -1
- data/lib/google/apis/core/version.rb +1 -1
- metadata +42 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 875da1ee3191009c4c597b589dd94e4047dd1e6a02e14ecacd2bd4e4ea238977
|
|
4
|
+
data.tar.gz: 6fb2e66161321b311d26c24cf6ce0eafffae04352933618dc0a38e987ed21f2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b22179a823a689cfe4257655f1a7943f63ae88bd0d0f14ae829d314c2b3fed24507cd874fae6915657b39dd4ecb3ac15488abbe3ef0b50957d96a0b7ad94887a
|
|
7
|
+
data.tar.gz: ad0018b7c5ffe8f2d43cbea3b32dc822b3ec9bfbe3a0eccb3566961661031203353a8c6eabc90a557740773c0ca6f717af0d1369dae2fde72ec6c0a22946baa2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 1.2.3 (2026-06-10)
|
|
4
|
+
|
|
5
|
+
#### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* upgrade addressable dependency to ~> 2.9 ([#26622](https://github.com/googleapis/google-api-ruby-client/issues/26622))
|
|
8
|
+
|
|
9
|
+
### 1.2.2 (2026-06-10)
|
|
10
|
+
|
|
11
|
+
#### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Relax retriable dependency constraint ([#26621](https://github.com/googleapis/google-api-ruby-client/issues/26621)) ([1511d44](https://github.com/googleapis/google-api-ruby-client/commit/1511d44e3945caebf41160e47cc42f7bdfdb5fe2)), closes [#26620](https://github.com/googleapis/google-api-ruby-client/issues/26620)
|
|
14
|
+
|
|
15
|
+
### 1.2.1 (2026-06-09)
|
|
16
|
+
|
|
17
|
+
#### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Add missing multi_json runtime dependency for representable ([#26612](https://github.com/googleapis/google-api-ruby-client/issues/26612)) ([16afc11](https://github.com/googleapis/google-api-ruby-client/commit/16afc118f58d64a1394f33b76133d69ce4632575)), closes [#26611](https://github.com/googleapis/google-api-ruby-client/issues/26611) [#26613](https://github.com/googleapis/google-api-ruby-client/issues/26613)
|
|
20
|
+
|
|
21
|
+
### 1.2.0 (2026-06-04)
|
|
22
|
+
|
|
23
|
+
#### Features
|
|
24
|
+
|
|
25
|
+
* ruby 3.2 minimum ([#26608](https://github.com/googleapis/google-api-ruby-client/issues/26608))
|
|
26
|
+
|
|
27
|
+
### 1.1.0 (2026-05-17)
|
|
28
|
+
|
|
29
|
+
#### Features
|
|
30
|
+
|
|
31
|
+
* adding checksum header ([#25157](https://github.com/googleapis/google-api-ruby-client/issues/25157))
|
|
32
|
+
|
|
3
33
|
### 1.0.2 (2025-09-09)
|
|
4
34
|
|
|
5
35
|
#### Bug Fixes
|
|
@@ -38,6 +38,11 @@ module Google
|
|
|
38
38
|
#
|
|
39
39
|
# @param [Object] store
|
|
40
40
|
# Storage object
|
|
41
|
+
#
|
|
42
|
+
# @note Warning: This class is part of a deprecated credentials flow.
|
|
43
|
+
# Providing an unvalidated credential configuration to Google APIs can
|
|
44
|
+
# compromise the security of your systems and data. Use
|
|
45
|
+
# google-auth-library-ruby instead.
|
|
41
46
|
def initialize(store)
|
|
42
47
|
@store= store
|
|
43
48
|
@authorization = nil
|
|
@@ -37,6 +37,11 @@ module Google
|
|
|
37
37
|
|
|
38
38
|
##
|
|
39
39
|
# Attempt to read in credentials from the specified file.
|
|
40
|
+
#
|
|
41
|
+
# @note Warning: This method is part of a deprecated credentials flow.
|
|
42
|
+
# Providing an unvalidated credential configuration to Google APIs can
|
|
43
|
+
# compromise the security of your systems and data. Use
|
|
44
|
+
# google-auth-library-ruby instead.
|
|
40
45
|
def load_credentials
|
|
41
46
|
open(path, 'r') { |f| JSON.parse(f.read) }
|
|
42
47
|
rescue
|
|
@@ -37,6 +37,12 @@ module Google
|
|
|
37
37
|
|
|
38
38
|
##
|
|
39
39
|
# Attempt to read in credentials from redis.
|
|
40
|
+
#
|
|
41
|
+
# @note Warning: This method is part of a deprecated credentials flow.
|
|
42
|
+
# Providing an unvalidated credential configuration to Google APIs can
|
|
43
|
+
# compromise the security of your systems and data. Use
|
|
44
|
+
# google-auth-library-ruby instead.
|
|
45
|
+
#
|
|
40
46
|
# @return [Hash]
|
|
41
47
|
def load_credentials
|
|
42
48
|
credentials = redis.get redis_credentials_key
|
|
@@ -421,6 +421,10 @@ module Google
|
|
|
421
421
|
template = Addressable::Template.new(root_url + upload_path + path)
|
|
422
422
|
command = StorageUploadCommand.new(method, template, client_version: client_version)
|
|
423
423
|
command.options = request_options.merge(options)
|
|
424
|
+
command.options.header = command.options.header&.dup || {}
|
|
425
|
+
unless command.options.header.any? { |k, _| k.to_s.casecmp('accept-encoding') == 0 }
|
|
426
|
+
command.options.header['Accept-Encoding'] = 'gzip'
|
|
427
|
+
end
|
|
424
428
|
apply_command_defaults(command)
|
|
425
429
|
command
|
|
426
430
|
end
|
|
@@ -459,6 +463,10 @@ module Google
|
|
|
459
463
|
template = Addressable::Template.new(root_url + base_path + path)
|
|
460
464
|
command = StorageDownloadCommand.new(method, template, client_version: client_version)
|
|
461
465
|
command.options = request_options.merge(options)
|
|
466
|
+
command.options.header = command.options.header&.dup || {}
|
|
467
|
+
unless command.options.header.any? { |k, _| k.to_s.casecmp('accept-encoding') == 0 }
|
|
468
|
+
command.options.header['Accept-Encoding'] = 'gzip'
|
|
469
|
+
end
|
|
462
470
|
command.query['alt'] = 'media'
|
|
463
471
|
apply_command_defaults(command)
|
|
464
472
|
command
|
|
@@ -176,6 +176,10 @@ module Google
|
|
|
176
176
|
request_header = header.dup
|
|
177
177
|
request_header[CONTENT_RANGE_HEADER] = get_content_range_header current_chunk_size
|
|
178
178
|
request_header[CONTENT_LENGTH_HEADER] = current_chunk_size.to_s
|
|
179
|
+
last_chunk = remaining_content_size <= current_chunk_size
|
|
180
|
+
formatted_string = formatted_checksum_header
|
|
181
|
+
request_header['X-Goog-Hash'] = formatted_string if (last_chunk && !formatted_string.empty?)
|
|
182
|
+
|
|
179
183
|
chunk_body =
|
|
180
184
|
if @upload_chunk_size == 0
|
|
181
185
|
upload_io
|
|
@@ -191,7 +195,7 @@ module Google
|
|
|
191
195
|
success(result)
|
|
192
196
|
rescue => e
|
|
193
197
|
logger.warn {
|
|
194
|
-
"error
|
|
198
|
+
"error occurred please use uploadId-#{response.headers['X-GUploader-UploadID']} to resume your upload"
|
|
195
199
|
} unless response.nil?
|
|
196
200
|
upload_io.pos = @offset
|
|
197
201
|
error(e, rethrow: true)
|
|
@@ -290,6 +294,30 @@ module Google
|
|
|
290
294
|
end
|
|
291
295
|
sprintf('bytes %s/%d', numerator, upload_io.size)
|
|
292
296
|
end
|
|
297
|
+
|
|
298
|
+
# Generates a formatted checksum header string from the request body.
|
|
299
|
+
#
|
|
300
|
+
# Parses the body as JSON and extracts checksum values for the keys "crc32c", "md5Hash", and "md5".
|
|
301
|
+
# The "md5Hash" key is renamed to "md5" in the output.
|
|
302
|
+
# Returns a comma-separated string in the format "key=value" for each present checksum.
|
|
303
|
+
#
|
|
304
|
+
# @example
|
|
305
|
+
# If the body contains:
|
|
306
|
+
# { "md5Hash": "1B2M2Y8AsgTpgAmY7PhCfg==",
|
|
307
|
+
# "crc32c": "AAAAAA==" }
|
|
308
|
+
# The method returns:
|
|
309
|
+
# "crc32c=AAAAAA==,md5=1B2M2Y8AsgTpgAmY7PhCfg=="
|
|
310
|
+
# @return [String] the formatted checksum header, or an empty string if no relevant keys are present
|
|
311
|
+
def formatted_checksum_header
|
|
312
|
+
hash_data = body.to_s.empty? ? {} : JSON.parse(body)
|
|
313
|
+
target_keys = ["crc32c", "md5Hash", "md5"]
|
|
314
|
+
selected_keys = hash_data.slice(*target_keys)
|
|
315
|
+
formatted_string = selected_keys.map do |key, value|
|
|
316
|
+
output_key = (key == "md5Hash") ? "md5" : key
|
|
317
|
+
"#{output_key}=#{value}"
|
|
318
|
+
end.join(',')
|
|
319
|
+
formatted_string
|
|
320
|
+
end
|
|
293
321
|
end
|
|
294
322
|
end
|
|
295
323
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-apis-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -10,53 +10,61 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
13
|
+
name: addressable
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '2.9'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '2.9'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
27
|
+
name: faraday
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '2.13'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '2.13'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: faraday-follow_redirects
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
47
|
-
- - ">="
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: 2.8.7
|
|
46
|
+
version: '0.3'
|
|
50
47
|
type: :runtime
|
|
51
48
|
prerelease: false
|
|
52
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
50
|
requirements:
|
|
54
51
|
- - "~>"
|
|
55
52
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '
|
|
57
|
-
|
|
53
|
+
version: '0.3'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: googleauth
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
58
59
|
- !ruby/object:Gem::Version
|
|
59
|
-
version:
|
|
60
|
+
version: '1.14'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '1.14'
|
|
60
68
|
- !ruby/object:Gem::Dependency
|
|
61
69
|
name: mini_mime
|
|
62
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,47 +80,53 @@ dependencies:
|
|
|
72
80
|
- !ruby/object:Gem::Version
|
|
73
81
|
version: '1.1'
|
|
74
82
|
- !ruby/object:Gem::Dependency
|
|
75
|
-
name:
|
|
83
|
+
name: multi_json
|
|
76
84
|
requirement: !ruby/object:Gem::Requirement
|
|
77
85
|
requirements:
|
|
78
86
|
- - "~>"
|
|
79
87
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '1.
|
|
88
|
+
version: '1.11'
|
|
81
89
|
type: :runtime
|
|
82
90
|
prerelease: false
|
|
83
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
84
92
|
requirements:
|
|
85
93
|
- - "~>"
|
|
86
94
|
- !ruby/object:Gem::Version
|
|
87
|
-
version: '1.
|
|
95
|
+
version: '1.11'
|
|
88
96
|
- !ruby/object:Gem::Dependency
|
|
89
|
-
name:
|
|
97
|
+
name: representable
|
|
90
98
|
requirement: !ruby/object:Gem::Requirement
|
|
91
99
|
requirements:
|
|
92
100
|
- - "~>"
|
|
93
101
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '
|
|
102
|
+
version: '3.0'
|
|
95
103
|
type: :runtime
|
|
96
104
|
prerelease: false
|
|
97
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
98
106
|
requirements:
|
|
99
107
|
- - "~>"
|
|
100
108
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: '
|
|
109
|
+
version: '3.0'
|
|
102
110
|
- !ruby/object:Gem::Dependency
|
|
103
|
-
name:
|
|
111
|
+
name: retriable
|
|
104
112
|
requirement: !ruby/object:Gem::Requirement
|
|
105
113
|
requirements:
|
|
106
|
-
- - "
|
|
114
|
+
- - ">="
|
|
107
115
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '
|
|
116
|
+
version: '3.1'
|
|
117
|
+
- - "<"
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: '5.0'
|
|
109
120
|
type: :runtime
|
|
110
121
|
prerelease: false
|
|
111
122
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
123
|
requirements:
|
|
113
|
-
- - "
|
|
124
|
+
- - ">="
|
|
114
125
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
126
|
+
version: '3.1'
|
|
127
|
+
- - "<"
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: '5.0'
|
|
116
130
|
email: googleapis-packages@google.com
|
|
117
131
|
executables: []
|
|
118
132
|
extensions: []
|
|
@@ -153,7 +167,7 @@ licenses:
|
|
|
153
167
|
metadata:
|
|
154
168
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
|
155
169
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
|
156
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v1.
|
|
170
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v1.2.3
|
|
157
171
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
|
158
172
|
rdoc_options: []
|
|
159
173
|
require_paths:
|
|
@@ -162,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
162
176
|
requirements:
|
|
163
177
|
- - ">="
|
|
164
178
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '3.
|
|
179
|
+
version: '3.2'
|
|
166
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
181
|
requirements:
|
|
168
182
|
- - ">="
|