File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 77# See https://aboutcode.org for more information about nexB OSS projects.
88#
99
10- import json
11-
12- import requests
13-
1410from vulnerabilities .importer import AdvisoryData
1511from vulnerabilities .importer import Importer
1612from vulnerabilities .references import XsaReference
2117class XenImporter (Importer ):
2218
2319 url = "https://xenbits.xen.org/xsa/xsa.json"
24- spdx_license_expression = ""
25- license_url = ""
20+ spdx_license_expression = "GPL-2 "
21+ license_url = "https://wiki.xenproject.org/wiki/Xen_FAQ_General "
2622
2723 def advisory_data (self ):
2824 data = fetch_response (self .url ).json ()
29- if not len (data ):
25+ # The data looks like this
26+ # [
27+ # {
28+ # "xsas": [
29+ # {
30+ # "cve": [
31+ # "CVE-2012-5510"
32+ # ],
33+ # "title": "XSA-1: Xen security advisory",
34+ # }
35+ # ]
36+ # }
37+ # ]
38+ if not data :
3039 return []
31- xsas = data [0 ]. get ( "xsas" ) or [ ]
40+ xsas = data [0 ][ "xsas" ]
3241 for xsa in xsas :
3342 yield from self .to_advisories (xsa )
3443
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) nexB Inc. and others. All rights reserved.
3+ # VulnerableCode is a trademark of nexB Inc.
4+ # SPDX-License-Identifier: Apache-2.0
5+ # See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+ # See https://github.com/nexB/vulnerablecode for support or download.
7+ # See https://aboutcode.org for more information about nexB OSS projects.
8+ #
9+
110import json
211import os
312
You can’t perform that action at this time.
0 commit comments