Skip to content

feat: per-exec user override across proto, CLI, and SDKs#291

Merged
DorianZheng merged 2 commits intomainfrom
feat/exec-user-override
Feb 23, 2026
Merged

feat: per-exec user override across proto, CLI, and SDKs#291
DorianZheng merged 2 commits intomainfrom
feat/exec-user-override

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

@DorianZheng DorianZheng commented Feb 23, 2026

Summary

Combines the structural cleanup (#289) and end-to-end wiring into a single PR:

  • Commit 1 (refactor): Adds user field to BoxCommand, ContainerCommand user resolution logic, and unit tests
  • Commit 2 (feat): Wires user override through proto (ExecRequest.user), portal, guest lifecycle, CLI (--user/-u), and Python/Node.js SDKs

Files changed

Layer Files
Proto service.protooptional string user = 8 on ExecRequest
Core litebox/exec.rsuser field + builder, portal/interfaces/exec.rs — pass user
Guest container/command.rs — user resolution, container/lifecycle.rs — rootfs path, service/exec/executor.rs — pass user
CLI cli.rs--user/-u flag
Python SDK box_handle.rs, simplebox.pyuser param
Node.js SDK box_handle.rsuser param

Test plan

  • cargo clippy -p boxlite -p boxlite-cli --tests -- -D warnings
  • cargo fmt --check
  • make test:integration
  • Manual: boxlite exec --user root <box> -- whoami returns root

- 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
@DorianZheng DorianZheng force-pushed the feat/exec-user-override branch from a2e128f to 8939b9b Compare February 23, 2026 12:58
@DorianZheng DorianZheng merged commit 4278e3e into main Feb 23, 2026
27 checks passed
@DorianZheng DorianZheng deleted the feat/exec-user-override branch February 23, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant