Skip to content

Commit

Permalink
remove redaction exclusions for Galaxy URLs (basic auth support is gone)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpetrello committed Aug 4, 2020
1 parent 520dfb0 commit 6d89b96
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions awx/main/redact.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,13 @@ class UriCleaner(object):

@staticmethod
def remove_sensitive(cleartext):
# exclude_list contains the items that will _not_ be redacted
# TODO: replace this with the server URLs from proj.org.credentials
exclude_list = []
#exclude_list = [settings.PUBLIC_GALAXY_SERVER['url']]
#if settings.PRIMARY_GALAXY_URL:
# exclude_list += [settings.PRIMARY_GALAXY_URL]
#if settings.FALLBACK_GALAXY_SERVERS:
# exclude_list += [server['url'] for server in settings.FALLBACK_GALAXY_SERVERS]
redactedtext = cleartext
text_index = 0
while True:
match = UriCleaner.SENSITIVE_URI_PATTERN.search(redactedtext, text_index)
if not match:
break
uri_str = match.group(1)
# Do not redact items from the exclude list
if any(uri_str.startswith(exclude_uri) for exclude_uri in exclude_list):
text_index = match.start() + len(uri_str)
continue
try:
# May raise a ValueError if invalid URI for one reason or another
o = urlparse.urlsplit(uri_str)
Expand Down

0 comments on commit 6d89b96

Please sign in to comment.