Eliminato chatgpt_base_url (B)

Da 24a3cfe2: via la chiave chatgpt_base_url e l'URL predefinito https://chatgpt.com/backend-api/
(la chiave resta accettata nei config e ignorata); schemi dell'app-server rigenerati.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-17 12:39:59 +01:00
parent 7effb5ec86
commit 499ee3a939
63 changed files with 160 additions and 532 deletions

View File

@@ -157,17 +157,10 @@ review_domains = ["review.example.com"]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn managed_auth_settings_are_exposed_enforced_and_read_only() -> Result<()> {
let codex_home = TempDir::new()?;
write_config(
&codex_home,
r#"cli_auth_credentials_store = "file"
chatgpt_base_url = "https://user.example/backend-api/"
"#,
)?;
write_config(&codex_home, "cli_auth_credentials_store = \"file\"\n")?;
std::fs::write(
codex_home.path().join("requirements.toml"),
r#"cli_auth_credentials_store = "ephemeral"
chatgpt_base_url = "https://managed.example/backend-api/"
"#,
"cli_auth_credentials_store = \"ephemeral\"\n",
)?;
let mut app_server = TestAppServer::builder()
.with_codex_home(codex_home.path())
@@ -183,14 +176,8 @@ chatgpt_base_url = "https://managed.example/backend-api/"
.await??;
let requirements = requirements.requirements.expect("managed requirements");
assert_eq!(
(
requirements.cli_auth_credentials_store,
requirements.chatgpt_base_url.as_deref(),
),
(
Some(CliAuthCredentialsStoreMode::Ephemeral),
Some("https://managed.example/backend-api/"),
),
requirements.cli_auth_credentials_store,
Some(CliAuthCredentialsStoreMode::Ephemeral),
);
let config_id = app_server
@@ -202,23 +189,11 @@ chatgpt_base_url = "https://managed.example/backend-api/"
let config: ConfigReadResponse =
timeout(DEFAULT_READ_TIMEOUT, app_server.read_response(config_id)).await??;
assert_eq!(
(
config.config.additional.get("cli_auth_credentials_store"),
config.config.additional.get("chatgpt_base_url"),
),
(
Some(&json!("ephemeral")),
Some(&json!("https://managed.example/backend-api/")),
),
config.config.additional.get("cli_auth_credentials_store"),
Some(&json!("ephemeral")),
);
for (field, value) in [
("cli_auth_credentials_store", json!("file")),
(
"chatgpt_base_url",
json!("https://user.example/backend-api/"),
),
] {
for (field, value) in [("cli_auth_credentials_store", json!("file"))] {
let write_id = app_server
.send_config_value_write_request(ConfigValueWriteParams {
file_path: None,
@@ -246,7 +221,7 @@ chatgpt_base_url = "https://managed.example/backend-api/"
assert_eq!(
std::fs::read_to_string(codex_home.path().join("config.toml"))?,
"cli_auth_credentials_store = \"file\"\nchatgpt_base_url = \"https://user.example/backend-api/\"\n",
"cli_auth_credentials_store = \"file\"\n",
);
Ok(())