You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(gcp): ignore ADC errors when explicit credentials are provided (#531)
* fix(gcp): ignore ADC errors when explicit credentials are provided
Previously, GoogleCloudStorageBuilder unconditionally attempted to read
Application Default Credentials (ADC), causing build failures when ADC
files existed in unsupported formats (e.g., external_account_authorized_user),
even when explicit credentials were provided via with_service_account_path(),
with_service_account_key(), or with_credentials().
This change makes ADC reading conditional:
- When explicit credentials are provided, ADC reading errors are ignored
- When no explicit credentials exist, ADC errors are propagated normally
This preserves error visibility for users relying on ADC while allowing
users with explicit credentials to work regardless of ADC state.
The credential precedence remains: explicit credentials > ADC > instance metadata
Tests added:
- Verify explicit service account path ignores invalid ADC
- Verify explicit service account key ignores invalid ADC
- Verify custom credentials provider ignores invalid ADC
- Verify ADC errors still propagate when no explicit credentials provided
* refactor: skip ADC read when explicit credentials provided
Per reviewer feedback, avoid unnecessary file I/O by returning None
directly instead of attempting to read ADC and discarding errors.
0 commit comments