(self)
| 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 | |
| 51 | def parse_advisory_data(raw_data, file_name): |
nothing calls this directly
no test coverage detected