Skip to content

fix!: reject unresolved and invalid runtime secrets - #312

Merged
joshrotenberg merged 2 commits into
mainfrom
fix/272-required-secret-resolution
Oct 19, 2026
Merged

joshrotenberg merged 2 commits into
mainfrom
fix/272-required-secret-resolution

Conversation

@joshrotenberg

@joshrotenberg joshrotenberg commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Closes #272.

An unset ${VAR} could previously remain a usable literal credential, and --check still reported success. Runtime resolution now rejects missing, empty, non-Unicode, malformed/embedded, and recursively unresolved references. It stages substitutions, validates bearer credential content, then revalidates the full resolved configuration so token collisions and invalid headers fail before use. Resolution failures expose a redacted, downcastable EnvResolutionError; any failure retains the original configuration.

CLI startup and --check, Proxy::from_config/builder construction, management config validation/update, and reload require successful resolution. Reload validates the entire revision before backend mutation. Management writes retain the original reference-bearing body rather than resolved secrets. Parsing/loading templates remains supported; literal empty backend env/header values remain allowed.

API change: resolve_env_vars now returns Result<()> and callers must handle it. README, API/architecture documentation, and all three executable library examples are updated. No permissive runtime mode is added.

Validation: all six AGENTS.md checks passed, including strict fmt/Clippy/rustdoc, 326 unit tests, 146 integration tests with real Redis, and 24 doctests. Six CLI/library/management/reload regressions also pass without default features, and the no-default all-target build passes. Tests cover every supported missing-secret field, empty/invalid/non-Unicode values, resolved scoped-token collisions, admin/data-token collisions, invalid headers, error redaction, staged rollback, reference-preserving writes, and a real MCP call through the retained backend after an invalid file-watcher revision.

Manual review of the pushed diff at 1b44d79f7adb82585f5165d6ec030ea3cb3b3fec completed with no remaining findings. Dependency pins are unchanged. Releases remain held.

@joshrotenberg joshrotenberg changed the title fix: reject unresolved and invalid runtime secrets fix!: reject unresolved and invalid runtime secrets Oct 19, 2026
@joshrotenberg
joshrotenberg marked this pull request as ready for review October 19, 2026 03:34
@joshrotenberg
joshrotenberg merged commit 8554cd7 into main Oct 19, 2026
18 checks passed
@joshrotenberg
joshrotenberg deleted the fix/272-required-secret-resolution branch October 19, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config area:security bug Something isn't working deep-review p1 security Security-relevant issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[A04] Reject unresolved or invalid secret environment references

1 participant