detect-secrets
detect-secrets copied to clipboard
Add Occurences to Potential Secrets
A potential secret is uniquely identified by three main properties: filename, secret_hash, type
. Since line_number
is not included this means we will only track a single potential secret in a file although it may appear on multiple lines. This is a fundamental design decision.
The idea behind this pull request is to give users some insight to how many occurences a potential secret is showing up in their files. This does not violate the fundamental design above but rather serves as an improvement hopefully giving better insight to developers on the overall scope of their potential secrets.
One of the key changes is changing the SecretsCollection
data structure from a Set
to a List
. The reasoning behind this decision is when we are scanning through the file - we do not only want to deny duplicate secrets to the data structure but alter the existing potential secrets occurrences. List
gives us a lot of flexibility with changing properties in the data structure while Set
is a little restricted. The new List
will operate almost identically to the previous Set
in terms of not allowing duplicate secrets but with the addition of tracking occurrences.
The occurrences
property will operate very similar to the line_number
property. They are similar in the way that we will not alert on the change of this property but rather only notify the user that the baseline file changed with updated information on their secrets.
Hi, @lorenzodb1 Is this feature already added, or it is still in pending review state? I mean is this feature coming in the next release? It seems to me that it would be a good one to add.
Hi,
Any update on this feature? it seems open for very long time.
Thanks, Bhaskar.