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

Elasticsearch has Header and HttpsContext Settings #2652

Merged
merged 1 commit into from
May 11, 2021

Conversation

jabbaugh
Copy link
Contributor

The current ElasticsearchAPI only supports basic auth. By including
header options as well as the HttpsContext there would be additional
options to keep previous functionality but still moving forward with
AkkaHttp.

References #xxxx

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@lightbend-cla-validator

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@jabbaugh jabbaugh force-pushed the master branch 4 times, most recently from 7ebaf08 to def1c17 Compare April 19, 2021 19:16
copy(connectionContext = Option(connectionContext))

def hasConnectionContextDefined: Boolean = connectionContext.isDefined

def copy(baseUrl: String = baseUrl,
Copy link
Contributor

Choose a reason for hiding this comment

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

@seglo - should this method be private? Because it is not, this class might end up being restricted for future updates because changes could affect binary compatibility. Note that other classes in this directory have the copy method set with private scope. Specifically, the ElasticsearchSourceSettings and the ElasticsearchWriteSettings. In my understanding, these classes are set up with very intentional member scopeto allow for binary compatible expansions on the alpakka api.

(Sorry, I know this line was not changed in this PR, but I am pretty sure this public copy method is the reason that @jabbaugh needed to update the mima filters.)

Copy link
Contributor

Choose a reason for hiding this comment

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

For reference, this class is new to the 3.0.0 release, so I don't think changing this method to private qualifies as a break change yet.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think it's fine to make it private.

Copy link
Member

Choose a reason for hiding this comment

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

We'll still need to add the MiMa exceptions since there's been a milestone release, but that's fine too.

Copy link
Member

@seglo seglo left a comment

Choose a reason for hiding this comment

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

Looking good. Left some comments.

@@ -0,0 +1 @@
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings.*")
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the individual violations instead of using the wildcard?

copy(connectionContext = Option(connectionContext))

def hasConnectionContextDefined: Boolean = connectionContext.isDefined

def copy(baseUrl: String = baseUrl,
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think it's fine to make it private.

copy(connectionContext = Option(connectionContext))

def hasConnectionContextDefined: Boolean = connectionContext.isDefined

def copy(baseUrl: String = baseUrl,
Copy link
Member

Choose a reason for hiding this comment

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

We'll still need to add the MiMa exceptions since there's been a milestone release, but that's fine too.

final class ElasticsearchConnectionSettings private (
val baseUrl: String,
val username: Option[String],
val password: Option[String]
val password: Option[String],
val headers: Option[List[HttpHeader]],
Copy link
Member

Choose a reason for hiding this comment

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

Could probably be initialized as an empty list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to an initialized empty list instead of an option.

@@ -40,6 +40,8 @@ Java
| baseUrl | Empty | The base URL of Elasticsearch. Should not include a trailing slash. |
| username | None | The username to authenticate with |
| password | None | The password to authenticate with |
| headers | None | List of headers that should be sent with the http request. |
| connectionContext | None | The connectionContext that will be used with the http request. |
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a note here or somewhere else in the docs about why you would use this configuration, to use a TLS connection.

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 added some more details for the connectionContext

@jabbaugh jabbaugh force-pushed the master branch 8 times, most recently from 2d0f6cc to 80d5890 Compare May 7, 2021 21:50
The current ElasticsearchAPI only supports basic auth. By including
header options as well as the HttpsContext there would be additional
options to keep previous functionality but still moving forward with
AkkaHttp.
Copy link
Member

@seglo seglo left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution!

@seglo seglo added this to the 3.0.0 milestone May 11, 2021
@seglo seglo merged commit 99cb34d into akka:master May 11, 2021
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.

4 participants