Fixed issue with generating multiple OTP - now prints a nice list for Copy/Paste. Began splitting client / server functionality. Demoted selector and setup to util from service. Fixed some typos.

This commit is contained in:
2025-10-09 09:36:48 -04:00
parent 6e4e35fa34
commit b74f77a9db
16 changed files with 503 additions and 332 deletions
+28 -10
View File
@@ -30,6 +30,13 @@ from flows.prepPolicy import (
sortHashes,
)
from flows.quietAgent import findQuietAgents
from flows.otp import (
generate,
otp_activities_by_agent,
revoke
)
from services.agenthandler import findAgents
from services.API import AirlockAPIWrapper
from utils.utils import (
@@ -41,6 +48,8 @@ from utils.utils import (
printEnforceChecklist,
)
logger = logging.getLogger(__name__)
dotenv.load_dotenv()
@@ -237,24 +246,33 @@ def menu_policy_enforce(api: AirlockAPIWrapper):
def menu_otp(api: AirlockAPIWrapper):
working_dir = load_env("WORKING_DIR")
while True:
print(colorText("\n--- 🎫 OTP Submenu 🎫 ---", "cyan"))
print(colorText("1. Generate OTP", "cyan"))
# print(colorText("2. Sub-option B","cyan"))
print(colorText("Q. Return to Main Menu", "cyan"))
print(colorText("1. 🔐 -Generate OTPs", "cyan"))
print(colorText("2. 📊 -OTP Activities By Agent", "cyan"))
print(colorText("3. ❌ -Revoke OTPs", "cyan"))
print(colorText("F. 📂 - Open Working Directory", "yellow"))
print(colorText("S. 🛠️ - Settings", "yellow"))
print(colorText("Q. 🔚 - Quit", "yellow"))
choice = input("Enter your choice: ")
if choice == "1":
# TODO generateOTP(api,findAgents()
break
otp_list = generate(api)
print(colorText(otp_list,"green"))
elif choice == "2":
print("You selected Sub-option B")
otp_activities_by_agent(api)
elif choice == "3":
revoke(api)
elif choice == "F":
open_directory(working_dir)
elif choice == "S":
menu_settings()
elif choice == "Q":
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please try again.")
def menu_settings():