Thanks to visit codestin.com
Credit goes to github.com

Skip to content

More performant BasicAuth plugin#80

Merged
domanchi merged 1 commit into
masterfrom
improved-performance-for-basic-auth-plugin
Oct 3, 2018
Merged

More performant BasicAuth plugin#80
domanchi merged 1 commit into
masterfrom
improved-performance-for-basic-auth-plugin

Conversation

@domanchi
Copy link
Copy Markdown
Contributor

@domanchi domanchi commented Oct 3, 2018

Summary

This should make the BasicAuth plugin much more performant, and fixes #79 and #77.

Testing

$ time python detect_secrets/main.py scan --no-hex-string-scan --no-base64-string-scan --no-keyword-scan --no-private-key-scan <large-file>

It actually finishes this time! Furthermore, I modified the large file by inserting a secret that I'd expect it to find, and it finds it as well.

Rationale

We're already doing BASIC_AUTH_REGEX.findall(line) which will run the regex on all non-overlapping matches of the pattern in the string. This means that we can ignore the prefix catch-all expression (.*?) because we don't care about that, and we can let the python library handle it for us.

@domanchi domanchi requested a review from KevinHock October 3, 2018 19:24
Copy link
Copy Markdown
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@domanchi domanchi merged commit a23296d into master Oct 3, 2018
@domanchi domanchi deleted the improved-performance-for-basic-auth-plugin branch October 3, 2018 20:24
@joshuarli
Copy link
Copy Markdown
Contributor

Nice one @domanchi!

jfagoagas pushed a commit to jfagoagas/detect-secrets that referenced this pull request Mar 14, 2026
Don't publish to separate images repositories depending on OS, instead tag the detect-secrets image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BasicAuth regex runs all night long

3 participants