fog-google 1.29.1 → 1.29.2
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 +4 -0
- data/lib/fog/google/storage/storage_json/mock.rb +6 -0
- data/lib/fog/google/storage/storage_json/real.rb +4 -1
- data/lib/fog/google/storage/storage_json/utils.rb +5 -6
- 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 +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12c7082ca48590c6f6e1cf40defabfd59cc125e675dc5ca7dbb95f0ccec0fcfd
|
|
4
|
+
data.tar.gz: d97c7139e7c73e801d549062072dc6b87641de2090080f3a053a7a9aeb8cd0dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed382c3164e2d4310fd349c8273a82b0cef46248eac34a30055ff6c81c5089d7b5ef33a95da4e91d3580ae0830ab7558b94e949f41487bfe3ee4b060777d813d
|
|
7
|
+
data.tar.gz: ce7e5bb93b47e6edda9c21e51a872de0fca7a91c165cb64b27e9065838e13efdebe6553f1f1fb311bb104e248b5217aef43114311be000eff82625eff55c2361
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ 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.2
|
|
8
|
+
|
|
9
|
+
- #654 Fix missing host attribute and update storage XML driver to support universe domains
|
|
10
|
+
|
|
7
11
|
## 1.29.1
|
|
8
12
|
|
|
9
13
|
### User-facing
|
|
@@ -7,10 +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
|
|
12
14
|
api_base_url = storage_api_base_url_for_universe(universe_domain)
|
|
13
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
|
+
|
|
14
20
|
@client = MockClient.new('test')
|
|
15
21
|
@storage_json = MockClient.new('test')
|
|
16
22
|
@iam_service = MockClient.new('test')
|
|
@@ -7,7 +7,7 @@ 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 = {})
|
|
@@ -16,6 +16,9 @@ module Fog
|
|
|
16
16
|
shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, api_base_url)
|
|
17
17
|
options[:google_api_scope_url] = GOOGLE_STORAGE_JSON_API_SCOPE_URLS.join(" ")
|
|
18
18
|
|
|
19
|
+
# Set @host for compatibility with request methods (e.g., get_object_https_url)
|
|
20
|
+
@host = storage_host_for_universe(universe_domain)
|
|
21
|
+
|
|
19
22
|
# TODO(temikus): Do we even need this client?
|
|
20
23
|
@client = initialize_google_client(options)
|
|
21
24
|
|
|
@@ -28,13 +28,12 @@ module Fog
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def storage_host_for_universe(universe_domain)
|
|
32
|
+
Fog::Google::Storage::Utils.storage_host_for_universe(universe_domain)
|
|
33
|
+
end
|
|
34
|
+
|
|
31
35
|
def storage_base_url_for_universe(universe_domain)
|
|
32
|
-
|
|
33
|
-
if !domain.empty?
|
|
34
|
-
"https://storage.#{universe_domain}/"
|
|
35
|
-
else
|
|
36
|
-
Fog::Google::StorageJSON::GOOGLE_STORAGE_BUCKET_BASE_URL
|
|
37
|
-
end
|
|
36
|
+
"https://#{storage_host_for_universe(universe_domain)}/"
|
|
38
37
|
end
|
|
39
38
|
|
|
40
39
|
private
|
|
@@ -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