attester

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSecret added in v0.3.1

func CreateSecret(ctx context.Context, k8sClient client.Client, attester *rodev1alpha1.Attester, signer Signer) (secret *corev1.Secret, err error)

CreateSecret creates a Kubernetes secret for the attester using the OpenPGP keys from signer

func DeleteSecret added in v0.2.0

func DeleteSecret(ctx context.Context, k8sClient client.Client, attester *rodev1alpha1.Attester) error

DeleteSecret deletes the Kubernetes secret for an attester resource

func NewAttestWrapper

func NewAttestWrapper(log logr.Logger, delegate occurrence.Creator, lister occurrence.Lister, attesterLister Lister, attEventManager attesteventmanager.AttestEventManager) 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
	String() string
}

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 Lister added in v0.2.0

type Lister interface {
	ListAttesters() map[string]Attester
}

Lister is an interface for listing Attesters

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
	SerializeKeys() ([]byte, error)
	SerializePublicKey() ([]byte, error)
	String() string
}

Signer is the interface for managing gpg signing

func NewSigner

func NewSigner(name string) (Signer, error)

Construct Signer with new OpenPGP keys

func NewSignerFromKeys added in v0.3.1

func NewSignerFromKeys(keys []byte) (Signer, error)

Construct Signer from existing OpenPGP keys

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

type ViolationError added in v0.2.0

type ViolationError struct {
	Violations []*Violation
}

ViolationError is a slice of Violations

func (ViolationError) Error added in v0.2.0

func (ve ViolationError) Error() string

Jump to

Keyboard shortcuts

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