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

Method is_configured

auth_manager.py:263–286  ·  view source on GitHub ↗

Check if authentication has been set up.

(self)

Source from the content-addressed store, hash-verified

261 # =========================================================================
262
263 def is_configured(self) -> bool:
264 """Check if authentication has been set up."""
265 try:
266 with self._get_auth_conn() as conn:
267 cursor = conn.cursor()
268 cursor.execute("SELECT COUNT(*) FROM auth")
269 return cursor.fetchone()[0] > 0
270 except sqlite3.OperationalError as e:
271 if 'no such table' not in str(e).lower():
272 logger.error(f"Error checking auth status: {e}")
273 return False
274 with self._lock:
275 try:
276 self._init_auth_db()
277 with self._get_auth_conn() as conn:
278 cursor = conn.cursor()
279 cursor.execute("SELECT COUNT(*) FROM auth")
280 return cursor.fetchone()[0] > 0
281 except Exception as retry_err:
282 logger.debug(f"Auth DB initialized on demand; reporting unconfigured: {retry_err}")
283 return False
284 except Exception as e:
285 logger.error(f"Error checking auth status: {e}")
286 return False
287
288 def get_auth_status(self, session=None) -> dict:
289 """Get current authentication status."""

Callers 14

get_auth_statusMethod · 0.95
setupMethod · 0.95
loginMethod · 0.95
logoutMethod · 0.95
change_passwordMethod · 0.95
recoverMethod · 0.95
shutdown_encryptMethod · 0.95
check_authenticationFunction · 0.45
login_pageFunction · 0.45
auth_setupFunction · 0.45

Calls 7

_get_auth_connMethod · 0.95
_init_auth_dbMethod · 0.95
cursorMethod · 0.80
errorMethod · 0.80
debugMethod · 0.80
executeMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected