revert flag changes

This commit is contained in:
Andoni A.
2025-08-01 16:07:16 +02:00
parent b1cfc2af7e
commit 8cd83f9ea1
5 changed files with 19 additions and 21 deletions
+1 -1
View File
@@ -737,7 +737,7 @@ Prowler enables security scanning of your **GitHub account**, including **Reposi
prowler github --oauth-app-token oauth_token
# GitHub App Credentials:
prowler github --github-app-id app_id --github-app-key app_key
prowler github --github-app-id app_id --github-app-key /path/to/private-key.pem
```
???+ note
-1
View File
@@ -239,7 +239,6 @@ class Provider(ABC):
personal_access_token=arguments.personal_access_token,
oauth_app_token=arguments.oauth_app_token,
github_app_key_path=arguments.github_app_key_path,
github_app_key_content=arguments.github_app_key_content,
github_app_id=arguments.github_app_id,
mutelist_path=arguments.mutelist_file,
config_path=arguments.config_file,
@@ -31,19 +31,12 @@ def init_parser(self):
)
github_auth_subparser.add_argument(
"--github-app-key-path",
"--github-app-key",
nargs="?",
help="Path to GitHub App private key file",
default=None,
metavar="GITHUB_APP_KEY_PATH",
)
github_auth_subparser.add_argument(
"--github-app-key",
nargs="?",
help="GitHub App private key content",
default=None,
dest="github_app_key_content",
metavar="GITHUB_APP_KEY_CONTENT",
)
github_scoping_subparser = github_parser.add_argument_group("Scan Scoping")
github_scoping_subparser.add_argument(
@@ -37,7 +37,7 @@ class TestGitHubProvider:
personal_access_token = PAT_TOKEN
oauth_app_token = None
github_app_id = None
github_app_key_content = None
github_app_key_path = None
fixer_config = load_and_validate_config_file(
"github", default_fixer_config_file_path
)
@@ -60,7 +60,7 @@ class TestGitHubProvider:
personal_access_token,
oauth_app_token,
github_app_id,
github_app_key_content,
github_app_key_path,
)
assert provider._type == "github"
@@ -79,7 +79,7 @@ class TestGitHubProvider:
personal_access_token = None
oauth_app_token = OAUTH_TOKEN
github_app_id = None
github_app_key_content = None
github_app_key_path = None
fixer_config = load_and_validate_config_file(
"github", default_fixer_config_file_path
)
@@ -102,7 +102,7 @@ class TestGitHubProvider:
personal_access_token,
oauth_app_token,
github_app_id,
github_app_key_content,
github_app_key_path,
)
assert provider._type == "github"
@@ -121,7 +121,7 @@ class TestGitHubProvider:
personal_access_token = None
oauth_app_token = None
github_app_id = APP_ID
github_app_key_content = APP_KEY
github_app_key_path = APP_KEY
fixer_config = load_and_validate_config_file(
"github", default_fixer_config_file_path
)
@@ -142,7 +142,7 @@ class TestGitHubProvider:
personal_access_token,
oauth_app_token,
github_app_id,
github_app_key_content,
github_app_key_path,
)
assert provider._type == "github"
@@ -210,7 +210,7 @@ class TestGitHubProvider:
),
):
connection = GithubProvider.test_connection(
github_app_id=APP_ID, github_app_key_content=APP_KEY
github_app_id=APP_ID, github_app_key_path=APP_KEY
)
assert isinstance(connection, Connection)
@@ -272,7 +272,7 @@ class TestGitHubProvider:
):
with pytest.raises(GithubInvalidCredentialsError):
GithubProvider.test_connection(
github_app_id=APP_ID, github_app_key_content="invalid-key"
github_app_id=APP_ID, github_app_key_path="invalid-key"
)
def test_test_connection_with_invalid_app_credentials_no_raise(self):
@@ -291,7 +291,7 @@ class TestGitHubProvider:
):
connection = GithubProvider.test_connection(
github_app_id=APP_ID,
github_app_key_content="invalid-key",
github_app_key_path="invalid-key",
raise_on_exception=False,
)
@@ -61,11 +61,17 @@ class Test_GitHubArguments:
arguments.init_parser(mock_github_args)
# Verify authentication arguments were added
assert self.mock_auth_group.add_argument.call_count == 5
assert self.mock_auth_group.add_argument.call_count == 4
# Check that all authentication arguments are present
calls = self.mock_auth_group.add_argument.call_args_list
auth_args = [call[0][0] for call in calls]
auth_args = []
for call in calls:
# Handle both single arguments and aliases
if len(call[0]) > 1:
auth_args.extend(call[0])
else:
auth_args.append(call[0][0])
assert "--personal-access-token" in auth_args
assert "--oauth-app-token" in auth_args