Skip to content

Commit 24be1e8

Browse files
authored
hide api-key from debug file (#61)
* Add sg file * Revert "Add sg file" This reverts commit 726298c. * hide api-key from debug file
1 parent 2f471a7 commit 24be1e8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cpapi/mgmt_api.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ def api_call(self, command, payload=None, sid=None, wait_for_task=True, timeout=
368368
# would not appear as plaintext in the debug file.
369369
if command == "login":
370370
json_data = compatible_loads(_data)
371-
json_data["password"] = "****"
371+
if "password" in json_data:
372+
json_data["password"] = "****"
373+
if "api-key" in json_data:
374+
json_data["api-key"] = "****"
372375
_data = json.dumps(json_data)
373376

374377
if self.debug_file:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="cp-mgmt-api-sdk",
6-
version="1.8.0",
6+
version="1.9.0",
77
author="API team",
88
author_email="[email protected]",
99
license='Apache 2.0',

0 commit comments

Comments
 (0)