fix: Revert danger-full-access denylist-only mode (#17732)

## Summary

- Reverts openai/codex#16946 and removes the danger-full-access
denylist-only network mode.
- Removes the corresponding config requirements, app-server
protocol/schema, config API, TUI debug output, and network proxy
behavior.
- Drops stale tests that depended on the reverted mode while preserving
newer managed allowlist-only coverage.

## Verification

- `just write-app-server-schema`
- `just fmt`
- `cargo test -p codex-config network_requirements`
- `cargo test -p codex-core network_proxy_spec`
- `cargo test -p codex-core
managed_network_proxy_decider_survives_full_access_start`
- `cargo test -p codex-app-server map_requirements_toml_to_api`
- `cargo test -p codex-tui debug_config_output`
- `cargo test -p codex-app-server-protocol`
- `just fix -p codex-config -p codex-core -p codex-app-server-protocol
-p codex-app-server -p codex-tui`
- `git diff --cached --check`

Not run: full workspace `cargo test` (repo instructions ask for
confirmation before that broader run).
This commit is contained in:
viyatb-oai
2026-04-14 09:50:14 -07:00
committed by GitHub
parent b3ae531b3a
commit 81c0bcc921
17 changed files with 60 additions and 384 deletions

View File

@@ -237,8 +237,6 @@ pub struct NetworkRequirementsToml {
/// When true, only managed `allowed_domains` are respected while managed
/// network enforcement is active. User allowlist entries are ignored.
pub managed_allowed_domains_only: Option<bool>,
/// In danger-full-access mode, allow all network access and enforce managed deny entries.
pub danger_full_access_denylist_only: Option<bool>,
pub unix_sockets: Option<NetworkUnixSocketPermissionsToml>,
pub allow_local_binding: Option<bool>,
}
@@ -257,8 +255,6 @@ struct RawNetworkRequirementsToml {
/// When true, only managed `allowed_domains` are respected while managed
/// network enforcement is active. User allowlist entries are ignored.
managed_allowed_domains_only: Option<bool>,
/// In danger-full-access mode, allow all network access and enforce managed deny entries.
danger_full_access_denylist_only: Option<bool>,
#[serde(default)]
denied_domains: Option<Vec<String>>,
unix_sockets: Option<NetworkUnixSocketPermissionsToml>,
@@ -283,7 +279,6 @@ impl<'de> Deserialize<'de> for NetworkRequirementsToml {
domains,
allowed_domains,
managed_allowed_domains_only,
danger_full_access_denylist_only,
denied_domains,
unix_sockets,
allow_unix_sockets,
@@ -312,7 +307,6 @@ impl<'de> Deserialize<'de> for NetworkRequirementsToml {
domains: domains
.or_else(|| legacy_domain_permissions_from_lists(allowed_domains, denied_domains)),
managed_allowed_domains_only,
danger_full_access_denylist_only,
unix_sockets: unix_sockets
.or_else(|| legacy_unix_socket_permissions_from_list(allow_unix_sockets)),
allow_local_binding,
@@ -365,8 +359,6 @@ pub struct NetworkConstraints {
/// When true, only managed `allowed_domains` are respected while managed
/// network enforcement is active. User allowlist entries are ignored.
pub managed_allowed_domains_only: Option<bool>,
/// In danger-full-access mode, allow all network access and enforce managed deny entries.
pub danger_full_access_denylist_only: Option<bool>,
pub unix_sockets: Option<NetworkUnixSocketPermissionsToml>,
pub allow_local_binding: Option<bool>,
}
@@ -392,7 +384,6 @@ impl From<NetworkRequirementsToml> for NetworkConstraints {
dangerously_allow_all_unix_sockets,
domains,
managed_allowed_domains_only,
danger_full_access_denylist_only,
unix_sockets,
allow_local_binding,
} = value;
@@ -405,7 +396,6 @@ impl From<NetworkRequirementsToml> for NetworkConstraints {
dangerously_allow_all_unix_sockets,
domains,
managed_allowed_domains_only,
danger_full_access_denylist_only,
unix_sockets,
allow_local_binding,
}
@@ -1811,7 +1801,6 @@ allowed_approvals_reviewers = ["user"]
allow_upstream_proxy = false
dangerously_allow_all_unix_sockets = true
managed_allowed_domains_only = true
danger_full_access_denylist_only = true
allow_local_binding = false
[experimental_network.domains]
@@ -1862,10 +1851,6 @@ allowed_approvals_reviewers = ["user"]
sourced_network.value.managed_allowed_domains_only,
Some(true)
);
assert_eq!(
sourced_network.value.danger_full_access_denylist_only,
Some(true)
);
assert_eq!(
sourced_network.value.unix_sockets.as_ref(),
Some(&NetworkUnixSocketPermissionsToml {
@@ -1889,7 +1874,6 @@ allowed_approvals_reviewers = ["user"]
dangerously_allow_all_unix_sockets = true
allowed_domains = ["api.example.com", "*.openai.com"]
managed_allowed_domains_only = true
danger_full_access_denylist_only = true
denied_domains = ["blocked.example.com"]
allow_unix_sockets = ["/tmp/example.sock"]
allow_local_binding = false
@@ -1934,10 +1918,6 @@ allowed_approvals_reviewers = ["user"]
sourced_network.value.managed_allowed_domains_only,
Some(true)
);
assert_eq!(
sourced_network.value.danger_full_access_denylist_only,
Some(true)
);
assert_eq!(
sourced_network.value.unix_sockets.as_ref(),
Some(&NetworkUnixSocketPermissionsToml {