Documentation
¶
Overview ¶
Package templatehook implements the built-in, in-process template.v1 hook. It has no command, file, URL, or network primitives and writes only through the realization containment boundary.
Index ¶
Constants ¶
const DefaultMaxTemplateBytes int64 = 1 << 20
Variables ¶
var ( ErrTemplateTooLarge = errors.New("templatehook: template exceeds limit") ErrOutputTooLarge = errors.New("templatehook: output exceeds limit") ErrUnsafeMode = errors.New("templatehook: unsafe output mode") ErrDestination = errors.New("templatehook: destination already exists") ErrSecretEncoding = errors.New("templatehook: secret input requires a context encoder") ErrCfgValue = errors.New("templatehook: invalid cfg value") ErrFunction = errors.New("templatehook: function is not allowlisted") )
var ErrInputSource = errors.New("templatehook: unsupported input source")
Functions ¶
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input retains sensitivity until template validation. Secret values cannot be stringified directly; cfgQuote is the only v1 context encoder that may read their plaintext.
func PublicInput ¶
func SecretInput ¶
type InputContext ¶
type InputContext struct {
Target domain.Target
Environment domain.Environment
Release domain.Release
Secrets SecretResolver
}
type Renderer ¶
Renderer bounds both template source and output. Inputs are plain strings; callers resolve typed Target/Release/literal/secret sources before rendering.
type ResolvedInputs ¶
type ResolvedInputs struct {
Inputs map[string]Input
SecretVersions map[string]string
ContainsSecret bool
}
func ResolveInputs ¶
func ResolveInputs(ctx context.Context, sources map[string]domain.InputSource, inputContext InputContext) (ResolvedInputs, error)
ResolveInputs maps the schema-checked source union through an explicit exposable-field allowlist. It resolves each logical secret once and returns only opaque versions alongside sensitivity-preserving template inputs.