Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow accessing public data with anonymous user when shim is turned ON #1755

Merged
merged 11 commits into from
Nov 8, 2023

Conversation

dilipped
Copy link
Collaborator

@dilipped dilipped commented Nov 4, 2023

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

gslib/tests/testcase/shim_unit_test_base.py Show resolved Hide resolved
gslib/utils/shim_util.py Show resolved Hide resolved
@dilipped dilipped marked this pull request as draft November 6, 2023 21:15
@dilipped dilipped marked this pull request as ready for review November 6, 2023 21:20
@dilipped dilipped added the kokoro:run kokoro:run label Nov 7, 2023
@gsutil-team-kokoro gsutil-team-kokoro removed the kokoro:run kokoro:run label Nov 7, 2023
@dilipped
Copy link
Collaborator Author

dilipped commented Nov 8, 2023

All kokoro failures are because of known issues. We had a bug filed for one of them. I filed a couple of new bugs to track the other kokoro failures.

@dilipped dilipped merged commit a872f98 into GoogleCloudPlatform:master Nov 8, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants