Skip to content

Commit

Permalink
Added option to censor sensitive secrets #96
Browse files Browse the repository at this point in the history
Only added them being hidden when used in SENSITIVE_DEBUG logs.
  • Loading branch information
Luminaex committed Dec 3, 2023
1 parent 8a8ae34 commit e6aebfd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def bootstrap_browser(
case 'reset':
landing_url = 'https://discord.com/reset#token=' + configuration['resetToken']
driver.get(landing_url)
logger.debug(f'Going to landing page: {landing_url}')
if configuration['sensitiveDebug'] == True:
logger.debug(f'Going to landing page: {landing_url}')
else:
logger.debug(f'Going to landing page: Hidden')
# Go to the required Discord login/landing page


Expand Down Expand Up @@ -174,9 +177,10 @@ def code_entry(
if session_statistics['attemptedCodeCount'] == 0:
for i in configuration:
session_statistics[i] = configuration[i]
#TODO: Make SENSITIVE_DEBUG level logs opt-in.
#If SENSITIVE_DEBUG is opted out, print placeholder characters instead of actual secrets.
logger.log('SENSITIVE_DEBUG',f"{color(i, 'green')}: {session_statistics[i]}")
if configuration['sensitiveDebug'] == True:
logger.log('SENSITIVE_DEBUG',f"{color(i, 'green')}: {session_statistics[i]}")
else:
logger.log('SENSITIVE_DEBUG',f"{color(i, 'green')}: Hidden")
logger.debug(f"Program Mode: {color(configuration['programMode'].lower(), 'green')}")
logger.debug(f"Code Mode: {color(configuration['codeMode'].lower(), 'green')}")

Expand Down
6 changes: 5 additions & 1 deletion user/cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ resetToken: ""

# Disable 2FA info
# Fill in your discord account token here.
authToken: ""
authToken: ""

# Show SENSITIVE_DEBUG log info
# Default = False
sensitiveDebug: "False"

0 comments on commit e6aebfd

Please sign in to comment.