resolution

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainIsDev

func ChainIsDev(dc DependencyChain, m manifest.Manifest) bool

Types

type DependencyChain

type DependencyChain struct {
	Graph *resolve.Graph
	Edges []resolve.Edge // Edge from root node is at the end of the list
}

func (DependencyChain) DirectDependency

func (dc DependencyChain) DirectDependency() (resolve.VersionKey, string)

func (DependencyChain) EndDependency

func (dc DependencyChain) EndDependency() (resolve.VersionKey, string)

type ResolutionDiff

type ResolutionDiff struct {
	Original     *ResolutionResult
	New          *ResolutionResult
	RemovedVulns []ResolutionVuln
	AddedVulns   []ResolutionVuln
	manifest.ManifestPatch
}

func (ResolutionDiff) Compare

func (a ResolutionDiff) Compare(b ResolutionDiff) int

Compare compares ResolutionDiffs based on 'effectiveness' (best first):

Sort order:

  1. (number of fixed vulns - introduced vulns) / (number of changed direct dependencies) [descending] (i.e. more efficient first)
  2. number of fixed vulns [descending]
  3. number of changed direct dependencies [ascending]
  4. changed direct dependency name package names [ascending]
  5. size of changed direct dependency bump [ascending]

type ResolutionResult

type ResolutionResult struct {
	Manifest        manifest.Manifest
	Graph           *resolve.Graph
	Vulns           []ResolutionVuln
	UnfilteredVulns []ResolutionVuln
}

func (*ResolutionResult) CalculateDiff

func (res *ResolutionResult) CalculateDiff(other *ResolutionResult) ResolutionDiff

func (*ResolutionResult) FilterVulns

func (res *ResolutionResult) FilterVulns(matchFn func(ResolutionVuln) bool)

FilterVulns populates Vulns with the UnfilteredVulns that satisfy matchFn

type ResolutionVuln

type ResolutionVuln struct {
	Vulnerability models.Vulnerability
	DevOnly       bool
	// Chains are paths through requirements from direct dependency to vulnerable package.
	// A 'Problem' chain constrains the package to a vulnerable version.
	// 'NonProblem' chains re-use the vulnerable version, but would not resolve to a vulnerable version in isolation.
	ProblemChains    []DependencyChain
	NonProblemChains []DependencyChain
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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