Files
imeai-aKode/codex-rs/websocket-client/src/lib_tests.rs
andrea.difonzo 6089fbde91 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>
2026-11-10 16:20:15 +01:00

38 lines
925 B
Rust

use tokio_tungstenite::tungstenite::http::Uri;
use super::is_loopback_destination;
#[test]
fn recognizes_loopback_websocket_destinations() {
for destination in [
"ws://localhost:8080",
"ws://LOCALHOST:8080",
"ws://127.0.0.1:8080",
"ws://[::1]:8080",
] {
let uri = destination.parse::<Uri>().unwrap();
assert!(
is_loopback_destination(&uri),
"expected loopback destination: {destination}; parsed host: {:?}",
uri.host()
);
}
}
#[test]
fn rejects_non_loopback_websocket_destinations() {
for destination in [
"ws://relay.example:8080",
"ws://192.0.2.1:8080",
"ws://[2001:db8::1]:8080",
"/missing-host",
] {
assert!(!is_loopback_destination(
&destination.parse::<Uri>().unwrap()
));
}
}
#[path = "network_policy_tests.rs"]
mod network_policy_tests;