diff --git a/lib/fog/google/models/storage/directory.rb b/lib/fog/google/models/storage/directory.rb index 7491bb714..d4ce67d90 100644 --- a/lib/fog/google/models/storage/directory.rb +++ b/lib/fog/google/models/storage/directory.rb @@ -65,7 +65,7 @@ module Fog requires :key options = {} if @acl - options['x-amz-acl'] = @acl + options['x-goog-acl'] = @acl end if @location options['LocationConstraint'] = @location diff --git a/lib/fog/google/models/storage/file.rb b/lib/fog/google/models/storage/file.rb index c9c82e1cc..0f5505052 100644 --- a/lib/fog/google/models/storage/file.rb +++ b/lib/fog/google/models/storage/file.rb @@ -84,7 +84,7 @@ module Fog Formatador.display_line("[yellow][WARN] options param is deprecated, use acl= instead[/] [light_black](#{caller.first})[/]") end if @acl - options['x-amz-acl'] ||= @acl + options['x-goog-acl'] ||= @acl end if content_type options['Content-Type'] = content_type diff --git a/lib/fog/google/parsers/storage/access_control_list.rb b/lib/fog/google/parsers/storage/access_control_list.rb index a55d8f000..8d7cd069e 100644 --- a/lib/fog/google/parsers/storage/access_control_list.rb +++ b/lib/fog/google/parsers/storage/access_control_list.rb @@ -6,35 +6,37 @@ module Fog class AccessControlList < Fog::Parsers::Base def reset - @in_access_control_list = false - @grant = { 'Grantee' => {} } + @in_entries = false + @entry = { 'Scope' => {} } @response = { 'Owner' => {}, 'AccessControlList' => [] } end def start_element(name, attrs = []) super - if name == 'AccessControlList' - @in_access_control_list = true + case name + when 'Entries' + @in_entries = true + when 'Scope' + key, value = attrs + @entry['Scope'][key] = value end end def end_element(name) case name - when 'AccessControlList' - @in_access_control_list = false - when 'Grant' - @response['AccessControlList'] << @grant - @grant = { 'Grantee' => {} } + when 'Entries' + @in_entries = false + when 'Entry' + @response['AccessControlList'] << @entry + @entry = { 'Scope' => {} } when 'DisplayName', 'ID' - if @in_access_control_list - @grant['Grantee'][name] = @value + if @in_entries + @entry['Scope'][name] = @value else @response['Owner'][name] = @value end when 'Permission' - @grant[name] = @value - when 'URI' - @grant['Grantee'][name] = @value + @entry[name] = @value end end