From fbba7fdf7a492ef27f8be908f9ec794a4a71c681 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Fri, 17 Jan 2025 18:18:12 +0200 Subject: [PATCH] rollback --- credsweeper/filters/value_pattern_check.py | 3 +-- tests/test_doc.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/credsweeper/filters/value_pattern_check.py b/credsweeper/filters/value_pattern_check.py index d4bf19fc7..f580f0c78 100644 --- a/credsweeper/filters/value_pattern_check.py +++ b/credsweeper/filters/value_pattern_check.py @@ -101,8 +101,7 @@ def run(self, line_data: LineData, target: AnalysisTarget) -> bool: """ if len(line_data.value) < self.pattern_len: - # the filter cannot check short value - return False + return True if self.equal_pattern_check(line_data.value): return True diff --git a/tests/test_doc.py b/tests/test_doc.py index 59ba58d6a..030140c5b 100644 --- a/tests/test_doc.py +++ b/tests/test_doc.py @@ -19,7 +19,7 @@ def test_secret_pair_p(self) -> None: content_provider: AbstractProvider = FilesProvider([SAMPLES_PATH / "doc_secret_pair"]) self.cred_sweeper.run(content_provider=content_provider) found_credentials = self.cred_sweeper.credential_manager.get_credentials() - self.assertEqual(39, len(found_credentials)) + self.assertEqual(38, len(found_credentials)) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -27,7 +27,7 @@ def test_passwd_pair_p(self) -> None: content_provider: AbstractProvider = FilesProvider([SAMPLES_PATH / "doc_passwd_pair"]) self.cred_sweeper.run(content_provider=content_provider) found_credentials = self.cred_sweeper.credential_manager.get_credentials() - self.assertEqual(73, len(found_credentials)) + self.assertEqual(72, len(found_credentials)) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #