Documentation
¶
Overview ¶
Package validate provides CRD-based validation for Dapr resources in standalone mode. It parses the embedded CRD YAML, builds a structural schema, and validates resources against both OpenAPI schema constraints (enum, minLength, minItems, required, etc.) and CEL XValidation rules. This gives standalone mode the same validation the Kubernetes API server provides via CRD admission.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WorkflowAccessPolicy ¶
func WorkflowAccessPolicy(ctx context.Context, policy *wfaclapi.WorkflowAccessPolicy) error
WorkflowAccessPolicy validates a WorkflowAccessPolicy against the OpenAPI schema and CEL rules embedded in the CRD. This provides the same validation in standalone mode that the Kubernetes API server provides via CRD admission.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates resources against the OpenAPI schema and CEL rules embedded in a CRD YAML. It is safe for concurrent use.
func NewValidator ¶
NewValidator creates a Validator that will lazily parse the given CRD YAML on first use. The name is used for log messages.
func (*Validator) Validate ¶
Validate checks the given resource against both the CRD's OpenAPI schema constraints (enum, minLength, minItems, required, etc.) and any CEL XValidation rules. The resource must be JSON-serializable. Returns nil if valid. The context is passed to CEL validation so callers can cancel long-running validation work (e.g. during shutdown or hot-reload storms).