Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for basic auth in couchdb input #5160

Merged
merged 2 commits into from
Dec 19, 2018
Merged

Conversation

danielnelson
Copy link
Contributor

closes: #5155

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Dec 18, 2018
@danielnelson danielnelson added this to the 1.10.0 milestone Dec 18, 2018
@danielnelson
Copy link
Contributor Author

@fungiboletus I added support for basic auth to the couchdb plugin, but have not tested it on a real server. Do you think you would be able to test it out with one of these builds? (let me know if your build is not listed here)

@@ -80,7 +80,9 @@ type (
}

CouchDB struct {
Hosts []string `toml:"hosts"`
Hosts []string `toml:"hosts"`
BasicUsername string `toml:"basic_username"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably would have just called it Username/Password to stay uniform with other plugins (elasticsearch, kibana, icinga2, rabbitmq, etc...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was on the fence about this but decided to be more explicit because CouchDB supports several authentication methods. We have a number plugins using this naming as well and I could go either way.

I would probably never consider implementing the cookie method, but the proxy method is a possibility. I guess if we added it we could provide another option auth_method? Which way do you think is best?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound logic. I say leave it, as you said, there are other plugins that use the basic_ prefix.

@fungiboletus
Copy link

@danielnelson Thanks, that was fast. I tested it and it worked as expected.

@danielnelson danielnelson merged commit 8418608 into master Dec 19, 2018
@danielnelson danielnelson deleted the couchdb-basic-auth branch December 19, 2018 20:59
trevorwhitney pushed a commit to trevorwhitney/telegraf that referenced this pull request Feb 14, 2019
@nbari
Copy link

nbari commented Mar 6, 2019

I am getting this error:

E! [telegraf] Error running agent: Error parsing telegraf.conf, line 29: field corresponding to `basic_username' is not defined in `*couchdb.CouchDB'

The configuration I am using is for couchdb2

[[inputs.couchdb]]
  hosts = ["http://127.0.0.1:5984/_node/_local/_stats"]
  basic_username = "foo"
  basic_password = "bar"

@danielnelson
Copy link
Contributor Author

@nbari What version of Telegraf do you have, it will need to be 1.10.0.

@nbari
Copy link

nbari commented Mar 7, 2019

I am using 1.9.3, will try updating to 1.10.0

otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
dupondje pushed a commit to dupondje/telegraf that referenced this pull request Apr 22, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support password authentication in the CouchDB plugin
4 participants