ApiKey should take precedence over basic auth (#1115)

* ApiKey should take precedence over basic auth

* Updated docs

* Updated test
This commit is contained in:
Tomas Della Vedova
2020-03-13 13:34:47 +01:00
committed by GitHub
parent 6bf04473c9
commit 9a9057db9e
4 changed files with 103 additions and 7 deletions

View File

@ -41,6 +41,8 @@ const client = new Client({
You can provide your credentials by passing the `username` and `password`
parameters via the `auth` option.
NOTE: If you provide both basic authentication credentials and the Api Key configuration, the Api Key will take precedence.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
@ -74,6 +76,8 @@ authentication by passing the `apiKey` parameter via the `auth` option. The
values that you can obtain from the
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-api-key.html[create api key endpoint].
NOTE: If you provide both basic authentication credentials and the Api Key configuration, the Api Key will take precedence.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')