Syncing before linting with black

This commit is contained in:
2025-11-06 10:59:59 -05:00
parent 2226cd8e46
commit f33b041ac0
10 changed files with 25 additions and 21 deletions
+6 -4
View File
@@ -24,13 +24,14 @@
import logging import logging
import os import os
import tempfile import tempfile
import dotenv import dotenv
import urllib3 import urllib3
from services.API import AirlockAPIWrapper from services.API import AirlockAPIWrapper
from services.security import getAPI from services.security import getAPI
from utils.setup import get_base_directory, setup from utils.setup import get_base_directory, setup
from utils.TUI import run_AirlockTools from utils.TUI import run_Loxide
from utils.utils import irtang from utils.utils import irtang
urllib3.disable_warnings( urllib3.disable_warnings(
@@ -74,15 +75,16 @@ def main():
raise raise
api_key = getAPI(username, "AirlockTools") api_key = getAPI(username, "Loxide")
if api_key is None: if api_key is None:
raise ValueError("API key for AirlockTools is missing.") raise ValueError("API key for Loxide is missing.")
api = AirlockAPIWrapper( api = AirlockAPIWrapper(
base_url=str(os.getenv("URL")), base_url=str(os.getenv("URL")),
api_key=api_key, api_key=api_key,
) )
run_AirlockTools(api) run_Loxide(api)
+3 -3
View File
@@ -1,7 +1,7 @@
# 🛡️ Airlock Tools # 🛡️ Loxide
Python toolkit for secure, auditable, and automated airlock agent and policy management. Designed for enterprise environments, it supports advanced policy workflows, device tracking, and terminal-based interaction. Python/Rust/Oxide toolkit for secure, auditable, and automated airlock agent and policy management. Designed for enterprise environments, it supports advanced policy workflows, device tracking, and terminal-based interaction.
--- ---
@@ -51,7 +51,7 @@ Python toolkit for secure, auditable, and automated airlock agent and policy man
## 📜 License ## 📜 License
**AirlockTools** is licensed under the **GNU Affero General Public License v3.0**. **Loxide** is licensed under the **GNU Affero General Public License v3.0**.
You may copy, distribute, and modify the software under the terms of the AGPL-3.0 license. You may copy, distribute, and modify the software under the terms of the AGPL-3.0 license.
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Dict, List, Optional from typing import Dict, List
def pull_policy_exec_histories(self, type: List[str], checkpoint: str, policy: List[str]) -> str: def pull_policy_exec_histories(self, type: List[str], checkpoint: str, policy: List[str]) -> str:
"""Retrieve execution history logs.""" """Retrieve execution history logs."""
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

-1
View File
@@ -28,7 +28,6 @@ import pandas as pd
import airlock_libs import airlock_libs
from services.API import AirlockAPIWrapper from services.API import AirlockAPIWrapper
from services.policyhandler import pullPolicyExechistories
from utils.configmanager import get_protected_value, load_env_json from utils.configmanager import get_protected_value, load_env_json
from utils.utils import colorText, regulator from utils.utils import colorText, regulator
+3 -1
View File
@@ -177,8 +177,10 @@ def pullPolicyExechistories(
def getPolicyInfo(api: AirlockAPIWrapper, policy, type, days): def getPolicyInfo(api: AirlockAPIWrapper, policy, type, days):
import airlock_libs
executionhist_policy = pd.DataFrame() executionhist_policy = pd.DataFrame()
exehist = pullPolicyExechistories(api, policy, type, days, True) exehist = airlock_libs.pull_policy_exec_histories(api, policy.name, str(type), days)
if exehist is not None: if exehist is not None:
data = json.loads(exehist) data = json.loads(exehist)
executionhist_policy = pd.DataFrame(data["response"]["exechistories"]) executionhist_policy = pd.DataFrame(data["response"]["exechistories"])
+1 -1
View File
@@ -52,7 +52,7 @@ def load_protected_config() -> dict:
except FileNotFoundError: except FileNotFoundError:
logging.warning("⚠️ system_config.json not found. Using built-in defaults.") logging.warning("⚠️ system_config.json not found. Using built-in defaults.")
system_config = { system_config = {
"APPNAME": "AirlockTools", "APPNAME": "Loxide",
"PATH_EXCLUSION_CONST": 4, "PATH_EXCLUSION_CONST": 4,
"MIN_FILES_FOR_PATH": 4, "MIN_FILES_FOR_PATH": 4,
"VT_THREAT_TOLERANCE": 4, "VT_THREAT_TOLERANCE": 4,
+6 -6
View File
@@ -31,15 +31,15 @@ def get_base_directory() -> Path:
system = platform.system() system = platform.system()
home = Path.home() home = Path.home()
if system == 'Windows': if system == 'Windows':
return Path(os.getenv('APPDATA', home / 'AppData' / 'Roaming')) / "AirlockTools" return Path(os.getenv('APPDATA', home / 'AppData' / 'Roaming')) / "Loxide"
elif system == 'Darwin': elif system == 'Darwin':
return home / 'Library' / 'Application Support' / "AirlockTools" return home / 'Library' / 'Application Support' / "Loxide"
else: else:
return home / '.local' / 'share' / "AirlockTools" return home / '.local' / 'share' / "Loxide"
def configure_logging(log_dir: Path, log_level: str = "DEBUG"): def configure_logging(log_dir: Path, log_level: str = "DEBUG"):
log_file = log_dir / "airlocktools.log" log_file = log_dir / "Loxide.log"
config = { config = {
"version": 1, # Required key for dictConfig format version "version": 1, # Required key for dictConfig format version
@@ -82,7 +82,7 @@ def configure_logging(log_dir: Path, log_level: str = "DEBUG"):
try: try:
config["handlers"]["eventlog"] = { config["handlers"]["eventlog"] = {
"class": "logging.handlers.NTEventLogHandler", "class": "logging.handlers.NTEventLogHandler",
"appname": "AirlockTools", # Event log source name "appname": "Loxide", # Event log source name
"level": "CRITICAL", # Only log critical errors "level": "CRITICAL", # Only log critical errors
"formatter": "simple", # Use simple format "formatter": "simple", # Use simple format
} }
@@ -108,7 +108,7 @@ def load_system_config() -> dict:
except FileNotFoundError: except FileNotFoundError:
logging.warning("⚠️ system_config.json not found. Using built-in defaults.") logging.warning("⚠️ system_config.json not found. Using built-in defaults.")
return { return {
"APPNAME": "AirlockTools", "APPNAME": "Loxide",
"LOG_LEVEL": "DEBUG", "LOG_LEVEL": "DEBUG",
"PATH_EXCLUSION_CONST": 4, "PATH_EXCLUSION_CONST": 4,
"MIN_FILES_FOR_PATH": 4, "MIN_FILES_FOR_PATH": 4,
View File
+4 -4
View File
@@ -366,7 +366,7 @@ class MainMenuScreen(Screen):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 2) APP # 2) APP
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
class AirlockTools(App): class Loxide(App):
CSS = """ CSS = """
#logo { #logo {
width: 100%; width: 100%;
@@ -447,7 +447,7 @@ def _run_legacy_job(func, args, kwargs) -> None:
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 4) PUBLIC ENTRYPOINT # 4) PUBLIC ENTRYPOINT
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def run_AirlockTools(api: AirlockAPIWrapper) -> None: def run_Loxide(api: AirlockAPIWrapper) -> None:
global _PENDING_JOB global _PENDING_JOB
while True: while True:
@@ -456,7 +456,7 @@ def run_AirlockTools(api: AirlockAPIWrapper) -> None:
dotenv.load_dotenv(dotenv_path=env_path, override=True) dotenv.load_dotenv(dotenv_path=env_path, override=True)
_PENDING_JOB = None _PENDING_JOB = None
app = AirlockTools(api) app = Loxide(api)
try: try:
app.run() app.run()
@@ -486,4 +486,4 @@ def run_AirlockTools(api: AirlockAPIWrapper) -> None:
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
if __name__ == "__main__": if __name__ == "__main__":
api = AirlockAPIWrapper() api = AirlockAPIWrapper()
run_AirlockTools(api) run_Loxide(api)