You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for both Elasticsearch authentication methods:
- Maintain backward compatibility with ES 7.17 API key auth (username/password tuple)
- Add support for ES 8.17 string-based API key
- Update docstring to clarify version requirements for each auth method
- Add optional api_key parameter to constructor with default=None
Copy file name to clipboardExpand all lines: cogstack.py
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -20,16 +20,27 @@ class CogStack(object):
20
20
hosts (List[str]): A list of Elasticsearch host URLs.
21
21
username (str, optional): The username to use when connecting to Elasticsearch. If not provided, the user will be prompted to enter a username.
22
22
password (str, optional): The password to use when connecting to Elasticsearch. If not provided, the user will be prompted to enter a password.
23
-
api (bool, optional): A boolean value indicating whether to use API keys or basic authentication to connect to Elasticsearch. Defaults to False (i.e., use basic authentication).
23
+
api (bool, optional): A boolean value indicating whether to use API keys or basic authentication to connect to Elasticsearch. Defaults to False (i.e., use basic authentication). Elasticsearch 7.17.
24
+
api_key (str, optional): The API key to use when connecting to Elasticsearch.
25
+
When provided along with `api=True`, this takes precedence over username/password. Only available when using Elasticsearch 8.17.
0 commit comments