- Consolidated all system/user config logic into configmanager.py - Removed duplicate loaders from setup.py and TUI.py - Eliminated .env redundancy; now only stores WORKING_DIR - Clarified boundaries: system config immutable, user config mutable - Updated TUI to use save_user_config() - Removed all deprecated/legacy config functions and aliases
This commit is contained in:
+11
-11
@@ -28,7 +28,7 @@ import pandas as pd
|
||||
|
||||
import airlock_libs
|
||||
from services.API import AirlockAPIWrapper
|
||||
from utils.configmanager import get_protected_value, load_env_json
|
||||
from utils.configmanager import get_system_list, get_system_value
|
||||
from utils.utils import colorText, regulator
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -90,9 +90,9 @@ class Hash:
|
||||
|
||||
@classmethod
|
||||
def categorize_hashes(cls, hashes):
|
||||
threat_tolerance = get_protected_value("VT_THREAT_TOLERANCE", cast_type=int)
|
||||
bad_publishers_pattern = regulator(load_env_json("BAD_PUBLISHERS", "[]"))
|
||||
pups_pattern = regulator(load_env_json("PUPS", "[]"))
|
||||
threat_tolerance = get_system_value("VT_THREAT_TOLERANCE", cast_type=int)
|
||||
bad_publishers_pattern = regulator(get_system_list("BAD_PUBLISHERS"))
|
||||
pups_pattern = regulator(get_system_list("PUPS"))
|
||||
|
||||
approved_count = 0
|
||||
unapproved_count = 0
|
||||
@@ -145,13 +145,13 @@ class Hash:
|
||||
approved_count += 1
|
||||
except (ValueError, TypeError):
|
||||
logger.debug(
|
||||
"Needs Review: Scannermatch score is missing or invalid. — {e}"
|
||||
"Needs Review: Scannermatch score is missing or invalid. — {e}"
|
||||
)
|
||||
hash_obj.at_decision = "needs_review"
|
||||
needs_review_count += 1
|
||||
|
||||
logger.debug(
|
||||
f"Final counts — Needs Review: {needs_review_count}, Approved: {approved_count}, Unapproved: {unapproved_count}"
|
||||
f"Final counts — Needs Review: {needs_review_count}, Approved: {approved_count}, Unapproved: {unapproved_count}"
|
||||
)
|
||||
return hashes
|
||||
|
||||
@@ -384,9 +384,9 @@ class ExecutionHistoryRecord:
|
||||
Returns:
|
||||
List[ExecutionHistoryRecord]: The same list, with hash_obj.at_decision updated.
|
||||
"""
|
||||
threat_tolerance = get_protected_value("VT_THREAT_TOLERANCE", cast_type=int)
|
||||
bad_publishers_pattern = regulator(load_env_json("BAD_PUBLISHERS", "[]"))
|
||||
pups_pattern = regulator(load_env_json("PUPS", "[]"))
|
||||
threat_tolerance = get_system_value("VT_THREAT_TOLERANCE", cast_type=int)
|
||||
bad_publishers_pattern = regulator(get_system_list("BAD_PUBLISHERS"))
|
||||
pups_pattern = regulator(get_system_list("PUPS"))
|
||||
|
||||
approved_count = 0
|
||||
unapproved_count = 0
|
||||
@@ -443,13 +443,13 @@ class ExecutionHistoryRecord:
|
||||
approved_count += 1
|
||||
except (ValueError, TypeError) as e:
|
||||
logger.debug(
|
||||
f"Needs Review: Scannermatch score is missing or invalid. — {e}"
|
||||
f"Needs Review: Scannermatch score is missing or invalid. — {e}"
|
||||
)
|
||||
hash_obj.at_decision = "needs_review"
|
||||
needs_review_count += 1
|
||||
|
||||
logger.debug(
|
||||
f"Final counts — Needs Review: {needs_review_count}, "
|
||||
f"Final counts — Needs Review: {needs_review_count}, "
|
||||
f"Approved: {approved_count}, Unapproved: {unapproved_count}"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user