Skip to content

fix(auth): trim env var tokens + hardening tests#9

Merged
lostmygithubaccount merged 1 commit intomainfrom
cody/ws-mdcliharden
Apr 4, 2026
Merged

fix(auth): trim env var tokens + hardening tests#9
lostmygithubaccount merged 1 commit intomainfrom
cody/ws-mdcliharden

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

  • Bug fix: Env var tokens (MOTHERDUCK_TOKEN, etc.) are now trimmed of whitespace before use — trailing newlines or spaces (common with export TOKEN=$(cat file)) previously caused silent auth failures
  • Tests: Added 12 new unit tests covering env var trimming, empty token rejection, debug redaction, extract_str helper, null fields, response status boundaries, and percent-encoding edge cases (55 total)

🤖 Generated with Claude Code

Env var tokens were used verbatim — trailing newlines or spaces (common
with `export TOKEN=$(cat file)`) would cause silent auth failures. Now
trimmed consistently with the CLI --token path.

Also adds 12 new unit tests covering: env var trimming, empty token
rejection, debug redaction, extract_str helper, null field handling,
response status boundaries, and percent-encoding edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount merged commit b8c342e into main Apr 4, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the cody/ws-mdcliharden branch April 4, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant