refactor: extract auth crate from codex-core

This commit is contained in:
Michael Bolin
2026-03-12 18:47:29 -07:00
parent f194d4b115
commit 75062a87cd
22 changed files with 2615 additions and 1823 deletions
+4 -2
View File
@@ -7,7 +7,6 @@
//! into a one-shot CLI command while still producing a durable `codex-login.log` artifact that
//! support can request from users.
use codex_core::CodexAuth;
use codex_core::auth::AuthCredentialsStoreMode;
use codex_core::auth::AuthMode;
use codex_core::auth::CLIENT_ID;
@@ -316,7 +315,10 @@ pub async fn run_login_with_device_code_fallback_to_browser(
pub async fn run_login_status(cli_config_overrides: CliConfigOverrides) -> ! {
let config = load_config_or_exit(cli_config_overrides).await;
match CodexAuth::from_auth_storage(&config.codex_home, config.cli_auth_credentials_store_mode) {
match codex_core::from_auth_storage_with_core_client(
&config.codex_home,
config.cli_auth_credentials_store_mode,
) {
Ok(Some(auth)) => match auth.auth_mode() {
AuthMode::ApiKey => match auth.get_token() {
Ok(api_key) => {