def __redact_key_from_response(self, record):
# type: (logging.LogRecord) -> None
"""Redact the ``Plaintext`` value from a KMS response body.
:param record: Logging record to filter
:type record: logging.LogRecord
"""
try:
parsed_body = json.loads(self.__to_str(cast(tuple, record.args)[0]))
parsed_body['Plaintext'] = _REDACTED
new_args = (json.dumps(parsed_body, sort_keys=True),) + cast(tuple, record.args)[1:]
record.args = new_args
except Exception: # pylint: disable=broad-except
return
评论列表
文章目录