Fixes for audit#83
Merged
Merged
Conversation
added 3 commits
October 8, 2018 17:52
`.lower()` is now done in `secret_generator` so there is no need to do it twice.
a5d75e3 to
081f3d8
Compare
Collaborator
|
This looks great to me! Thank you so much for making this, squeaky clean commits too. :) |
domanchi
reviewed
Oct 8, 2018
| return output | ||
|
|
||
| for identifier in self.secret_generator(string.lower()): | ||
| for identifier in self.secret_generator(string): |
Contributor
There was a problem hiding this comment.
It's probably more performant to make the string lowered once here, and passed into secret_generator, than to make it .lower() every time.
| def secret_generator(self, string): | ||
| for line in BLACKLIST: | ||
| if line in string: | ||
| if line.lower() in string.lower(): |
Contributor
There was a problem hiding this comment.
Why not just change PASS = in BLACKLIST to lowercase?
Contributor
Author
|
@domanchi Good points :) I will update the PR shortly. |
domanchi
approved these changes
Oct 8, 2018
KevinHock
approved these changes
Oct 9, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two issues I've noticed in the
auditmode:keywordplugin failing withSecretNotFoundOnSpecifiedLineErrorif the secret is different in terms of lowercase vs uppercase. (before this change thekeywordplugin is case-insensitive atdetect-secrets/detect_secrets/plugins/keyword.py
Line 58 in d912ced
detect-secrets/detect_secrets/plugins/keyword.py
Line 70 in d912ced
auditmode atdetect-secrets/detect_secrets/core/audit.py
Line 313 in cc6bddb
_get_secret_with_contextfailing for small files if they don't have\nat the end of the file.