feat(sandbox): forward supported just-bash SandboxOptions through justbash()#446
Closed
arimxyer wants to merge 1 commit into
Closed
feat(sandbox): forward supported just-bash SandboxOptions through justbash()#446arimxyer wants to merge 1 commit into
arimxyer wants to merge 1 commit into
Conversation
…tbash() Signed-off-by: Ari Mayer <ari111097@gmail.com>
Contributor
|
@arimxyer is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Looks like #284 just landed in the just-bash repo |
Author
|
Superseded by #607. Now that the upstream fix (vercel-labs/just-bash#284) shipped in just-bash 3.1.0, #607 does this in one pass off fresh |
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.
What
Forward the just-bash
SandboxOptionsfields thatjustbash()currently hardcodes oromits, through
JustBashSandboxCreateOptions→Sandbox.create(...):timeoutMsmaxCallDepthmaxCommandCountmaxLoopIterationsdefenseInDepthToday
JustBashSandboxCreateOptionsexposes onlyautoInstall, andcreateBashSandboxcalls
Sandbox.create({ cwd, env, fs, network })with everything else hardcoded — so anauthor has no way to set the interpreter's execution limits, an overall timeout, or
toggle defense-in-depth.
Why
This is the "backends should forward their options" generalization (cf. #239): the
just-bash backend should let authors set the
SandboxOptionsjust-bash actually accepts,rather than silently fixing them. Each new field is optional and forwarded as
undefinedwhen omitted, falling back to just-bash's own default — so existing apps are unaffected.
Relationship to #431 (capability flags / Python)
This does not yet close #431. #431 asks for
python3(and js-exec) throughjustbash(), but those capability flags live on just-bash'sBashOptions(thenew Bash(...)constructor) and just-bash'sSandbox.create— the call eve uses — dropsthem. That's an upstream gap, filed and fixed in vercel-labs/just-bash#284. Once that
change ships in a just-bash release eve depends on, this same passthrough extends to
python/javascript/commands/customCommands/fetchto genuinely close #431.The
JustBashSandboxCreateOptionsdoc comment notes this explicitly.The limits/timeout/defense-in-depth forwarding here is complete and self-contained —
mergeable on its own as the #239-class "backends forward their options" passthrough. The
bundled-interpreter capability flags (
python,javascript, …) are a follow-up thatextends this same
JustBashSandboxCreateOptionssurface once just-bash#284 ships in arelease eve depends on; that follow-up is what closes #431.
Backward compatibility
No behavior change when the new fields are omitted — each forwards as
undefined, i.e.just-bash's existing default (network still defaults to full internet access exactly as
before).
Tests
packages/eve/src/execution/sandbox/bindings/just-bash-capability-options.integration.test.ts(new): mocks the
just-bashmodule'sSandbox.create, asserts (a) author-suppliedoptions are forwarded into the call, and (b) omitting them leaves the call unchanged from
today (new fields
undefined, network default intact).Validation
pnpm --filter eve run typecheck— cleanpnpm --filter eve exec vitest run --config vitest.integration.config.ts just-bash-capability-options— passRefs #431, #239. Upstream prerequisite for the capability flags: vercel-labs/just-bash#284.