Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

s3_encryption => true is now s3_server_side_encryption => :aes256

  • Loading branch information...
commit 65e0338f3ed07ddf95958ce71265a0ba76e9c1c6 1 parent af6d343
@Sporky023 Sporky023 authored
View
6 lib/paperclip/storage/s3.rb
@@ -115,7 +115,7 @@ def self.extended base
@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 @@ def flush_writes #:nodoc:
: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
View
4 test/storage/s3_live_test.rb
@@ -142,7 +142,7 @@ class S3LiveTest < Test::Unit::TestCase
: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 @@ class S3LiveTest < Test::Unit::TestCase
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
View
2  test/storage/s3_test.rb
@@ -693,7 +693,7 @@ def counter
'access_key_id' => "12345",
'secret_access_key' => "54321"
},
- :s3_encrypted => true
+ :s3_server_side_encryption => :aes256
end
context "when assigned" do
Please sign in to comment.
Something went wrong with that request. Please try again.