Mask notifier and newsletter config passwords (Fixes Tautulli/Tautulli-Issues#172)

This commit is contained in:
JonnyWong16 2019-07-08 23:50:48 -07:00
parent 96c0f9cad5
commit 91476a420a
4 changed files with 95 additions and 49 deletions

View file

@ -1178,3 +1178,18 @@ def split_args(args=None):
return [arg.decode(plexpy.SYS_ENCODING, 'ignore')
for arg in shlex.split(args.encode(plexpy.SYS_ENCODING, 'ignore'))]
return []
def mask_config_passwords(config):
if isinstance(config, list):
for cfg in config:
if 'password' in cfg['name'] and cfg['value'] != '':
cfg['value'] = ' '
elif isinstance(config, dict):
for cfg, val in config.iteritems():
# Check for a password config keys and if the password is not blank
if 'password' in cfg and val != '':
# Set the password to blank so it is not exposed in the HTML form
config[cfg] = ' '
return config