attestation

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	PURL packageurl.PackageURL
	Type Type
}

Attestation an attestation url

func Reduce

func Reduce(atts []Attestation, filter string) ([]Attestation, error)

Reduce filters the Attestations based on the given filter

func (Attestation) IsAttestationType

func (a Attestation) IsAttestationType(t string) bool

IsAttestationType indicates if a PURL has the given attestation type.

func (Attestation) IsRegistry

func (a Attestation) IsRegistry(registryURL string) bool

IsRegistry filters on a specific repository_url qualifier of the package.

type DefaultPrinter

type DefaultPrinter struct {
	// contains filtered or unexported fields
}

DefaultPrinter prints the attestation purls

func NewDefaultPrinter

func NewDefaultPrinter(w io.Writer) *DefaultPrinter

NewDefaultPrinter creates a new DefaultPrinter instance utilizing the given io.Writer

func (*DefaultPrinter) Print

func (p *DefaultPrinter) Print(atts []Attestation) error

Print prints the attestations to the io.Writer

func (*DefaultPrinter) PrintAttestation

func (p *DefaultPrinter) PrintAttestation(a Attestation) error

PrintAttestation prints a single attestation to the io.Writer

type Discoverer

type Discoverer interface {
	Discover(string) (io.Reader, error)
}

Discoverer allows to discover attestations

type File added in v0.2.0

type File interface {
	cremote.File
	Scheme() string
}

File extends cremote.File by adding Scheme

func ParseFileRef added in v0.2.0

func ParseFileRef(fileRef string) (File, error)

ParseFileRef parses a file reference as a AttestationFile

type FilteredEnv

type FilteredEnv struct {
	Attestations []Attestation
}

FilteredEnv holds the context to apply filter expressions.

type Printer

type Printer interface {
	Print(atts []Attestation) error
}

Printer allows to print results

type PublishResult added in v0.2.0

type PublishResult struct {
	OCIRef name.Reference
	PURL   *packageurl.PackageURL
}

PublishResult captures the result after publishing the attestations

func Publish added in v0.2.0

func Publish(ctx context.Context, repository, tagPrefix string, version string, att cremote.File) (*PublishResult, error)

Publish publishes the attestations to an oci repository

type Resolver

type Resolver interface {
	Resolve(io.Reader) ([]Attestation, error)
}

Resolver allows to resolve attestations

type Type

type Type int

Type enumeration of attestation types

const (
	// Unknown unknown attestation
	Unknown Type = iota
	// SBOM an sbom attestation
	SBOM
	// Provenance a provenance attestation
	Provenance
)

func TypeFromString

func TypeFromString(text string) Type

TypeFromString takes an attestation type as string and return the Type

func (Type) String

func (i Type) String() string

func (*Type) UnmarshalText

func (t *Type) UnmarshalText(text []byte) error

UnmarshalText unmarshals the type from a text form

Directories

Path Synopsis
discoverers
fs
oci
resolvers
txt

Jump to

Keyboard shortcuts

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