attest

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitRef = "refs/attestations/commits"
	TreeRef   = "refs/attestations/trees"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestor

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

func NewAttestor

func NewAttestor(repo *git.Repository, sv *sign.SignerVerifier, rekorFn rekorUpload) *Attestor

func (*Attestor) WriteAttestation

func (a *Attestor) WriteAttestation(ctx context.Context, refName string, sha plumbing.Hash, input Reader, attType string) (plumbing.Hash, error)

WriteAttestion writes the given content + a DSSE signed attestation to the corresponding attestation ref. The SHA of the created commit is returned.

repo: What repository to write to. refName: What ref to write to (e.g. refs/attestations/commits) sha: Commit SHA you are attesting to. input: Attestation file input. attType: Attestation type. See attestation.GenerateStatement for allowed values.

func (*Attestor) WriteFile

func (a *Attestor) WriteFile(ctx context.Context, refName string, sha plumbing.Hash, path, attType string) (plumbing.Hash, error)

WriteFile is a convenience wrapper around WriteAttestation that takes in a filepath rather than an io.Reader.

type Encoder

type Encoder interface {
	Encode(o plumbing.EncodedObject) error
}

type NamedReader

type NamedReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func (NamedReader) Name

func (r NamedReader) Name() string

type Reader

type Reader interface {
	io.Reader
	Name() string
}

func NewNamedReader

func NewNamedReader(r io.Reader, name string) Reader

Jump to

Keyboard shortcuts

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