detect-secrets icon indicating copy to clipboard operation
detect-secrets copied to clipboard

Add feature to scan line

Open karankohli13 opened this issue 2 years ago • 2 comments

Add function to scan line

secrets = SecretsCollection()
with default_settings():
secrets.scan_line('test.txt','XMY_KEY="AKIAY5XAIXXR7ALTOOHH"MY_SECRET="3L091LfFvV/dcoDCy5YO7sWz56bitLQjlVVY2WxmY"')

karankohli13 avatar Aug 28 '22 21:08 karankohli13

Hi @karankohli13, thank you for your contribution! Could you please expand on what issue you're trying to solve with this PR?

lorenzodb1 avatar Sep 20 '22 22:09 lorenzodb1

Hi @karankohli13, thank you for your contribution! Could you please expand on what issue you're trying to solve with this PR?

Hi, this function is useful when using the python library in third party apps, sometimes the use case of scanning a particular line/string for secrets comes up and this function creates a wrapper for that purpose.

karankohli13 avatar Sep 25 '22 15:09 karankohli13

I faced the same needs, please add something to scan from general string without reading file. Example is some data which comes from HTTP response from server

0x123456789 avatar Sep 25 '24 18:09 0x123456789