mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
Make Codex HTTP identity explicit
This commit is contained in:
@@ -9,6 +9,7 @@ use codex_api::SharedAuthProvider;
|
||||
use codex_client::build_reqwest_client_with_custom_ca;
|
||||
use codex_client::with_chatgpt_cloudflare_cookie_store;
|
||||
use codex_login::CodexAuth;
|
||||
use codex_login::default_client::Originator;
|
||||
use codex_login::default_client::get_codex_user_agent;
|
||||
use codex_protocol::account::PlanType as AccountPlanType;
|
||||
use codex_protocol::protocol::CreditsSnapshot;
|
||||
@@ -170,8 +171,9 @@ impl Client {
|
||||
}
|
||||
|
||||
pub fn from_auth(base_url: impl Into<String>, auth: &CodexAuth) -> Result<Self> {
|
||||
let originator = Originator::process_default();
|
||||
Ok(Self::new(base_url)?
|
||||
.with_user_agent(get_codex_user_agent())
|
||||
.with_user_agent(get_codex_user_agent(&originator))
|
||||
.with_auth_provider(codex_model_provider::auth_provider_from_auth(auth)))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user