Repository navigation
Test what dev-shell users of --inherit-env rely on (#101) - #124
Merged
Merged
Conversation
The daemon side of --inherit-env was covered; four things a dev-shell user depends on were not, so a regression in any of them would ship silently: - sudo-proxy-mcp lets an unprivileged request to a remote host through (the delegate-to-Bash refusal is now a function, unit-tested); - execute(host=NAME) dials $XDG_RUNTIME_DIR/sudo-proxy-NAME.sock, where a user's own ssh -R/-L tunnel must end; - forward_agent still gives an inheriting step the agent socket, and inheritance never supplies one, even with '*'; - a chdir plan runs a tool from the inherited PATH in its directory. Each test was checked against a mutation of the code it guards. docs/usage.md gave /tmp/sudo-proxy-HOST.sock as the hand-made equivalent of --host, which sudo-proxy-mcp never dials; it now gives the real path, and the dev-shell section points there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cuihtlauac ALVARADO <cuihtlauac@tarides.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.
The daemon side of
--inherit-envis well tested. Four things a dev-shell user depends on (the setup reported in #101) were not, so a regression in any of them would ship without a failing test.Tests added
sudo-proxy-mcplets an unprivileged request to a remote host through. The delegate-to-Bash refusal moves intorefuses_local_unprivileged(no behaviour change) and is unit-tested together withnormalize_host. A remote host passes.localhost,user@localhostand127.0.0.1are refused.execute(host=NAME)dials$XDG_RUNTIME_DIR/sudo-proxy-NAME.sock. A user's ownssh -R/-Ltunnel must end at that path, so renaming it breaks them.forward_agentwith inheritance (tests/inherit.rs). An inheriting step gets the agent socket, plus the inheritedPATHand variables. Inheritance never suppliesSSH_AUTH_SOCK, even with--inherit-env='*'.chdirplan with inheritance (tests/inherit.rs). A tool found only on the inheritedPATHruns in the plan's directory with the inherited variables. This is the request shape reported in Opt-in flag to run unprivileged commands with the daemon's environment and PATH #101.Each test was checked against a deliberate break of the code it guards, and each break made its test fail:
cwdwhen inheriting;Doc fix
docs/usage.mdgave/tmp/sudo-proxy-HOST.sockas the hand-made equivalent of--host, a pathsudo-proxy-mcpnever dials. It now gives$XDG_RUNTIME_DIR/sudo-proxy-HOST.sock, and the dev-shell section points there forssh -Rtunnels.Checks
These pass locally:
cargo test --release --no-fail-fast. On the first run, the known flaky concurrency burst test failed; it passed on the rerun.cargo clippy --all-targets -- -D warnings.cargo fmt --check.cargo build --no-default-features.🤖 Generated with Claude Code