WIP fase 2b-2: rimosso login ChatGPT/OAuth/device code, agent/workload identity, backend-client; resta solo chiave API (test non tutti verdi)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#![allow(clippy::expect_used)]
|
||||
|
||||
mod auth_fixtures;
|
||||
mod config;
|
||||
mod json_logging;
|
||||
mod local_websocket_exec_server;
|
||||
@@ -11,12 +10,6 @@ mod rollout;
|
||||
mod rpc_delay;
|
||||
mod test_app_server;
|
||||
|
||||
pub use auth_fixtures::ChatGptAuthFixture;
|
||||
pub use auth_fixtures::ChatGptIdTokenClaims;
|
||||
pub use auth_fixtures::encode_id_token;
|
||||
pub use auth_fixtures::mount_chatgpt_account;
|
||||
pub use auth_fixtures::mount_workspace_routing;
|
||||
pub use auth_fixtures::write_chatgpt_auth;
|
||||
use codex_app_server_protocol::JSONRPCResponse;
|
||||
pub use config::MockResponsesConfig;
|
||||
pub use config::write_mock_responses_config_toml;
|
||||
@@ -62,3 +55,14 @@ pub fn to_response<T: DeserializeOwned>(response: JSONRPCResponse) -> anyhow::Re
|
||||
let codex_response = serde_json::from_value(value)?;
|
||||
Ok(codex_response)
|
||||
}
|
||||
|
||||
/// Store an API key in `codex_home` the way `codex login --with-api-key` does.
|
||||
pub fn write_api_key_auth(codex_home: &std::path::Path) -> anyhow::Result<()> {
|
||||
codex_login::login_with_api_key(
|
||||
codex_home,
|
||||
"sk-test-api-key",
|
||||
codex_config::types::AuthCredentialsStoreMode::File,
|
||||
codex_login::AuthKeyringBackendKind::default(),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user