attester

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAttestWrapper

func NewAttestWrapper(logger *zap.SugaredLogger, delegate occurrence.Creator, lister occurrence.Lister, attesters []Attester) occurrence.Creator

NewAttestWrapper creates an Creator that also performs attestation

Types

type AttestRequest

type AttestRequest struct {
	ResourceURI string
	Occurrences []*grafeas.Occurrence
}

AttestRequest contains request for attester

type AttestResponse

type AttestResponse struct {
	Attestation *grafeas.Occurrence
}

AttestResponse contains response from attester

type Attester

type Attester interface {
	Attest(ctx context.Context, req *AttestRequest) (*AttestResponse, error)
	Verify(ctx context.Context, req *VerifyRequest) error
}

Attester for performing attestation. returns `ok` if attestation created

func NewAttester

func NewAttester(name string, policy Policy, signer Signer) Attester

NewAttester creates a new attester

type Policy

type Policy interface {
	Evaluate(context.Context, interface{}) []*Violation
	Serialize(out io.Writer) error
}

Policy is the interface for managing policy

func NewPolicy

func NewPolicy(name string, module string, trace bool) (Policy, error)

NewPolicy creates a new policy

func ReadPolicy

func ReadPolicy(in io.Reader) (Policy, error)

ReadPolicy creates a signer from reader

type Signer

type Signer interface {
	Sign(string) (string, error)
	Verify(string) (string, error)
	KeyID() string
	Serialize(out io.Writer) error
}

Signer is the interface for managing gpg signing

func NewSigner

func NewSigner(name string) (Signer, error)

NewSigner creates a new signer

func ReadSigner

func ReadSigner(in io.Reader) (Signer, error)

ReadSigner creates a signer from reader

type VerifyRequest

type VerifyRequest struct {
	Occurrence *grafeas.Occurrence
}

VerifyRequest contains request for attester

type Violation

type Violation struct {
	Raw     interface{}
	Msg     string
	Details map[string]interface{}
}

Violation describes a violation

func NewViolation

func NewViolation(raw interface{}) *Violation

NewViolation creates new violation from raw val

func (*Violation) String

func (v *Violation) String() string

Jump to

Keyboard shortcuts

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