Repository navigation
feat(sandbox): read the Cargo registry and rustup sources read-only - #1626
Merged
Merged
Conversation
Extend the built-in read-only library carve-out from Go to Rust: /registry/src, /git/checkouts (default ~/.cargo) and /toolchains/*/lib/rustlib/src (default ~/.rustup) are readable without configuration, and writes there keep the read-only library directory error. Resolves #1624
inference-gateway-maintainer
Bot
marked this pull request as ready for review
October 28, 2026 13:33
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
October 28, 2026 13:33
Contributor
|
🎉 This PR is included in version 0.238.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #1624
Summary
The sandbox's built-in read-only library carve-out covered only Go (
$GOMODCACHEor$GOPATH/pkg/modand$GOROOT/src), so reading a dependency's source from the Cargo registry was denied with "read to path '/home/runner/.cargo/registry/src/...' is denied by the sandbox". This extends the same read-only carve-out to the Cargo registry sources and the rustup toolchain sources, so Rust projects can read dependency source without configuration, and writes there keep the existing "read-only library directory" error.Changes
isWithinRustLibDirs, covering$CARGO_HOME/registry/srcand$CARGO_HOME/git/checkouts(default~/.cargo) and$RUSTUP_HOME/toolchains/*/lib/rustlib/src(default~/.rustup), resolved from the environment the same way the Go dirs are; the per-toolchain directory is matched by path shape (<toolchains>/<toolchain>/lib/rustlib/src[/...]) instead of listing the toolchains directoryTestValidateWrite_RustLibCarveOutlocks in reads under both the default and the env-resolved homes, writes denied, non-carved siblings still denied (registry/cache,registry/index,lib/rustlib/<triple>/lib) and sandbox writes still allowedCARGO_HOME,RUSTUP_HOME,rustlib,rustup,toolchains)Downstream impact: none beyond the CLI and its docs - this is CLI-internal sandbox policy, no schema or gateway changes, so no SDK or Helm work is expected. A [DOCS] tracking issue is filed in inference-gateway/docs for the user-facing docs site.