mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Honor managed permission profiles in network proxy resolution (#34436)
## Why Permission profiles defined by `requirements.toml` can be selected as active, but their network configuration was not included when resolving the network proxy specification for that selection. ## What changed Merge managed permission profiles from `requirements.toml` with configured profiles before looking up the active profile's network proxy settings. ## Testing - Verify config loading retains the proxy settings of an active managed profile. - Verify `turn/start` accepts a managed profile with network settings. GitOrigin-RevId: 3374f82a8fb0ce8f338fa2cea77c28ea2eb89636
This commit is contained in:
1 parent
c9ef7eff00
commit
88fac6fe10
3 files changed
+117
-8
No files matched your search
@@ -1364,6 +1364,9 @@ async fn system_requirements_define_managed_permission_profiles() -> anyhow::Res
|
||||
codex_home.join(CONFIG_TOML_FILE),
|
||||
r#"
|
||||
default_permissions = "managed-standard"
|
||||
|
||||
[features]
|
||||
network_proxy = true
|
||||
"#,
|
||||
)
|
||||
.await?;
|
||||
@@ -1378,6 +1381,11 @@ managed-standard = true
|
||||
|
||||
[permissions.managed-standard]
|
||||
extends = ":workspace"
|
||||
|
||||
[permissions.managed-standard.network]
|
||||
enabled = true
|
||||
proxy_url = "http://127.0.0.1:43128"
|
||||
enable_socks5 = false
|
||||
"#,
|
||||
)
|
||||
.await?;
|
||||
@@ -1399,13 +1407,20 @@ extends = ":workspace"
|
||||
.allowed_permission_profiles,
|
||||
Some(BTreeMap::from([("managed-standard".to_string(), true)]))
|
||||
);
|
||||
assert_eq!(
|
||||
config
|
||||
.permissions
|
||||
.active_permission_profile()
|
||||
.map(|profile| profile.id),
|
||||
Some("managed-standard".to_string())
|
||||
);
|
||||
let active_permission_profile = config
|
||||
.permissions
|
||||
.active_permission_profile()
|
||||
.expect("managed profile should be active");
|
||||
assert_eq!(active_permission_profile.id, "managed-standard");
|
||||
|
||||
let network = config
|
||||
.network_proxy_spec_for_active_permission_profile(
|
||||
&active_permission_profile,
|
||||
config.permissions.permission_profile(),
|
||||
)?
|
||||
.expect("managed profile should retain its network proxy configuration");
|
||||
assert_eq!(network.proxy_host_and_port(), "127.0.0.1:43128");
|
||||
assert!(!network.socks_enabled());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -4204,8 +4204,12 @@ impl Config {
|
||||
),
|
||||
)
|
||||
})?;
|
||||
let mut configured_network_proxy_config = network_proxy_config_for_profile_selection(
|
||||
let permissions = merge_managed_permission_profiles(
|
||||
cfg.permissions.as_ref(),
|
||||
self.config_layer_stack.requirements_toml(),
|
||||
)?;
|
||||
let mut configured_network_proxy_config = network_proxy_config_for_profile_selection(
|
||||
permissions.as_ref(),
|
||||
active_permission_profile.id.as_str(),
|
||||
)?;
|
||||
if self.features.enabled(Feature::NetworkProxy)
|
||||
|
||||
Reference in new issue
Block a user