Add quick unlock flag and event logging

This commit is contained in:
thePR0M3TH3AN
2025-08-05 23:05:11 -04:00
parent 4f11db5aa4
commit 94d0b80dce
4 changed files with 49 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ import hashlib
from typing import Optional, Literal
import shutil
import time
from datetime import datetime, timezone
import builtins
import threading
import queue
@@ -345,6 +346,15 @@ class PasswordManager:
self.initialize_managers()
self.locked = False
self.update_activity()
if (
getattr(self, "config_manager", None)
and self.config_manager.get_quick_unlock()
):
logger.info(
"Quick unlock used by %s at %s",
self.current_fingerprint or "unknown",
datetime.now(timezone.utc).isoformat(),
)
self.last_unlock_duration = time.perf_counter() - start
if getattr(self, "verbose_timing", False):
logger.info("Vault unlocked in %.2f seconds", self.last_unlock_duration)