-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added npm detector #841
added npm detector #841
Conversation
@ankushgoel27 thanks for adding this detector, really appreciate it. As for the approach I would take in this case, I would probably include a second
I'm also sure there is a way to write a regex to cover both cases, but at that point reading the regex might be more cumbersome that writing two. |
They are very dissimilar. I tried creating one regex for both but its more complicated. how do i include a second keypat? sorry, not so very well versed in golang. maybe you can help :) the new format regex is |
ok, figured it out. Will send a pull request soon. |
Hi, during my testing, i had a file with multiple valid old format tokens and new format tokens. But trufflehog was detecting only 1 of each. it should detect all tokens present in the file. |
Fixed naming convention and detection of multiple tokens. Ready to be merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot for adding these.
Added NPM detector. Only using regex for the old format. NPM introduced a new format which is NPM_[0-9a-zA-z]{36}. Not sure how to add both regexes to the same npmtoken.go file