artifacts

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArtifactsInputsResultName  = "ARTIFACT_INPUTS"
	ArtifactsOutputsResultName = "ARTIFACT_OUTPUTS"
	OCIScheme                  = "oci://"
	GitSchemePrefix            = "git+"

	OCIImageURLResultName    = "IMAGE_URL"
	OCIImageDigestResultName = "IMAGE_DIGEST"
	OCIImagesResultName      = "IMAGES"
)

Variables

View Source
var (
	Sha1Regexp *regexp.Regexp = regexp.MustCompile(`^[a-f0-9]{40}$`)
)

Functions

func ExtractOCIImagesFromResults added in v0.3.0

func ExtractOCIImagesFromResults(ctx context.Context, results []objects.Result) []interface{}

ExtractOCIImagesFromResults returns all the results marked as OCIImage type-hint result.

func IsBuildArtifact added in v0.21.0

func IsBuildArtifact(res objects.Result) (bool, error)

IsBuildArtifact indicates if a given result was marked as a Build Artifact.

func ParseDigest added in v0.17.0

func ParseDigest(dig string) (algo_string string, hex string, err error)

ParseDigest parses the digest string and returns the algorithm and hex section of the digest.

func RetrieveMaterialsFromStructuredResults added in v0.13.0

func RetrieveMaterialsFromStructuredResults(ctx context.Context, objResults []objects.Result) []common.ProvenanceMaterial

RetrieveMaterialsFromStructuredResults retrieves structured results from Object Results, and convert them into materials.

Types

type OCIArtifact

type OCIArtifact struct{}

func (*OCIArtifact) Enabled added in v0.7.0

func (oa *OCIArtifact) Enabled(cfg config.Config) bool

func (*OCIArtifact) ExtractObjects

func (oa *OCIArtifact) ExtractObjects(ctx context.Context, obj objects.TektonObject) []interface{}

func (*OCIArtifact) FullKey added in v0.13.0

func (oa *OCIArtifact) FullKey(obj interface{}) string

func (*OCIArtifact) PayloadFormat

func (oa *OCIArtifact) PayloadFormat(cfg config.Config) config.PayloadType

func (*OCIArtifact) ShortKey added in v0.13.0

func (oa *OCIArtifact) ShortKey(obj interface{}) string

func (*OCIArtifact) Signer

func (oa *OCIArtifact) Signer(cfg config.Config) string

func (*OCIArtifact) StorageBackend

func (oa *OCIArtifact) StorageBackend(cfg config.Config) sets.Set[string]

func (*OCIArtifact) Type

func (oa *OCIArtifact) Type() string

type PipelineRunArtifact added in v0.13.0

type PipelineRunArtifact struct{}

func (*PipelineRunArtifact) Enabled added in v0.13.0

func (pa *PipelineRunArtifact) Enabled(cfg config.Config) bool

func (*PipelineRunArtifact) ExtractObjects added in v0.13.0

func (pa *PipelineRunArtifact) ExtractObjects(ctx context.Context, obj objects.TektonObject) []interface{}

func (*PipelineRunArtifact) FullKey added in v0.13.0

func (pa *PipelineRunArtifact) FullKey(obj interface{}) string

func (*PipelineRunArtifact) PayloadFormat added in v0.13.0

func (pa *PipelineRunArtifact) PayloadFormat(cfg config.Config) config.PayloadType

func (*PipelineRunArtifact) ShortKey added in v0.13.0

func (pa *PipelineRunArtifact) ShortKey(obj interface{}) string

func (*PipelineRunArtifact) Signer added in v0.13.0

func (pa *PipelineRunArtifact) Signer(cfg config.Config) string

func (*PipelineRunArtifact) StorageBackend added in v0.13.0

func (pa *PipelineRunArtifact) StorageBackend(cfg config.Config) sets.Set[string]

func (*PipelineRunArtifact) Type added in v0.13.0

func (pa *PipelineRunArtifact) Type() string

type Signable

type Signable interface {
	ExtractObjects(ctx context.Context, obj objects.TektonObject) []interface{}
	StorageBackend(cfg config.Config) sets.Set[string]
	Signer(cfg config.Config) string
	PayloadFormat(cfg config.Config) config.PayloadType
	// FullKey returns the full identifier for a signable artifact.
	// - For OCI artifact, it is the full representation in the format of `<NAME>@sha256:<DIGEST>`.
	// - For TaskRun/PipelineRun artifact, it is `<GROUP>-<VERSION>-<KIND>-<UID>`
	FullKey(interface{}) string
	// ShortKey returns the short version  of an artifact identifier.
	// - For OCI artifact, it is first 12 chars of the image digest.
	// - For TaskRun/PipelineRun artifact, it is `<KIND>-<UID>`.
	ShortKey(interface{}) string
	Type() string
	Enabled(cfg config.Config) bool
}

type StructuredSignable added in v0.11.0

type StructuredSignable struct {
	URI    string
	Digest string
}

StructuredSignable contains info for signable targets to become either subjects or materials in intoto Statements. URI is the resource uri for the target needed iff the target is a material. Digest is the target's SHA digest.

func ExtractBuildArtifactsFromResults added in v0.21.0

func ExtractBuildArtifactsFromResults(ctx context.Context, results []objects.Result) (objs []*StructuredSignable)

ExtractBuildArtifactsFromResults extracts all the structured signable targets from the given results, only processing the ones marked as build artifacts.

func ExtractSignableTargetFromResults added in v0.11.0

func ExtractSignableTargetFromResults(ctx context.Context, obj objects.TektonObject) []StructuredSignable

ExtractSignableTargetFromResults extracts signable targets that aim to generate intoto provenance as materials within TaskRun results and store them as StructuredSignable.

func ExtractStructuredTargetFromResults added in v0.13.0

func ExtractStructuredTargetFromResults(ctx context.Context, objResults []objects.Result, categoryMarker string) []*StructuredSignable

ExtractStructuredTargetFromResults extracts structured signable targets aim to generate intoto provenance as materials within TaskRun results and store them as StructuredSignable. categoryMarker categorizes signable targets into inputs and outputs.

func (*StructuredSignable) FullRef added in v0.12.0

func (s *StructuredSignable) FullRef() string

FullRef returns the full reference of the signable artifact in the format of URI@DIGEST

type TaskRunArtifact

type TaskRunArtifact struct{}

func (*TaskRunArtifact) Enabled added in v0.7.0

func (ta *TaskRunArtifact) Enabled(cfg config.Config) bool

func (*TaskRunArtifact) ExtractObjects

func (ta *TaskRunArtifact) ExtractObjects(ctx context.Context, obj objects.TektonObject) []interface{}

func (*TaskRunArtifact) FullKey added in v0.13.0

func (ta *TaskRunArtifact) FullKey(obj interface{}) string

func (*TaskRunArtifact) PayloadFormat

func (ta *TaskRunArtifact) PayloadFormat(cfg config.Config) config.PayloadType

func (*TaskRunArtifact) ShortKey added in v0.13.0

func (ta *TaskRunArtifact) ShortKey(obj interface{}) string

func (*TaskRunArtifact) Signer

func (ta *TaskRunArtifact) Signer(cfg config.Config) string

func (*TaskRunArtifact) StorageBackend

func (ta *TaskRunArtifact) StorageBackend(cfg config.Config) sets.Set[string]

func (*TaskRunArtifact) Type

func (ta *TaskRunArtifact) Type() string

Jump to

Keyboard shortcuts

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