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

Method list_zap_credentials

db_manager.py:2636–2665  ·  view source on GitHub ↗

List all saved ZAP credentials (without passwords). Returns: List of credential entries (passwords masked)

(self)

Source from the content-addressed store, hash-verified

2634 DELETE FROM zap_target_credentials WHERE target_host = ?
2635 """, (target_host,))
2636 conn.commit()
2637
2638 if cursor.rowcount > 0:
2639 logger.info(f"Deleted ZAP credentials for target: {target_host}")
2640 return True
2641
2642 except Exception as e:
2643 logger.error(f"Failed to delete ZAP credentials for {target_host}: {e}")
2644 return False
2645
2646 def list_zap_credentials(self) -> List[Dict[str, Any]]:
2647 """
2648 List all saved ZAP credentials (without passwords).
2649
2650 Returns:
2651 List of credential entries (passwords masked)
2652 """
2653 try:
2654 with self.get_connection() as conn:
2655 cursor = conn.cursor()
2656 cursor.execute("""
2657 SELECT id, target_host, auth_type, login_url, username,
2658 username_field, password_field, http_realm, notes,
2659 created_at, updated_at
2660 FROM zap_target_credentials
2661 ORDER BY updated_at DESC
2662 """)
2663
2664 results = []
2665 for row in cursor.fetchall():
2666 result = dict(row)
2667 # Indicate if password is set without revealing it
2668 result['has_password'] = True # If row exists, password was provided

Callers 1

list_zap_credentialsFunction · 0.80

Calls 6

get_connectionMethod · 0.95
cursorMethod · 0.80
appendMethod · 0.80
errorMethod · 0.80
executeMethod · 0.45
fetchallMethod · 0.45

Tested by

no test coverage detected