fog-google 1.27.0 → 1.29.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/.github/workflows/integration-compute-core.yml +1 -1
- data/.github/workflows/integration-compute-instance_groups.yml +1 -1
- data/.github/workflows/integration-compute-loadbalancing.yml +1 -1
- data/.github/workflows/integration-compute-networking.yml +1 -1
- data/.github/workflows/integration-monitoring.yml +1 -1
- data/.github/workflows/integration-pubsub.yml +1 -1
- data/.github/workflows/integration-sql.yml +1 -1
- data/.github/workflows/integration-storage.yml +1 -1
- data/.github/workflows/unit.yml +1 -1
- data/CHANGELOG.md +30 -0
- data/fog-google.gemspec +1 -0
- data/lib/fog/google/shared.rb +20 -3
- data/lib/fog/google/storage/storage_json/mock.rb +19 -1
- data/lib/fog/google/storage/storage_json/models/directory.rb +1 -1
- data/lib/fog/google/storage/storage_json/models/file.rb +1 -1
- data/lib/fog/google/storage/storage_json/real.rb +14 -3
- data/lib/fog/google/storage/storage_json/utils.rb +17 -0
- data/lib/fog/google/storage/storage_json.rb +1 -0
- data/lib/fog/google/storage/storage_xml/mock.rb +3 -0
- data/lib/fog/google/storage/storage_xml/real.rb +1 -1
- data/lib/fog/google/storage/storage_xml/utils.rb +4 -0
- data/lib/fog/google/storage/storage_xml.rb +1 -1
- data/lib/fog/google/storage.rb +14 -0
- data/lib/fog/google/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70267564198e1bf6559634d7a117abab84f75071dd4924103e5a2d95ffaf726a
|
|
4
|
+
data.tar.gz: 79ddefe25739fc06bb54752473fd11b9f48014e2d1c9f0eccf8c58e0896505bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24a13db6b1f8577285099248c14bf2a701b7a1995fab782f94d19bf4176ba037ebf02c1e8ada3bcf759b9f47bbfe357540be402141f4379e2a4ed9ee7ad9551b
|
|
7
|
+
data.tar.gz: a1ebe02f51befe24c8b7df2b9e0d4b2f8f60368353ce450771926b9c0de0b7d595c08ac692aafa402be7014bd5b2123ff48c933c03fd2cbc07e98bb950e50b8b
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
runs-on: fog-arc-runner
|
|
37
37
|
strategy:
|
|
38
38
|
matrix:
|
|
39
|
-
ruby-version: [ '3.
|
|
39
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
40
40
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
41
41
|
# TODO(fog-google#626): remove this once cleanup is fixed
|
|
42
42
|
max-parallel: 1
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
runs-on: fog-arc-runner
|
|
38
38
|
strategy:
|
|
39
39
|
matrix:
|
|
40
|
-
ruby-version: [ '3.
|
|
40
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
41
41
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
42
42
|
max-parallel: 1
|
|
43
43
|
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
runs-on: fog-arc-runner
|
|
38
38
|
strategy:
|
|
39
39
|
matrix:
|
|
40
|
-
ruby-version: [ '3.
|
|
40
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
41
41
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
42
42
|
max-parallel: 1
|
|
43
43
|
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
runs-on: fog-arc-runner
|
|
37
37
|
strategy:
|
|
38
38
|
matrix:
|
|
39
|
-
ruby-version: [ '3.
|
|
39
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
40
40
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
41
41
|
max-parallel: 1
|
|
42
42
|
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
runs-on: fog-arc-runner
|
|
38
38
|
strategy:
|
|
39
39
|
matrix:
|
|
40
|
-
ruby-version: [ '3.
|
|
40
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
41
41
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
42
42
|
max-parallel: 1
|
|
43
43
|
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
runs-on: fog-arc-runner
|
|
38
38
|
strategy:
|
|
39
39
|
matrix:
|
|
40
|
-
ruby-version: [ '3.
|
|
40
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
41
41
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
42
42
|
max-parallel: 1
|
|
43
43
|
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
runs-on: fog-arc-runner
|
|
38
38
|
strategy:
|
|
39
39
|
matrix:
|
|
40
|
-
ruby-version: [ '3.
|
|
40
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
41
41
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
42
42
|
max-parallel: 1
|
|
43
43
|
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
runs-on: fog-arc-runner
|
|
39
39
|
strategy:
|
|
40
40
|
matrix:
|
|
41
|
-
ruby-version: [ '3.
|
|
41
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
|
|
42
42
|
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
|
43
43
|
max-parallel: 1
|
|
44
44
|
|
data/.github/workflows/unit.yml
CHANGED
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
runs-on: ubuntu-latest
|
|
17
17
|
strategy:
|
|
18
18
|
matrix:
|
|
19
|
-
ruby-version: [ '3.
|
|
19
|
+
ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0', 'head', 'truffleruby-head']
|
|
20
20
|
|
|
21
21
|
steps:
|
|
22
22
|
- uses: actions/checkout@v6
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,36 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1
|
|
|
4
4
|
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## 1.29.3
|
|
8
|
+
|
|
9
|
+
- #656 Fix IAM credentials not setting universe domain properly
|
|
10
|
+
|
|
11
|
+
## 1.29.2
|
|
12
|
+
|
|
13
|
+
- #654 Fix missing host attribute and update storage XML driver to support universe domains
|
|
14
|
+
|
|
15
|
+
## 1.29.1
|
|
16
|
+
|
|
17
|
+
### User-facing
|
|
18
|
+
|
|
19
|
+
- #653 Ensure universe domain is applied to all services
|
|
20
|
+
|
|
21
|
+
## 1.29.0
|
|
22
|
+
|
|
23
|
+
### User-facing
|
|
24
|
+
|
|
25
|
+
- #652 Replace google_json_root_url with universe_domain
|
|
26
|
+
|
|
27
|
+
## 1.28.0
|
|
28
|
+
|
|
29
|
+
### User-facing
|
|
30
|
+
|
|
31
|
+
- #650 add support for custom storage endpoints
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
### Development changes
|
|
36
|
+
|
|
7
37
|
## 1.27.0
|
|
8
38
|
|
|
9
39
|
### User-facing
|
data/fog-google.gemspec
CHANGED
|
@@ -44,6 +44,7 @@ Gem::Specification.new do |spec|
|
|
|
44
44
|
spec.add_development_dependency "retriable"
|
|
45
45
|
spec.add_development_dependency "rake"
|
|
46
46
|
spec.add_development_dependency "minitest"
|
|
47
|
+
spec.add_development_dependency "minitest-mock"
|
|
47
48
|
spec.add_development_dependency "minitest-reporters"
|
|
48
49
|
spec.add_development_dependency "shindo"
|
|
49
50
|
spec.add_development_dependency "vcr"
|
data/lib/fog/google/shared.rb
CHANGED
|
@@ -88,9 +88,12 @@ module Fog
|
|
|
88
88
|
# Applies given options to the client instance
|
|
89
89
|
#
|
|
90
90
|
# @param [Google::Apis::Core::BaseService] service API service client instance
|
|
91
|
-
# @param [Hash] options (
|
|
91
|
+
# @param [Hash] options (:universe_domain, :google_client_options)
|
|
92
92
|
# @return [void]
|
|
93
93
|
def apply_client_options(service, options = {})
|
|
94
|
+
universe_domain = universe_domain_from_options(options)
|
|
95
|
+
service.universe_domain = universe_domain if universe_domain
|
|
96
|
+
|
|
94
97
|
google_client_options = options[:google_client_options]
|
|
95
98
|
return if google_client_options.nil? || google_client_options.empty?
|
|
96
99
|
|
|
@@ -157,12 +160,22 @@ module Fog
|
|
|
157
160
|
|
|
158
161
|
private
|
|
159
162
|
|
|
163
|
+
# Helper method to get universe domain from options or environment
|
|
164
|
+
#
|
|
165
|
+
# @param [Hash] options - client options hash
|
|
166
|
+
# @return [String, nil] - universe domain or nil
|
|
167
|
+
def universe_domain_from_options(options)
|
|
168
|
+
options[:universe_domain] || ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]
|
|
169
|
+
end
|
|
170
|
+
|
|
160
171
|
# Helper method to process application default authentication
|
|
161
172
|
#
|
|
162
173
|
# @param [Hash] options - client options hash
|
|
163
174
|
# @return [Google::Auth::DefaultCredentials] - google auth object
|
|
164
175
|
def process_application_default_auth(options)
|
|
165
|
-
|
|
176
|
+
google_options = options.slice(:universe_domain)
|
|
177
|
+
credentials = ::Google::Auth.get_application_default(options[:google_api_scope_url], google_options)
|
|
178
|
+
credentials
|
|
166
179
|
end
|
|
167
180
|
|
|
168
181
|
# Helper method to process fallback authentication
|
|
@@ -203,10 +216,14 @@ module Fog
|
|
|
203
216
|
|
|
204
217
|
validate_json_credentials(json_key)
|
|
205
218
|
|
|
206
|
-
::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
219
|
+
credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
207
220
|
:json_key_io => StringIO.new(json_key),
|
|
208
221
|
:scope => options[:google_api_scope_url]
|
|
209
222
|
)
|
|
223
|
+
|
|
224
|
+
universe_domain = universe_domain_from_options(options)
|
|
225
|
+
credentials.universe_domain = universe_domain if universe_domain && credentials.respond_to?(:universe_domain=)
|
|
226
|
+
credentials
|
|
210
227
|
end
|
|
211
228
|
|
|
212
229
|
# Helper method to sort out deprecated and missing auth options
|
|
@@ -7,8 +7,16 @@ module Fog
|
|
|
7
7
|
|
|
8
8
|
MockClient = Struct.new(:issuer)
|
|
9
9
|
|
|
10
|
+
attr_reader :host
|
|
11
|
+
|
|
10
12
|
def initialize(options = {})
|
|
11
|
-
|
|
13
|
+
@options = options.dup
|
|
14
|
+
api_base_url = storage_api_base_url_for_universe(universe_domain)
|
|
15
|
+
shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, api_base_url)
|
|
16
|
+
|
|
17
|
+
# Set @host for compatibility with request methods (e.g., get_object_https_url)
|
|
18
|
+
@host = storage_host_for_universe(universe_domain)
|
|
19
|
+
|
|
12
20
|
@client = MockClient.new('test')
|
|
13
21
|
@storage_json = MockClient.new('test')
|
|
14
22
|
@iam_service = MockClient.new('test')
|
|
@@ -18,9 +26,19 @@ module Fog
|
|
|
18
26
|
"foo"
|
|
19
27
|
end
|
|
20
28
|
|
|
29
|
+
def bucket_base_url
|
|
30
|
+
storage_base_url_for_universe(universe_domain)
|
|
31
|
+
end
|
|
32
|
+
|
|
21
33
|
def google_access_id
|
|
22
34
|
"my-account@project.iam.gserviceaccount"
|
|
23
35
|
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def universe_domain
|
|
40
|
+
universe_domain_from_options(@options)
|
|
41
|
+
end
|
|
24
42
|
end
|
|
25
43
|
end
|
|
26
44
|
end
|
|
@@ -7,14 +7,17 @@ module Fog
|
|
|
7
7
|
include Utils
|
|
8
8
|
include Fog::Google::Shared
|
|
9
9
|
|
|
10
|
-
attr_accessor :client
|
|
10
|
+
attr_accessor :client, :host
|
|
11
11
|
attr_reader :storage_json
|
|
12
12
|
|
|
13
13
|
def initialize(options = {})
|
|
14
|
-
shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
|
|
15
14
|
@options = options.dup
|
|
15
|
+
api_base_url = storage_api_base_url_for_universe(universe_domain)
|
|
16
|
+
shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, api_base_url)
|
|
16
17
|
options[:google_api_scope_url] = GOOGLE_STORAGE_JSON_API_SCOPE_URLS.join(" ")
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
# Set @host for compatibility with request methods (e.g., get_object_https_url)
|
|
20
|
+
@host = storage_host_for_universe(universe_domain)
|
|
18
21
|
|
|
19
22
|
# TODO(temikus): Do we even need this client?
|
|
20
23
|
@client = initialize_google_client(options)
|
|
@@ -27,6 +30,10 @@ module Fog
|
|
|
27
30
|
@storage_json.client_options.send_timeout_sec = options[:send_timeout_sec] if options[:send_timeout_sec]
|
|
28
31
|
end
|
|
29
32
|
|
|
33
|
+
def bucket_base_url
|
|
34
|
+
storage_base_url_for_universe(universe_domain)
|
|
35
|
+
end
|
|
36
|
+
|
|
30
37
|
def signature(params)
|
|
31
38
|
string_to_sign = <<-DATA
|
|
32
39
|
#{params[:method]}
|
|
@@ -74,6 +81,10 @@ DATA
|
|
|
74
81
|
|
|
75
82
|
private
|
|
76
83
|
|
|
84
|
+
def universe_domain
|
|
85
|
+
universe_domain_from_options(@options)
|
|
86
|
+
end
|
|
87
|
+
|
|
77
88
|
def google_access_id
|
|
78
89
|
@google_access_id ||= get_google_access_id
|
|
79
90
|
end
|
|
@@ -19,6 +19,23 @@ module Fog
|
|
|
19
19
|
https_url(params, expires)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def storage_api_base_url_for_universe(universe_domain)
|
|
23
|
+
domain = universe_domain.to_s.strip
|
|
24
|
+
if !domain.empty? && domain != "googleapis.com"
|
|
25
|
+
"https://storage.#{domain}/storage/"
|
|
26
|
+
else
|
|
27
|
+
Fog::Google::StorageJSON::GOOGLE_STORAGE_JSON_BASE_URL
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def storage_host_for_universe(universe_domain)
|
|
32
|
+
Fog::Google::Storage::Utils.storage_host_for_universe(universe_domain)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def storage_base_url_for_universe(universe_domain)
|
|
36
|
+
"https://#{storage_host_for_universe(universe_domain)}/"
|
|
37
|
+
end
|
|
38
|
+
|
|
22
39
|
private
|
|
23
40
|
|
|
24
41
|
def host_path_query(params, expires)
|
|
@@ -83,6 +83,7 @@ module Fog
|
|
|
83
83
|
|
|
84
84
|
def initialize(options = {})
|
|
85
85
|
@google_storage_access_key_id = options[:google_storage_access_key_id]
|
|
86
|
+
@host = storage_host_for_universe(options[:universe_domain])
|
|
86
87
|
end
|
|
87
88
|
|
|
88
89
|
def data
|
|
@@ -96,6 +97,8 @@ module Fog
|
|
|
96
97
|
def signature(_params)
|
|
97
98
|
"foo"
|
|
98
99
|
end
|
|
100
|
+
|
|
101
|
+
attr_reader :host
|
|
99
102
|
end
|
|
100
103
|
end
|
|
101
104
|
end
|
|
@@ -28,7 +28,7 @@ module Fog
|
|
|
28
28
|
@google_storage_secret_access_key = options[:google_storage_secret_access_key]
|
|
29
29
|
@connection_options = options[:connection_options] || {}
|
|
30
30
|
@hmac = Fog::HMAC.new("sha1", @google_storage_secret_access_key)
|
|
31
|
-
@host = options[:
|
|
31
|
+
@host = storage_host_for_universe(options[:universe_domain])
|
|
32
32
|
@persistent = options.fetch(:persistent, true)
|
|
33
33
|
@port = options[:port] || 443
|
|
34
34
|
@scheme = options[:scheme] || "https"
|
|
@@ -6,7 +6,7 @@ module Fog
|
|
|
6
6
|
autoload :Utils, "fog/google/storage/storage_xml/utils"
|
|
7
7
|
|
|
8
8
|
requires :google_storage_access_key_id, :google_storage_secret_access_key
|
|
9
|
-
recognizes :
|
|
9
|
+
recognizes :port, :scheme, :persistent, :path_style, :universe_domain
|
|
10
10
|
|
|
11
11
|
model_path "fog/google/storage/storage_xml/models"
|
|
12
12
|
collection :directories
|
data/lib/fog/google/storage.rb
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
module Fog
|
|
2
2
|
module Google
|
|
3
3
|
class Storage < Fog::Service
|
|
4
|
+
GOOGLE_STORAGE_HOST = "storage.googleapis.com".freeze
|
|
5
|
+
|
|
6
|
+
# Shared utilities for both JSON and XML storage implementations
|
|
7
|
+
module Utils
|
|
8
|
+
def self.storage_host_for_universe(universe_domain)
|
|
9
|
+
domain = universe_domain.to_s.strip
|
|
10
|
+
if !domain.empty? && domain != "googleapis.com"
|
|
11
|
+
"storage.#{domain}"
|
|
12
|
+
else
|
|
13
|
+
GOOGLE_STORAGE_HOST
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
4
18
|
def self.new(options = {})
|
|
5
19
|
begin
|
|
6
20
|
fog_creds = Fog.credentials
|
data/lib/fog/google/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fog-google
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.29.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nat Welch
|
|
@@ -246,6 +246,20 @@ dependencies:
|
|
|
246
246
|
- - ">="
|
|
247
247
|
- !ruby/object:Gem::Version
|
|
248
248
|
version: '0'
|
|
249
|
+
- !ruby/object:Gem::Dependency
|
|
250
|
+
name: minitest-mock
|
|
251
|
+
requirement: !ruby/object:Gem::Requirement
|
|
252
|
+
requirements:
|
|
253
|
+
- - ">="
|
|
254
|
+
- !ruby/object:Gem::Version
|
|
255
|
+
version: '0'
|
|
256
|
+
type: :development
|
|
257
|
+
prerelease: false
|
|
258
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
259
|
+
requirements:
|
|
260
|
+
- - ">="
|
|
261
|
+
- !ruby/object:Gem::Version
|
|
262
|
+
version: '0'
|
|
249
263
|
- !ruby/object:Gem::Dependency
|
|
250
264
|
name: minitest-reporters
|
|
251
265
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -789,7 +803,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
789
803
|
- !ruby/object:Gem::Version
|
|
790
804
|
version: '0'
|
|
791
805
|
requirements: []
|
|
792
|
-
rubygems_version: 3.
|
|
806
|
+
rubygems_version: 3.7.2
|
|
793
807
|
specification_version: 4
|
|
794
808
|
summary: Module for the 'fog' gem to support Google.
|
|
795
809
|
test_files: []
|