wafcontroller

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIGroupName is the name of the WAF API group.
	APIGroupName = "waf"
	// APIPrefix is the prefix for WAF API endpoints.
	APIPrefix = "/waf"
)
View Source
const (
	// Category is the category of the WAFController.
	Category = supervisor.CategoryBusinessController

	// Kind is the kind of the WAFController.
	Kind = "WAFController"

	// ResultRuleGroupNotFoundError indicates that the rule group was not found.
	ResultRuleGroupNotFoundError ResultError = "ruleGroupNotFoundError"
)

Variables

This section is empty.

Functions

func GetResults

func GetResults() []string

Types

type ResultError

type ResultError string

type RuleGroup

type RuleGroup interface {
	Name() string
	// Handle processes the request and returns a WAF response.
	// TODO: how to handle the response?
	// TODO: should we process the stream request and stream response?
	Handle(ctx *context.Context) *protocol.WAFResult

	Close()
}

RuleGroup defines the interface for a WAF rule group.

type Spec

type Spec struct {
	RuleGroups []*protocol.RuleGroupSpec `json:"ruleGroups" jsonschema:"required"`
}

Spec is the specification for WAFController.

func (*Spec) Validate

func (spec *Spec) Validate() error

Validate validates the WAFController specification.

type StatsResponse

type StatsResponse struct {
	Stats []*metrics.MetricStats `json:"stats"`
}

type Status

type Status struct{}

Status is the status of WAFController.

type WAFController

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

WAFController is the controller for WAF.

func GetGlobalWAFController

func GetGlobalWAFController() (*WAFController, error)

func (*WAFController) Category

func (waf *WAFController) Category() supervisor.ObjectCategory

Category returns the category of the WAFController.

func (*WAFController) Close

func (waf *WAFController) Close()

Close closes the WAFController and releases resources.

func (*WAFController) DefaultSpec

func (waf *WAFController) DefaultSpec() interface{}

DefaultSpec returns the default specification for WAFController.

func (*WAFController) Handle

func (waf *WAFController) Handle(ctx *context.Context, ruleGroupName string) string

Handle processes the request and returns a WAF response.

func (*WAFController) Inherit

func (waf *WAFController) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)

Inherit initializes the WAFController with the previous generation's specification.

func (*WAFController) Init

func (waf *WAFController) Init(superSpec *supervisor.Spec)

Init initializes the WAFController with the provided supervisor specification.

func (*WAFController) Kind

func (waf *WAFController) Kind() string

Kind returns the kind of the WAFController.

func (*WAFController) Status

func (waf *WAFController) Status() *supervisor.Status

Status returns the status of the WAFController.

type WAFHandler

type WAFHandler interface {
	Handle(ctx *context.Context, ruleGroupName string) string
}

WAFHandler is used to handle WAF requests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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