Pavel savchenko
|
4246bbeffd
|
fix: make GOOGLE_APPLICATION_CREDENTIALS optional
The variable can often be omitted in environments that use default
credentials such as GKE (Google cloud's managed Kubernetes) or VM
instances.
Django-storages also acknowledges this, and it provides GS_CREDENTIALS
as a way around systems where the default credentials are not used
or undesired.
However, it's impossible to not set the environment variable setting,
and without passing a path to a valid file that contains a valid JSON
structure of a service account key, this code will raise an error.
Refs:
* https://django-storages.readthedocs.io/en/latest/backends/gcloud.html#authentication-settings
* https://googleapis.dev/python/google-auth/latest/reference/google.auth.html#google.auth.default
* d2ab3afdb5/google/oauth2/service_account.py (L643-L658)
* d2ab3afdb5/google/auth/_service_account_info.py (L78-L80)
|
1 year ago |