Documentation
¶
Index ¶
- func Apply(root string, plans []FixCandidate) error
- func ApplyOverride(root string, p FixCandidate) error
- func BestInRange(candidates []string, constraint string) string
- func RunInstall(ctx context.Context, batches []FixBatch, dryRun bool, w io.Writer) error
- func Satisfies(version, constraint string) bool
- type Batch
- type FixBatch
- type FixCandidate
- type FixMethod
- type Options
- type ProofCounts
- type SafeVersionRejection
- type Strategy
- type TargetDecision
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(root string, plans []FixCandidate) error
func ApplyOverride ¶
func ApplyOverride(root string, p FixCandidate) error
ApplyOverride pins the (transitive) package to its safe version via the package manager's override mechanism in the nearest package.json:
npm / bun → "overrides"
pnpm → "pnpm": { "overrides" }
yarn → "resolutions"
No-op (nil) when no package.json is found in the manifest's directory.
func BestInRange ¶
func RunInstall ¶
Types ¶
type Batch ¶
type Batch struct {
Plans []FixCandidate
Counts ProofCounts
}
func BuildPlans ¶
func BuildPlans(vulns []scan.EnrichedVuln, packages []scan.ScopedPackage, groups []scan.ManifestGroup, insights []vdb.CliPackageInsight, opts Options) Batch
type FixBatch ¶
type FixBatch struct {
SourceFile string
Ecosystem string
Dir string
Plans []FixCandidate
}
func GroupBatches ¶
func GroupBatches(root string, plans []FixCandidate) []FixBatch
type FixCandidate ¶
type FixCandidate struct {
PackageName string
Ecosystem string
CurrentVer string
SourceFile string
IsDirect bool
ParentName string
ParentRange string
ParentTarget string // resolved parent version for a parent-upgrade (npm only)
TargetVer string
Method FixMethod
PackageManager string // concrete resolver (npm/pnpm/yarn/bun/...) for the manifest, when known
Command string
CveIDs []string
Reason string
Skipped bool
SkipReason string
RejectedVersions []SafeVersionRejection // populated when SkipReason contains "no Safe-Harbour"
LatestAvailable string // newest known version for context in the proof-of-work output
}
func SelectManifests ¶
func SelectManifests(plans []FixCandidate, manifest string, yes bool) ([]FixCandidate, error)
type ProofCounts ¶
type ProofCounts struct {
Direct int
TransitiveParentUpdate int
TransitiveParentUpgrade int
TransitiveOverride int
UnresolvedDeepChains int
}
func CountPlans ¶
func CountPlans(plans []FixCandidate) ProofCounts
type SafeVersionRejection ¶ added in v3.21.0
SafeVersionRejection records why a candidate Safe-Harbour version could not be used as an autofix target (vuln count, exploit count, or malware flag).
type TargetDecision ¶
func ResolveTarget ¶
func ResolveTarget(current string, strategy Strategy, latest []vdb.CliVersionStamp, safe []vdb.CliSafeHarbourVersion, summary *vdb.CliSafeHarbourSummary, maxMajorBump int) (string, TargetDecision)
Click to show internal directories.
Click to hide internal directories.