password param fixed for ad

This commit is contained in:
Tuncay ÇOLAK 2021-10-04 14:42:21 +03:00
parent e7fdfdca74
commit 8d4a2257b9
2 changed files with 6 additions and 4 deletions

View file

@ -103,12 +103,13 @@ class AnonymousMessenger(ClientXMPP):
dn = str(j['agentDn']) dn = str(j['agentDn'])
self.logger.debug('Registration status: ' + str(status)) self.logger.debug('Registration status: ' + str(status))
is_password = False is_password = False
for key, value in j.items(): body_without_password = json.loads(str(msg['body']))
for key, value in body_without_password.items():
if "password" in key.lower(): if "password" in key.lower():
j[key] = "********" body_without_password[key] = "********"
is_password = True is_password = True
if is_password: if is_password:
self.logger.info('---------->Received message: {0}'.format(str(j))) self.logger.info('---------->Received message: {0}'.format(str(body_without_password)))
else: else:
self.logger.info('---------->Received message: {0}'.format(str(msg['body']))) self.logger.info('---------->Received message: {0}'.format(str(msg['body'])))

View file

@ -362,6 +362,7 @@ class ExecuteSSSDAdAuthentication:
try: try:
process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE, process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, shell=shell) stdout=subprocess.PIPE, shell=shell)
self.logger.debug('Executing command for ad registration')
if result is True: if result is True:
result_code = process.wait() result_code = process.wait()
p_out = process.stdout.read().decode("unicode_escape") p_out = process.stdout.read().decode("unicode_escape")
@ -370,5 +371,5 @@ class ExecuteSSSDAdAuthentication:
else: else:
return None, None, None return None, None, None
except Exception as e: except Exception as e:
return 1, 'Could not execute command' return 1, 'Error Message: {0}'.format(str(e)), ''