aKode fase 2b-2: rimosso login ChatGPT e tutti i sottosistemi solo-ChatGPT

- Login: resta solo chiave API (+ header, Bedrock). Rimossi OAuth/browser,
  device code, refresh/revoke su auth.openai.com, PAT, agent/workload identity,
  runtime agent instance, backend-client e openapi-models, workspace routing.
- Rimossi: generazione immagini (ext + skill imagegen), history notes, plugin
  remoti (catalogo, sync, share), cyber access program, daybreak, cloud config
  e requirements (config_server ora fail-closed), attestation, frozen cloud
  skills, EMA MCP auth, Codex Apps/connettori, ricerca ospitata, header/zstd/
  routing/cookie del backend Codex, fallback OPENAI_API_KEY del realtime.
- Messaggi d'errore senza link a chatgpt.com.
- Chiavi di config legacy accettate e ignorate; feature rimosse = Stage::Removed.
- Test: cancellati solo quelli del codice rimosso; test di sicurezza
  (sandbox estensioni, permessi, redazione, auth storage, requirements)
  adattati. Restano solo fallimenti d'ambiente (code-mode-host/V8, ~/.agents).
- Istruzioni di sistema invariate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-10 16:20:15 +01:00
parent 82347a58ed
commit 6089fbde91
1573 changed files with 10289 additions and 177679 deletions

View File

@@ -7,14 +7,10 @@ use codex_core::TurnInputRequest;
use codex_core::config::ConfigBuilder;
use codex_login::AuthManager;
use codex_login::CodexAuth;
use codex_login::auth::AgentIdentityAuthPolicy;
use codex_model_provider::AgentIdentitySessionFallback;
use codex_model_provider::ProviderAuthScope;
use codex_model_provider::create_model_provider;
use codex_model_provider::test_support::seed_gateway_auth;
use codex_model_provider_info::ModelProviderInfo;
use codex_protocol::protocol::EventMsg;
use codex_protocol::protocol::SessionSource;
use codex_protocol::user_input::UserInput;
use core_test_support::responses;
use core_test_support::test_codex::TestCodex;
@@ -137,19 +133,15 @@ async fn command_gateway_authenticates_without_an_oauth_grant_and_caches_the_tok
}
#[tokio::test]
async fn inference_sends_chatgpt_and_gateway_credentials_to_the_configured_headers() -> Result<()> {
async fn inference_sends_stored_and_gateway_credentials_to_the_configured_headers() -> Result<()> {
// Stored API-key auth and gateway OAuth combine; no ChatGPT account header is sent.
sample_with_gateway(
"requires_openai_auth = true",
"delivery = { kind = 'header', name = 'x-gateway-auth' }",
CodexAuth::from_external_chatgpt_tokens(
"header.e30.sig",
"test-account",
/*chatgpt_plan_type*/ None,
)?,
CodexAuth::from_api_key("provider-token"),
&[
("authorization", "Bearer header.e30.sig"),
("authorization", "Bearer provider-token"),
("x-gateway-auth", "Bearer gateway-token"),
("chatgpt-account-id", "test-account"),
],
/*expected_error*/ None,
)
@@ -172,7 +164,7 @@ async fn omitted_delivery_sends_only_gateway_auth_even_when_signed_in() -> Resul
sample_with_gateway(
"requires_openai_auth = false",
"",
CodexAuth::create_dummy_chatgpt_auth_for_testing(),
CodexAuth::from_api_key("Test API Key"),
&[("authorization", "Bearer gateway-token")],
/*expected_error*/ None,
)
@@ -375,15 +367,7 @@ delivery = { kind = "header", name = "x-gateway-auth" }
error.to_string(),
"failed to create provider OAuth HTTP client"
);
let error = provider
.api_auth_for_scope(ProviderAuthScope {
agent_identity_policy: AgentIdentityAuthPolicy::JwtOnly,
session_source: SessionSource::Cli,
agent_identity_session_fallback: AgentIdentitySessionFallback::default(),
})
.await
.err()
.unwrap();
let error = provider.request_auth().await.err().unwrap();
assert_eq!(
error.to_string(),
"failed to create provider OAuth HTTP client"