Skip to content

Commit

Permalink
drop Validator in favour of DataSource
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Aug 5, 2022
1 parent 922859f commit 78dd5ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
# Visit https://github.com/nexB/vulnerablecode/ for support and download.


VALIDATORS_REGISTRY = []
DATASOURCE_REGISTRY = []

VALIDATORS_REGISTRY = {x.__module__.split(".")[-1]: x for x in VALIDATORS_REGISTRY}
DATASOURCE_REGISTRY = {x.__module__.split(".")[-1]: x for x in DATASOURCE_REGISTRY}
File renamed without changes.
13 changes: 7 additions & 6 deletions vulntotal/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,22 @@ def to_dict(self):
}


class Validator:
_raw_dump = []
class DataSource:
def __init__(self):
self._raw_dump = []

def validator_advisory(self, purl) -> Iterable[VendorData]:
def datasource_advisory(self, purl) -> Iterable[VendorData]:
"""
Yield VendorData object corresponding to vendor
Yield VendorData object corresponding to DataSource
"""
return NotImplementedError

@classmethod
def support_ecosystem(cls):
def supported_ecosystem(cls):
"""
Return dictionary containing supported ecosystem
{
"PURL equivalent ecosystem" : "Validator ecosystem",
"PURL equivalent ecosystem" : "DataSource ecosystem",
}
"""
return NotImplementedError
Expand Down

0 comments on commit 78dd5ae

Please sign in to comment.