state

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScanStatusUnknown     = "unknown"
	ScanStatusRunning     = "running"
	ScanStatusCompleted   = "completed"
	ScanStatusInterrupted = "interrupted"
	ScanStatusFailed      = "failed"
)
View Source
const ApprovalInventoryVersion = "1"
View Source
const ScanStatusVersion = "1"
View Source
const SnapshotVersion = "v1"

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(explicit string) string

func Save

func Save(path string, snapshot Snapshot) error

func SaveScanStatus added in v1.2.0

func SaveScanStatus(statePath string, status ScanStatus) error

func ScanStatusPath added in v1.2.0

func ScanStatusPath(statePath string) string

Types

type PhaseTiming added in v1.2.0

type PhaseTiming struct {
	Phase          string `json:"phase"`
	StartedAt      string `json:"started_at,omitempty"`
	CompletedAt    string `json:"completed_at,omitempty"`
	DurationMillis int64  `json:"duration_ms,omitempty"`
}

type ScanStatus added in v1.2.0

type ScanStatus struct {
	ScanStatusVersion   string            `json:"scan_status_version"`
	Status              string            `json:"status"`
	StatePath           string            `json:"state_path"`
	Target              any               `json:"target,omitempty"`
	Targets             any               `json:"targets,omitempty"`
	CurrentPhase        string            `json:"current_phase,omitempty"`
	LastSuccessfulPhase string            `json:"last_successful_phase,omitempty"`
	RepoTotal           int               `json:"repo_total,omitempty"`
	ReposCompleted      int               `json:"repos_completed,omitempty"`
	ReposFailed         int               `json:"repos_failed,omitempty"`
	PartialResult       bool              `json:"partial_result,omitempty"`
	PartialResultMarker string            `json:"partial_result_marker,omitempty"`
	StartedAt           string            `json:"started_at,omitempty"`
	UpdatedAt           string            `json:"updated_at,omitempty"`
	CompletedAt         string            `json:"completed_at,omitempty"`
	Error               string            `json:"error,omitempty"`
	ArtifactPaths       map[string]string `json:"artifact_paths,omitempty"`
	PhaseTimings        []PhaseTiming     `json:"phase_timings,omitempty"`
}

func LoadScanStatus added in v1.2.0

func LoadScanStatus(statePath string) (ScanStatus, error)

type ScoreView added in v1.1.2

type ScoreView struct {
	Findings        []source.Finding
	PostureScore    *score.Result
	Identities      []manifest.IdentityRecord
	TransitionCount int
	AttackPaths     []riskattack.ScoredPath
	TopAttackPaths  []riskattack.ScoredPath
	HasRiskReport   bool
}

func LoadScoreView added in v1.1.2

func LoadScoreView(path string) (ScoreView, error)

LoadScoreView validates the stored scan snapshot shape needed by the score command without fully materializing large unused report sections on the cached-score path.

type Snapshot

type Snapshot struct {
	Version                  string                    `json:"version"`
	ApprovalInventoryVersion string                    `json:"approval_inventory_version,omitempty"`
	Target                   source.Target             `json:"target"`
	Targets                  []source.Target           `json:"targets,omitempty"`
	Findings                 []source.Finding          `json:"findings"`
	Inventory                *agginventory.Inventory   `json:"inventory,omitempty"`
	ControlBacklog           *controlbacklog.Backlog   `json:"control_backlog,omitempty"`
	ScanQuality              *scanquality.Report       `json:"scan_quality,omitempty"`
	ScanMode                 string                    `json:"scan_mode,omitempty"`
	RiskReport               *risk.Report              `json:"risk_report,omitempty"`
	Profile                  *profileeval.Result       `json:"profile,omitempty"`
	PostureScore             *score.Result             `json:"posture_score,omitempty"`
	Identities               []manifest.IdentityRecord `json:"identities,omitempty"`
	Transitions              []lifecycle.Transition    `json:"lifecycle_transitions,omitempty"`
}

Snapshot stores deterministic scan material for diff mode.

func Load

func Load(path string) (Snapshot, error)

func LoadRaw added in v1.1.1

func LoadRaw(path string) (Snapshot, error)

Jump to

Keyboard shortcuts

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