Convert service sidecar ctmpl to dynamic KV-backed templates#306
Merged
Conversation
ae0e2e4 to
22c066b
Compare
Service agent.toml.ctmpl files were static copies with no Go template
directives, so OpenBao Agent never picked up rotated secrets from KV.
Transform rendered agent.toml into a proper ctmpl with {{ with secret }}
directives for http_responder_hmac, trusted_ca_sha256 (via toJSON), and
a conditional EAB block guarded by {{ if .Data.data.kid }}.
Add vault { address } block to agent.hcl so OpenBao Agent can connect
to the OpenBao server.
Write EAB KV unconditionally (empty strings when unconfigured) so the
{{ with secret }} path always exists and never blocks.
Closes #300
22c066b to
2cbcf5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent.toml.ctmplfrom static copies into dynamic Go templates with{{ with secret }}directives forhttp_responder_hmac,trusted_ca_sha256(viatoJSON), and conditional EAB blocks- Addvault { address }andtemplate_config { static_secret_render_interval = "30s" }toagent.hclso OpenBao Agent can connect and periodically re-renderTest plan
cargo clippy --all-targets -- -D warningspassescargo fmt -- --checkpassesbuild_ctmpl_contentpass (cargo test --bin bootroot -- service)cargo test --test bootroot_service— 17/17 pass (ctmpl + agent.hcl content assertions added)cargo test --test e2e_same_host_local_file— 4/4 pass (ctmpl + agent.hcl content assertions added)cargo test --test bootroot_rotate— 14/14 pass (no regressions)./tests/docker/run-e2e.sh main-lifecycle,remote-lifecycle,rotation-recovery)Closes #300