Skip to content
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

scan_line method not detecting secrets in passed string #709

Open
1 of 2 tasks
pbraband opened this issue Aug 23, 2023 · 1 comment
Open
1 of 2 tasks

scan_line method not detecting secrets in passed string #709

pbraband opened this issue Aug 23, 2023 · 1 comment
Labels
question The issue is a technical question related to the project. triaged The issue has been reviewed but has not been solved yet.

Comments

@pbraband
Copy link

  • I'm submitting a ...

    • bug report
    • feature request
  • What is the current behavior?
    Invoking scan_line from within another python script isn't detecting secrets in the strings being passed in

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
    image

  • What is the expected behavior?
    a potential secret obj returned from the generator

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

    • detect-secrets Version: 1.4.0
    • Python Version: 3.11.4
    • OS Version: MacOS Ventura 13.4.1 (22F82)
    • File type (if applicable): N/A
  • Other information

@lorenzodb1 lorenzodb1 added the pending The issue still needs to be reviewed by one of the maintainers. label Nov 17, 2023
@lorenzodb1 lorenzodb1 added question The issue is a technical question related to the project. triaged The issue has been reviewed but has not been solved yet. and removed pending The issue still needs to be reviewed by one of the maintainers. labels May 16, 2024
@Fennerr
Copy link

Fennerr commented Jul 19, 2024

I had the same issue. Importing the default_settings, and then wrapping the scan_line inside of a with line fixed it for me:

from detect_secrets.settings import default_settings
...
with default_settings():
    secrets = list(scan_line(variable.value))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a technical question related to the project. triaged The issue has been reviewed but has not been solved yet.
Projects
None yet
Development

No branches or pull requests

3 participants