validation

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 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 added in v1.3.0

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 {
	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
	ValidateRewritePath(path string) error
	ValidateFilterHeaderName(name string) error
	ValidateFilterHeaderValue(value 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 added in v1.3.0

type PolicyValidator interface {
	// Validate validates an NGF Policy.
	Validate(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 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