grafeas

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DeploymentType voucher.MetadataType = "deployment"

DeploymentType is a Grafeas specific type which refers to MetadataItems containing deployment data.

View Source
const DiscoveryType voucher.MetadataType = "discovery"

DiscoveryType is a Grafeas specific type which refers to MetadataItems containing metadata discovery status.

View Source
const ImageType voucher.MetadataType = "image"

ImageType is a Grafeas specific type which refers to MetadataItems containing Image information.

View Source
const PackageType voucher.MetadataType = "package"

PackageType is a Grafeas specific type which refers to MetadataItems containing package information.

Variables

View Source
var (
	ErrTimeout = errors.New("timeout error when getting REST data")
)

GrafeasAPIService vars

Functions

func NewAPIError

func NewAPIError(statusCode int, url, method string, data []byte) error

NewAPIError creates a new APIError

Types

type APIError

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

APIError to store grafeas API errors

func (*APIError) Error

func (err *APIError) Error() string

Error returns the grafeas API error as a string.

type APIService

APIService is the interface for communicating with Grafeas

func NewAPIService

func NewAPIService(basePath, versionPath string) APIService

NewAPIService creates new GrafeasAPIService

type Client

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

Client implements voucher.MetadataClient, connecting to Grafeas.

func NewClient

func NewClient(ctx context.Context, binauthProject, vulProject string, keyring signer.AttestationSigner, service APIService) (*Client, error)

NewClient creates a new Grafeas Client.

func (*Client) AddAttestationToImage

func (g *Client) AddAttestationToImage(ctx context.Context, ref reference.Canonical, payload voucher.Attestation) (voucher.SignedAttestation, error)

AddAttestationToImage adds a new attestation with the passed Attestation to the image described by ImageData.

func (*Client) CanAttest

func (g *Client) CanAttest() bool

CanAttest returns true if the client can create and sign attestations.

func (*Client) Close

func (g *Client) Close()

Close closes the Grafeas client.

func (*Client) GetAttestations

func (g *Client) GetAttestations(ctx context.Context, ref reference.Canonical) ([]voucher.SignedAttestation, error)

GetAttestations returns all of the attestations associated with an image

func (*Client) GetBuildDetail

func (g *Client) GetBuildDetail(ctx context.Context, ref reference.Canonical) (repository.BuildDetail, error)

GetBuildDetail gets BuildDetails for the passed image.

func (*Client) GetVulnerabilities

func (g *Client) GetVulnerabilities(ctx context.Context, ref reference.Canonical) (items []voucher.Vulnerability, err error)

GetVulnerabilities returns the detected vulnerabilities for the Image described by voucher.ImageData.

func (*Client) NewPayloadBody

func (g *Client) NewPayloadBody(ref reference.Canonical) (string, error)

NewPayloadBody returns a payload body appropriate for this MetadataClient.

Directories

Path Synopsis
Package mock_grafeas is a generated GoMock package.
Package mock_grafeas is a generated GoMock package.

Jump to

Keyboard shortcuts

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