diff options
author | Zuul <zuul@review.openstack.org> | 2019-03-27 16:19:40 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-03-27 16:19:40 +0000 |
commit | 895062f3afc6135ba79267842c8616c4213cd925 (patch) | |
tree | da524ea1acb8a57367b4b1fb52b79ee7465d852e /oslo_utils | |
parent | a272eed61cea5ab70f90c8016f46484bd1111e23 (diff) | |
parent | 08d76b5373dd19d0425d525983637f260d9be629 (diff) | |
download | oslo-utils-895062f3afc6135ba79267842c8616c4213cd925.tar.gz |
Merge "Mask encryption_key_id"
Diffstat (limited to 'oslo_utils')
-rw-r--r-- | oslo_utils/strutils.py | 3 | ||||
-rw-r--r-- | oslo_utils/tests/test_strutils.py | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/oslo_utils/strutils.py b/oslo_utils/strutils.py index 1edcf5a..936e4d5 100644 --- a/oslo_utils/strutils.py +++ b/oslo_utils/strutils.py @@ -58,7 +58,8 @@ SLUGIFY_HYPHENATE_RE = re.compile(r"[-\s]+") _SANITIZE_KEYS = ['adminPass', 'admin_pass', 'password', 'admin_password', 'auth_token', 'new_pass', 'auth_password', 'secret_uuid', 'secret', 'sys_pswd', 'token', 'configdrive', - 'CHAPPASSWORD', 'encrypted_key', 'private_key'] + 'CHAPPASSWORD', 'encrypted_key', 'private_key', + 'encryption_key_id'] # NOTE(ldbragst): Let's build a list of regex objects using the list of # _SANITIZE_KEYS we already have. This way, we only have to add the new key diff --git a/oslo_utils/tests/test_strutils.py b/oslo_utils/tests/test_strutils.py index e015b2e..f7efcd9 100644 --- a/oslo_utils/tests/test_strutils.py +++ b/oslo_utils/tests/test_strutils.py @@ -459,6 +459,9 @@ class MaskPasswordTestCase(test_base.BaseTestCase): payload = """body: {"rescue": {"password": "1234567"}}""" expected = """body: {"rescue": {"password": "***"}}""" self.assertEqual(expected, strutils.mask_password(payload)) + payload = """body: {"rescue": {"encryption_key_id": "1234567"}}""" + expected = """body: {"rescue": {"encryption_key_id": "***"}}""" + self.assertEqual(expected, strutils.mask_password(payload)) def test_xml_message(self): payload = """<?xml version="1.0" encoding="UTF-8"?> |