scottwernervt / cloudstorage

Unified cloud storage API for storage services.
http://cloudstorage.readthedocs.io/en/latest/
MIT License
93 stars 27 forks source link

GCS Authentication via metadata api #51

Closed duncward closed 5 years ago

duncward commented 5 years ago

From the google-cloud-storage documentation;

If you’re running in Compute Engine or App Engine, authentication should “just work”. https://googleapis.dev/python/google-api-core/latest/auth.html

This relies not on supplying GOOGLE_APPLICATION_CREDENTIALS environment variable, but on the client making a call to the metadata api http://metadata.google.internal/computeMetadata/v1/service-accounts//identity documented here https://cloud.google.com/storage/docs/json_api/v1/

So ideally the environment variable should be optional.

There is a similar operation for AWS.