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 explicit username and password option for Mongodb #2889

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

tsg
Copy link
Contributor

@tsg tsg commented Oct 31, 2016

We previously only had the option of specifying a user/pass in the
URL string, which is problematic because it results in the password
being indexed in Elasticsearch (#2888).

This adds the option to specify a username/password at the module
configuration. To make this happen, I had to copy some unexported
functions from the mgo driver.

@tsg tsg added in progress Pull request is currently in progress. review Metricbeat Metricbeat labels Oct 31, 2016
Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

I think it is missing make collect and docs. But I see there is still the in progress label ;-)

#hosts: ["localhost:27017"]

# Username to use when connecting to MongoDB. Empty by default.
# username: user
Copy link
Contributor

Choose a reason for hiding this comment

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

no space in front of username and password needed

if err != nil {
return nil, err
}
info.Timeout = base.Module().Config().Timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@tsg tsg added the needs_backport PR is waiting to be backported to other branches. label Oct 31, 2016
@tsg
Copy link
Contributor Author

tsg commented Oct 31, 2016

Not strictly a bug fix, but I think we should backport this to the 5.0 branch as it makes it really difficult to use the MongoDB module otherwise.

We previously only had the option of specifying a user/pass in the
URL string, which is problematic because it results in the password
being indexed in Elasticsearch (elastic#2888).

This adds the option to specify a username/password at the module
configuration. To make this happen, I had to copy some unexported
functions from the mgo driver.
@tsg tsg force-pushed the mongodb_user_pass_options branch from c3953b0 to c03da67 Compare October 31, 2016 11:42
@tsg tsg removed the in progress Pull request is currently in progress. label Oct 31, 2016
@ruflin ruflin merged commit 6c7dfe4 into elastic:master Oct 31, 2016
tsg pushed a commit to tsg/beats that referenced this pull request Nov 1, 2016
Similar to elastic#2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
ruflin pushed a commit that referenced this pull request Nov 1, 2016
Similar to #2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
tsg added a commit to tsg/beats that referenced this pull request Nov 1, 2016
Similar to elastic#2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
(cherry picked from commit f0b52e1)
tsg added a commit to tsg/beats that referenced this pull request Nov 1, 2016
Similar to elastic#2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
(cherry picked from commit f0b52e1)
monicasarbu pushed a commit that referenced this pull request Nov 1, 2016
Similar to #2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
(cherry picked from commit f0b52e1)
tsg added a commit to tsg/beats that referenced this pull request Nov 1, 2016
We previously only had the option of specifying a user/pass in the
URL string, which is problematic because it results in the password
being indexed in Elasticsearch (elastic#2888).

This adds the option to specify a username/password at the module
configuration. To make this happen, I had to copy some unexported
functions from the mgo driver.
(cherry picked from commit 6c7dfe4)
andrewkroh pushed a commit that referenced this pull request Nov 1, 2016
We previously only had the option of specifying a user/pass in the
URL string, which is problematic because it results in the password
being indexed in Elasticsearch (#2888).

This adds the option to specify a username/password at the module
configuration. To make this happen, I had to copy some unexported
functions from the mgo driver.
(cherry picked from commit 6c7dfe4)
@tsg tsg removed the needs_backport PR is waiting to be backported to other branches. label Nov 29, 2016
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Similar to elastic#2889 but for PostgreSQL. Also adds docs to the Postgres module,
which were missing, and adjusted the integration tests to use the username
option instead of the full URL.
(cherry picked from commit f1fb61d)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…lastic#2900)

We previously only had the option of specifying a user/pass in the
URL string, which is problematic because it results in the password
being indexed in Elasticsearch (elastic#2888).

This adds the option to specify a username/password at the module
configuration. To make this happen, I had to copy some unexported
functions from the mgo driver.
(cherry picked from commit b4f22e3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants