S3 input config - credentials never nil

Description

I posted a bug on GitHub, but am not too sure if those are checked or not:

https://github.com/elasticsearch/logstash/issues/1619

Even though I don't specify credentials, they appear to being set to an empty array [], which isn't nil, and so the check in the s3 plugin always skips using environment variables:

1 2 3 4 5 if @credentials.nil? @access_key_id = ENV['AWS_ACCESS_KEY_ID'] @secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] elsif @credentials.is_a? Array if @credentials.length ==1

I think I know how to code around this:

1 2 3 4 5 6 7 8 if @credentials.nil? @access_key_id = ENV['AWS_ACCESS_KEY_ID'] @secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] elsif @credentials.is_a? Array if @credentials.length ==0 @access_key_id = ENV['AWS_ACCESS_KEY_ID'] @secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] if @credentials.length ==1

but I don't know if my case isn't working because of a combination of java version and OS, and would rather not mess with something that I'm not familiar enough with. Also, I think the problem might be with the validation routine or the expectation that an Array can have nil as a default.

Environment

None

Status

Assignee

Logstash Developers

Reporter

John P

Labels

Fix versions

Affects versions

1.4.0

Priority