File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -336,20 +336,6 @@ public function setHosts(array $hosts): ClientBuilder
336
336
return $ this ;
337
337
}
338
338
339
- /**
340
- * Set the APIKey for Authenication
341
- *
342
- * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
343
- *
344
- * @param string $apiKey
345
- */
346
- public function setApiKeyAuthentication (string $ apiKey )
347
- {
348
- $ this ->connectionParams ['client ' ]['headers ' ]['Authorization ' ] = ['ApiKey ' . $ apiKey ];
349
-
350
- return $ this ;
351
- }
352
-
353
339
/**
354
340
* Set the APIKey Pair, consiting of the API Id and the ApiKey of the Response from /_security/api_key
355
341
*
@@ -358,9 +344,11 @@ public function setApiKeyAuthentication(string $apiKey)
358
344
* @param string $id
359
345
* @param string $apiKey
360
346
*/
361
- public function setApiKeyPairAuthentication (string $ id , string $ apiKey )
347
+ public function setApiKey (string $ id , string $ apiKey )
362
348
{
363
- $ this ->setApiKeyAuthentication (base64_encode ($ id . ': ' . $ apiKey ));
349
+ $ this ->connectionParams ['client ' ]['headers ' ]['Authorization ' ] = [
350
+ 'ApiKey ' . base64_encode ($ id . ': ' . $ apiKey )
351
+ ];
364
352
365
353
return $ this ;
366
354
}
You can’t perform that action at this time.
0 commit comments