diff --git a/README.rst b/README.rst index fa40940..2e936da 100644 --- a/README.rst +++ b/README.rst @@ -227,6 +227,8 @@ Create a full scan from a set of package manifest files. Returns a full scan inc +------------------------+------------+-------------------------------------------------------------------------------+ | integration_org_slug | False | Organization slug for integration | +------------------------+------------+-------------------------------------------------------------------------------+ +| scan_type | False | ScanType enum value: "socket", "socket_tier1", or "socket_basics" | ++------------------------+------------+-------------------------------------------------------------------------------+ fullscans.delete(org_slug, full_scan_id) """""""""""""""""""""""""""""""""""""""" diff --git a/pyproject.toml b/pyproject.toml index 6f05c7b..eba5e0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "socketdev" -version = "3.0.28" +version = "3.0.29" requires-python = ">= 3.9" dependencies = [ 'requests', diff --git a/socketdev/fullscans/__init__.py b/socketdev/fullscans/__init__.py index 4845295..03ea309 100644 --- a/socketdev/fullscans/__init__.py +++ b/socketdev/fullscans/__init__.py @@ -41,6 +41,12 @@ class DiffType(str, Enum): UPDATED = "updated" +class ScanType(str, Enum): + SOCKET = "socket" + SOCKET_TIER1 = "socket_tier1" + SOCKET_BASICS = "socket_basics" + + @dataclass(kw_only=True) class SocketPURL: type: SocketPURL_Type @@ -99,6 +105,7 @@ class FullScanParams: make_default_branch: Optional[bool] = None set_as_pending_head: Optional[bool] = None tmp: Optional[bool] = None + scan_type: Optional[ScanType] = None def __getitem__(self, key): return getattr(self, key) @@ -109,6 +116,7 @@ def to_dict(self): @classmethod def from_dict(cls, data: dict) -> "FullScanParams": integration_type = data.get("integration_type") + scan_type = data.get("scan_type") return cls( repo=data["repo"], org_slug=data.get("org_slug"), @@ -122,6 +130,7 @@ def from_dict(cls, data: dict) -> "FullScanParams": make_default_branch=data.get("make_default_branch"), set_as_pending_head=data.get("set_as_pending_head"), tmp=data.get("tmp"), + scan_type=ScanType(scan_type) if scan_type is not None else None, ) diff --git a/socketdev/version.py b/socketdev/version.py index c6dfd40..e0e9ceb 100644 --- a/socketdev/version.py +++ b/socketdev/version.py @@ -1 +1 @@ -__version__ = "3.0.28" +__version__ = "3.0.29"