When the password filter hides a value we replace it with a string
of asterisks - indicating that there was a value here. Move it
to a constant so it can be reused later.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
ConversionOp = Tuple[PasswordFilter, PasswordFilter]
+_MASKED = '*' * 16
+
def _get_intent(data: Simplified) -> Intent:
"""Helper function that returns the intent value from a data dict."""
if operation == (PasswordFilter.NONE, PasswordFilter.BASE64):
pvalue = base64.b64encode(pvalue.encode("utf8")).decode("utf8")
elif operation == (PasswordFilter.NONE, PasswordFilter.HIDDEN):
- pvalue = "*" * 16
+ pvalue = _MASKED
elif operation == (PasswordFilter.BASE64, PasswordFilter.NONE):
pvalue = base64.b64decode(pvalue.encode("utf8")).decode("utf8")
else: