clair

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthorization

func AddAuthorization(layer v1.Layer, token *oauth2.Token) v1.Layer

AddAuthorization adds a Bearer token to the v1.Layer passed to it and returns a new v1.Layer.

func GetLayerURI added in v1.1.0

func GetLayerURI(hostname string, digest digest.Digest) string

GetLayerURI gets the layer URI for the passed digest on the passed hostname.

func GetNewLayerURI added in v1.1.0

func GetNewLayerURI(hostname string) string

GetNewLayerURI gets the new layer URI for the passed hostname.

Types

type Config

type Config struct {
	Hostname string `json:"hostname"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Config is a structure that tracks Clair specific configuration.

func (*Config) UpdateRequest

func (c *Config) UpdateRequest(request *http.Request)

UpdateRequest sets the Authorization header for the passed request.

func (*Config) UseBasicAuth

func (c *Config) UseBasicAuth() bool

UseBasicAuth returns true if connections made using this configuration should be using BasicAuth.

type LayerReference

type LayerReference struct {
	Image   reference.Canonical // The Image's reference.
	Current digest.Digest       // The digest of the current layer.
	Parent  digest.Digest       // The digest of the parent layer.
}

LayerReference is a structure containing a Layer digest, as well as the repository URI, to simplify loading a Layer from the server.

func NewLayerReference

func NewLayerReference(image reference.Canonical, current, parent digest.Digest) LayerReference

NewLayerReference creates a new LayerReference based on the passed Image, and layer digest (the current digest) and that layer's parent digest.

func (*LayerReference) GetLayer

func (ref *LayerReference) GetLayer() v1.Layer

GetLayer returns a layer description of the LayerReference.

func (*LayerReference) GetURI

func (ref *LayerReference) GetURI() string

GetURI gets the URI that is described in the LayerReference.

type Scanner

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

Scanner implements the interface SnakeoilScanner.

func NewScanner

func NewScanner(config Config, auth voucher.Auth) *Scanner

NewScanner creates a new Scanner.

func (*Scanner) FailOn

func (scanner *Scanner) FailOn(severity voucher.Severity)

FailOn sets severity level that a vulnerability must match or exheed to prompt a failure.

func (*Scanner) Scan

func (scanner *Scanner) Scan(i voucher.ImageData) ([]voucher.Vulnerability, error)

Scan runs a scan in the Clair namespace.

func (*Scanner) SetBasicAuth

func (scanner *Scanner) SetBasicAuth(username, password string)

SetBasicAuth sets the username and password to use for Basic Auth, and enforces the use of Basic Auth for new connections.

Jump to

Keyboard shortcuts

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