validation

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 25

Documentation

Index

Constants

View Source
const TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB

Variables

View Source
var (
	SupportedTransportProtocols = []string{
		"tcp",
		"kcp",
		"quic",
		"websocket",
		"wss",
	}

	SupportedAuthMethods = []v1.AuthMethod{
		"token",
		"oidc",
	}

	SupportedAuthAdditionalScopes = []v1.AuthScope{
		"HeartBeats",
		"NewWorkConns",
	}

	SupportedLogLevels = []string{
		"trace",
		"debug",
		"info",
		"warn",
		"error",
	}

	SupportedHTTPPluginOps = []string{
		splugin.OpLogin,
		splugin.OpNewProxy,
		splugin.OpCloseProxy,
		splugin.OpPing,
		splugin.OpNewWorkConn,
		splugin.OpNewUserConn,
	}
)

Functions

func AppendError

func AppendError(err error, errs ...error) error

func ValidateAnnotations added in v0.55.0

func ValidateAnnotations(annotations map[string]string) error

ValidateAnnotations validates that a set of annotations are correctly defined.

func ValidateAnnotationsSize added in v0.55.0

func ValidateAnnotationsSize(annotations map[string]string) error

func ValidateClientPluginOptions

func ValidateClientPluginOptions(c v1.ClientPluginOptions) error

func ValidateOIDCClientCredentialsConfig added in v0.68.0

func ValidateOIDCClientCredentialsConfig(c *v1.AuthOIDCClientConfig) error

func ValidatePort

func ValidatePort(port int, fieldPath string) error

ValidatePort checks that the network port is in range

func ValidateProxyConfigurerForClient

func ValidateProxyConfigurerForClient(c v1.ProxyConfigurer) error

func ValidateProxyConfigurerForServer

func ValidateProxyConfigurerForServer(c v1.ProxyConfigurer, s *v1.ServerConfig) error

func ValidateVisitorConfigurer

func ValidateVisitorConfigurer(c v1.VisitorConfigurer) error

Types

type ConfigValidator added in v0.66.0

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

ConfigValidator holds the context dependencies for configuration validation.

func NewConfigValidator added in v0.66.0

func NewConfigValidator(unsafeFeatures *security.UnsafeFeatures) *ConfigValidator

NewConfigValidator creates a new ConfigValidator instance.

func (*ConfigValidator) ValidateClientCommonConfig added in v0.66.0

func (v *ConfigValidator) ValidateClientCommonConfig(c *v1.ClientCommonConfig) (Warning, error)

func (*ConfigValidator) ValidateServerConfig added in v0.66.0

func (v *ConfigValidator) ValidateServerConfig(c *v1.ServerConfig) (Warning, error)

func (*ConfigValidator) ValidateUnsafeFeature added in v0.66.0

func (v *ConfigValidator) ValidateUnsafeFeature(feature string) error

ValidateUnsafeFeature checks if a specific unsafe feature is enabled.

type Warning

type Warning error

func ValidateAllClientConfig

func ValidateAllClientConfig(
	c *v1.ClientCommonConfig,
	proxyCfgs []v1.ProxyConfigurer,
	visitorCfgs []v1.VisitorConfigurer,
	unsafeFeatures *security.UnsafeFeatures,
) (Warning, error)

Jump to

Keyboard shortcuts

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