Documentation
¶
Overview ¶
Package audit provides npm registry audit API integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles npm audit API requests.
func (*Client) AuditDependencies ¶
func (c *Client) AuditDependencies(deps []types.Dependency) ([]types.VulnerabilityFinding, error)
AuditDependencies audits a list of dependencies.
func (*Client) AuditSinglePackage ¶
func (c *Client) AuditSinglePackage(name, version string) ([]types.VulnerabilityInfo, error)
AuditSinglePackage audits a single package.
type OSVClient ¶
type OSVClient struct {
// contains filtered or unexported fields
}
OSVClient audits dependencies for known vulnerabilities via OSV.dev, which spans npm, PyPI and more in a single API. querybatch returns only vuln ids per query, so confirmed hits are hydrated through the per-vuln endpoint to recover severity, title and fixed versions.
func NewOSVClient ¶
NewOSVClient creates a new OSV.dev audit client.
func (*OSVClient) AuditDependencies ¶
func (c *OSVClient) AuditDependencies(deps []types.Dependency) ([]types.VulnerabilityFinding, error)
AuditDependencies audits a list of dependencies, returning one finding per (package, version, vulnerability).
func (*OSVClient) AuditSinglePackage ¶
func (c *OSVClient) AuditSinglePackage(ecosystem, name, version string) ([]types.VulnerabilityInfo, error)
AuditSinglePackage audits a single package and returns simplified records.
type OSVOption ¶
type OSVOption func(*OSVClient)
OSVOption configures an OSVClient.
func WithOSVHTTPClient ¶ added in v1.16.0
WithOSVHTTPClient sets a custom HTTP client.
func WithOSVURLs ¶ added in v1.16.0
WithOSVURLs sets custom query and vuln endpoints (for testing).