Skip to content

fix(watcher): sanitize tenant_id in asyncio task and thread names - #106

Merged
zeevdr merged 1 commit into
mainfrom
fix/sanitize-task-names
May 25, 2026
Merged

zeevdr merged 1 commit into
mainfrom
fix/sanitize-task-names

Conversation

@zeevdr

@zeevdr zeevdr commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Task and thread names included tenant_id verbatim, allowing user-controlled control characters to appear in asyncio task names and threading.Thread names.
  • Adds a module-level compiled regex that strips everything outside the printable ASCII range (0x20–0x7E) before embedding the ID in the name.

Test plan

  • test_thread_name_sanitizes_control_chars — verifies sync watcher strips \x00 and \x1f from thread name
  • test_task_name_sanitizes_control_chars — verifies async watcher strips same chars from asyncio task name
  • 254 tests pass, 97.55% coverage (above 95% threshold)

Closes #70

Strip non-printable characters from tenant_id before embedding it in the
asyncio task name (async_watcher) and threading.Thread name (watcher).
A module-level compiled regex removes everything outside the printable
ASCII range (0x20–0x7E), so user-controlled tenant IDs containing
control characters no longer propagate into task/thread names.

Closes #70

Co-Authored-By: Claude <[email protected]>
@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 25, 2026
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr
zeevdr merged commit cb495ad into main May 25, 2026
15 checks passed
@zeevdr
zeevdr deleted the fix/sanitize-task-names branch May 25, 2026 15:35
@github-project-automation github-project-automation Bot moved this from Todo to Done in OpenDecree May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Sanitize tenant_id in asyncio task names

1 participant