|
13 | 13 | import re
|
14 | 14 | import sqlite3
|
15 | 15 | from pathlib import Path
|
16 |
| -from typing import Any |
17 | 16 |
|
18 | 17 | import aiohttp
|
19 | 18 | from rich.progress import track
|
@@ -77,7 +76,7 @@ def __init__(
|
77 | 76 | self.cve_count = -1
|
78 | 77 | self.nvd_type = nvd_type
|
79 | 78 | self.incremental_update = incremental_update
|
80 |
| - self.all_cve_entries: list[dict[str, Any]] | None = None |
| 79 | + self.all_cve_entries: list[dict[str, object]] | None = None |
81 | 80 |
|
82 | 81 | # store the nvd api key for use later
|
83 | 82 | self.nvd_api_key = nvd_api_key
|
@@ -170,7 +169,7 @@ def format_data(self, all_cve_entries):
|
170 | 169 |
|
171 | 170 | return cve_data, affects_data
|
172 | 171 |
|
173 |
| - def parse_node(self, node: dict[str, Any]) -> list[dict[str, str]]: |
| 172 | + def parse_node(self, node: dict[str, list[dict[str, str]]]) -> list[dict[str, str]]: |
174 | 173 | affects_list = []
|
175 | 174 | if "cpe_match" in node:
|
176 | 175 | for cpe_match in node["cpe_match"]:
|
@@ -280,7 +279,9 @@ def format_data_api2(self, all_cve_entries):
|
280 | 279 |
|
281 | 280 | return cve_data, affects_data
|
282 | 281 |
|
283 |
| - def parse_node_api2(self, node: dict[str, Any]) -> list[dict[str, str]]: |
| 282 | + def parse_node_api2( |
| 283 | + self, node: dict[str, list[dict[str, str]]] |
| 284 | + ) -> list[dict[str, str]]: |
284 | 285 | affects_list = []
|
285 | 286 | if "cpeMatch" in node:
|
286 | 287 | for cpe_match in node["cpeMatch"]:
|
@@ -478,7 +479,7 @@ async def cache_update(
|
478 | 479 | with ErrorHandler(mode=self.error_mode, logger=self.LOGGER):
|
479 | 480 | raise SHAMismatch(f"{url} (have: {gotsha}, want: {sha})")
|
480 | 481 |
|
481 |
| - def load_nvd_year(self, year: int) -> dict[str, Any]: |
| 482 | + def load_nvd_year(self, year: int) -> dict[str, str | object]: |
482 | 483 | """
|
483 | 484 | Return the dict of CVE data for the given year.
|
484 | 485 | """
|
|
0 commit comments