statemachine

package
v1.0.0-rc.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(vuln models.Vuln, event models.VulnEvent)

Types

type BranchDiff

type BranchDiff[T models.Vuln] struct {
	// Completely new vulnerabilities (not on any other branch)
	NewToAllBranches []T

	// Vulnerabilities that exist on other branches (need event history copied)
	ExistingOnOtherBranches []BranchVulnMatch[T]
}

func DiffVulnsBetweenBranches

func DiffVulnsBetweenBranches[T models.Vuln](
	currentBranchVulns []T,
	otherBranchesVulns []T,
) BranchDiff[T]

Compare compares vulnerabilities on current branch with other branches

type BranchVulnMatch

type BranchVulnMatch[T models.Vuln] struct {
	// The vulnerability as detected on the current branch
	CurrentBranchVuln T

	// The same vulnerability from other branches with their event history
	OtherBranchVulns []T

	// Consolidated events from all other branches (ready to copy)
	EventsToCopy []models.VulnEvent
}

BranchVulnMatch represents a vulnerability found on current branch that exists elsewhere

type DependencyVulnStateMachine

type DependencyVulnStateMachine struct {
}

type ScanDiff

type ScanDiff struct {
	// Newly discovered vulnerabilities (never seen before)
	NewlyDiscovered []models.DependencyVuln

	// Fixed everywhere (no longer detected in any artifact)
	FixedEverywhere []models.DependencyVuln

	// First time detected in this specific artifact (but exists elsewhere)
	NewInArtifact []models.DependencyVuln

	// No longer detected in this artifact (but still exists elsewhere)
	RemovedFromArtifact []models.DependencyVuln

	// Still detected, no changes
	Unchanged []models.DependencyVuln
}

func DiffScanResults

func DiffScanResults(artifactName string, foundVulns []models.DependencyVuln, existingVulns []models.DependencyVuln) ScanDiff

type VulnSet

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

func NewVulnSet

func NewVulnSet(vulns []models.DependencyVuln) *VulnSet

NewVulnSet creates a new vulnerability set

func (*VulnSet) Add

func (s *VulnSet) Add(vuln models.DependencyVuln)

Add adds a vulnerability to the set (deduplicates by hash)

func (*VulnSet) Contains

func (s *VulnSet) Contains(vuln models.DependencyVuln) bool

Contains checks if a vulnerability exists in the set

func (*VulnSet) Get

Get retrieves a vulnerability from the set

Jump to

Keyboard shortcuts

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