Pin the rule that a binding sets only names its recipe declares

The secret-files campaign rests on one admit line: a binding may bind only
names its recipe declares, so a recipe that declares a secret only as its
*_FILE name leaves a plaintext value no place in a binding. Its only test,
extra_operator_environment_is_rejected, asserted is_err(), which any other
refusal satisfies.

The replacement tests assert this refusal exactly, each against a declared
twin that admits:
- an undeclared [workload.environment] name;
- an undeclared [workload.secret_files] name;
- the plaintext twin of a declared *_FILE name, the shape of the Heimdall
  leak;
- `idunn validate` returns the refusal, as main prints it, without the bound
  value (a canary), pinning the admit layer of P6.

Tests only. The deployment test fixtures become pub(crate) so control_plane's
validate test can reuse them.

Idunn secret-files cut, Cut 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 12:36:27 +02:00
commit d21ead285b
2 changed files with 101 additions and 10 deletions

View file

@ -10216,6 +10216,30 @@ mod tests {
}
}
#[test]
fn validate_refuses_an_undeclared_binding_name_without_echoing_its_value() {
use crate::deployment::tests::{
UNDECLARED_INPUT_REFUSAL, binding_with_environment, recipe_declaring_inputs,
};
let canary = "canary-bound-value-4e91c7";
let directory = tempfile::tempdir().unwrap();
let recipe = directory.path().join("recipe.toml");
fs::write(&recipe, recipe_declaring_inputs()).unwrap();
let declared = directory.path().join("declared.toml");
fs::write(&declared, binding_with_environment("DECLARED_INPUT", canary)).unwrap();
let undeclared = directory.path().join("undeclared.toml");
fs::write(&undeclared, binding_with_environment("UNDECLARED_INPUT", canary)).unwrap();
validate(&recipe, Some(&declared)).unwrap();
// `idunn` returns this error from main, which prints its Debug form,
// context chain included, and exits non-zero.
let printed = format!("{:?}", validate(&recipe, Some(&undeclared)).unwrap_err());
assert!(printed.contains(UNDECLARED_INPUT_REFUSAL), "{printed}");
assert!(!printed.contains("canary"), "validate echoed a bound value");
}
#[test]
fn cli_exposes_only_declarative_commands() {
for arguments in [