Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doug/add column selection #11

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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