MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / advisory_data

Method advisory_data

vulnerabilities/importers/gsd.py:34–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 url = "https://codeload.github.com/cloudsecurityalliance/gsd-database/zip/refs/heads/main"
33
34 def advisory_data(self) -> Iterable[AdvisoryData]:
35 response = requests.get(self.url).content
36 with ZipFile(BytesIO(response)) as zip_file:
37 for file_name in zip_file.namelist():
38 if file_name == "gsd-database-main/allowlist.json" or not file_name.endswith(
39 ".json"
40 ):
41 continue
42
43 with zip_file.open(file_name) as f:
44 try:
45 raw_data = json.load(f)
46 yield parse_advisory_data(raw_data, file_name)
47 except Exception as e:
48 logger.error(f"Invalid GSD advisory data file: {file_name} - {e}")
49
50
51def parse_advisory_data(raw_data, file_name):

Callers

nothing calls this directly

Calls 2

parse_advisory_dataFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected