Include offenderEntropy in the JSON output (#549)

* Pass the entropy data back to the Leak struct

Do this to make it easier to tune entropy checks and make decisions in
systems consuming the output.

~ B'ezrat Hashem ~

* Return negative number when entropy not checked

That way you can tell the difference between not checking or an
actual entropy level of 0

~ B'ezrat Hashem ~

* Make sure to handle range checks properly

Make sure to show when something had an entropy returned but was outside
range, or didn't have a hit at all, etc...

~ B'zrat Hashem ~

* Add a few doc strings

Follow the project's conventiona add a comment above the methods

~ B'ezrat Hashem ~

* Update tests and get them to pass

~ B'ezrat Hashem ~

* Remove checked in `.got` files

~ B'ezrat Hashem ~

* Add `*.got` to the `.gitignore`

Make sure the test output files aren't checked-in

~ B'ezrat Hashem ~
This commit is contained in:
bplaxco authored and GitHub committed 2021-05-03 20:22:20 -04:00
1 parent e7553b0168
commit 8250e40a75
52 files changed
+240 -50

No files matched your search

+9
View File
@@ -3,6 +3,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/README.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -67,6 +71,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -83,6 +88,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -99,6 +105,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -115,6 +122,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_5/notes.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -131,6 +139,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_8/README.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",