fog-google 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c887d0e4ec298a9bae19c3635d07d50c5087127f
4
- data.tar.gz: 7eb641c583f2f23f672412761f37597cc1f61f35
3
+ metadata.gz: 25266cee5f8d646f7c52eb9b8f5040bb44ccc3a8
4
+ data.tar.gz: 4c63ac801d14caa7b5c5f2f545ebd5dcc5d1835e
5
5
  SHA512:
6
- metadata.gz: 3bb2bc0e0bebc53d38bca1ffb78f6a427096d0db14ff3d45f9957d2a4d9ff29e2e7ab4d4a2effe0b3f1a448e69ecd051e1d7a4ebb4f014a64bb436e286e1b301
7
- data.tar.gz: 55d52662b1df470355ad29f35cfa88b406006c5da95153db7cdbc458bc3424ec9275accf55a1ff81df9aa8b66d53102ef07a53f5f6f54f1412151fc5c89c7cd3
6
+ metadata.gz: a3f4e3e6c0e68f49849008d7acae31157b8ace0fbec57a3f2d04a0d8b5ca9c38e86728b9ba16323e5304443dc1eab1b7f41e71659056915b66f8179d52b443dc
7
+ data.tar.gz: 61d194a1b0f993e4169bb8e368df19c4e3612bc53ade56be246a6356675593e7f6acdd42882c337c22fb37b412151098cdae6a0288bdffa7b7354e57bf87b210
data/CONTRIBUTORS.md CHANGED
@@ -1,6 +1,7 @@
1
1
  With also previous help from unnamed Google employees and [Fog contributors](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md)
2
2
 
3
3
  * Akshay Moghe <amoghe@maginatics.com>
4
+ * Alessio Caiazza <acaiazza@gitlab.com>
4
5
  * Alex Coomans <alex@alexcoomans.com>
5
6
  * Alexander Kolesen <akolesen@iron.io>
6
7
  * Alexander Lomov <lomov.as@gmail.com>
@@ -425,10 +425,9 @@ module Fog
425
425
 
426
426
  options = attributes.reject { |_, v| v.nil? }
427
427
 
428
- if service_accounts && service_accounts[:scopes]
429
- options[:service_accounts] = service_accounts.merge(
430
- :scopes => map_scopes(service_accounts[:scopes])
431
- )
428
+ if service_accounts && service_accounts[0]
429
+ service_accounts[0][:scopes] = map_scopes(service_accounts[0][:scopes])
430
+ options[:service_accounts] = service_accounts
432
431
  end
433
432
 
434
433
  if attributes[:external_ip]
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.2.2".freeze
3
+ VERSION = "1.3.0".freeze
4
4
  end
5
5
  end
@@ -44,6 +44,7 @@ module Fog
44
44
  request :copy_object
45
45
  request :delete_bucket
46
46
  request :delete_object
47
+ request :delete_object_url
47
48
  request :get_bucket
48
49
  request :get_bucket_acl
49
50
  request :get_object
@@ -0,0 +1,39 @@
1
+ module Fog
2
+ module Storage
3
+ class GoogleJSON
4
+ class Real
5
+ # Get an expiring object url from Google Storage for deleting an object
6
+ # https://cloud.google.com/storage/docs/access-control#Signed-URLs
7
+ #
8
+ # @param bucket_name [String] Name of bucket containing object
9
+ # @param object_name [String] Name of object to get expiring url for
10
+ # @param expires [Time] Expiry time for this URL
11
+ #
12
+ # @return [String] Expiring object https URL
13
+ def delete_object_url(bucket_name, object_name, expires)
14
+ raise ArgumentError.new("bucket_name is required") unless bucket_name
15
+ raise ArgumentError.new("object_name is required") unless object_name
16
+ https_url({
17
+ :headers => {},
18
+ :host => @host,
19
+ :method => "DELETE",
20
+ :path => "#{bucket_name}/#{object_name}"
21
+ }, expires)
22
+ end
23
+ end
24
+
25
+ class Mock
26
+ def delete_object_url(bucket_name, object_name, expires)
27
+ raise ArgumentError.new("bucket_name is required") unless bucket_name
28
+ raise ArgumentError.new("object_name is required") unless object_name
29
+ https_url({
30
+ :headers => {},
31
+ :host => @host,
32
+ :method => "DELETE",
33
+ :path => "#{bucket_name}/#{object_name}"
34
+ }, expires)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -18,6 +18,7 @@ module Fog
18
18
  request :copy_object
19
19
  request :delete_bucket
20
20
  request :delete_object
21
+ request :delete_object_url
21
22
  request :get_bucket
22
23
  request :get_bucket_acl
23
24
  request :get_object
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module Storage
3
+ class GoogleXML
4
+ class Real
5
+ # Get an expiring object url from Google Storage for deleting an object
6
+ #
7
+ # ==== Parameters
8
+ # * bucket_name<~String> - Name of bucket containing object
9
+ # * object_name<~String> - Name of object to get expiring url for
10
+ # * expires<~Time> - An expiry time for this url
11
+ #
12
+ # ==== Returns
13
+ # * response<~Excon::Response>:
14
+ # * body<~String> - url for object
15
+ #
16
+ def delete_object_url(bucket_name, object_name, expires)
17
+ raise ArgumentError.new("bucket_name is required") unless bucket_name
18
+ raise ArgumentError.new("object_name is required") unless object_name
19
+ https_url({
20
+ :headers => {},
21
+ :host => @host,
22
+ :method => "DELETE",
23
+ :path => "#{bucket_name}/#{object_name}"
24
+ }, expires)
25
+ end
26
+ end
27
+
28
+ class Mock
29
+ def delete_object_url(bucket_name, object_name, expires)
30
+ raise ArgumentError.new("bucket_name is required") unless bucket_name
31
+ raise ArgumentError.new("object_name is required") unless object_name
32
+ https_url({
33
+ :headers => {},
34
+ :host => @host,
35
+ :method => "DELETE",
36
+ :path => "#{bucket_name}/#{object_name}"
37
+ }, expires)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ 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.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-14 00:00:00.000000000 Z
12
+ date: 2018-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog-core
@@ -599,6 +599,7 @@ files:
599
599
  - lib/fog/storage/google_json/requests/copy_object.rb
600
600
  - lib/fog/storage/google_json/requests/delete_bucket.rb
601
601
  - lib/fog/storage/google_json/requests/delete_object.rb
602
+ - lib/fog/storage/google_json/requests/delete_object_url.rb
602
603
  - lib/fog/storage/google_json/requests/get_bucket.rb
603
604
  - lib/fog/storage/google_json/requests/get_bucket_acl.rb
604
605
  - lib/fog/storage/google_json/requests/get_object.rb
@@ -627,6 +628,7 @@ files:
627
628
  - lib/fog/storage/google_xml/requests/copy_object.rb
628
629
  - lib/fog/storage/google_xml/requests/delete_bucket.rb
629
630
  - lib/fog/storage/google_xml/requests/delete_object.rb
631
+ - lib/fog/storage/google_xml/requests/delete_object_url.rb
630
632
  - lib/fog/storage/google_xml/requests/get_bucket.rb
631
633
  - lib/fog/storage/google_xml/requests/get_bucket_acl.rb
632
634
  - lib/fog/storage/google_xml/requests/get_object.rb
@@ -719,7 +721,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
719
721
  version: '0'
720
722
  requirements: []
721
723
  rubyforge_project:
722
- rubygems_version: 2.6.12
724
+ rubygems_version: 2.6.13
723
725
  signing_key:
724
726
  specification_version: 4
725
727
  summary: Module for the 'fog' gem to support Google.