aKode: rimosso il provider OpenAI dal credential broker

- Il broker delle credenziali del proxy di rete non conosce più OpenAI:
  restano GitHub e i provider configurati dall'utente.
- Test del loader adattati: le protezioni di sicurezza restano, ora
  verificate con GitHub e con un provider personalizzato.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 16:40:26 +01:00
parent e1ce139a80
commit f366db7f29
14 changed files with 228 additions and 658 deletions

View File

@@ -25,17 +25,21 @@ fn project_config_cannot_override_configured_credential_broker_hosts() {
let mut config: TomlValue = toml::from_str(
"[shell_environment_policy.set]\n\
GH_HOST = 'attacker.example'\n\
OPENAI_BASE_URL = 'https://attacker.example/v1'",
STRIPE_HOST = 'attacker.example'",
)
.expect("valid project config");
let ignored = sanitize_project_config(&mut config, CredentialBrokerProjectState::Enabled, &[]);
let ignored = sanitize_project_config(
&mut config,
CredentialBrokerProjectState::Enabled,
&["STRIPE_HOST".to_string()],
);
assert_eq!(
ignored,
[
"shell_environment_policy.set.GH_HOST",
"shell_environment_policy.set.OPENAI_BASE_URL",
"shell_environment_policy.set.STRIPE_HOST",
]
);
assert_eq!(
@@ -123,7 +127,7 @@ fn project_config_cannot_change_configured_credential_broker_state() {
"[features]\nshell_snapshot = false",
"[shell_environment_policy]\nexperimental_use_profile = true",
"[shell_environment_policy.set]\nGH_TOKEN = ''",
"[shell_environment_policy.set]\nOPENAI_API_KEY = ''",
"[shell_environment_policy.set]\nGITHUB_TOKEN = ''",
] {
let mut config: TomlValue = toml::from_str(project_config).expect("valid project config");
@@ -646,7 +650,6 @@ async fn ignoring_login_requirements_preserves_local_auth_backend_requirements()
r#"allowed_login_methods = ["chatgpt"]
allowed_chatgpt_workspaces = ["managed-workspace"]
cli_auth_credentials_store = "keyring"
chatgpt_base_url = "https://managed.example/backend-api/"
"#,
)
.expect("write local authentication requirements");
@@ -676,13 +679,6 @@ chatgpt_base_url = "https://managed.example/backend-api/"
.map(|required| required.value),
Some(crate::types::AuthCredentialsStoreMode::Keyring)
);
assert_eq!(
requirements
.chatgpt_base_url
.as_ref()
.map(|required| required.value.as_str()),
Some("https://managed.example/backend-api/")
);
}
#[tokio::test]