Skip to content

🐛 fix(limiter): reject namespace IDs starting with dash#399

Merged
sodre merged 1 commit into
mainfrom
fix/398-namespace-dash-cli
Feb 16, 2026
Merged

🐛 fix(limiter): reject namespace IDs starting with dash#399
sodre merged 1 commit into
mainfrom
fix/398-namespace-dash-cli

Conversation

@sodre

@sodre sodre commented Feb 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a guard in register_namespace() to regenerate namespace IDs that start with -, preventing Click from misinterpreting them as option flags in CLI commands like namespace recover and namespace purge
  • Update CLAUDE.md to document the dash exclusion in namespace ID format
  • Add unit test verifying the regeneration behavior by mocking secrets.token_urlsafe

Test plan

  • Unit test test_register_namespace_skips_dash_prefixed_id passes
  • Generated sync code is up-to-date (hatch run generate-sync reports unchanged)
  • All 2350 unit tests pass with 100% diff coverage
  • CI passes

Closes #398

🤖 Generated with Claude Code

Namespace IDs generated by `secrets.token_urlsafe(8)` can start with `-`,
which causes Click to interpret them as option flags in CLI commands like
`namespace recover` and `namespace purge`. Add a guard in
`register_namespace()` to regenerate the ID when it starts with `-`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sodre sodre added this to the v0.10.0 milestone Feb 16, 2026
@sodre sodre added area/cli Command line interface area/limiter Core rate limiting logic labels Feb 16, 2026
@codecov

codecov Bot commented Feb 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (eca1c42) to head (5b21823).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #399   +/-   ##
=======================================
  Coverage   91.88%   91.89%           
=======================================
  Files          33       33           
  Lines        7435     7437    +2     
=======================================
+ Hits         6832     6834    +2     
  Misses        603      603           
Flag Coverage Δ
doctest 29.43% <100.00%> (+0.01%) ⬆️
e2e 42.36% <50.00%> (+<0.01%) ⬆️
integration 50.84% <100.00%> (+0.01%) ⬆️
unit 91.62% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sodre sodre marked this pull request as ready for review February 16, 2026 12:52
@sodre sodre merged commit fbb2896 into main Feb 16, 2026
25 checks passed
@sodre sodre deleted the fix/398-namespace-dash-cli branch February 16, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli Command line interface area/limiter Core rate limiting logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Namespace IDs starting with dash break CLI commands

1 participant