validate

package
v0.19.1302 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentScopedPolicyType added in v0.19.1245

func ComponentScopedPolicyType(policyType config.AppPolicyType) bool

ComponentScopedPolicyType reports whether a policy type is evaluated per component. Sandbox and kubernetes_cluster policies are not component-scoped and ignore components.

func RemoteFetchCheck added in v0.19.1302

func RemoteFetchCheck(policy *urlpolicy.Policy, onWarn func(urlpolicy.Violation)) func(field, rawURL string) error

RemoteFetchCheck returns the parse.ParseConfig.CheckRemoteFetch hook for a policy: it rejects a remote file outside the allowed hosts before it is fetched. In warn mode the violation goes to onWarn and the fetch goes ahead. It returns nil when the policy restricts no fetch.

func RunnerURLPolicyViolations added in v0.19.1302

func RunnerURLPolicyViolations(policy *urlpolicy.Policy, runner RunnerURLs) urlpolicy.Violations

RunnerURLPolicyViolations checks the runner section of an app config.

func StackURLPolicyViolations added in v0.19.1302

func StackURLPolicyViolations(policy *urlpolicy.Policy, field string, stack StackURLs) urlpolicy.Violations

StackURLPolicyViolations checks stack template URLs. field is the config path of the section, "stack" for the app stack config.

func URLPolicyViolations added in v0.19.1302

func URLPolicyViolations(policy *urlpolicy.Policy, a *config.AppConfig) urlpolicy.Violations

URLPolicyViolations checks every policy-governed value in an app config.

func Validate

func Validate(ctx context.Context, v *validator.Validate, a *config.AppConfig, opts ...Option) error

func ValidateActionWorkflowTriggers

func ValidateActionWorkflowTriggers(cfg *config.AppConfig) error

func ValidateAzureRunnerIdentities added in v0.19.1074

func ValidateAzureRunnerIdentities(a *config.AppConfig) error

ValidateAzureRunnerIdentities guards the one combination that otherwise fails with an opaque IMDS "Identity not found" at runtime: an azure-bicep app that defines per-operation identities (any azure permission role) AND pins a custom runner_nested_template_url whose template does not accept a "userAssignedIdentities" parameter. Only the built-in runner (empty URL) or a template that declares that parameter can attach the identities to the VMSS.

func ValidateCustomNestedStackOutputs added in v0.19.777

func ValidateCustomNestedStackOutputs(a *config.AppConfig) error

func ValidateDefaultLabels added in v0.19.1123

func ValidateDefaultLabels(a *config.AppConfig) error

ValidateDefaultLabels enforces the same label rules as install labels, and rejects per-install label keys that collide with a default — the app-level block is the only place a default key may be set.

func ValidateDependencies

func ValidateDependencies(cfg *config.AppConfig) error

func ValidateDuplicateComponentNames

func ValidateDuplicateComponentNames(cfg *config.AppConfig) error

func ValidateGCPCloudSQLDeleteOutsideBreakGlass added in v0.19.1297

func ValidateGCPCloudSQLDeleteOutsideBreakGlass(a *config.AppConfig) error

func ValidateJSONSchema

func ValidateJSONSchema(ctx context.Context, c *config.AppConfig) error

func ValidateOPAPolicy added in v0.19.1145

func ValidateOPAPolicy(contents string) error

func ValidateOPAPolicyForType added in v0.19.1277

func ValidateOPAPolicyForType(contents string, policyType config.AppPolicyType) error

func ValidatePolicies

func ValidatePolicies(a *config.AppConfig) error

func ValidatePoliciesWithLogger

func ValidatePoliciesWithLogger(a *config.AppConfig, l *zap.Logger) error

func ValidatePolicyApplyOnTeardown added in v0.19.1245

func ValidatePolicyApplyOnTeardown(policyName string, policyType config.AppPolicyType, applyOnTeardown *bool) error

ValidatePolicyApplyOnTeardown validates apply_on_teardown for a single policy. It is shared by config validation (nuon CLI sync) and the ctl-api create endpoint so both enforce the same rules.

func ValidatePolicyComponents added in v0.19.997

func ValidatePolicyComponents(policyName string, policyType config.AppPolicyType, components []string) error

ValidatePolicyComponents validates the components list for a single policy. It is shared by config validation (nuon CLI sync) and the ctl-api create endpoint so both enforce the same rules.

func ValidatePolicyNames added in v0.19.1244

func ValidatePolicyNames(a *config.AppConfig) error

func ValidateTemplateRefs added in v0.19.1158

func ValidateTemplateRefs(a *config.AppConfig) error

ValidateTemplateRefs checks that component and action template references resolve to declared names, and that stack/sandbox templates only use refs available in those render contexts. All findings are returned as one error.

func ValidateTriggers added in v0.19.1096

func ValidateTriggers(cfg *config.AppConfig) error

func ValidateURLPolicy added in v0.19.1302

func ValidateURLPolicy(policy *urlpolicy.Policy, a *config.AppConfig) error

ValidateURLPolicy returns the config's violations as one error. In warn mode the error is a warning, which Validate reports without failing.

func ValidateUniquePolicyNames added in v0.19.1244

func ValidateUniquePolicyNames(policies []config.AppPolicy) error

func ValidateVars

func ValidateVars(ctx context.Context, cfg *config.AppConfig) error

func ValidateVersion

func ValidateVersion(a *config.AppConfig) error

Types

type Option added in v0.19.1302

type Option func(*options)

Option configures Validate.

func WithURLPolicy added in v0.19.1302

func WithURLPolicy(policy *urlpolicy.Policy) Option

WithURLPolicy makes Validate check the config's URLs against the control plane's allowed hosts. A nil policy restricts nothing.

type RunnerURLs added in v0.19.1302

type RunnerURLs struct {
	RunnerAPIURL       string
	PublicAPIURL       string
	InitScriptURL      string
	PhoneHomeScriptURL string
	EnvVars            map[string]string
}

RunnerURLs are the runner config values the policy governs.

type StackURLs added in v0.19.1302

type StackURLs struct {
	// Type is the app's stack type. Custom nested stacks on GCP name curated
	// modules, not URLs, and are validated against that list instead.
	Type                    string
	VPCNestedTemplateURL    string
	RunnerNestedTemplateURL string
	UIDefinition            string
	CustomNestedStacks      []config.CustomNestedStack
}

StackURLs are the stack template values the policy governs. The app stack config and the per-install stack overrides share this shape.

type URLRef added in v0.19.1302

type URLRef struct {
	Category urlpolicy.Category
	Field    string
	Value    string
}

URLRef is one policy-governed URL found in a config: the value, the config path it came from and the category that governs it.

func RunnerURLRefs added in v0.19.1302

func RunnerURLRefs(runner RunnerURLs) []URLRef

RunnerURLRefs lists the URLs in the runner section of an app config. Unset values are left out.

func StackURLRefs added in v0.19.1302

func StackURLRefs(field string, stack StackURLs) []URLRef

StackURLRefs lists the remote stack template URLs in a stack section. field is the config path of the section, "stack" for the app stack config. Unset values and files in the config repo are left out.

Jump to

Keyboard shortcuts

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