Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Fixes #45
Add optional vals-backed secret resolution using the existing resolver pipeline:
ValsSecretResolversends a JSON document tovals eval -f - -o jsonoverstdin without a shell. It preserves returned JSON types and string whitespace,
uses the existing interpolation cache, and enforces a 60-second timeout.
Failures omit reference contents and subprocess output from error messages.
The vals executable is installed separately and only invoked for explicit vals
interpolations. Existing resolvers and Python dependencies remain unchanged.
Document installation, authentication, and trusted-configuration requirements.
Type of Change
Testing
Commands run from the isolated worktree using Python 3.14:
.venv/bin/python -m pytest tests/ -q --tb=short --cov=himl --cov-report=term-missing --cov-fail-under=80— passed: 289 tests, 92.68% coverage (80% minimum).
.venv/bin/flake8 himl tests --count --select=E9,F63,F7,F82 --show-source --statistics— passed: 0 findings.
.venv/bin/mypy himl/ --ignore-missing-imports— passed: no issues in 16 source files.
.venv/bin/flake8 himl/secret_resolvers.py tests/test_secret_resolvers.py tests/test_inject_secrets.py --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics— passed: 0 findings.
temporarily on
PATH,.venv/bin/python -c 'from himl.inject_secrets import SecretInjector; injector = SecretInjector(); assert injector.inject_secret("{{vals.ref(ref+echo://hello)}}") == "hello"; assert injector.inject_secret("{{vals.ref(ref+echo://hello)}}") == "hello"; print("PASS: real vals v0.50.0 echo resolution and cached reuse")'— passed.
New tests were observed failing before implementation. They cover typed output,
reference validation, missing/unusable executable, timeout, invalid encoding
and JSON, provider errors without secret disclosure, URI parsing, cached
resolution, full config processing, and skipping secret resolution.
Checklist
Additional Notes
No explanatory code comments or downstream changes were necessary.
Authenticated cloud-provider calls, Docker builds, and the full OS/Python CI
matrix were not run locally; provider behavior is delegated to vals.
Only explicit
{{vals.ref(...)}}expressions are evaluated, not plainref+strings. Provider authentication inherits the environment; himl's default AWS
profile is not forwarded. Configurations must be trusted because vals includes
command-execution and local-file providers. Literal parentheses in references
remain subject to the existing interpolation parser's limitations.