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
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Patch bump from 0.2.1 -> 0.2.2 via `bin/bump-version --patch`.
Regenerates Cargo.lock, crates/dkdc-md-cli-py/Cargo.lock, and uv.lock.

## Highlights

Fifteen commits merged since v0.2.1 (2026-03-22). Biggest items are
auth hardening, Python binding test coverage, and CI/release pipeline
stabilization after the transfer to the `dkdc-io` org.

## Fixes / hardening

- `fix(auth): trim whitespace from env var tokens and add hardening tests` (#9)
- `fix(ci): add local PyPI publish step` (#6)
- `fix: add contents:read to release-rust publish job permissions` (#5)
- `fix: add checkout ref to release workflows + remove target cache` (#2)
- `fix: use dkdc.io email for dkdc-io org` (#4)

## Refactors / tests

- `refactor(client): extract API paths and use typed HTTP headers` (#11)
- `refactor(client): extract constants and clean up patterns` (#10)
- `test(py): add Python binding tests` (#13)

## Chores / infra

- `chore(ci): migrate to org reusable workflows` (#7)
- `chore: fix CLAUDE.md symlink to AGENTS.md` (#7)
- `chore: update repo references after transfer to dkdc-io` (#1)
- `chore: update dependencies` (#12)
- `docs: fix token resolution order and remove stale script reference` (#8)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount mentioned this pull request Apr 13, 2026
2 tasks
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Patch bump from 0.2.1 -> 0.2.2 via `bin/bump-version --patch`.
Regenerates Cargo.lock, crates/dkdc-md-cli-py/Cargo.lock, and uv.lock.

## Highlights

Fifteen commits merged since v0.2.1 (2026-03-22). Biggest items are
auth hardening, Python binding test coverage, and CI/release pipeline
stabilization after the transfer to the `dkdc-io` org.

## Fixes / hardening

- `fix(auth): trim whitespace from env var tokens and add hardening tests` (#9)
- `fix(ci): add local PyPI publish step` (#6)
- `fix: add contents:read to release-rust publish job permissions` (#5)
- `fix: add checkout ref to release workflows + remove target cache` (#2)
- `fix: use dkdc.io email for dkdc-io org` (#4)

## Refactors / tests

- `refactor(client): extract API paths and use typed HTTP headers` (#11)
- `refactor(client): extract constants and clean up patterns` (#10)
- `test(py): add Python binding tests` (#13)

## Chores / infra

- `chore(ci): migrate to org reusable workflows` (#7)
- `chore: fix CLAUDE.md symlink to AGENTS.md` (#7)
- `chore: update repo references after transfer to dkdc-io` (#1)
- `chore: update dependencies` (#12)
- `docs: fix token resolution order and remove stale script reference` (#8)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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