crafter

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAttestationStateNotLoaded = errors.New("crafting state not loaded")
View Source
var ErrRunnerContextNotFound = errors.New("the runner environment doesn't match the required runner type")

Functions

func LoadSchema

func LoadSchema(pathOrURI string) (*schemaapi.CraftingSchema, error)

func NewRunner

func NewRunner(t schemaapi.CraftingSchema_Runner_RunnerType) supportedRunner

Types

type Crafter

type Crafter struct {
	CraftingState *api.CraftingState

	Runner supportedRunner
	// contains filtered or unexported fields
}

func NewCrafter

func NewCrafter(opts ...NewOpt) *Crafter

Create a completely new crafter

func (*Crafter) AddMaterial

func (c *Crafter) AddMaterial(key, value string) error

Inject material to attestation state

func (*Crafter) AlreadyInitialized

func (c *Crafter) AlreadyInitialized() bool

func (*Crafter) Init

func (c *Crafter) Init(opts *InitOpts) error

Initialize the crafter with a remote or local schema

func (*Crafter) LoadCraftingState

func (c *Crafter) LoadCraftingState() error

func (*Crafter) Reset

func (c *Crafter) Reset() error

Reset removes the current crafting state

func (*Crafter) ResolveEnvVars

func (c *Crafter) ResolveEnvVars(strict bool) error

ResolveEnvVars will iterate on the env vars in the allow list and resolve them from the system context strict indicates if it should fail if any env variable can not be found

func (*Crafter) ValidateAttestation

func (c *Crafter) ValidateAttestation() error

type InitOpts

type InitOpts struct {
	// Control plane workflow metadata
	WfInfo *api.WorkflowMetadata
	// already marshaled schema
	SchemaV1 *schemaapi.CraftingSchema
	// do not record, upload or push attestation
	DryRun bool
}

type NewOpt

type NewOpt func(c *Crafter)

func WithLogger

func WithLogger(l *zerolog.Logger) NewOpt

func WithStatePath

func WithStatePath(path string) NewOpt

where to store the attestation state file

func WithUploader

func WithUploader(uploader casclient.Uploader) NewOpt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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