httptransport

package
v4.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IndexAPIPath            = indexerRoot + apiRoot + "index_report"
	IndexReportAPIPath      = indexerRoot + apiRoot + "index_report/"
	IndexStateAPIPath       = indexerRoot + apiRoot + "index_state"
	AffectedManifestAPIPath = indexerRoot + internalRoot + "affected_manifest/"
	VulnerabilityReportPath = matcherRoot + apiRoot + "vulnerability_report/"
	UpdateOperationAPIPath  = matcherRoot + internalRoot + "update_operation/"
	UpdateDiffAPIPath       = matcherRoot + internalRoot + "update_diff/"
	NotificationAPIPath     = notifierRoot + apiRoot + "notification/"
	KeysAPIPath             = notifierRoot + apiRoot + "services/notifier/keys"
	KeyByIDAPIPath          = notifierRoot + apiRoot + "services/notifier/keys/"
	OpenAPIV1Path           = "/openapi/v1"
)
View Source
const (
	DefaultPageSize = 500
)
View Source
const IntraserviceIssuer = `clair-intraservice`

IntraserviceIssuer is the issuer that will be used if Clair is configured to mint its own JWTs.

Variables

This section is empty.

Functions

func AffectedManifestHandler

func AffectedManifestHandler(serv indexer.Affected) http.HandlerFunc

func DiscoveryHandler

func DiscoveryHandler() http.Handler

DiscoveryHandler serves the embedded OpenAPI spec.

func IndexHandler

func IndexHandler(serv indexer.StateIndexer) http.HandlerFunc

IndexHandler utilizes an Indexer to begin a Index of a manifest.

func IndexReportHandler

func IndexReportHandler(serv indexer.StateReporter) http.HandlerFunc

IndexReportHandler utilizes a Reporter to serialize and return a claircore.IndexReport given a path parameter

func IndexStateHandler

func IndexStateHandler(service indexer.Stater) http.HandlerFunc

IndexStateHandler utilizes a Stater to report the curent runtime state of an Indexer.

Indexers running with different scanner versions will produce unique states and indicate to clients a re-index is necessary.

func UpdateDiffHandler

func UpdateDiffHandler(serv matcher.Differ) http.HandlerFunc

UpdateDiffHandler provides an endpoint to GET update diffs when provided an UpdateOperation ref.

Types

type NotifHandler

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

func NotificationHandler

func NotificationHandler(serv service.Service) *NotifHandler

func (*NotifHandler) Delete

func (h *NotifHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*NotifHandler) Get

Get will return paginated notifications to the caller.

func (*NotifHandler) ServeHTTP

func (h *NotifHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Response

type Response struct {
	Page          notifier.Page           `json:"page"`
	Notifications []notifier.Notification `json:"notifications"`
}

type Server

type Server struct {
	*http.Server
	*http.ServeMux
	// contains filtered or unexported fields
}

Server is the primary http server Clair exposes its functionality on.

func New

func New(ctx context.Context, conf config.Config, indexer indexer.Service, matcher matcher.Service, notifier notifier.Service) (*Server, error)

type UOHandler

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

UOHandler implements http.Handler and provides http.HandlerFunc(s) for GET and DELETE operations.

func UpdateOperationHandler

func UpdateOperationHandler(serv matcher.Differ) *UOHandler

UpdateOperationHandler creates a new UOHandler

func (*UOHandler) Delete

func (h *UOHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes an UpdateOperation models from the system.

func (*UOHandler) Get

func (h *UOHandler) Get(w http.ResponseWriter, r *http.Request)

Clients may provide an 'If-None-Match' header with the etag value to receive a StatusNotModified when no new UpdateOperations have been created.

func (*UOHandler) ServeHTTP

func (h *UOHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP provides GET and DELETE operations for UpdateOperation models.

Implements http.Handler interface and may also be used as a http.HandlerFunc

type VulnerabilityReportHandler

type VulnerabilityReportHandler struct {
	Matcher matcher.Service
	Indexer indexer.Service
	Cache   time.Duration
}

VulnerabilityReportHandler produces VulnerabilityReports.

func (*VulnerabilityReportHandler) ServeHTTP added in v4.3.0

ServeHTTP implements http.Handler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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