MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __init__

Method __init__

auth_manager.py:50–63  ·  view source on GitHub ↗
(self, shared_data)

Source from the content-addressed store, hash-verified

48 RECOVERY_CODE_LENGTH = 8
49
50 def __init__(self, shared_data):
51 self.shared_data = shared_data
52 self.datadir = getattr(shared_data, 'datadir', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data'))
53 self._db_ready = not self._check_has_encrypted_db() # True if no decryption needed
54 self.auth_db_path = os.path.join(self.datadir, 'ragnar_auth.db')
55 self.main_db_path = os.path.join(self.datadir, 'ragnar.db')
56 self.encrypted_db_path = os.path.join(self.datadir, 'ragnar.db.enc')
57 self._lock = threading.RLock()
58 self._fernet_key = None # Cached in memory after login
59 self._secret_key = None
60
61 os.makedirs(self.datadir, exist_ok=True)
62 self._init_auth_db()
63 self._handle_crash_recovery()
64
65 def _check_has_encrypted_db(self):
66 """Check if an encrypted DB file exists (needs decryption on login)."""

Callers

nothing calls this directly

Calls 3

_init_auth_dbMethod · 0.95

Tested by

no test coverage detected