validate

package
v0.8.74 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectComponentResults added in v0.8.73

func CollectComponentResults(
	results []Result,
	errorFormatter func(Result) error,
) ([]applicationsnapshot.Component, [][]byte, error)

CollectComponentResults processes a slice of results, accumulating errors and collecting successful components. It returns the collected components (sorted by ContainerImage), policy inputs, and any aggregated errors. The errorFormatter is called for each failed result to create an error message.

func ContainsOutputFormat added in v0.8.73

func ContainsOutputFormat(outputFormats []string, format string) bool

ContainsOutputFormat checks if the specified output format is in the output formats list. It handles formats that may include file paths (e.g., "attestation=/path/to/file").

func GetPolicyConfig

func GetPolicyConfig(ctx context.Context, policyConfiguration string) (string, error)

Determine policyConfig

func ProcessOutputForImageValidation added in v0.8.73

func ProcessOutputForImageValidation(
	out *output.Output,
	err error,
	comp app.SnapshotComponent,
	showSuccesses bool,
	outputFormats []string,
) applicationsnapshot.Component

ProcessOutputForImageValidation processes an output.Output using the same pipeline as the validate image command. This ensures consistent processing for both validate image and validate vsa (fallback) commands. Returns the processed Component which contains violations, warnings, successes processed with the same logic (filtering, sorting, etc.) as the validate image command.

func ReadFile

func ReadFile(ctx context.Context, fileName string) (string, error)

Read file from the workspace and return its contents.

func WriteReport added in v0.8.73

WriteReport creates and writes a report using the provided data and options. It returns the created report so it can be used for further processing (e.g., VSA validation).

Types

type ReportData added in v0.8.73

type ReportData struct {
	Snapshot      string
	Components    []applicationsnapshot.Component
	Policy        policy.Policy
	PolicyInputs  [][]byte
	Expansion     *applicationsnapshot.ExpansionInfo
	ShowSuccesses bool
	ShowWarnings  bool
}

ReportData contains the data needed to create an application snapshot report

type ReportOutputOptions added in v0.8.73

type ReportOutputOptions struct {
	Output     []string
	NoColor    bool
	ForceColor bool
}

ReportOutputOptions contains options for formatting and writing the report

type Result added in v0.8.73

type Result struct {
	Err         error
	Component   applicationsnapshot.Component
	PolicyInput []byte
}

Result represents the result of validating a single component

func PopulateResultFromOutput added in v0.8.73

func PopulateResultFromOutput(
	out *output.Output,
	err error,
	comp app.SnapshotComponent,
	showSuccesses bool,
	outputFormats []string,
) Result

PopulateResultFromOutput decomposes an output.Output object into a Result object. This is used to convert validation output into a consistent result structure that can be used for report generation.

Directories

Path Synopsis
attest.go
attest.go

Jump to

Keyboard shortcuts

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