feat: support compose configs via a shared podman store module#31
Merged
Conversation
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
Add compose
configssupport (Bucket B). Configs are the non-sensitive sibling of secrets: same shape, but they mount at the container-root path/<name>(not/run/secrets/<name>) and add an inlinecontent:source.Rather than duplicate the secret machinery, this branch extracts it into a shared, kind-parameterized
compose2pod/store.py(a frozenStoreKind), sosecrets.pyandconfigs.pyshrink to thin kind-specs andemit.py/parsing.pyweave both through one union seam overSTORE_KINDS = (SECRET, CONFIG). Because the secret kind keeps store prefix"", the extraction is byte-identical for existing documents.Design:
planning/changes/2026-07-10.03-configs.md.What's supported
configs:with exactly one string source:file:(host path, resolved against--project-dir),environment:(host env var), orcontent:(inline literal).content:runs throughto_shell(), so${VAR}inside it expands at script-run time (the tool's deferred-interpolation model) and its var names feed the stderr interpolation note.configs:short form[name]and full long form{source, target, uid, gid, mode}.<pod>-config-<name>so a config never collides with a same-named secret; created afterpodman pod create, removed in the EXIT trap./<name>; a long-formtarget:must be absolute (relative targets rejected).external: truerejected.Architecture
store.py(leaf) owns the machinery parameterized byStoreKind{label, top_key, prefix, sources, default_target, require_absolute_target}.secrets.py/configs.pyare the two kind-specs;stores.pyaggregatesSTORE_KINDS.emit.py/parsing.pycall the kind-unioning entry points, so adding a kind is a registry change, not new emit logic.Security
Config/secret names and env-var names flow into generated shell raw, so they are charset-validated with
re.fullmatch(^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/^[a-zA-Z_][a-zA-Z0-9_]*$) in the shared gate. The newcontent:surface was adversarially probed:to_shellneutralizes"`$\and never matches$(...), so arbitrary content cannot break out of its double-quotedprintffragment while legitimate${VAR}stays live. Long-formtargetisshlex.quoted by the emit renderer. An independent whole-branch review confirmed no injection path.Testing
just test-ciat 100% coverage (263 tests),just lint-ciclean,just check-planningOK. The ported secret suite (test_store.py) is the byte-identical guard for the refactor;test_configs.pycovers file/env/content create lines,/<name>and absolute targets, relative-target rejection, and content var interpolation;test_emit.pyproves the unioned trap and that a same-named secret+config produce distinct stores.architecture/supported-subset.mdgains a Configs section and its stale post-refactor secret citations were corrected.Known minor limitations (parity with secrets, non-blocking)
targetis interpreted by podman as extra--secretsub-options (arg-level, not shell injection; the compose author controls both inputs). Same as secrets today.targetbypasses the absolute-path rule (podman rejects it at runtime). Same target-passthrough behavior as secrets.Fixing these for configs only would diverge the two kinds; left as a possible future hardening pass covering both.