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

Function add_credential

webapp_modern.py:13232–13270  ·  view source on GitHub ↗

Add a new credential finding

()

Source from the content-addressed store, hash-verified

13230 'error': 'Invalid confirmation token. Use "ERASE_ALL_DATA" to confirm.'
13231 }), 403
13232
13233 logger.critical("=" * 80)
13234 logger.critical("KILL SWITCH ACTIVATED - INITIATING COMPLETE DATA ERASURE")
13235 logger.critical("=" * 80)
13236
13237 results = {
13238 'database_deleted': False,
13239 'data_folder_deleted': False,
13240 'repository_deleted': False,
13241 'shutdown_scheduled': False,
13242 'errors': []
13243 }
13244
13245 # Get the Ragnar directory path
13246 ragnar_dir = shared_data.currentdir
13247 home_dir = os.path.expanduser('~')
13248 ragnar_home_path = os.path.join(home_dir, 'Ragnar')
13249
13250 # Use home path if it exists, otherwise use current directory
13251 if os.path.exists(ragnar_home_path):
13252 ragnar_dir = ragnar_home_path
13253
13254 logger.critical(f"Target Ragnar directory: {ragnar_dir}")
13255
13256 # STEP 1: Delete ragnar.db database file
13257 try:
13258 db_path = os.path.join(ragnar_dir, 'data', 'ragnar.db')
13259 logger.critical(f"Step 1/3: Deleting database file: {db_path}")
13260
13261 if os.path.isfile(db_path):
13262 os.remove(db_path)
13263 logger.critical(f"✓ Deleted: {db_path}")
13264 results['database_deleted'] = True
13265 else:
13266 logger.warning(f"Database file not found: {db_path}")
13267 results['database_deleted'] = True # Consider it success if file doesn't exist
13268
13269 except Exception as e:
13270 error_msg = f"Error deleting database file: {str(e)}"
13271 logger.error(error_msg)
13272 results['errors'].append(error_msg)
13273

Callers

nothing calls this directly

Calls 5

sync_all_countsFunction · 0.85
broadcast_status_updateFunction · 0.85
add_credentialMethod · 0.80
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected