permissions: migrate approval and sandbox consumers to profiles

This commit is contained in:
Michael Bolin
2026-04-25 15:57:32 -07:00
parent 106cd7414f
commit 70cd79acac
25 changed files with 330 additions and 167 deletions
+5 -3
View File
@@ -16,7 +16,6 @@ use codex_features::Feature;
use codex_protocol::approvals::NetworkApprovalProtocol;
use codex_protocol::approvals::NetworkPolicyAmendment;
use codex_protocol::approvals::NetworkPolicyRuleAction;
use codex_protocol::models::PermissionProfile;
use codex_protocol::protocol::ApplyPatchApprovalRequestEvent;
use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::EventMsg;
@@ -2881,8 +2880,11 @@ allow_local_binding = true
};
let mut builder = test_codex().with_home(home).with_config(move |config| {
config.permissions.approval_policy = Constrained::allow_any(approval_policy);
config.permissions.sandbox_policy = Constrained::allow_any(SandboxPolicy::DangerFullAccess);
config.permissions.permission_profile = Constrained::allow_any(PermissionProfile::Disabled);
let cwd = config.cwd.clone();
config
.permissions
.set_legacy_sandbox_policy(SandboxPolicy::DangerFullAccess, cwd.as_path())
.expect("test setup should allow sandbox policy");
let layers = config
.config_layer_stack
.get_layers(