diff --git a/pyproject.toml b/pyproject.toml index 7031aea..78f7701 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "socketdev" -version = "3.0.20" +version = "3.0.21" requires-python = ">= 3.9" dependencies = [ 'requests', @@ -123,4 +123,4 @@ docstring-code-format = false # # This only has an effect when the `docstring-code-format` setting is # enabled. -docstring-code-line-length = "dynamic" \ No newline at end of file +docstring-code-line-length = "dynamic" diff --git a/socketdev/fullscans/__init__.py b/socketdev/fullscans/__init__.py index 94439f9..25af73a 100644 --- a/socketdev/fullscans/__init__.py +++ b/socketdev/fullscans/__init__.py @@ -895,4 +895,35 @@ def gfm(self, org_slug: str, before: str, after: str) -> dict: error_message = response.json().get("error", {}).get("message", "Unknown error") log.error(f"Error getting diff scan results: {response.status_code}, message: {error_message}") - return {} \ No newline at end of file + return {} + + def finalize_tier1( + self, + full_scan_id: str, + tier1_reachability_scan_id: str, + ) -> bool: + """ + Finalize a tier 1 reachability scan by associating it with a full scan. + + Args: + full_scan_id: The ID of the full scan to associate with the tier 1 scan + tier1_reachability_scan_id: The tier 1 reachability scan ID from the facts file + + Returns: + True if successful, False otherwise + """ + path = "tier1-reachability-scan/finalize" + payload = json.dumps({ + "tier1_reachability_scan_id": tier1_reachability_scan_id, + "report_run_id": full_scan_id + }) + + response = self.api.do_request( + path=path, + method="POST", + payload=payload + ) + + if response.status_code in (200, 201, 204): + return True + return False \ No newline at end of file diff --git a/socketdev/version.py b/socketdev/version.py index 7c6f3ae..3a43c58 100644 --- a/socketdev/version.py +++ b/socketdev/version.py @@ -1 +1 @@ -__version__ = "3.0.20" +__version__ = "3.0.21"