mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-05-06 08:47:18 +00:00
fix(check): break circular import between config and check.utils (#10895)
This commit is contained in:
@@ -10,6 +10,15 @@ import yaml
|
||||
from packaging import version
|
||||
|
||||
from prowler.lib.check.compliance_models import load_compliance_framework_universal
|
||||
|
||||
# Re-exported from a leaf module so prowler.lib.check.utils can import the
|
||||
# constant without participating in the config <-> compliance_models <-> utils
|
||||
# import cycle. Existing consumers continue to import from this module.
|
||||
# The `as EXTERNAL_TOOL_PROVIDERS` rename is the PEP 484 explicit re-export
|
||||
# form so static analyzers (CodeQL, mypy, ruff) treat the name as public.
|
||||
from prowler.lib.check.external_tool_providers import ( # noqa: F401
|
||||
EXTERNAL_TOOL_PROVIDERS as EXTERNAL_TOOL_PROVIDERS,
|
||||
)
|
||||
from prowler.lib.logger import logger
|
||||
|
||||
|
||||
@@ -69,10 +78,6 @@ class Provider(str, Enum):
|
||||
VERCEL = "vercel"
|
||||
|
||||
|
||||
# Providers that delegate scanning to an external tool (e.g. Trivy, promptfoo)
|
||||
# and bypass standard check/service loading.
|
||||
EXTERNAL_TOOL_PROVIDERS = frozenset({"iac", "llm", "image"})
|
||||
|
||||
# Compliance
|
||||
actual_directory = pathlib.Path(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
@@ -152,7 +157,7 @@ def set_output_timestamp(
|
||||
Override the global output timestamps so generated artifacts reflect a specific scan.
|
||||
Returns the previous values so callers can restore them afterwards.
|
||||
"""
|
||||
global timestamp, timestamp_utc, output_file_timestamp, timestamp_iso
|
||||
global output_file_timestamp, timestamp_iso
|
||||
|
||||
previous_values = (
|
||||
timestamp.value,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Providers that delegate scanning to an external tool (e.g. Trivy, promptfoo)
|
||||
# and bypass standard check/service loading.
|
||||
#
|
||||
# Kept in a leaf module with no imports so it can be referenced from both
|
||||
# prowler.config.config and prowler.lib.check.utils without forming an
|
||||
# import cycle.
|
||||
EXTERNAL_TOOL_PROVIDERS = frozenset({"iac", "llm", "image"})
|
||||
@@ -2,7 +2,7 @@ import importlib
|
||||
import sys
|
||||
from pkgutil import walk_packages
|
||||
|
||||
from prowler.config.config import EXTERNAL_TOOL_PROVIDERS
|
||||
from prowler.lib.check.external_tool_providers import EXTERNAL_TOOL_PROVIDERS
|
||||
from prowler.lib.logger import logger
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user