Reuse shared ChatGPT host allowlist

This commit is contained in:
Matthew Zeng
2026-05-05 11:09:31 -07:00
parent 0fcebd8d8f
commit 3c0c775143
3 changed files with 4 additions and 7 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -2983,6 +2983,7 @@ dependencies = [
"async-channel",
"codex-api",
"codex-async-utils",
"codex-client",
"codex-config",
"codex-exec-server",
"codex-login",

View File

@@ -16,6 +16,7 @@ anyhow = { workspace = true }
async-channel = { workspace = true }
codex-async-utils = { workspace = true }
codex-api = { workspace = true }
codex-client = { workspace = true }
codex-config = { workspace = true }
codex-exec-server = { workspace = true }
codex-login = { workspace = true }

View File

@@ -17,6 +17,7 @@ use std::path::PathBuf;
use std::time::Duration;
use async_channel::unbounded;
use codex_client::is_allowed_chatgpt_host;
use codex_config::Constrained;
use codex_config::McpServerConfig;
use codex_config::McpServerProvenance;
@@ -474,13 +475,7 @@ fn is_allowed_codex_apps_chatgpt_host(host: &Option<Host<&str>>) -> bool {
let Some(Host::Domain(host)) = host else {
return false;
};
let host = *host;
host == "chatgpt.com"
|| host == "chat.openai.com"
|| host == "chatgpt-staging.com"
|| host.ends_with(".chatgpt.com")
|| host.ends_with(".chatgpt-staging.com")
is_allowed_chatgpt_host(host)
}
fn is_localhost_for_codex_apps(host: &Option<Host<&str>>) -> bool {