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

is_verified remains false even with result return with --only-verified flag #520

Closed
eyalatox opened this issue Feb 16, 2022 · 3 comments
Closed
Labels
bug The issue describes a malfunctioning aspect of the project. good first issue The issue can be tackled by someone who has little to no knowledge about the project. P3 When you get around it. E.g. a fix for non-breaking issue we will work on when there's nothing more testing A fix for the issue has been released and we asked the reported to confirm it has been fixed.

Comments

@eyalatox
Copy link

Hello,

I've written the below simple plugin as a PoC, deliberately ensuring it is always verified to be true.
Yet, it never gets the is_verified field to be true.
Interestingly it does return when using the --only-verified flag.
Is that a bug, or am I missing something here?

import re

from detect_secrets.constants import VerifiedResult
from detect_secrets.util.code_snippet import CodeSnippet
from detect_secrets.plugins.base import RegexBasedDetector


class ADetector(RegexBasedDetector):
    secret_type = '5A token'

    denylist = [
        re.compile(r'A{5,}'),
    ]

    def verify(self, secret: str, context: CodeSnippet) -> VerifiedResult:
        return VerifiedResult.VERIFIED_TRUE 
@eran-medan
Copy link

It seems like a major regression, is_verified is not set in any place in the code anymore. (wasn't the case in 1.10). What happened??

@jpdakran jpdakran added pending The issue still needs to be reviewed by one of the maintainers. bug The issue describes a malfunctioning aspect of the project. P3 When you get around it. E.g. a fix for non-breaking issue we will work on when there's nothing more triaged The issue has been reviewed but has not been solved yet. good first issue The issue can be tackled by someone who has little to no knowledge about the project. and removed pending The issue still needs to be reviewed by one of the maintainers. labels Jun 15, 2022
@lorenzodb1 lorenzodb1 added the good first issue The issue can be tackled by someone who has little to no knowledge about the project. label Jun 15, 2022
@jpdakran jpdakran added selected The issue has been selected to be worked on. and removed triaged The issue has been reviewed but has not been solved yet. labels Jun 15, 2022
@lorenzodb1
Copy link
Contributor

Hi @eran-medan, sorry for the late update. We should have fixed this in #578, would you mind updating to v1.3.0 and re-testing this?

@lorenzodb1 lorenzodb1 added testing A fix for the issue has been released and we asked the reported to confirm it has been fixed. and removed selected The issue has been selected to be worked on. labels Sep 16, 2022
@jpdakran
Copy link
Member

Hello. I have re-tested this with your custom plugin above. This is fixed. I will consider this resolved. If you have any other questions or you do not consider this resolved - please re-open an issue and the team will be happy to assist. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue describes a malfunctioning aspect of the project. good first issue The issue can be tackled by someone who has little to no knowledge about the project. P3 When you get around it. E.g. a fix for non-breaking issue we will work on when there's nothing more testing A fix for the issue has been released and we asked the reported to confirm it has been fixed.
Projects
None yet
Development

No branches or pull requests

4 participants