lib/logstash/outputs/s3.rb in logstash-output-s3-4.1.1 vs lib/logstash/outputs/s3.rb in logstash-output-s3-4.1.2
- old
+ new
@@ -127,11 +127,11 @@
# The S3 canned ACL to use when putting the file. Defaults to "private".
config :canned_acl, :validate => ["private", "public-read", "public-read-write", "authenticated-read", "aws-exec-read", "bucket-owner-read", "bucket-owner-full-control", "log-delivery-write"],
:default => "private"
- # Specifies wether or not to use S3's server side encryption. Defaults to no encryption.
+ # Specifies whether or not to use S3's server side encryption. Defaults to no encryption.
config :server_side_encryption, :validate => :boolean, :default => false
# Specifies what type of encryption to use when SSE is enabled.
config :server_side_encryption_algorithm, :validate => ["AES256", "aws:kms"], :default => "AES256"
@@ -269,11 +269,23 @@
end
def full_options
options = aws_options_hash || {}
options[:signature_version] = @signature_version if @signature_version
- @additional_settings.merge(options)
+ symbolized_settings.merge(options)
end
+
+ def symbolized_settings
+ @symbolized_settings ||= symbolize_keys(@additional_settings)
+ end
+
+ def symbolize_keys(hash)
+ return hash unless hash.is_a?(Hash)
+ symbolized = {}
+ hash.each { |key, value| symbolized[key.to_sym] = symbolize_keys(value) }
+ symbolized
+ end
+
def normalize_key(prefix_key)
prefix_key.gsub(PathValidator.matches_re, PREFIX_KEY_NORMALIZE_CHARACTER)
end