Skip to content

Commit

Permalink
Doug/add column selection (#11)
Browse files Browse the repository at this point in the history
* Added tracking of direct/transitive dependency

* removing unneeded files

* Updated version for push to pypi
  • Loading branch information
dacoburn authored Oct 2, 2024
1 parent c52b993 commit 5dcc41b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion socketsync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


__author__ = 'socket.dev'
__version__ = '1.0.8'
__version__ = '1.0.9'
__all__ = [
"log",
"__version__",
Expand Down
3 changes: 3 additions & 0 deletions socketsync/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class Issue:
ignore: bool
monitor: bool
action: str
direct: bool

def __init__(self, **kwargs):
if kwargs:
Expand All @@ -172,6 +173,8 @@ def __init__(self, **kwargs):
self.ignore = False
if not hasattr(self, "monitor"):
self.monitor = False
if not hasattr(self, "direct"):
self.direct = False
self.pkg_url = f"https://socket.dev/{self.pkg_type}/package/{self.pkg_name}/overview/{self.pkg_version}"

def __str__(self):
Expand Down
9 changes: 6 additions & 3 deletions socketsync/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from socketdev import socketdev
from socketsync.issues import AllIssues
from socketsync.licenses import Licenses
from typing import Union
from socketsync.classes import (
Report,
IssueRecord,
Expand Down Expand Up @@ -59,6 +58,7 @@ class Core:
from_time: int
actions_override: list[str]
enable_all_alerts: bool
properties: list

def __init__(
self,
Expand All @@ -71,7 +71,8 @@ def __init__(
default_branch_only: bool = False,
report_id: str = None,
from_time: int = 300,
actions_override: list = None
actions_override: list = None,
properties: list = None
):
self.actions_override = actions_override
global actions
Expand All @@ -80,6 +81,7 @@ def __init__(
self.report_id = report_id
self.default_branches = default_branches
self.from_time = from_time
self.properties = properties
if self.default_branches is not None:
global default_branch_names
default_branch_names = self.default_branches
Expand Down Expand Up @@ -307,7 +309,8 @@ def create_issue_alerts(package: Package, alerts: list, packages: dict, report:
suggestion=suggestion,
next_step_title=next_step_title,
introduced_by=introduced_by,
is_error=is_error
is_error=is_error,
direct=package.direct
)
if alert.type in security_policy:
action = security_policy[alert.type]['action']
Expand Down

0 comments on commit 5dcc41b

Please sign in to comment.