From 15563e1e9ddfdd32d8a6bdccf8f29c540ae31011 Mon Sep 17 00:00:00 2001 From: mikhail-oai Date: Thu, 19 Mar 2026 20:05:09 -0400 Subject: [PATCH] Use storage helpers in auth and OAuth keyring tests --- codex-rs/login/src/auth/storage_tests.rs | 6 +----- codex-rs/rmcp-client/src/oauth.rs | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/codex-rs/login/src/auth/storage_tests.rs b/codex-rs/login/src/auth/storage_tests.rs index 5da88c9ecd..e1c3372f1a 100644 --- a/codex-rs/login/src/auth/storage_tests.rs +++ b/codex-rs/login/src/auth/storage_tests.rs @@ -393,11 +393,7 @@ fn auto_auth_storage_load_prefers_keyring_value() -> anyhow::Result<()> { Arc::new(mock_keyring.clone()), ); let keyring_auth = auth_with_prefix("keyring"); - seed_keyring_with_auth( - &mock_keyring, - || compute_store_key(codex_home.path()), - &keyring_auth, - )?; + storage.keyring_storage.save(&keyring_auth)?; let file_auth = auth_with_prefix("file"); storage.file_storage.save(&file_auth)?; diff --git a/codex-rs/rmcp-client/src/oauth.rs b/codex-rs/rmcp-client/src/oauth.rs index ea43b757bd..921d5eff2a 100644 --- a/codex-rs/rmcp-client/src/oauth.rs +++ b/codex-rs/rmcp-client/src/oauth.rs @@ -948,6 +948,9 @@ mod tests { let _env = TempCodexHome::new(); let store = KeyringStoreWithError::fail_delete(MockKeyringStore::default()); let tokens = sample_tokens(); + let key = super::compute_store_key(&tokens.server_name, &tokens.url)?; + let value = serde_json::to_value(&tokens)?; + save_json_to_keyring(&store, KEYRING_SERVICE, &key, &value)?; super::save_oauth_tokens_to_file(&tokens).unwrap(); let result = super::delete_oauth_tokens_from_keyring_and_file(