httptransport

package
v4.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 37 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

View Source
var ErrMediaType = errors.New("no common media type")

ErrMediaType is returned if no common media types can be found for a given request.

Functions

func DiscoveryHandler

func DiscoveryHandler() http.Handler

DiscoveryHandler serves the embedded OpenAPI spec.

func UpdateDiffHandler

func UpdateDiffHandler(serv matcher.Differ) http.HandlerFunc

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

Types

type IndexerV1 added in v4.4.0

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

IndexerV1 is a consolidated Indexer endpoint.

func NewIndexerV1 added in v4.4.0

func NewIndexerV1(_ context.Context, prefix string, srv indexer.Service, topt otelhttp.Option) (*IndexerV1, error)

NewIndexerV1 returns an http.Handler serving the Indexer V1 API rooted at "prefix".

func (*IndexerV1) ServeHTTP added in v4.4.0

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

ServeHTTP implements http.Handler.

type NotifHandler

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

func NotificationHandler

func NotificationHandler(serv notifier.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.

Notes

Bugs

  • Content type negotiation does an O(n*m) comparison driven on user input, which may be a DoS issue.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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