mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
## Why Auth routing represented the default proxy policy as an absent configuration, leaving consumers to reconstruct the fallback HTTP client independently. Carry the application's resolved policy explicitly so auth and related requests use the same client configuration. ## What changed - Build `AuthRouteConfig` from the resolved `HttpClientFactory` for both `ReqwestDefault` and `RespectSystemProxy` policies. - Pass that route configuration through login, auth, cloud task, and cloud configuration flows, and reuse its factory when loading cloud configuration. - Log cloud-task configuration load failures before falling back to the transport-default proxy policy. ## Testing Extended configuration tests to verify that effective and bootstrap auth routes select the expected proxy policy when system-proxy support is enabled or disabled by feature requirements. GitOrigin-RevId: d03802e2660f5cf6d940e8e718ec5c82ede7eab1
25 lines
773 B
Rust
25 lines
773 B
Rust
use codex_http_client::HttpClientFactory;
|
|
|
|
/// Auth-layer adapter around client-owned proxy policy.
|
|
///
|
|
/// `AuthConfig` carries this value while endpoint resolution and platform details remain in the
|
|
/// client layer.
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct AuthRouteConfig {
|
|
http_client_factory: HttpClientFactory,
|
|
}
|
|
|
|
impl AuthRouteConfig {
|
|
/// Adapts an application-resolved HTTP client factory for auth requests.
|
|
pub fn from_http_client_factory(http_client_factory: HttpClientFactory) -> Self {
|
|
Self {
|
|
http_client_factory,
|
|
}
|
|
}
|
|
|
|
/// Returns the HTTP client factory represented by this routing configuration.
|
|
pub fn http_client_factory(&self) -> &HttpClientFactory {
|
|
&self.http_client_factory
|
|
}
|
|
}
|