|
1 | 1 | # |
2 | 2 | # Copyright (c) nexB Inc. and others. All rights reserved. |
3 | | -# http://nexb.com and https://github.com/nexB/vulnerablecode/ |
4 | | -# The VulnTotal software is licensed under the Apache License version 2.0. |
5 | | -# Data generated with VulnTotal require an acknowledgment. |
| 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. |
6 | 8 | # |
7 | | -# You may not use this software except in compliance with the License. |
8 | | -# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 |
9 | | -# Unless required by applicable law or agreed to in writing, software distributed |
10 | | -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
11 | | -# CONDITIONS OF ANY KIND, either express or implied. See the License for the |
12 | | -# specific language governing permissions and limitations under the License. |
13 | | -# |
14 | | -# When you publish or redistribute any data created with VulnTotal or any VulnTotal |
15 | | -# derivative work, you must accompany this data with the following acknowledgment: |
16 | | -# |
17 | | -# Generated with VulnTotal and provided on an "AS IS" BASIS, WITHOUT WARRANTIES |
18 | | -# OR CONDITIONS OF ANY KIND, either express or implied. No content created from |
19 | | -# VulnTotal should be considered or used as legal advice. Consult an Attorney |
20 | | -# for any legal advice. |
21 | | -# VulnTotal is a free software tool from nexB Inc. and others. |
22 | | -# Visit https://github.com/nexB/vulnerablecode/ for support and download. |
23 | 9 |
|
24 | 10 | import glob |
25 | 11 | import importlib |
|
29 | 15 | from os.path import isfile |
30 | 16 | from os.path import join |
31 | 17 |
|
| 18 | +from vulntotal.datasources import deps |
| 19 | +from vulntotal.datasources import github |
| 20 | +from vulntotal.datasources import gitlab |
| 21 | +from vulntotal.datasources import oss_index |
| 22 | +from vulntotal.datasources import osv |
| 23 | +from vulntotal.datasources import snyk |
| 24 | +from vulntotal.datasources import vulnerablecode |
32 | 25 | from vulntotal.validator import DataSource |
33 | 26 |
|
34 | | -DATASOURCE_REGISTRY = {} |
35 | | -files = glob.glob(join(dirname(__file__), "*.py")) |
36 | | -modules = [ |
37 | | - f"vulntotal.datasources.{basename(f)[:-3]}" |
38 | | - for f in files |
39 | | - if isfile(f) and not f.endswith("__init__.py") |
40 | | -] |
41 | | - |
42 | | - |
43 | | -for module in modules: |
44 | | - for name, cls in inspect.getmembers(importlib.import_module(module), inspect.isclass): |
45 | | - if cls.__module__ == module and cls.__base__ == DataSource: |
46 | | - DATASOURCE_REGISTRY[cls.__module__.split(".")[-1]] = cls |
47 | | - break |
| 27 | +DATASOURCE_REGISTRY = { |
| 28 | + "deps": deps.DepsDataSource, |
| 29 | + "github": github.GithubDataSource, |
| 30 | + "gitlab": gitlab.GitlabDataSource, |
| 31 | + "oss_index": oss_index.OSSDataSource, |
| 32 | + "osv": osv.OSVDataSource, |
| 33 | + "snyk": snyk.SnykDataSource, |
| 34 | + "vulnerablecode": vulnerablecode.VulnerableCodeDataSource, |
| 35 | +} |
0 commit comments