Commit 36b48d05 by Menno van der Sman Committed by Jon Yurek

Accept and pass :credential_provider option to AWS-SDK

parent 5261670b
...@@ -212,7 +212,7 @@ module Paperclip ...@@ -212,7 +212,7 @@ module Paperclip
config[:proxy_uri] = URI::HTTP.build(proxy_opts) config[:proxy_uri] = URI::HTTP.build(proxy_opts)
end end
[:access_key_id, :secret_access_key].each do |opt| [:access_key_id, :secret_access_key, :credential_provider].each do |opt|
config[opt] = s3_credentials[opt] if s3_credentials[opt] config[opt] = s3_credentials[opt] if s3_credentials[opt]
end end
......
...@@ -720,6 +720,23 @@ class S3Test < Test::Unit::TestCase ...@@ -720,6 +720,23 @@ class S3Test < Test::Unit::TestCase
end end
end end
context "An attachment with S3 storage and S3 credentials with a :credential_provider" do
setup do
class DummyCredentialProvider; end
rebuild_model :storage => :s3,
:bucket => "testing",
:s3_credentials => {
:credential_provider => DummyCredentialProvider.new
}
@dummy = Dummy.new
end
should "set the credential-provider" do
assert_kind_of DummyCredentialProvider, @dummy.avatar.s3_bucket.config.credential_provider
end
end
context "An attachment with S3 storage and specific s3 headers set" do context "An attachment with S3 storage and specific s3 headers set" do
setup do setup do
rebuild_model :storage => :s3, rebuild_model :storage => :s3,
......
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