The client can currently connect to an Elasticsearch node at a single URI without any kind of authentication. The ability to provide Basic Authentication credentials to the client to use to connect to a URI should be implemented.
Possible implementation
ConnectionSettings is intended to be the struct that collects all relevant details needed to establish a connection to Elasticsearch, so the ability to pass Basic Authentication credentials logically sits as a field on ConnectionSettings.
Connection really depends on ConnectionSettings, so should arguably be passed as a ctor argument to create one, with Elasticsearch client now depending only on Connection. In future, there may be client specific settings unrelated to the Connection, but this dependency flow can be refactored if that need arises. Similarly, when #7 is implemented, Connection would be constructed by a ConnectionPool implementation, but again, this can be refactored when implementing connection pools.
The client can currently connect to an Elasticsearch node at a single URI without any kind of authentication. The ability to provide Basic Authentication credentials to the client to use to connect to a URI should be implemented.
Possible implementation
ConnectionSettings
is intended to be the struct that collects all relevant details needed to establish a connection to Elasticsearch, so the ability to pass Basic Authentication credentials logically sits as a field onConnectionSettings
.Connection
really depends onConnectionSettings
, so should arguably be passed as a ctor argument to create one, withElasticsearch
client now depending only onConnection
. In future, there may be client specific settings unrelated to the Connection, but this dependency flow can be refactored if that need arises. Similarly, when #7 is implemented,Connection
would be constructed by aConnectionPool
implementation, but again, this can be refactored when implementing connection pools.