slsaprovenance

package
v2.3.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvenanceV1DraftType = "https://slsa.dev/provenance/v1.0?draft"
	ProvenanceV02Type     = "https://slsa.dev/provenance/v0.2"
)

Variables

View Source
var ProvenanceMap sync.Map

ProvenanceMap stores the different provenance version types.

Functions

func GetAsString

func GetAsString(environment map[string]any, field string) (string, error)

func GetBranch

func GetBranch(environment map[string]any, predicateType string) (string, error)

func GetEventPayload

func GetEventPayload(environment map[string]any, predicateType string) (map[string]any, error)

GetEventPayload retrieves the GitHub event payload from the environment map that contains the GitHub context payload.

func GetTag

func GetTag(environment map[string]any, predicateType string) (string, error)

func GetWorkflowInputs

func GetWorkflowInputs(environment map[string]any, predicateType string) (map[string]any, error)

GetWorkflowInputs gets the workflow inputs from the GitHub environment map and converts the keys to the necessary casing depending on predicate type.

Types

type Provenance

type Provenance interface {
	// BuilderID returns the builder id in the predicate.
	BuilderID() (string, error)

	// SourceURI is the full URI (including tag) of the source material.
	SourceURI() (string, error)

	// ConfigURI is the full URI (including tag) of the configuration material.
	ConfigURI() (string, error)

	// Subject is the list of intoto subjects in the provenance.
	Subjects() ([]intoto.Subject, error)

	// GetBranch retrieves the branch name of the source from the provenance.
	GetBranch() (string, error)

	// GetTag retrieves the tag of the source from the provenance.
	GetTag() (string, error)

	// GetWorkflowInputs retrieves the inputs from the provenance. Only succeeds for event
	// relevant event types (workflow_inputs).
	GetWorkflowInputs() (map[string]interface{}, error)
}

func ProvenanceFromEnvelope

func ProvenanceFromEnvelope(env *dsselib.Envelope) (Provenance, error)

Provenance interface that each type may implement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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