wasm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// All the expressions defined must match to match this condition
	// +optional
	AllOf []PatternExpression `json:"allOf,omitempty"`
}

Condition defines traffic matching rules

type DataItem

type DataItem struct {
	// +optional
	Static *StaticSpec `json:"static,omitempty"`

	// +optional
	Selector *SelectorSpec `json:"selector,omitempty"`
}

TODO implement one of constraint Precisely one of "static", "selector" must be set.

type FailureModeType

type FailureModeType string

+kubebuilder:validation:Enum:=deny;allow

const (
	FailureModeDeny  FailureModeType = "deny"
	FailureModeAllow FailureModeType = "allow"
)

type PatternExpression

type PatternExpression struct {
	// Selector of an attribute from the contextual properties provided by kuadrant
	// during request and connection processing
	Selector kuadrantv1beta2.ContextSelector `json:"selector"`

	// The binary operator to be applied to the content fetched from context, for comparison with "value".
	// Possible values are: "eq" (equal to), "neq" (not equal to), "incl" (includes; for arrays), "excl" (excludes; for arrays), "matches" (regex)
	// TODO build comprehensive list of operators
	Operator PatternOperator `json:"operator"`

	// The value of reference for the comparison with the content fetched from the context.
	Value string `json:"value"`
}

type Plugin

type Plugin struct {
	FailureMode       FailureModeType   `json:"failureMode"`
	RateLimitPolicies []RateLimitPolicy `json:"rateLimitPolicies"`
}

func (*Plugin) ToStruct

func (w *Plugin) ToStruct() (*_struct.Struct, error)

type RateLimitPolicy

type RateLimitPolicy struct {
	Name      string   `json:"name"`
	Domain    string   `json:"domain"`
	Service   string   `json:"service"`
	Hostnames []string `json:"hostnames"`

	// +optional
	Rules []Rule `json:"rules,omitempty"`
}

type Rule

type Rule struct {
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
	// +optional
	Data []DataItem `json:"data,omitempty"`
}

Rule defines one rate limit configuration. When conditions are met, it uses `data` section to generate one RLS descriptor.

type SelectorSpec

type SelectorSpec struct {
	// Selector of an attribute from the contextual properties provided by kuadrant
	// during request and connection processing
	Selector kuadrantv1beta2.ContextSelector `json:"selector"`

	// If not set it defaults to `selector` field value as the descriptor key.
	// +optional
	Key *string `json:"key,omitempty"`

	// An optional value to use if the selector is not found in the context.
	// If not set and the selector is not found in the context, then no descriptor is generated.
	// +optional
	Default *string `json:"default,omitempty"`
}

type StaticSpec

type StaticSpec struct {
	Value string `json:"value"`
	Key   string `json:"key"`
}

Jump to

Keyboard shortcuts

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