httptransport

package
v4.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 44 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"
	UpdateOperationDeleteAPIPath = 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 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.

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 MatcherV1 added in v4.5.0

type MatcherV1 struct {
	Cache time.Duration
	// contains filtered or unexported fields
}

MatcherV1 is a consolidated Matcher endpoint.

func NewMatcherV1 added in v4.5.0

func NewMatcherV1(_ context.Context, prefix string, srv matcher.Service, indexerSrv indexer.Service, cacheAge time.Duration, topt otelhttp.Option) *MatcherV1

NewMatcherV1 returns an http.Handler serving the Matcher V1 API rooted at "prefix".

func (*MatcherV1) ServeHTTP added in v4.5.0

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

ServeHTTP implements http.Handler.

type NotificationV1 added in v4.5.0

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

NotificationV1 is a Notification endpoint.

func NewNotificationV1 added in v4.5.0

func NewNotificationV1(_ context.Context, prefix string, srv notifier.Service, topt otelhttp.Option) (*NotificationV1, error)

NewNotificationV1 returns an http.Handler serving the Notification V1 API rooted at "prefix".

func (*NotificationV1) ServeHTTP added in v4.5.0

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

ServeHTTP implements http.Handler.

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)

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