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

Method delete_zap_credentials

db_manager.py:2608–2634  ·  view source on GitHub ↗

Delete ZAP credentials for a target. Args: target_host: Target host/IP to delete credentials for Returns: True if deleted (or didn't exist)

(self, target_host: str)

Source from the content-addressed store, hash-verified

2606
2607 # Try without port
2608 host_no_port = host.split(':')[0]
2609 if host_no_port != host:
2610 return self.get_zap_credentials(host_no_port)
2611
2612 return None
2613
2614 except Exception as e:
2615 logger.error(f"Failed to get ZAP credentials for URL {url}: {e}")
2616 return None
2617
2618 def delete_zap_credentials(self, target_host: str) -> bool:
2619 """
2620 Delete ZAP credentials for a target.
2621
2622 Args:
2623 target_host: Target host/IP to delete credentials for
2624
2625 Returns:
2626 True if deleted (or didn't exist)
2627 """
2628 try:
2629 target_host = self._normalize_target_host(target_host)
2630
2631 with self.get_connection() as conn:
2632 cursor = conn.cursor()
2633 cursor.execute("""
2634 DELETE FROM zap_target_credentials WHERE target_host = ?
2635 """, (target_host,))
2636 conn.commit()
2637

Callers 1

delete_zap_credentialsFunction · 0.80

Calls 7

get_connectionMethod · 0.95
cursorMethod · 0.80
commitMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected