Get status of a specific scan
(scan_id)
| 17365 | """Add a new credential finding""" |
| 17366 | try: |
| 17367 | if not (hasattr(shared_data, 'network_intelligence') and |
| 17368 | shared_data.network_intelligence and |
| 17369 | shared_data.config.get('network_intelligence_enabled', True)): |
| 17370 | return jsonify({'error': 'Network intelligence not available'}), 400 |
| 17371 | |
| 17372 | data = request.get_json() |
| 17373 | required_fields = ['host', 'service', 'username', 'password'] |
| 17374 | |
| 17375 | if not all(field in data for field in required_fields): |
| 17376 | return jsonify({'error': 'Missing required fields'}), 400 |
| 17377 | |
| 17378 | cred_id = shared_data.network_intelligence.add_credential( |
| 17379 | host=data['host'], |
| 17380 | service=data['service'], |
| 17381 | username=data['username'], |
| 17382 | password=data['password'], |
| 17383 | protocol=data.get('protocol', 'unknown'), |
| 17384 | details=data.get('details', {}) |
| 17385 | ) |
| 17386 | |
| 17387 | if cred_id: |
| 17388 | # Trigger sync and broadcast update |
nothing calls this directly
no test coverage detected