project

package
v0.0.0-...-0828d53 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromReaders

func FromReaders(readers iterator.NamedReadCloserIterator, orgPolicy organization.Policy, validator options.PolicyValidator) (map[string]Policy, error)

FromReaders creates a set of policies indexed by their unique id.

Types

type BuildRequirements

type BuildRequirements struct {
	RequireSlsaLevel *int `json:"require_slsa_level"`
}

BuildRequirements defines the build requirements.

type Environment

type Environment struct {
	AnyOf []string `json:"any_of"`
}

Environment defines the target environment.

type Package

type Package struct {
	Name        string      `json:"name"`
	Environment Environment `json:"environment"`
}

Package defines publication metadata, such as the name, registry and the target environment.

type Policy

type Policy struct {
	Format            int               `json:"format"`
	Protection        Protection        `json:"protection"`
	Packages          []Package         `json:"packages"`
	BuildRequirements BuildRequirements `json:"build"`
	// contains filtered or unexported fields
}

Policy defines the policy.

func (*Policy) Evaluate

func (p *Policy) Evaluate(digests intoto.DigestSet, packageName string,
	orgPolicy organization.Policy, publishOpts options.PublishVerification) (*Protection, error)

Evaluate evaluates a policy.

type PolicyOption

type PolicyOption func(*Policy) error

PolicyOption defines a policy option.

type Protection

type Protection struct {
	GoogleServiceAccount string `json:"google_service_account"`
}

Jump to

Keyboard shortcuts

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