image

package
v0.0.0-...-06b94e1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthorization

func GetAuthorization(ctx context.Context, source AuthorizationSource) ([]authorizationSignature, error)

func GetK8sResource

func GetK8sResource(ecp *ecc.EnterpriseContractPolicySpec) (authorizationGetter, error)

func PrintAuthorization

func PrintAuthorization(authorization []authorizationSignature) error

func ValidateImage

func ValidateImage(ctx context.Context, url string, p policy.Policy, detailed bool) (*output.Output, error)

ValidateImage executes the required method calls to evaluate a given policy against a given image url.

Types

type AuthorizationSource

type AuthorizationSource interface {
	GetSource(context.Context) (authorizationGetter, error)
}

type ImageReference

type ImageReference struct {
	Repository string
	Digest     string
	Tag        string
	// contains filtered or unexported fields
}

func NewImageReference

func NewImageReference(url string, opts ...name.Option) (*ImageReference, error)

NewImageReference returns an ImageReference instance based on the given url.

func ParseAndResolve

func ParseAndResolve(url string, opts ...name.Option) (*ImageReference, error)

ParseAndResolve parses the url into an ImageReference object. The digest is resolved if needed.

func ParseAndResolveAll

func ParseAndResolveAll(urls []string, opts ...name.Option) ([]ImageReference, error)

ParseAndResolveAll is like ParseAndResolve, but for a list of urls.

func (ImageReference) Ref

func (i ImageReference) Ref() name.Reference

func (*ImageReference) String

func (i *ImageReference) String() string

type K8sSource

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

holds config information to get client instance

func NewK8sSource

func NewK8sSource(policyConfiguration string) (*K8sSource, error)

func (*K8sSource) GetSource

func (k *K8sSource) GetSource(ctx context.Context) (authorizationGetter, error)

fetch the k8s resource from the cluster

Jump to

Keyboard shortcuts

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