diff --git a/dep_checker/dependencies.py b/dep_checker/dependencies.py index 3b65d79..bc322e0 100644 --- a/dep_checker/dependencies.py +++ b/dep_checker/dependencies.py @@ -38,6 +38,7 @@ def get_cpe(self, repo_path: Path) -> Optional[str]: ] common_dependencies: list[str] = [ + "ada", "acorn", "brotli", "c-ares", @@ -50,7 +51,9 @@ def get_cpe(self, repo_path: Path) -> Optional[str]: "npm", "OpenSSL", "libuv", + "simdutf", "uvwasi", + "undici", "zlib", ] @@ -64,6 +67,14 @@ def get_cpe(self, repo_path: Path) -> Optional[str]: dependencies_info: dict[str, Dependency] = { + "ada": Dependency( + version_parser=vp.get_ada_version, + cpe=CPE(vendor="ada-url", product="ada"), + ), + "simdutf": Dependency( + version_parser=vp.get_simdutf_version, + cpe=CPE(vendor="simdutf", product="simdutf"), + ), "zlib": Dependency( version_parser=vp.get_zlib_version, cpe=CPE(vendor="zlib", product="zlib"), diff --git a/dep_checker/versions_parser.py b/dep_checker/versions_parser.py index 9183e3c..4cacc1a 100644 --- a/dep_checker/versions_parser.py +++ b/dep_checker/versions_parser.py @@ -204,3 +204,17 @@ def get_zlib_version(repo_path: Path) -> str: if matches is None: raise RuntimeError("Error extracting version number for zlib") return matches.groupdict()["version"] + +def get_simdutf_version(repo_path: Path) -> str: + with open(repo_path / "deps/simdutf/simdutf.h", "r") as f: + matches = re.search('#define SIMDUTF_VERSION "(?P.*)"', f.read()) + if matches is None: + raise RuntimeError("Error extracting version number for simdutf") + return matches.groupdict()["version"] + +def get_ada_version(repo_path: Path) -> str: + with open(repo_path / "deps/ada/ada.h", "r") as f: + matches = re.search('#define ADA_VERSION "(?P.*)"', f.read()) + if matches is None: + raise RuntimeError("Error extracting version number for ada") + return matches.groupdict()["version"]