python-scf
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: python-scf | ||
| Version: 0.3.0 | ||
| Version: 0.4.0 | ||
| Summary: A small tool to fetch informations about CVE from suse.com. | ||
@@ -5,0 +5,0 @@ Author: dadav |
| Metadata-Version: 2.1 | ||
| Name: python-scf | ||
| Version: 0.3.0 | ||
| Version: 0.4.0 | ||
| Summary: A small tool to fetch informations about CVE from suse.com. | ||
@@ -5,0 +5,0 @@ Author: dadav |
+1
-1
@@ -1,1 +0,1 @@ | ||
| __version__ = '0.3.0' | ||
| __version__ = '0.4.0' |
+26
-2
@@ -11,2 +11,3 @@ import os | ||
| from subprocess import call, Popen, DEVNULL | ||
| from collections import defaultdict | ||
@@ -16,2 +17,3 @@ import typer | ||
| from scf import __version__ | ||
| from scf.models import OverallState | ||
| from scf.server import run as server_start | ||
@@ -238,3 +240,5 @@ from scf.suse import get_cve_details, list_cve_by_year, get_all_cve, prefetch_cve | ||
| def cve_cmd_list( | ||
| year: bool = typer.Option(False, '-y', '--year', help='List cve grouped by year.'), | ||
| grouped: bool = typer.Option(False, '--grouped-by-year', help='List cve grouped by year.'), | ||
| year: int = typer.Option(None, '-y', '--year', help='List cve for a specific year.'), | ||
| unresolved: bool = typer.Option(False, '-u', '--unresolved-only', help='Only print cve which are not resolved yet.'), | ||
| use_cache: bool = typer.Option(False, '--cache', help='Enables the cache.'), | ||
@@ -247,7 +251,27 @@ use_json: bool = typer.Option(False, '--json', help='Print the result as json.'),) -> None: | ||
| if year: | ||
| if grouped: | ||
| cves = list_cve_by_year(use_cache=use_cache) | ||
| elif year is not None: | ||
| cves = list_cve_by_year(use_cache=use_cache)[str(year)] | ||
| else: | ||
| cves = get_all_cve(use_cache=use_cache) | ||
| # apply the filters | ||
| if unresolved: | ||
| if isinstance(cves, dict): | ||
| filtered = defaultdict() | ||
| for cve_year, cve_list in cves.items(): | ||
| for cve in cve_list: | ||
| details = get_cve_details(cve, use_cache=True) | ||
| if details.overall_state != OverallState.RESOLVED: | ||
| filtered[cve_year].append(cve) | ||
| else: | ||
| filtered = [] | ||
| for cve in cves: | ||
| details = get_cve_details(cve, use_cache=True) | ||
| if details.overall_state != OverallState.RESOLVED: | ||
| filtered.append(cve) | ||
| cves = filtered | ||
| if use_json: | ||
@@ -254,0 +278,0 @@ typer.echo(json.dumps(cves)) |
+4
-0
@@ -24,2 +24,3 @@ """ | ||
| IGNORE = 'IGNORE' | ||
| REVISIT = 'REVISIT' | ||
@@ -36,2 +37,3 @@ def pretty(self): | ||
| 'ANALYSIS': 'slate_blue1', | ||
| 'REVISIT': 'slate_blue1', | ||
| 'NEW': 'slate_blue1', | ||
@@ -79,2 +81,3 @@ 'POSTBONED': 'slate_blue1', | ||
| ASK_MAINTAINER = 'ASK_MAINTAINER' | ||
| IGNORE = 'IGNORE' | ||
@@ -89,2 +92,3 @@ def pretty(self): | ||
| 'RELEASED': 'green', | ||
| 'IGNORE': 'green', | ||
| 'UNSUPPORTED': 'orange_red1', | ||
@@ -91,0 +95,0 @@ 'IN_PROGRESS': 'slate_blue1', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
71914
1.66%763
3.53%