{"modulePath":"github.com/codefit-cli/codefit","version":"v0.2.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cve\n\nPackage cve checks project dependencies against known vulnerabilities via OSV.dev (PRD section 18, RF-09). codefit keeps NO vulnerability database of its own: on each scan it queries OSV.dev (free, no API key, aggregating the GitHub Advisory Database, Linux distro feeds and more), so the data is always fresh and maintained by infrastructure the whole world already runs.\n\nStatus: BUILT (RF-09). The OSV.dev HTTP client and the dependency-manifest parsing are implemented and reachable through the codefit-check-cves tool: exact versions are read from package-lock.json and go.mod, never guessed from a package.json range — a manifest present without its lockfile is reported as a note instead.\n\n## Types\n\n```go\ntype Client interface {\n\tQuery(ctx context.Context, deps []Dependency) (map[string][]Vulnerability, error)\n}\n```\nClient queries OSV.dev for the vulnerabilities affecting a set of dependencies, keyed by \"name@version\". The default implementation is [NewOSVClient](#NewOSVClient).\n\n```go\nfunc NewOSVClient(opts ...OSVOption) Client\n```\nNewOSVClient returns a Client backed by OSV.dev.\n\n```go\ntype Dependency struct {\n\tName      string\n\tVersion   string\n\tEcosystem string\n}\n```\nDependency is one parsed project dependency (from go.mod, package.json, ...) at an exact version, in its ecosystem (OSV.dev uses the ecosystem to scope the query, e.g. \"Go\", \"npm\", \"PyPI\").\n\n```go\ntype ManifestScan struct {\n\tDependencies []Dependency\n\tNotes        []string\n}\n```\nManifestScan is the result of reading a project's dependency manifests: the exact-versioned dependencies found, plus honest notes about anything that could NOT be resolved (a manifest present without its lockfile, or no manifest at all), so the caller never mistakes \"no dependencies parsed\" for \"no dependencies present\".\n\n```go\nfunc ParseManifests(root string) (ManifestScan, error)\n```\nParseManifests reads the supported dependency manifests at the project root and returns the exact-versioned dependencies across ecosystems. Version resolution is from LOCKFILES / go.mod only (RF-09 decision A): the ranges in package.json are never resolved — codefit reports what is pinned, not a guess. A manifest present but unparseable is a loud error (never silently dropped); an absent manifest is fine and recorded as a note.\n\nKnown limits (declared): only package-lock.json (npm) and go.mod (Go) are read at the project root — yarn/pnpm lockfiles and nested/monorepo manifests are not yet covered.\n\n```go\ntype OSVOption func(*osvClient)\n```\nOSVOption configures an osvClient.\n\n```go\nfunc WithBaseURL(u string) OSVOption\n```\nWithBaseURL overrides the OSV API base URL (used by tests to point at a mock).\n\n```go\nfunc WithHTTPClient(h *http.Client) OSVOption\n```\nWithHTTPClient overrides the HTTP client (timeouts, transport).\n\n```go\ntype Vulnerability struct {\n\tID         string // e.g. \"GHSA-...\" or \"CVE-...\"\n\tSummary    string\n\tSeverity   string // CVSS-derived\n\tFixedIn    string // first fixed version, if known\n\tReferences []string\n}\n```\nVulnerability is a known vulnerability OSV.dev reports for a dependency.\n\n","path":"github.com/codefit-cli/codefit/internal/core/cve","name":"cve","synopsis":"Package cve checks project dependencies against known vulnerabilities via OSV.dev (PRD section 18, RF-09).","isRedistributable":true}
