statemachine

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VisibilityDraft     = "draft"
	VisibilityPublic    = "public"
	VisibilityWithdrawn = "withdrawn"
)

Variables

This section is empty.

Functions

func Apply

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

func CanDelete added in v1.10.0

func CanDelete(currentVisibility string) error

func CheckStateTransition added in v1.10.0

func CheckStateTransition(currentVisibility string, newVisibility string) error

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) 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