Accessing public data does not require authentication. In gsutil, this works out-of-the-box. In gcloud storage, the user has to set auth/disable_credentials property to use it without authentication (i.e without setting up an active account). For the shim, in order to not break the workflow of existing users who rely on the gsutil behavior, we will set the auth/disable_credentials property automatically if we detect that gcloud doesn't have any active account configured.
The change has been tested manually
Before:
$ CLOUDSDK_CORE_PASS_CREDENTIALS_TO_GSUTIL=1 GCLOUD_BINARY_PATH=/usr/bin/gcloud python3 gsutil.py -o "GSUtil:use_gcloud_storage=True" ls gs://pub/test.txt
ERROR: (gcloud.storage.ls) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials.
If you have already logged in with a different account, run:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
After:
$ CLOUDSDK_CORE_PASS_CREDENTIALS_TO_GSUTIL=1 GCLOUD_BINARY_PATH=/usr/bin/gcloud python3 gsutil.py -o "GSUtil:use_gcloud_storage=True" ls gs://pub/test.txt
gs://pub/test.txt
Accessing public data does not require authentication. In gsutil, this works out-of-the-box. In
gcloud storage
, the user has to setauth/disable_credentials
property to use it without authentication (i.e without setting up an active account). For the shim, in order to not break the workflow of existing users who rely on the gsutil behavior, we will set theauth/disable_credentials
property automatically if we detect thatgcloud
doesn't have any active account configured.The change has been tested manually
Before:
After: