fix: remove token value from Bad Token log warnings (#79) #85
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#85
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue/79-stop-logging-raw-auth-tokens-in-warning-messages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #79
Summary
Removed
: {token}interpolation from allBad Tokenlogger/logging warning messages across 22 router files (73 occurrences). Auth tokens were being written to the log file in plaintext on every failed authentication attempt.Changes
app/routers_v3/awards.pyapp/routers_v3/battingstats.pyapp/routers_v3/current.pyapp/routers_v3/custom_commands.pyapp/routers_v3/decisions.pyapp/routers_v3/divisions.pyapp/routers_v3/draftdata.pyapp/routers_v3/draftlist.pyapp/routers_v3/draftpicks.pyapp/routers_v3/help_commands.pyapp/routers_v3/injuries.pyapp/routers_v3/keepers.pyapp/routers_v3/managers.pyapp/routers_v3/pitchingstats.pyapp/routers_v3/results.pyapp/routers_v3/sbaplayers.pyapp/routers_v3/schedules.pyapp/routers_v3/standings.pyapp/routers_v3/stratgame.pyapp/routers_v3/transactions.pyapp/routers_v3/views.pyapp/routers_v3/stratplay/crud.pyBefore / After
Unnecessary
f-string prefix also removed since these strings no longer contain format variables.Test Results
No test suite — verified changes by confirming zero remaining
Bad Token.*{token}patterns via grep.AI Code Review
Files Reviewed
app/routers_v3/awards.py(modified)app/routers_v3/battingstats.py(modified)app/routers_v3/current.py(modified)app/routers_v3/custom_commands.py(modified)app/routers_v3/decisions.py(modified)app/routers_v3/divisions.py(modified)app/routers_v3/draftdata.py(modified)app/routers_v3/draftlist.py(modified)app/routers_v3/draftpicks.py(modified)app/routers_v3/help_commands.py(modified)app/routers_v3/injuries.py(modified)app/routers_v3/keepers.py(modified)app/routers_v3/managers.py(modified)app/routers_v3/pitchingstats.py(modified)app/routers_v3/results.py(modified)app/routers_v3/sbaplayers.py(modified)app/routers_v3/schedules.py(modified)app/routers_v3/standings.py(modified)app/routers_v3/stratgame.py(modified)app/routers_v3/transactions.py(modified)app/routers_v3/views.py(modified)app/routers_v3/stratplay/crud.py(modified)Findings
Correctness
{token}f-string interpolation is removed from everyBad Tokenlog warning across the codebase.f"..."prefix is also correctly removed from each affected line since no format variables remain.sbaplayers.pyuseslogging.warning(module-level) rather than a localloggerinstance — both patterns are handled correctly.Bad Token.*{token}patterns in the diff.Security
/tmp/sba-database.logon failed auth attempts. This is the correct remediation for issue #79.next-release→mainmerge at #64). The approach is identical and correct.Style & Conventions
draftdata.pyretains its pre-existing single-quote style — not changed by this PR.Suggestions
awards.pylogs"patch_player - Bad Token"for all 3 of its auth checks;results.pylogs"patch_player - Bad Token"forpost_resultsandpatch_result;current.pylogs"patch_current - Bad Token"for its delete handler;draftlist.pylogs"post_draftlist - Bad Token"forget_draftlist;views.pylogs"refresh_season_batting_stats - Bad Token"forrefresh_season_pitching_stats). These are pre-existing and out of scope for this PR but worth a follow-up cleanup.Verdict: COMMENT
Clean, complete implementation. All 22 files updated, f-strings correctly removed, both
loggerandloggingcall styles handled. No issues found. Posting as COMMENT because Gitea blocks self-approval.Automated review by Claude PR Reviewer
Checkout
From your project repository, check out a new branch and test the changes.