The pytest-resilient-circuits package in one area does not use get_client though and only directly creates its client through the client constructor, and in another area it constructs the arguments to pass on to the main API but does not pass on the api key, so the pytest framework code previously only supported user/password and the connect method for authentication.
How Has This Been Tested?
Manually tested with api_key and api_key_secret set in environment and the connection works
Manually tested with user and password set in environment with no api_key and the connection still attempts the connect as it did before if api key and secret are not set.
No test case was added since it doesn't look like there are existing test cases for any of the config and environment variables used here.
pylint and pycodestyle showed some warnings, but "fixing" these would have made the new code inconsistent with existing code, or would have required more extensive changes to existing code.
[x] Either no new documentation is required by this change, OR I added new documentation
[x] Either no new tests are required by this change, OR I added new tests
[x] I have run pep8 and pylint. I have cleaned up all valid errors and warnings in code I have added or modified. These tools may generate false positives. Don't be worried about ignoring some errors or warnings. The goal is clean, consistent, and readable code.
Hi @brunnjf
Thank you for submitting this, we always welcome contributions to improve our packages.
I will submit something to track this internally so that we can review and ideally merge this in.
Description
Adds support for api_key to the pytest_resilient_circuits package.
Motivation and Context
When a resilient client is obtained through the get_client call https://github.com/ibmresilient/resilient-python-api/blob/e9bbe7ac8daf6794ab64a6cdbb971785a11c7102/resilient/resilient/co3.py#L100 there is support for both api_keys https://github.com/ibmresilient/resilient-python-api/blob/e9bbe7ac8daf6794ab64a6cdbb971785a11c7102/resilient/resilient/co3.py#L162 and a session based connection with user/pw https://github.com/ibmresilient/resilient-python-api/blob/e9bbe7ac8daf6794ab64a6cdbb971785a11c7102/resilient/resilient/co3.py#L166
The pytest-resilient-circuits package in one area does not use get_client though and only directly creates its client through the client constructor, and in another area it constructs the arguments to pass on to the main API but does not pass on the api key, so the pytest framework code previously only supported user/password and the connect method for authentication.
How Has This Been Tested?
Manually tested with api_key and api_key_secret set in environment and the connection works Manually tested with user and password set in environment with no api_key and the connection still attempts the connect as it did before if api key and secret are not set.
No test case was added since it doesn't look like there are existing test cases for any of the config and environment variables used here.
pylint and pycodestyle showed some warnings, but "fixing" these would have made the new code inconsistent with existing code, or would have required more extensive changes to existing code.
Checklist:
Signed-off-by: Jonathan Brunn jbrunn@us.ibm.com