fix: Remove fallback to cached exchanged credential in _load_existing_credential

The _load_existing_credential method in CredentialManager will now only attempt to load credentials from the credential service and will no longer check the AuthConfig's exchanged_auth_credential cache.

Close #3772

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852944533
This commit is contained in:
George Weale
2026-01-06 14:50:05 -08:00
committed by Copybara-Service
parent 30d3411d60
commit 1ae0e16b2c
2 changed files with 3 additions and 7 deletions
@@ -133,7 +133,7 @@ class TestCredentialManager:
@pytest.mark.asyncio
async def test_load_existing_credential_already_exchanged(self):
"""Test _load_existing_credential when credential is already exchanged."""
"""Test _load_existing_credential ignores shared config cache."""
auth_config = Mock(spec=AuthConfig)
mock_credential = Mock(spec=AuthCredential)
auth_config.exchanged_auth_credential = mock_credential
@@ -145,7 +145,7 @@ class TestCredentialManager:
result = await manager._load_existing_credential(callback_context)
assert result == mock_credential
assert result is None
@pytest.mark.asyncio
async def test_load_existing_credential_with_credential_service(self):