WIP fase 2b-3: rimozione sottosistemi solo-ChatGPT (plugin remoti, image gen, daybreak, cyber, attestation, cloud config, app/connettori) - test in corso
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,12 +20,10 @@ use crate::HttpClient;
|
||||
use crate::HttpClientFactory;
|
||||
use crate::HttpClientTlsConfig;
|
||||
use crate::OutboundProxyRoute;
|
||||
use crate::chatgpt_cloudflare_cookies::ChatGptCookieStore;
|
||||
use crate::client::HttpClientBackend;
|
||||
use crate::client::RequestLogging;
|
||||
use crate::client::TransportClient;
|
||||
use crate::custom_ca::build_reqwest_client_with_custom_ca;
|
||||
use crate::with_chatgpt_cloudflare_cookie_store;
|
||||
|
||||
/// Configures an [`HttpClient`] without exposing the underlying HTTP implementation.
|
||||
///
|
||||
@@ -40,8 +38,6 @@ pub struct HttpClientBuilder {
|
||||
follow_redirects: bool,
|
||||
pub(crate) redirect_observed: Option<Arc<AtomicBool>>,
|
||||
pub(crate) connect_timeout: Option<Duration>,
|
||||
chatgpt_cloudflare_cookie_store: bool,
|
||||
chatgpt_cookie_store: Option<Arc<ChatGptCookieStore>>,
|
||||
pub(crate) request_logging: RequestLogging,
|
||||
tls_backend: TlsBackend,
|
||||
pub(crate) tls: HttpClientTlsConfig,
|
||||
@@ -157,18 +153,6 @@ impl HttpClientBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_chatgpt_cloudflare_cookie_store(mut self) -> Self {
|
||||
self.chatgpt_cloudflare_cookie_store = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Uses the factory's configured ChatGPT cookies without changing proxy behavior.
|
||||
pub fn with_chatgpt_cookies(mut self, http_client_factory: &HttpClientFactory) -> Self {
|
||||
self.chatgpt_cloudflare_cookie_store = true;
|
||||
self.chatgpt_cookie_store = http_client_factory.chatgpt_cookie_store();
|
||||
self
|
||||
}
|
||||
|
||||
/// Suppresses request URL and response-header diagnostics.
|
||||
pub fn without_request_logging(mut self) -> Self {
|
||||
self.request_logging = RequestLogging::Disabled;
|
||||
@@ -181,7 +165,7 @@ impl HttpClientBuilder {
|
||||
/// resolve a concrete direct or proxy route when the factory is configured with
|
||||
/// [`crate::OutboundProxyPolicy::RespectSystemProxy`].
|
||||
pub fn build_respecting_outbound_proxy_policy(
|
||||
mut self,
|
||||
self,
|
||||
http_client_factory: &HttpClientFactory,
|
||||
request_url: &str,
|
||||
route_class: ClientRouteClass,
|
||||
@@ -207,7 +191,6 @@ impl HttpClientBuilder {
|
||||
)?
|
||||
.into_client());
|
||||
}
|
||||
self.chatgpt_cookie_store = http_client_factory.chatgpt_cookie_store();
|
||||
let (builder, request_logging, default_headers) = self.into_reqwest_parts();
|
||||
let inner =
|
||||
crate::outbound_proxy::build_reqwest_client_for_route(builder, route_class, &route)?;
|
||||
@@ -220,12 +203,10 @@ impl HttpClientBuilder {
|
||||
|
||||
/// Builds a client for a route that was already resolved by a route-aware caller.
|
||||
pub(crate) fn build_for_resolved_route(
|
||||
mut self,
|
||||
http_client_factory: &HttpClientFactory,
|
||||
self,
|
||||
route_class: ClientRouteClass,
|
||||
route: &OutboundProxyRoute,
|
||||
) -> Result<TransportClient, BuildRouteAwareHttpClientError> {
|
||||
self.chatgpt_cookie_store = http_client_factory.chatgpt_cookie_store();
|
||||
let explicit_roots = self.tls.root_certificate.is_some();
|
||||
let (builder, request_logging, default_headers) = self.into_reqwest_parts();
|
||||
let inner = if explicit_roots {
|
||||
@@ -423,12 +404,6 @@ impl HttpClientBuilder {
|
||||
if let Some(connect_timeout) = self.connect_timeout {
|
||||
builder = builder.connect_timeout(connect_timeout);
|
||||
}
|
||||
if self.chatgpt_cloudflare_cookie_store {
|
||||
builder = match self.chatgpt_cookie_store {
|
||||
Some(store) => builder.cookie_provider(store),
|
||||
None => with_chatgpt_cloudflare_cookie_store(builder),
|
||||
};
|
||||
}
|
||||
builder
|
||||
}
|
||||
}
|
||||
@@ -442,8 +417,6 @@ impl Default for HttpClientBuilder {
|
||||
follow_redirects: true,
|
||||
redirect_observed: None,
|
||||
connect_timeout: None,
|
||||
chatgpt_cloudflare_cookie_store: false,
|
||||
chatgpt_cookie_store: None,
|
||||
request_logging: RequestLogging::Enabled,
|
||||
tls_backend: TlsBackend::TransportDefault,
|
||||
tls: HttpClientTlsConfig::default(),
|
||||
|
||||
Reference in New Issue
Block a user