api

package
v1.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gzip

func Gzip(next http.HandlerFunc) http.HandlerFunc

Gzip Middleware for Responses

func HTTPBasic added in v1.6.0

func HTTPBasic(auth *BasicAuth, next http.HandlerFunc) http.HandlerFunc

func HealthzHandler

func HealthzHandler(synced func() bool) http.HandlerFunc

HealthzHandler for the Liveness REST API

func NamespaceReportingHandler added in v1.5.0

func NamespaceReportingHandler(s reporting.PolicyReportGenerator, basePath string) http.HandlerFunc

NamespaceReportingHandler for the NamespaceReport REST API

func NewLoggerMiddleware added in v1.5.1

func NewLoggerMiddleware(logger *zap.Logger, mux http.Handler) http.Handler

func PolicyHandler

func PolicyHandler(s *kyverno.PolicyStore) http.HandlerFunc

PolicyHandler for the Policy REST API

func PolicyReportingHandler added in v1.5.0

func PolicyReportingHandler(s reporting.PolicyReportGenerator, basePath string) http.HandlerFunc

PolicyHandler for the PolicyReport REST API

func ReadyHandler

func ReadyHandler() http.HandlerFunc

ReadyHandler for the Readiness REST API

func VerifyImageRulesHandler added in v1.1.0

func VerifyImageRulesHandler(s *kyverno.PolicyStore) http.HandlerFunc

VerifyImageRulesHandler for the ImageVerify Policy REST API

Types

type BasicAuth added in v1.6.0

type BasicAuth struct {
	Username string
	Password string
}

type Policy added in v1.1.0

type Policy struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
	UID       string `json:"uid,omitempty"`
}

type Server

type Server interface {
	// Start the HTTP REST API
	Start() error
	// Shutdown the HTTP Sever
	Shutdown(ctx context.Context) error
	// RegisterREST add all REST API handler
	RegisterREST()
	// RegisterMetrics adds Metrics handler
	RegisterMetrics()
}

Server for the optional HTTP REST API

func NewServer

func NewServer(pStore *kyverno.PolicyStore, reports reporting.PolicyReportGenerator, port int, synced func() bool, auth *BasicAuth, logger *zap.Logger) Server

NewServer constructor for a new API Server

type VerifyImage added in v1.1.0

type VerifyImage struct {
	Policy       *Policy `json:"policy"`
	Rule         string  `json:"rule"`
	Repository   string  `json:"repository"`
	Image        string  `json:"image"`
	Key          string  `json:"key"`
	Attestations string  `json:"attestations,omitempty"`
}

Jump to

Keyboard shortcuts

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