Context
This refactor is prompted by PR #1824 review threads:
start_ado_proxy_step currently materializes as a 200+ line generated shell body, and render_az_wrapper is a large interpolated standalone shell executable. Both are hard to review and maintain even though shellcheck and focused tests already cover the emitted behavior.
The goal is to make the generated scripts easier to reason about without changing behavior or weakening the security model.
Requirements
- Split the generated shell into smaller, cohesive Rust functions instead of one oversized generated body.
- Make wrapper/proxy script source independently reviewable by introducing a more structured generation path.
- Investigate
include_str! templates, structured script fragments/builders, or generated bundle helpers.
- Keep substitutions explicitly typed and validated; do not simply move an opaque format string from one place to another.
- Preserve the security constraint that proxy startup/material handover remains one atomic trusted Bash step: splitting across tasks must not persist the bearer, CA private key, leaf keys, or stdin material under
/tmp, argv, environment, container layers, or runner files.
- Preserve emitted behavior and step ordering.
- Ensure exact credential custody remains unchanged.
- Validate with shellcheck/bash-lint and unit tests.
- Keep the real candidate proxy smoke test behavior intact, including allowed reads, denials, CA/topology checks, and proof tag validation.
Acceptance
- Smaller cohesive Rust functions for proxy/wrapper generation.
- Wrapper/proxy script source is independently reviewable.
- Emitted behavior and step ordering remain unchanged.
- Security invariants for credential custody are preserved.
- shellcheck/bash-lint and unit tests pass.
- Real candidate proxy smoke still demonstrates allowed reads, denials, CA/topology checks, and proof tag behavior.
Context
This refactor is prompted by PR #1824 review threads:
start_ado_proxy_stepcurrently materializes as a 200+ line generated shell body, andrender_az_wrapperis a large interpolated standalone shell executable. Both are hard to review and maintain even though shellcheck and focused tests already cover the emitted behavior.The goal is to make the generated scripts easier to reason about without changing behavior or weakening the security model.
Requirements
include_str!templates, structured script fragments/builders, or generated bundle helpers./tmp, argv, environment, container layers, or runner files.Acceptance