policy_handler

package
v0.0.68 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluatorSelector

type EvaluatorSelector func(ctx context.Context, goal goals.Goal, dataSource data.DataSource) (goals.GoalEvaluator, error)

type EventHandler

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

func NewPolicyEventHandler

func NewPolicyEventHandler(subscriptionNames []string, evalSelector EvaluatorSelector, opts ...Opt) EventHandler

func (EventHandler) CreateHttpHandler added in v0.0.38

func (h EventHandler) CreateHttpHandler() func(http.ResponseWriter, *http.Request)

func (EventHandler) ExecuteSyncRequest added in v0.0.41

func (h EventHandler) ExecuteSyncRequest(ctx context.Context, req skill.RequestContext) ([]goals.GoalEvaluationQueryResult, error)

func (EventHandler) Start

func (h EventHandler) Start()

type Opt

type Opt func(handler *EventHandler)

func WithAsync added in v0.0.33

func WithAsync() Opt

WithAsync is enabled by default, added last after all other Opts if not explicitly registered early.

func WithAsyncMultiQuery

func WithAsyncMultiQuery() Opt

WithAsyncMultiQuery will enable the async graphql data source to spool results across multiple queries. These intermediate results are stored in the following requests' metadata, and as such risk hitting the upper limit on the metadata field, and failing.

func WithLocal

func WithLocal() Opt

func WithSyncQuery

func WithSyncQuery() Opt

type Package added in v0.0.47

type Package struct {
	Licenses  []string `edn:"licenses,omitempty"` // only needed for the license policy evaluation
	Name      string   `edn:"name"`
	Namespace string   `edn:"namespace"`
	Version   string   `edn:"version"`
	Purl      string   `edn:"purl"`
	Type      string   `edn:"type"`
}

type SyncRequestMetadata added in v0.0.16

type SyncRequestMetadata struct {
	QueryResults map[edn.Keyword]edn.RawMessage `edn:"fixedQueryResults"`
	Packages     []Package                      `edn:"packages"`      // todo remove when no longer used
	User         string                         `edn:"imgConfigUser"` // The user from the image config blob // todo remove when no longer used
	SBOM         string                         `edn:"sbom"`
	ContentType  string                         `edn:"contentType"`
	Encoding     string                         `edn:"encoding"`
}

Jump to

Keyboard shortcuts

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