41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/httpimagestore/configuration/s3.rb', line 41
def self.parse(configuration, node)
configuration.s3 and raise StatementCollisionError.new(node, 's3')
node.grab_values
node.required_attributes('key', 'secret')
node.valid_attribute_values('ssl', true, false, nil)
key, secret, ssl = node.grab_attributes('key', 'secret', 'ssl')
ssl = true if ssl.nil?
configuration.s3 = AWS::S3.new(
access_key_id: key,
secret_access_key: secret,
logger: logger_for(AWS::S3),
log_level: :debug,
use_ssl: ssl
)
log.info "S3 client using '#{key}' key and #{ssl ? 'HTTPS' : 'HTTP'} connections"
end
|