-
Notifications
You must be signed in to change notification settings - Fork 313
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
Support API key authentication #1778
Conversation
docs/command_line_reference.rst
Outdated
@@ -717,6 +717,7 @@ Here are a few common examples: | |||
|
|||
* Enable HTTP compression: ``--client-options="http_compress:true"`` | |||
* Enable basic authentication: ``--client-options="basic_auth_user:'user',basic_auth_password:'password'"``. Avoid the characters ``'``, ``,`` and ``:`` in user name and password as Rally's parsing of these options is currently really simple and there is no possibility to escape characters. | |||
* Enable API key authentication: ``--client-options="api_key:'a0V...2dw=='"`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a note suggesting only one authentication mechanism should be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, thanks. Done in 4f73902
(#1778), can you please take another look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment, the rest LGTM.
2023-09-13 16:05:39,325 ActorAddr-(T|:37685)/PID:2257 esrally.client.factory INFO Creating ES client connected to [{'host': 'target.host', 'port': 443}] with option
s [{'api_key': '*****', 'use_ssl': True, 'verify_certs': False, 'retry_on_timeout': True}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Note: API key and other sensitive information can still leak through the following DEBUG log, but as we do not use DEBUG log level by default I think that is acceptable.
Line 1254 in a2bc19e
logger.debug("Command line arguments: %s", args) |
Closes #1777, relates #1757
Most of the work is done in the Elasticsearch Python client, so we do only three things:
However:
api_key
,basic_auth_user
andbasic_auth_password
are all set, since we get a traceback withValueError: Can only set one of 'api_key', 'basic_auth', and 'bearer_auth'
in this case.create_api_key_per_client
withapi_key
:basic_auth
is still required for that use case, as documented.