Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOfflineDatabaseNotFound = errors.New("no offline version of the OSV database is available")
Functions ¶
func VulnerabilitiesAffectingPackage ¶
func VulnerabilitiesAffectingPackage(allVulns []osvschema.Vulnerability, pkg imodels.PackageInfo) []*osvschema.Vulnerability
TODO: Move this to another file.
Types ¶
type LocalMatcher ¶
type LocalMatcher struct {
// contains filtered or unexported fields
}
LocalMatcher implements the VulnerabilityMatcher interface by downloading the osv export zip files, and performing the matching locally.
func NewLocalMatcher ¶
func NewLocalMatcher(localDBPath string, userAgent string, downloadDB bool) (*LocalMatcher, error)
func (*LocalMatcher) LoadEcosystem ¶
LoadEcosystem tries to preload the ecosystem into the cache, and returns an error if the ecosystem cannot be loaded.
func (*LocalMatcher) MatchVulnerabilities ¶
func (matcher *LocalMatcher) MatchVulnerabilities(ctx context.Context, invs []*extractor.Package) ([][]*osvschema.Vulnerability, error)
type ZipDB ¶
type ZipDB struct {
// the name of the database
Name string
// the url that the zip archive was downloaded from
ArchiveURL string
// whether this database should make any network requests
Offline bool
// the path to the zip archive on disk
StoredAt string
// User agent to query with
UserAgent string
// contains filtered or unexported fields
}
func NewZippedDB ¶
func (*ZipDB) Check ¶
func (db *ZipDB) Check(pkgs []imodels.PackageInfo) ([]*osvschema.Vulnerability, error)
func (*ZipDB) Vulnerabilities ¶
func (db *ZipDB) Vulnerabilities(includeWithdrawn bool) []osvschema.Vulnerability
Click to show internal directories.
Click to hide internal directories.