cve

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSVAffected

type OSVAffected struct {
	Package           OSVPackage             `json:"package"`
	Ranges            []OSVRange             `json:"ranges"`
	DatabaseSpecific  map[string]interface{} `json:"database_specific,omitempty"`
	EcosystemSpecific map[string]interface{} `json:"ecosystem_specific,omitempty"`
}

OSVAffected represents affected package information

type OSVClient

type OSVClient struct {
	// contains filtered or unexported fields
}

OSVClient interacts with the Open Source Vulnerabilities (OSV) API

func NewOSVClient

func NewOSVClient() *OSVClient

NewOSVClient creates a new OSV API client

func (*OSVClient) GetVulnerabilities

func (c *OSVClient) GetVulnerabilities(groupID, artifactID, version string) ([]*models.Vulnerability, error)

GetVulnerabilities queries OSV for vulnerabilities in a package

func (*OSVClient) GetVulnerabilitiesForDependencies

func (c *OSVClient) GetVulnerabilitiesForDependencies(dependencies []*models.Dependency) (map[string][]*models.Vulnerability, error)

GetVulnerabilitiesForDependencies gets vulnerabilities for all dependencies

type OSVEvent

type OSVEvent struct {
	Introduced string `json:"introduced,omitempty"`
	Fixed      string `json:"fixed,omitempty"`
}

OSVEvent represents a version event

type OSVPackage

type OSVPackage struct {
	Name      string `json:"name"`
	Ecosystem string `json:"ecosystem"`
}

OSVPackage represents a package in OSV format

type OSVQuery

type OSVQuery struct {
	Package OSVPackage `json:"package"`
	Version string     `json:"version,omitempty"`
}

OSVQuery represents a query to the OSV API

type OSVRange

type OSVRange struct {
	Type   string     `json:"type"`
	Events []OSVEvent `json:"events"`
}

OSVRange represents a version range

type OSVResponse

type OSVResponse struct {
	Vulns []OSVVulnerability `json:"vulns"`
}

OSVResponse represents the response from OSV API

type OSVSeverity

type OSVSeverity struct {
	Type  string `json:"type"`
	Score string `json:"score"`
}

OSVSeverity represents severity information

type OSVVulnerability

type OSVVulnerability struct {
	ID       string        `json:"id"`
	Summary  string        `json:"summary"`
	Details  string        `json:"details"`
	Severity []OSVSeverity `json:"severity,omitempty"`
	Affected []OSVAffected `json:"affected"`
}

OSVVulnerability represents a vulnerability from OSV

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL