Documentation
¶
Index ¶
- func ComponentScopedPolicyType(policyType config.AppPolicyType) bool
- func RemoteFetchCheck(policy *urlpolicy.Policy, onWarn func(urlpolicy.Violation)) func(field, rawURL string) error
- func RunnerURLPolicyViolations(policy *urlpolicy.Policy, runner RunnerURLs) urlpolicy.Violations
- func StackURLPolicyViolations(policy *urlpolicy.Policy, field string, stack StackURLs) urlpolicy.Violations
- func URLPolicyViolations(policy *urlpolicy.Policy, a *config.AppConfig) urlpolicy.Violations
- func Validate(ctx context.Context, v *validator.Validate, a *config.AppConfig, ...) error
- func ValidateActionWorkflowTriggers(cfg *config.AppConfig) error
- func ValidateAzureRunnerIdentities(a *config.AppConfig) error
- func ValidateCustomNestedStackOutputs(a *config.AppConfig) error
- func ValidateDefaultLabels(a *config.AppConfig) error
- func ValidateDependencies(cfg *config.AppConfig) error
- func ValidateDuplicateComponentNames(cfg *config.AppConfig) error
- func ValidateGCPCloudSQLDeleteOutsideBreakGlass(a *config.AppConfig) error
- func ValidateJSONSchema(ctx context.Context, c *config.AppConfig) error
- func ValidateOPAPolicy(contents string) error
- func ValidateOPAPolicyForType(contents string, policyType config.AppPolicyType) error
- func ValidatePolicies(a *config.AppConfig) error
- func ValidatePoliciesWithLogger(a *config.AppConfig, l *zap.Logger) error
- func ValidatePolicyApplyOnTeardown(policyName string, policyType config.AppPolicyType, applyOnTeardown *bool) error
- func ValidatePolicyComponents(policyName string, policyType config.AppPolicyType, components []string) error
- func ValidatePolicyNames(a *config.AppConfig) error
- func ValidateTemplateRefs(a *config.AppConfig) error
- func ValidateTriggers(cfg *config.AppConfig) error
- func ValidateURLPolicy(policy *urlpolicy.Policy, a *config.AppConfig) error
- func ValidateUniquePolicyNames(policies []config.AppPolicy) error
- func ValidateVars(ctx context.Context, cfg *config.AppConfig) error
- func ValidateVersion(a *config.AppConfig) error
- type Option
- type RunnerURLs
- type StackURLs
- type URLRef
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
URLPolicyViolations checks every policy-governed value in an app config.
func ValidateAzureRunnerIdentities ¶ added in v0.19.1074
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 ValidateDefaultLabels ¶ added in v0.19.1123
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 ValidateGCPCloudSQLDeleteOutsideBreakGlass ¶ added in v0.19.1297
func ValidateOPAPolicy ¶ added in v0.19.1145
func ValidateOPAPolicyForType ¶ added in v0.19.1277
func ValidateOPAPolicyForType(contents string, policyType config.AppPolicyType) error
func ValidatePolicies ¶
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 ValidateTemplateRefs ¶ added in v0.19.1158
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 ValidateURLPolicy ¶ added in v0.19.1302
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 ValidateVersion ¶
Types ¶
type Option ¶ added in v0.19.1302
type Option func(*options)
Option configures Validate.
func WithURLPolicy ¶ added in v0.19.1302
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
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
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.
Source Files
¶
- json.go
- validate.go
- validate_action_workflow_triggers.go
- validate_azure_runner_identities.go
- validate_custom_nested_stacks.go
- validate_default_labels.go
- validate_dependencies.go
- validate_duplicate_component_names.go
- validate_gcp_cloudsql_delete.go
- validate_policies.go
- validate_template_refs.go
- validate_triggers.go
- validate_url_policy.go
- validate_vars.go
- validate_version.go