fabro/lib/crates/fabro-cli/src
Bryan Helmkamp 077469d0c6
refactor(auth): scrub FABRO_WORKER_TOKEN from worker env at startup
The worker subprocess is spawned with env_clear+allowlist by the server, so
the only sensitive value in its env is FABRO_WORKER_TOKEN itself. Read the
token and remove_var it from the process env in main() before Tokio starts
worker threads, then thread it explicitly through runner::execute(&str).

Every descendant (hooks, local sandbox, devcontainer initializeCommand,
MCP stdio, etc.) now inherits a worker env with no bearer in it, so an
unscrubbed spawn site cannot leak the token. This makes the prior denylist
scrub in fabro-hooks and fabro-sandbox redundant — delete it and the shared
WORKER_SECRET_ENV_DENYLIST constant. The sandbox keeps its _api_key/_secret/
_token/_password/_credential suffix heuristic for user-supplied env_vars
hygiene.

Extend the server-dispatched-worker env-leak integration test to also
assert a Bash stage running in the worker does not observe FABRO_WORKER_TOKEN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:10:58 -04:00
..
commands refactor(auth): scrub FABRO_WORKER_TOKEN from worker env at startup 2026-04-23 15:10:58 -04:00
shared refactor(run-status): unify tagged lifecycle states 2026-04-22 17:15:13 -04:00
sleep_inhibitor chore(clippy): require reasons on allow attributes 2026-04-19 20:24:24 -04:00
args.rs refactor(auth): use per-run worker JWTs for subprocesses 2026-04-23 11:04:45 -04:00
command_context.rs Merge remote-tracking branch 'origin/main' 2026-04-23 08:56:40 -04:00
gh.rs feat(install): let user choose GitHub App owner (personal or org) 2026-04-10 09:32:05 -04:00
landing.rs feat(cli): add fabro docs to landing Set up section 2026-04-17 09:03:40 -04:00
local_server.rs Merge remote-tracking branch 'origin/main' 2026-04-23 08:34:44 -04:00
logging.rs Merge remote-tracking branch 'origin/main' 2026-04-19 19:33:40 -04:00
main.rs refactor(auth): scrub FABRO_WORKER_TOKEN from worker env at startup 2026-04-23 15:10:58 -04:00
manifest_builder.rs refactor(config): move settings combine into types 2026-04-23 08:42:19 -04:00
server_client.rs test(auth): backfill worker jwt regression coverage 2026-04-23 11:35:08 -04:00
server_runs.rs refactor(run-status): unify tagged lifecycle states 2026-04-22 17:15:13 -04:00
user_config.rs Merge remote-tracking branch 'origin/main' 2026-04-23 08:34:44 -04:00