Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty matches #104

Merged
merged 2 commits into from
May 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/offat/tester/post_test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def detect_exposure(data: str) -> dict:
for pattern_name, pattern in sensitive_data_regex_patterns.items():
matches = findall(pattern, data)
if matches:
if isinstance(matches, list) and isinstance(matches[0], tuple):
matches = [tuple(filter(None, item)) for item in matches]
dmdhrumilmistry marked this conversation as resolved.
Show resolved Hide resolved
detected_exposures[pattern_name] = matches
return detected_exposures

Expand Down