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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b906fc99a99a411080813fa3b393740485e4e9f135be7770dc2ae9d561999755
4
- data.tar.gz: 631201184861b22cc6d80c89328747df129b3f4a8ee5b9b02887ed0bc7879868
3
+ metadata.gz: 12c7082ca48590c6f6e1cf40defabfd59cc125e675dc5ca7dbb95f0ccec0fcfd
4
+ data.tar.gz: d97c7139e7c73e801d549062072dc6b87641de2090080f3a053a7a9aeb8cd0dd
5
5
  SHA512:
6
- metadata.gz: a5e4728aa283c129d71622823ec3314110be7879a2d29a420fbc0d2f9ec998ab8005a663bf8cbbcc9949ff09e7613c538612aaa3f2f226de5e4e370bdb44116e
7
- data.tar.gz: 0feb92378a91ac6d133e042537b3084a376af760a8cdcb655273eb3326a2a28b9d584b66414a5f0227a3563d0b581957fb0603952ff2ae7dccec636e96217100
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
- domain = universe_domain.to_s.strip
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[:host] || "storage.googleapis.com"
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"
@@ -28,6 +28,10 @@ module Fog
28
28
  https_url(params, expires)
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
  private
32
36
 
33
37
  def host_path_query(params, expires)
@@ -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 :host, :port, :scheme, :persistent, :path_style
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.29.1".freeze
3
+ VERSION = "1.29.2".freeze
4
4
  end
5
5
  end
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.29.1
4
+ version: 1.29.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch