check

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluation added in v0.1.2

type Evaluation struct {
	Input   string           `json:"input" yaml:"input"`
	License internal.License `json:"license" yaml:"license"`
	Package internal.Package `json:"package" yaml:"package"`
	Passed  bool             `json:"passed" yaml:"passed"`
	Reasons []string         `json:"reasons" yaml:"reasons"`
}

func NewEvaluation added in v0.1.2

func NewEvaluation(input string, le evalutation.LicenseEvaluation) Evaluation

type Report

type Report struct {
	ReportID  string
	Results   evalutation.Results
	Config    ReportConfig
	Timestamp string
	Monitor   *event.ManualStagedProgress
	// contains filtered or unexported fields
}

Report presents the results of a grant check command `grant alpine:latest ./foo` The above command will have two results. The first result is easy. Generate an SBOM for alpine:latest and run the policy against it. The second result is a little more complicated. Visit each leaf of ./foo and check for licenses, sbom, or archives. Results are composed of a case its evaluations. The case is the total of SBOM/Licenses generated from the user request. The evaluations are the individual assessments of the policy against the packages/licenses in the case.

func NewReport

func NewReport(rc ReportConfig, userRequests ...string) (*Report, error)

NewReport will generate a new report for the given format for the check command The supplied policy is applied to all user requests. If no policy is provided, the default policy will be used If no requests are provided, an empty report will be generated If a request is provided, but the sbom cannot be generated, the source will be ignored and an error will be returned Where do we render packages that had no licenses?

func (*Report) HasFailures added in v0.1.2

func (r *Report) HasFailures() bool

func (*Report) Render

func (r *Report) Render() error

Render will call Render on each result in the report and return the report

type ReportConfig

type ReportConfig struct {
	Policy  grant.Policy
	Options internal.ReportOptions
	Monitor *event.ManualStagedProgress
}

type Response added in v0.1.2

type Response struct {
	ReportID  string       `json:"report_id" yaml:"report_id"`
	Timestamp string       `json:"timestamp" yaml:"timestamp"`
	Inputs    []string     `json:"inputs" yaml:"inputs"`
	Results   []Evaluation `json:"results" yaml:"results"`
}

Jump to

Keyboard shortcuts

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