mirror of
https://github.com/openai/codex.git
synced 2026-05-02 12:21:26 +03:00
Cache cloud requirements (#11305)
We're loading these from the web on every startup. This puts them in a local file with a 1hr TTL. We sign the downloaded requirements with a key compiled into the Codex CLI to prevent unsophisticated tampering (determined circumvention is outside of our threat model: after all, one could just compile Codex without any of these checks). If any of the following are true, we ignore the local cache and re-fetch from Cloud: * The signature is invalid for the payload (== requirements, sign time, ttl, user identity) * The identity does not match the auth'd user's identity * The TTL has expired * We cannot parse requirements.toml from the payload
This commit is contained in:
@@ -225,7 +225,11 @@ pub async fn run_main(
|
||||
.chatgpt_base_url
|
||||
.clone()
|
||||
.unwrap_or_else(|| "https://chatgpt.com/backend-api/".to_string());
|
||||
let cloud_requirements = cloud_requirements_loader(cloud_auth_manager, chatgpt_base_url);
|
||||
let cloud_requirements = cloud_requirements_loader(
|
||||
cloud_auth_manager,
|
||||
chatgpt_base_url,
|
||||
codex_home.to_path_buf(),
|
||||
);
|
||||
|
||||
let model_provider_override = if cli.oss {
|
||||
let resolved = resolve_oss_provider(
|
||||
@@ -502,6 +506,7 @@ async fn run_ratatui_app(
|
||||
cloud_requirements = cloud_requirements_loader(
|
||||
auth_manager.clone(),
|
||||
initial_config.chatgpt_base_url.clone(),
|
||||
initial_config.codex_home.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user