File tree 2 files changed +3
-33
lines changed
2 files changed +3
-33
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ def __init__(
23
23
is_secret = None ,
24
24
):
25
25
"""
26
- :type typ: list( str)
26
+ :type typ: str
27
27
:param typ: human-readable secret types, defined by the plugins
28
28
that generated this PotentialSecret.
29
- e.g. [ "High Entropy String"]
29
+ e.g. "High Entropy String"
30
30
31
31
:type filename: str
32
32
:param filename: name of file that this secret was found
@@ -41,7 +41,7 @@ def __init__(
41
41
:type is_secret: bool|None
42
42
:param is_secret: whether or not the secret is a true- or false- positive
43
43
"""
44
- self .type = [ typ ]
44
+ self .type = typ
45
45
self .filename = filename
46
46
self .lineno = lineno
47
47
self .secret_hash = self .hash_secret (secret )
Original file line number Diff line number Diff line change @@ -259,41 +259,11 @@ def _results_accumulator(self, filename):
259
259
if not file_results :
260
260
return
261
261
262
- self ._remove_keyword_secrets_if_line_reported_already (
263
- file_results ,
264
- )
265
-
266
262
if filename not in self .data :
267
263
self .data [filename ] = file_results
268
264
else :
269
265
self .data [filename ].update (file_results )
270
266
271
- def _remove_keyword_secrets_if_line_reported_already (
272
- self ,
273
- file_results ,
274
- ):
275
- """
276
- It is often the case that e.g.
277
- SUPER_SECRET_VALUE = 'c3VwZXIgbG9uZyBzdHJ'
278
- is reported both by the KeywordDetector and another plugin.
279
-
280
- To minimize diff size, we will simply not report findings from
281
- the KeywordDetector if another plugin reports a secret on the
282
- same line.
283
- """
284
- password_secrets = list ()
285
- line_numbers_of_other_plugins = set ()
286
-
287
- for secret in file_results :
288
- if secret .type == 'Password' :
289
- password_secrets .append (secret )
290
- else :
291
- line_numbers_of_other_plugins .add (secret .lineno )
292
-
293
- for password_secret in password_secrets :
294
- if password_secret .lineno in line_numbers_of_other_plugins :
295
- del file_results [password_secret ]
296
-
297
267
def _extract_secrets_from_file (self , f , filename ):
298
268
"""Extract secrets from a given file object.
299
269
You can’t perform that action at this time.
0 commit comments