The current implementation relies exclusively on Application Default Credentials (ADC), which is not great for local development. Here’s what I think should happen.
Local development environment (including Cloud Shell)
- With gcloud CLI installed:
- Without gcloud CLI installed:
- The authentication process should not fail.
- It needs a clear fallback mechanism, allowing authentication via a service account key file, pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable
Google Cloud environment (Cloud Run, GCE, GKE)
- When running on a Google Cloud compute resource, the application must automatically use the attached service identity through the metadata service for authentication. This is the default behavior for the client libraries.
- The application should automatically default to the project ID and region where the server is deployed, eliminating the need for explicit configuration in this environment.
The current implementation relies exclusively on Application Default Credentials (ADC), which is not great for local development. Here’s what I think should happen.
Local development environment (including Cloud Shell)
cloudshell-gcaproject #105Google Cloud environment (Cloud Run, GCE, GKE)