allow --list-checks without authentication

This commit is contained in:
HugoPBrito
2025-12-16 12:35:15 +01:00
parent 25b732655c
commit c612637a86

View File

@@ -1,6 +1,3 @@
from os import environ
def init_parser(self):
"""Init the Cloudflare provider CLI parser."""
cloudflare_parser = self.subparsers.add_parser(
@@ -17,18 +14,3 @@ def init_parser(self):
metavar="ZONE",
help="Filter scan to specific Cloudflare zones (name or ID).",
)
def validate_arguments(arguments) -> tuple[bool, str]:
"""Validate Cloudflare provider arguments."""
token = environ.get("CLOUDFLARE_API_TOKEN", "")
api_key = environ.get("CLOUDFLARE_API_KEY", "")
api_email = environ.get("CLOUDFLARE_API_EMAIL", "")
if not token and not (api_key and api_email):
return (
False,
"Cloudflare provider requires CLOUDFLARE_API_TOKEN or the combination of CLOUDFLARE_API_KEY and CLOUDFLARE_API_EMAIL environment variables.",
)
return (True, "")