This repository has been archived by the owner on May 12, 2021. It is now read-only.
Elasticsearch basic HTTP authentication #372
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rd) using ES 5.3.0's "preemptive authentication"
takezoe
reviewed
Apr 20, 2017
case (Some(username), Some(password)) => Some(username, password) | ||
case (Some(username), None) => Some(username, "") | ||
case (None, Some(password)) => Some("", password) | ||
case (None, None) => None} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern match can be simpler like:
usernamePassword match {
case (None, None) => None
case (username, password) => Some((username.getOrElse(""), password.getOrElse("")))
}
and Some(username, password)
causes auto tuppling. It's warned by Scala compiler to avoid unintended conversion to arguments to tuple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, @takezoe. Pushing this improvement now.
4 tasks
mars
force-pushed
the
esclient-auth
branch
2 times, most recently
from
May 23, 2017 22:22
aa01be5
to
052f5d8
Compare
…JARs in classpath
Closing in favor of #421 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add optional username-password configuration for the new Elasticsearch 5 client; in
pio-env.sh
config:# Optional basic HTTP auth PIO_STORAGE_SOURCES_ELASTICSEARCH_USERNAME=my-name PIO_STORAGE_SOURCES_ELASTICSEARCH_PASSWORD=my-secret
These credentials are sent in each Elasticsearch request as an HTTP Basic Authorization header.
Enables use of public-cloud, hosted Elasticsearch clusters, such as Bonsai on Heroku.
I'm looking into adding test coverage. (I have the Docker test suite setup now.)