inspect additional sensitive data carriers - #49
Conversation
higagan
left a comment
There was a problem hiding this comment.
Verified this locally — the code is right, and thanks for cutting the kwarg-name and fail-closed parts as discussed. Scope is exactly what we agreed.
All five carriers now block, and ordinary calls still work (int, float, Path, callbacks pass through untouched, so nothing breaks):
dict KEY (JSON-native) -> BLOCKED
bytes / bytearray -> BLOCKED
set / frozenset -> BLOCKED
ordinary scalar call -> ran
102 tests pass, ruff check clean. Decoding bytes with errors="ignore" is the right call — it can only join characters, never split a keyword, so it fails safe.
One thing left before merge: the README Limitations section still says
only
str,list,tuple, anddictvalues are inspected
which your PR makes untrue. That's the last unchecked box on #48. Could you update it to match — something like:
only
str,bytes,list,tuple,set, anddictkeys and values are inspected
Once that's in, this is good to merge.
(Two unrelated things I hit while reviewing, both pre-existing on main and not yours: ruff format --check flags cli.py/test_scan.py, and cyclic input raises RecursionError. Filed separately.)
|
@dyson-025 — still happy to merge once the README Limitations line is updated to match the new coverage. That's the only thing outstanding. |
|
just wait 1 hour i will fix this. |
) AGENTS.md rule 4 still listed bytes and set as uninspected, which #49 made false. Updated to match the README: str, bytes, list, tuple, set, and dict keys and values are now inspected. Also fixes a stray capital 'Only' in the README Limitations paragraph.
Description
Extends
SensitiveDataFilterto inspect additional value carriers while preserving existing behavior.Changes
bytesandbytearrayby decoding them before applying the filter.setandfrozensetrecursively like other container types.Related Issues
Closes #48
Type of Change
Verification Checklist
pytest)ruff formatruff check