RustImplementation #23

Merged
mysticmomba merged 118 commits from RustImplementation into master 2025-11-04 18:13:24 -05:00
Showing only changes of commit 3bb69aaab7 - Show all commits
+6 -2
View File
@@ -81,10 +81,14 @@ def monitorOTP(url, pups):
current_active_OTP = pd.read_parquet(new_otp_path) current_active_OTP = pd.read_parquet(new_otp_path)
if 'otpid' not in current_active_OTP.columns: current_active_OTP = pd.DataFrame(columns=['otpid'])
if 'otpid' not in old_active_OTP.columns: old_active_OTP = pd.DataFrame(columns=['otpid'])
newly_added = current_active_OTP[~current_active_OTP['otpid'].isin(old_active_OTP['otpid'])] newly_added = current_active_OTP[~current_active_OTP['otpid'].isin(old_active_OTP['otpid'])]
still_in_OTP = old_active_OTP[old_active_OTP['otpid'].isin(current_active_OTP['otpid'])] still_in_OTP = old_active_OTP[old_active_OTP['otpid'].isin(current_active_OTP['otpid'])]
no_longer_OTP = old_active_OTP[~old_active_OTP['otpid'].isin(current_active_OTP['otpid'])] no_longer_OTP = old_active_OTP[~old_active_OTP['otpid'].isin(current_active_OTP['otpid'])]
register_function("addhash", addOTPHashes) register_function("addhash", addOTPHashes)
for _, row in newly_added.iterrows(): for _, row in newly_added.iterrows():
@@ -123,7 +127,7 @@ def monitorOTP(url, pups):
if not os.path.exists(f"OTP\\PARQ\\localapprovalhistory.parquet"): if not os.path.exists(f"OTP\\PARQ\\localapprovalhistory.parquet"):
df = pd.DataFrame() df = pd.DataFrame()
df.to_parquet(f"OTP\\PARQ\\localapprovalhistory.parquet") df.to_parquet(f"OTP\\PARQ\\localapprovalhistory.parquet")
else:
history = pd.read_parquet(f"OTP\\PARQ\\localapprovalhistory.parquet") history = pd.read_parquet(f"OTP\\PARQ\\localapprovalhistory.parquet")
history = pd.concat([history, finalhashesadded], ignore_index=True) history = pd.concat([history, finalhashesadded], ignore_index=True)
ct.style_dataframe_dark(history, f"localapproval_history.html") ct.style_dataframe_dark(history, f"localapproval_history.html")
@@ -156,7 +160,7 @@ def addOTPHashes(url, clientid, otpid, pups):
# Add hashes to policy # Add hashes to policy
if hashes_to_add: if hashes_to_add:
policyf.addHash(url, allowlist, hashes_to_add) policyf.addHashReal(url, allowlist, hashes_to_add)
# Update 'hash_added' column # Update 'hash_added' column
activities["hash_added"] = activities.apply( activities["hash_added"] = activities.apply(