Summary of What Needs to be Done:
Add unit tests for the _sanitize_stderr helper function in backend/secuscan/parser_sandbox.py. This function strips file paths and Python line-number references from stderr output and truncates it to a maximum character count. It prevents internal file paths from leaking into logs.
Changes that Need to be Made:
Create testing/backend/unit/test_parser_sandbox_sanitize_stderr.py with tests for:
- Unix paths replaced with [PATH] (e.g., /home/user/file.py)
- Windows paths replaced with [PATH] (e.g., C:\Users\file.py)
- Python line numbers replaced with [LINE] (e.g., line 42)
- Multiple replacements in one string
- Strings with no sensitive content passed through unchanged
- Truncation to max_chars (default 500)
- Custom max_chars parameter
- Empty string handled correctly
- Long output truncation preserves [PATH] and [LINE] replacements
Impact that it would Provide:
Improves test coverage for a security-sensitive output sanitization function. Ensures internal paths and line numbers cannot leak into logs or error messages shown to end users.
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.
Summary of What Needs to be Done:
Add unit tests for the _sanitize_stderr helper function in backend/secuscan/parser_sandbox.py. This function strips file paths and Python line-number references from stderr output and truncates it to a maximum character count. It prevents internal file paths from leaking into logs.
Changes that Need to be Made:
Create testing/backend/unit/test_parser_sandbox_sanitize_stderr.py with tests for:
Impact that it would Provide:
Improves test coverage for a security-sensitive output sanitization function. Ensures internal paths and line numbers cannot leak into logs or error messages shown to end users.
Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.