Expand description
Binding ${param.NAME} references to supplied values (#444).
Binding is a pre-parse pass over the untyped config document, run after
${env:} / ${file:} / ${secret:} interpolation and before the typed
PipelineConfig deserialise. Two consequences worth stating, because both
are load-bearing:
- Structure safety. Substitution happens per JSON/YAML scalar, exactly
like
crate::interpolate::interpolate_value— a supplied value holding:, a newline, or-stays the single scalar it replaced and can never inject a key or an array element. Downstream, SQL-bound and JSON-safe substitution paths (substitute_context_bind_params/substitute_context_jsoninfaucet_core::util) are untouched, so the existing SQL/JSON-injection guarantees still hold for param-derived text. - No re-interpolation of caller input. Env/file/secret directives are
resolved before binding, so a supplied value is never itself scanned for
directives. Belt and braces, a supplied value containing
${is rejected outright: params are data, not directives.
When ${param.NAME} is a scalar’s entire text the declared type is
preserved (an int param lands as a JSON number, not "5"); embedded in a
longer string it is stringified, like every other interpolation namespace.
Structs§
- Bound
Params - The result of a bind: every declared param’s effective value, plus which of them are sensitive.
Enums§
- Bind
Mode - What to do with a
requiredparam the caller did not supply.
Constants§
- PARAMS_
KEY - The config key holding the declaration block.
- PARAM_
ID - The interpolation namespace params live in (
${param.NAME}).
Functions§
- bind_
document - Bind params in an untyped config document, in place.
- collect_
cli_ params - Collect a
--param name=valuelist into aSuppliedParamsmap, rejecting a repeated name (silently keeping the last would be a footgun). - collect_
env_ overrides - Collect a
--param-env NAME[=VALUE]list into an env overlay. A bareNAMEtakes the value from the caller’s own environment (so a secret never appears in the process arguments);NAME=VALUEsets it explicitly. - declared
- Read the
params:block out of an untyped config document, validating it. A document with no block yields an empty spec. - parse_
cli_ param - Parse a
--param key=valueCLI argument. The value is kept as a JSON string;spec::coerceconverts it to the declared type at bind time. - resolve
- Resolve every declared param to a value, without touching the document.
Type Aliases§
- Supplied
Params - Caller-supplied values, keyed by param name. Values arrive either as real
JSON (HTTP) or as strings (
--param k=v);spec::coercenormalizes both.