Skip to content

"credentials" method name conflicts with the config setting of the same name.#20

Open
RichardN wants to merge 1 commit intologstash-plugins:mainfrom
RichardN:master
Open

"credentials" method name conflicts with the config setting of the same name.#20
RichardN wants to merge 1 commit intologstash-plugins:mainfrom
RichardN:master

Conversation

@RichardN
Copy link

I'm trying to fix the tests so the s3 input plugin using the aws-sdk-v2 pull request code and discovered that this is the probable issue.

The current rspec tests pass with this change, and testing on a rebased version of the above logstash-input-s3 code gives the following changes (which I believe are what we'd expect..)

  1. LogStash::Inputs::S3#get_s3object with deprecated credentials option should instantiate AWS::S3 clients with a proxy set
    Failure/Error: subject.send(:get_s3object)
    <#Module:0x48e07006::Resource (class)> received :new with unexpected arguments
    expected: ({:access_key_id=>"1234", :secret_access_key=>"secret", :http_proxy=>"http://example.com", :region=>"us-east-1"})
    got: ({:credentials=>#<Aws::Credentials access_key_id="1234">, :http_proxy=>"http://example.com", :region=>"us-east-1"})

    ./lib/logstash/inputs/s3.rb:388:in `get_s3object'

    ./spec/inputs/s3_spec.rb:78:in`block in (root)'

  2. LogStash::Inputs::S3#get_s3object with modern access key options should instantiate AWS::S3 clients with a proxy set
    Failure/Error: subject.send(:get_s3object)
    <#Module:0x48e07006::Resource (class)> received :new with unexpected arguments
    expected: ({:access_key_id=>"1234", :secret_access_key=>"secret", :http_proxy=>"http://example.com", :region=>"us-east-1"})
    got: ({:credentials=>#<Aws::Credentials access_key_id="1234">, :http_proxy=>"http://example.com", :region=>"us-east-1"})

    ./lib/logstash/inputs/s3.rb:388:in `get_s3object'

    ./spec/inputs/s3_spec.rb:100:in`block in (root)'

…s with the deprecated config setting (which creates a method of the same name)
@RichardN
Copy link
Author

I've fixed up my fork of https://github.com/RichardN/logstash-input-s3 so that the rspec passes if this change is made to this mixin. The alternative to doing this is that the legacy "credentials" setting is removed any plugin which uses this mixin.

@karmi
Copy link

karmi commented Mar 29, 2018

Hi @RichardN, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in yout Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile?

1 similar comment
@karmi
Copy link

karmi commented Mar 29, 2018

Hi @RichardN, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in yout Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants