Documentation
¶
Overview ¶
Package validation provides shared validation primitives used by both the API layer (pkg/secrets) and the in-pod materializer (pkg/agentd/secrets). Keeping validation here prevents drift between the two code paths.
Index ¶
Constants ¶
const SecretNamePattern = `^[a-z0-9._-]+$`
SecretNamePattern is the regex pattern (as a string) that secret names must match. Frontend teams SHOULD copy this exact string into their client-side validation (e.g., React Hook Form pattern or zod .regex()). This package is the single source of truth — file an issue against pkg/validation if the pattern needs to change.
Variables ¶
var SecretNameRE = regexp.MustCompile(SecretNamePattern)
SecretNameRE is the compiled regex for SecretNamePattern. Exported so callers can use it directly in Go.
Functions ¶
func ValidateSecretName ¶
ValidateSecretName validates a secret name against the shared rules. Returns nil if valid, or a descriptive error.
Types ¶
This section is empty.