Skip to content

Commit cff0f6e

Browse files
author
rootware
committed
Making sure only sensitive string is in the api detection
1 parent c2be1f2 commit cff0f6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyredactkit/core_redactor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def identify_data(self, textchunk: str) -> list:
4747
for id in id_object.regexes:
4848
redact_pattern = id['pattern']
4949
if re.search(redact_pattern, line):
50-
sensitive_data.append(line)
50+
pattern_string = re.search(redact_pattern, line)
51+
sensitive_string = pattern_string.group(0)
52+
sensitive_data.append(sensitive_string)
5153
return sensitive_data
5254

5355
def redact_all(self, line: str) -> tuple:

0 commit comments

Comments
 (0)