Commit 65e0338f by Luke Griffiths

s3_encryption => true is now s3_server_side_encryption => :aes256

parent af6d343e
......@@ -115,7 +115,7 @@ module Paperclip
@s3_headers[:storage_class] = @options[:s3_storage_class] if @options[:s3_storage_class]
@s3_encrypted = @options[:s3_encrypted]
@s3_server_side_encryption = @options[:s3_server_side_encryption]
unless @options[:url].to_s.match(/^:s3.*url$/) || @options[:url] == ":asset_host"
@options[:path] = @options[:path].gsub(/:url/, @options[:url]).gsub(/^:rails_root\/public\/system/, '')
......@@ -283,7 +283,9 @@ module Paperclip
:acl => acl
}
write_options[:metadata] = @s3_metadata unless @s3_metadata.empty?
write_options[:server_side_encryption] = :aes256 if @s3_encrypted
unless @s3_server_side_encryption.blank?
write_options[:server_side_encryption] = @s3_server_side_encryption
end
write_options.merge!(@s3_headers)
s3_object(style).write(file, write_options)
rescue AWS::S3::Errors::NoSuchBucket => e
......
......@@ -142,7 +142,7 @@ unless ENV["S3_BUCKET"].blank?
:bucket => ENV["S3_BUCKET"],
:path => ":class/:attachment/:id/:style.:extension",
:s3_credentials => File.new(File.join(File.dirname(__FILE__), "..", "fixtures", "s3.yml")),
:s3_encrypted => true
:s3_server_side_encryption => :aes256
Dummy.delete_all
@dummy = Dummy.new
......@@ -165,7 +165,7 @@ unless ENV["S3_BUCKET"].blank?
end
should "be encrypted on S3" do
assert @dummy.avatar.s3_object.server_side_encryption?
assert @dummy.avatar.s3_object.server_side_encryption == :aes256
end
end
end
......
......@@ -693,7 +693,7 @@ class S3Test < Test::Unit::TestCase
'access_key_id' => "12345",
'secret_access_key' => "54321"
},
:s3_encrypted => true
:s3_server_side_encryption => :aes256
end
context "when assigned" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment