Skip to content

Commit 0ded415

Browse files
committed
Update how scan ID and HTML url are extracted
The CreateFullScanREsponse object is used here and `id` and `html_url` are actually nested in the `data` field, not on the root of the object. `html_url` should also be `html_report_url`
1 parent 858d060 commit 0ded415

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

socket_basics/socket_basics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,10 @@ def submit_socket_facts(self, socket_facts_path: Path, results: Dict[str, Any])
356356
logger.error(f"Error creating full scan: {error_msg}")
357357
raise Exception(f"Error creating full scan: {error_msg}")
358358

359-
# Extract the scan ID and HTML URL from the response
360-
scan_id = getattr(res, 'id', None)
361-
html_url = getattr(res, 'html_url', None)
359+
# SDK CreateFullScanResponse nests metadata under .data
360+
data = getattr(res, 'data', None) or res
361+
scan_id = getattr(data, 'id', None)
362+
html_url = getattr(data, 'html_report_url', None) or getattr(data, 'html_url', None)
362363
logger.debug(f"Extracted from object: scan_id={scan_id}, html_url={html_url}")
363364

364365
if scan_id:

0 commit comments

Comments
 (0)