mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
Merge pull request #54 from chrismeyersfsu/improvement-stdout_sensitive_data_removal
fix use before declare and added a missed redact
This commit is contained in:
commit
5ca31292e4
@ -2238,6 +2238,7 @@ class UnifiedJobStdout(RetrieveAPIView):
|
||||
conv = Ansi2HTMLConverter(scheme=scheme, dark_bg=dark_bg,
|
||||
title=get_view_name(self.__class__))
|
||||
content, start, end, absolute_end = unified_job.result_stdout_raw_limited(start_line, end_line)
|
||||
content = UriCleaner.remove_sensitive(content)
|
||||
if content_only:
|
||||
headers = conv.produce_headers()
|
||||
body = conv.convert(content, full=False) # Escapes any HTML that may be in content.
|
||||
|
@ -16,24 +16,17 @@ class UriCleaner(object):
|
||||
break
|
||||
o = urlparse.urlsplit(match.group(1))
|
||||
if not o.username and not o.password:
|
||||
flag_continue = False
|
||||
if o.netloc:
|
||||
if o.netloc and ":" in o.netloc:
|
||||
# Handle the special case url http://username:password that can appear in SCM url
|
||||
# on account of a bug? in ansible redaction
|
||||
try:
|
||||
(username, password) = o.netloc.split(':')
|
||||
except ValueError as e:
|
||||
flag_continue = True
|
||||
pass
|
||||
|
||||
if flag_continue:
|
||||
(username, password) = o.netloc.split(':')
|
||||
else:
|
||||
text_index += len(match.group(1))
|
||||
continue
|
||||
else:
|
||||
username = o.username
|
||||
password = o.password
|
||||
|
||||
|
||||
# Given a python MatchObject, with respect to redactedtext, find and
|
||||
# replace the first occurance of username and the first and second
|
||||
# occurance of password
|
||||
|
Loading…
Reference in New Issue
Block a user