Add network environment ID plumbing (#28766)

## Why

Prepare network approval scoping to distinguish execution environments
without changing behavior yet.

## What changed

- Add optional environment IDs to network policy requests.
- Add optional network environment IDs to exec and sandbox request
structs.
- Thread default None values through existing construction points.
- Fix stale constructor call sites that caused the CI compile failures.

## Not included

- Per-environment proxy listeners.
- Network approval cache or prompt behavior changes.
- Ambiguous request attribution handling.

Those behavior changes moved to stacked follow-up #28899.

## Validation

- just fmt
- CI will run tests and clippy
This commit is contained in:
jif authored and GitHub committed 2026-06-18 14:09:38 +02:00
1 parent ecc4c30e28
commit 0369b24d54
21 files changed
+60

No files matched your search

+5
View File
@@ -47,6 +47,7 @@ pub struct ExecRequest {
pub env: HashMap<String, String>,
pub(crate) exec_server_env_config: Option<ExecServerEnvConfig>,
pub network: Option<NetworkProxy>,
pub network_environment_id: Option<String>,
pub expiration: ExecExpiration,
pub capture_policy: ExecCapturePolicy,
pub sandbox: SandboxType,
@@ -68,6 +69,7 @@ impl ExecRequest {
cwd: AbsolutePathBuf,
env: HashMap<String, String>,
network: Option<NetworkProxy>,
network_environment_id: Option<String>,
expiration: ExecExpiration,
capture_policy: ExecCapturePolicy,
sandbox: SandboxType,
@@ -87,6 +89,7 @@ impl ExecRequest {
env,
exec_server_env_config: None,
network,
network_environment_id,
expiration,
capture_policy,
sandbox,
@@ -113,6 +116,7 @@ impl ExecRequest {
sandbox_policy_cwd: windows_sandbox_policy_cwd,
mut env,
network,
network_environment_id,
sandbox,
windows_sandbox_level,
windows_sandbox_private_desktop,
@@ -141,6 +145,7 @@ impl ExecRequest {
env,
exec_server_env_config: None,
network,
network_environment_id,
expiration,
capture_policy,
sandbox,