validation

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericValidator

type GenericValidator interface {
	ValidateEscapedStringNoVarExpansion(value string) error
	ValidateServiceName(name string) error
	ValidateNginxDuration(duration string) error
	ValidateNginxSize(size string) error
	ValidateEndpoint(endpoint string) error
}

GenericValidator validates any generic values from NGF API resources from the perspective of a data-plane. These could be values that we want to re-validate in case of any CRD schema manipulation.

type HTTPFieldsValidator

type HTTPFieldsValidator interface {
	SkipValidation() bool
	ValidatePathInMatch(path string) error
	ValidateHeaderNameInMatch(name string) error
	ValidateHeaderValueInMatch(value string) error
	ValidateQueryParamNameInMatch(name string) error
	ValidateQueryParamValueInMatch(name string) error
	ValidateMethodInMatch(method string) (valid bool, supportedValues []string)
	ValidateRedirectScheme(scheme string) (valid bool, supportedValues []string)
	ValidateRedirectPort(port int32) error
	ValidateRedirectStatusCode(statusCode int) (valid bool, supportedValues []string)
	ValidateHostname(hostname string) error
	ValidateFilterHeaderName(name string) error
	ValidateFilterHeaderValue(value string) error
	ValidatePath(path string) error
}

HTTPFieldsValidator validates the HTTP-related fields of Gateway API resources from the perspective of a data-plane. Data-plane implementations must implement this interface.

type PolicyValidator

type PolicyValidator interface {
	// Validate validates an NGF Policy.
	Validate(policy policies.Policy) []conditions.Condition
	// ValidateGlobalSettings validates an NGF Policy with the NginxProxy settings.
	ValidateGlobalSettings(policy policies.Policy, globalSettings *policies.GlobalSettings) []conditions.Condition
	// Conflicts returns true if the two Policies conflict.
	Conflicts(a, b policies.Policy) bool
}

PolicyValidator validates an NGF Policy.

type SkipValidator

type SkipValidator struct{}

SkipValidator is used to skip validation on internally-created routes for request mirroring.

func (SkipValidator) SkipValidation

func (SkipValidator) SkipValidation() bool

func (SkipValidator) ValidateFilterHeaderName

func (SkipValidator) ValidateFilterHeaderName(string) error

func (SkipValidator) ValidateFilterHeaderValue

func (SkipValidator) ValidateFilterHeaderValue(string) error

func (SkipValidator) ValidateHeaderNameInMatch

func (SkipValidator) ValidateHeaderNameInMatch(string) error

func (SkipValidator) ValidateHeaderValueInMatch

func (SkipValidator) ValidateHeaderValueInMatch(string) error

func (SkipValidator) ValidateHostname

func (SkipValidator) ValidateHostname(string) error

func (SkipValidator) ValidateMethodInMatch

func (SkipValidator) ValidateMethodInMatch(string) (bool, []string)

func (SkipValidator) ValidatePath

func (SkipValidator) ValidatePath(string) error

func (SkipValidator) ValidatePathInMatch

func (SkipValidator) ValidatePathInMatch(string) error

func (SkipValidator) ValidateQueryParamNameInMatch

func (SkipValidator) ValidateQueryParamNameInMatch(string) error

func (SkipValidator) ValidateQueryParamValueInMatch

func (SkipValidator) ValidateQueryParamValueInMatch(string) error

func (SkipValidator) ValidateRedirectPort

func (SkipValidator) ValidateRedirectPort(int32) error

func (SkipValidator) ValidateRedirectScheme

func (SkipValidator) ValidateRedirectScheme(string) (bool, []string)

func (SkipValidator) ValidateRedirectStatusCode

func (SkipValidator) ValidateRedirectStatusCode(int) (bool, []string)

type Validators

type Validators struct {
	HTTPFieldsValidator HTTPFieldsValidator
	GenericValidator    GenericValidator
	PolicyValidator     PolicyValidator
}

Validators include validators for API resources from the perspective of a data-plane. It is used for fields that propagate into the data plane configuration. For example, the path in a routing rule. However, not all such fields are validated: NGF will not validate a field using Validators if it is confident that the field is valid.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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