Skip to content

Commit 3417967

Browse files
authored
Doug/add guardrails for missing attributes (#85)
* Version bump * Version bump
1 parent 064eb9c commit 3417967

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.1.0"
9+
version = "2.1.2"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.1.0'
2+
__version__ = '2.1.2'

socketsecurity/core/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from socketdev.org import Organization
1616
from socketdev.repos import RepositoryInfo
1717
from socketdev.settings import SecurityPolicyRule
18-
18+
import copy
1919
from socketsecurity import __version__
2020
from socketsecurity.core.classes import (
2121
Alert,
@@ -628,11 +628,14 @@ def create_new_diff(
628628
head_full_scan_id = None
629629

630630
if head_full_scan_id is None:
631-
tmp_params = params
631+
new_params = copy.deepcopy(params.__dict__)
632+
new_params.pop('include_license_details')
633+
tmp_params = FullScanParams(**new_params)
634+
tmp_params.include_license_details = params.include_license_details
632635
tmp_params.tmp = True
633636
tmp_params.set_as_pending_head = False
634637
tmp_params.make_default_branch = False
635-
head_full_scan = self.create_full_scan(Core.empty_head_scan_file(), params)
638+
head_full_scan = self.create_full_scan(Core.empty_head_scan_file(), tmp_params)
636639
head_full_scan_id = head_full_scan.id
637640

638641
# Create new scan
@@ -796,6 +799,8 @@ def get_source_data(package: Package, packages: dict) -> list:
796799
introduced_by = []
797800
if package.direct:
798801
manifests = ""
802+
if not hasattr(package, "manifestFiles"):
803+
return introduced_by
799804
for manifest_data in package.manifestFiles:
800805
manifest_file = manifest_data.get("file")
801806
manifests += f"{manifest_file};"

0 commit comments

Comments
 (0)