Tech DebtsCLIM3 Authenticated Distribution
PR #4 Auth Hardening Review Findings
PR #4 Auth Hardening Review Findings
Initial Debt
Codex PR review found two follow-up auth robustness issues:
- Empty
--auth-urlorDP_AUTH_URLvalues were treated as configured and produced relative device endpoints such as/device/code. - Malformed stored
auth.jsoncredentials threw during reads, makingpunks auth statusand baseline credential lookup fail instead of returning an unauthenticated state.
Resolution
- Normalize
--auth-urlandDP_AUTH_URLby trimming whitespace and treating empty values as missing. - Return
nullfromreadAuthCredentialwhen the stored file cannot be parsed or decoded. - Added direct tests for empty auth URL values and malformed stored credentials.
Validation
bun run test --filter=@punks/cli: passed 77 tests.bun run check-types --filter=@punks/cli: passed 3 tasks.bun run check: passed.git diff --check: passed.bun run build --filter=@punks/cli: passed.- Built CLI
auth login --help: passed.