google / google/googleapis.dart
The error message when `clientViaApplicationDefaultCredentials` fallbacks to reading `metadata` servers (and failing) is cryptic
- Dominant language
- Dart
- Stars
- 419
- Forks
- 136
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 5
Description
Context for this issue: https://github.com/invertase/dart_firebase_admin/issues/6
It appears that if a user tries to create a client with `clientViaApplicationDefaultCredentials`, yet have neither the environment nor `gcloud/application_default_credentials.json` setup, then `google_apis_auth` fallbacks to reaching out to `metadata.google.internal`.
The problem is that if that endpoint is unavailable (which is likely the case if the user made a mistake and _did_ want to login using the other options), then we end-up with a "Failed host lookup: 'metadata.google.internal'" error.
This is likely confusing, and a better error message could make it more intuitive to understand what the issue is.
Contributor guide
Research direction
The issue names clientViaApplicationDefaultCredentials and the metadata.google.internal fallback, but no source file or test. Start by tracing that entry point and the credential fallback path. Done means an unavailable metadata endpoint produces an actionable message explaining the missing credentials and other login options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100