provenance

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	PayloadType string        `json:"payloadType"`
	Payload     string        `json:"payload"`
	Signatures  []interface{} `json:"signatures"`
}

Envelope is the outermost layer of the attestation, handling authentication and serialization. The format and protocol are defined in DSSE and adopted by in-toto in ITE-5. https://github.com/in-toto/attestation/blob/main/spec/README.md#envelope

type Predicate

type Predicate struct {
	slsa.ProvenancePredicate
	// contains filtered or unexported fields
}

func NewSLSAPredicate

func NewSLSAPredicate() Predicate

NewSLSAPredicate returns a new SLSA provenance predicate

func (*Predicate) AddMaterial

func (p *Predicate) AddMaterial(uri string, ds common.DigestSet)

AddMaterial adds an entry to the listo of materials

func (*Predicate) SetImplementation

func (p *Predicate) SetImplementation(impl PredicateImplementation)

setImplementation sets the predicate implementation

func (*Predicate) Write

func (p *Predicate) Write(path string) error

Write outputs the predicate as JSON to a file

type PredicateImplementation

type PredicateImplementation interface {
	AddMaterial(*Predicate, string, common.DigestSet)
	Write(*Predicate, string) error
}

type Statement

type Statement struct {
	intoto.StatementHeader
	Predicate Predicate `json:"predicate"`
	// contains filtered or unexported fields
}

Statement is the middle layer of the attestation, binding it to a particular subject and unambiguously identifying the types of the predicate. https://github.com/in-toto/attestation/blob/main/spec/README.md#statement

func LoadStatement

func LoadStatement(path string) (s *Statement, err error)

LoadStatement loads a statement from a json file

func NewSLSAStatement

func NewSLSAStatement() *Statement

NewSLSAStatement creates a new attestation

func (*Statement) AddSubject

func (s *Statement) AddSubject(uri string, ds common.DigestSet)

AddSubject adds an entry to the listo of materials

func (*Statement) AddSubjectFromFile

func (s *Statement) AddSubjectFromFile(filePath string) error

AddSubjectFromFile adds a subject to the list by checking a file in the filesystem

func (*Statement) ClonePredicate

func (s *Statement) ClonePredicate(manifestPath string) error

ClonePredicate reads a provenance metadata file from `manifestPath` and clones the predicate data to the current object.

func (*Statement) LoadPredicate

func (s *Statement) LoadPredicate(path string) error

LoadPredicate loads a predicate from a json file

func (*Statement) ReadSubjectsFromDir

func (s *Statement) ReadSubjectsFromDir(path string) (err error)

ReadSubjectsFromDir reads a directory and adds every file as a subject to the statement.

func (*Statement) SetImplementation

func (s *Statement) SetImplementation(si StatementImplementation)

func (*Statement) ToJSON

func (s *Statement) ToJSON() ([]byte, error)

func (*Statement) VerifySubjects

func (s *Statement) VerifySubjects(path string) (err error)

VerifySubjects checks the provenance metadata of the attestation subjects by reading them from `path`.

func (*Statement) Write

func (s *Statement) Write(path string) error

Write outputs the predicate as JSON to a file

type StatementImplementation

type StatementImplementation interface {
	AddSubject(*Statement, string, common.DigestSet)
	ReadSubjectsFromDir(*Statement, string) error
	SubjectFromFile(string) (intoto.Subject, error)
	Write(*Statement, string) error
	ToJSON(s *Statement) ([]byte, error)
	ClonePredicate(*Statement, string) error
	VerifySubjects(path string, subjects *[]intoto.Subject) (err error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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