Exemplo n.º 1
0
    def run_logic(
        self,
        secret=None,
        secret_lineno=15,
        plugins_used=None,
        should_find_secret=True,
        force_line_printing=False,
    ):
        # Setup default arguments
        if not secret:
            secret = potential_secret_factory(
                type_='Private Key',
                filename='filenameA',
                secret='BEGIN PRIVATE KEY',
                lineno=secret_lineno,
            )

        if not plugins_used:
            plugins_used = [
                {
                    'name': 'PrivateKeyDetector',
                },
            ]

        with self.mock_get_raw_secret_value(
                secret.secret_value,
                secret_lineno,
                should_find_secret,
        ):
            audit._print_context(
                filename=secret.filename,
                secret=secret.json(),
                custom_plugin_paths=(),
                count=1,
                total=2,
                plugins_used=plugins_used,
                force_line_printing=force_line_printing,
            )
Exemplo n.º 2
0
    def run_logic(self, secret=None, secret_lineno=15, settings=None):
        # Setup default arguments
        if not secret:
            secret = potential_secret_factory(
                type_='Private Key',
                filename='filenameA',
                secret='BEGIN PRIVATE KEY',
                lineno=secret_lineno,
            ).json()

        if not settings:
            settings = [
                {
                    'name': 'PrivateKeyDetector',
                },
            ]

        audit._print_context(
            secret['filename'],
            secret,
            count=1,
            total=2,
            plugin_settings=settings,
        )
Exemplo n.º 3
0
    def run_logic(self, secret=None, secret_lineno=15, settings=None):
        # Setup default arguments
        if not secret:
            secret = potential_secret_factory(
                type_='Private Key',
                filename='filenameA',
                secret='BEGIN PRIVATE KEY',
                lineno=secret_lineno,
            ).json()

        if not settings:
            settings = [
                {
                    'name': 'PrivateKeyDetector',
                },
            ]

        audit._print_context(
            secret['filename'],
            secret,
            count=1,
            total=2,
            plugin_settings=settings,
        )