Files
codex/codex-rs/cli
lsingh-oai 79773e8826 Enforce application network policy in standalone MCP commands (#52215)
## Why

Standalone MCP commands must honor `application.network` restrictions during OAuth discovery and login, even when the MCP server is allowed by its identity requirements.

## What changed

- Apply local network policy to cloud configuration bootstrap authentication and activate the effective policy on the loaded CLI configuration.
- Load `codex mcp add` through the shared cloud configuration loader and use its resolved `codex_home` when saving server configuration.
- Block disallowed OAuth discovery requests before connecting while preserving the ability to save a server when discovery is unavailable.

## Testing

Add isolated regression tests for blocked MCP discovery and login, discovery with network policy disabled, allowed and denied HTTPS destinations, and rejection of malformed managed network policy. Connection checks verify that denied requests never reach a TCP listener.

GitOrigin-RevId: f91401b51d6e6b9472bb01838f0d0903f83d62f3
2026-10-08 18:22:39 +00:00
..