feat: per-exec user override across proto, CLI, and SDKs#291
Merged
DorianZheng merged 2 commits intomainfrom Feb 23, 2026
Merged
feat: per-exec user override across proto, CLI, and SDKs#291DorianZheng merged 2 commits intomainfrom
DorianZheng merged 2 commits intomainfrom
Conversation
- Validate empty/whitespace user specs at BoxCommand::user() builder (shift-left from guest executor to host-side builder) - Simplify executor to pass user override directly (no empty-string guard) - Extract resolve_exec_user() method from inline logic in build_and_spawn() - Refactor integration tests with TestBox helper and table-driven approach - Add unit tests for empty-string and whitespace-only edge cases
Wire the user override field end-to-end: - Add `optional string user` to ExecRequest proto - Add `user` field to BoxCommand builder - Pass user through portal exec interface - Pass rootfs path to ContainerCommand::new() in guest - Add `--user`/`-u` flag to CLI exec command - Add `user` param to Python and Node.js SDK exec methods
a2e128f to
8939b9b
Compare
4 tasks
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.
Summary
Combines the structural cleanup (#289) and end-to-end wiring into a single PR:
refactor): Addsuserfield toBoxCommand,ContainerCommanduser resolution logic, and unit testsfeat): Wires user override through proto (ExecRequest.user), portal, guest lifecycle, CLI (--user/-u), and Python/Node.js SDKsFiles changed
service.proto—optional string user = 8on ExecRequestlitebox/exec.rs—userfield + builder,portal/interfaces/exec.rs— pass usercontainer/command.rs— user resolution,container/lifecycle.rs— rootfs path,service/exec/executor.rs— pass usercli.rs—--user/-uflagbox_handle.rs,simplebox.py—userparambox_handle.rs—userparamTest plan
cargo clippy -p boxlite -p boxlite-cli --tests -- -D warningscargo fmt --checkmake test:integrationboxlite exec --user root <box> -- whoamireturnsroot