You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/tests
hinoka@chromium.org c6a2ee6930 Adds SSO auth to gsutil
Code path:
1. plugins.sso_auth is imported, which adds the AuthHandler class to the global state.
2. HasConfiguredCredentials() in gslib/utils.py is called by gsutil, and will return true if "prodaccess" exists on the system, which tells the system that we don't want a no-op auth handler.
3. When a command is called, all the auth handlers are cycled through and sso_auth.SSOAuth is called, which calls a stubby command to emit a gaiamint'ed oauth2 access token, which is then used as the Authorization Header

if --bypass_prodaccess is passed in, then:
1. HasConfiguredCredentials() will bypass the check for prodaccess, as if it didn't exist.
2. plugins.sso_auth does not get imported.
Which will essentially cause gsutil to behave as if this patch never existed.

So the expected behavior is:
=.boto file does not exist, prodaccess exists, but unauthenticated=
Failure: No handler was ready to authenticate. 3 handlers were checked. ['OAuth2Auth', 'HmacAuthV1Handler', 'SSOAuth'] Check your credentials.

=.boto file exists, prodaccess exists, but unauthenticated=
sso_auth will raise NotReadyToAuthenticate, and the .boto file will be used instead

=.boto file exists, prodaccess exists, authenticated=
sso_auth will be run _after_ the default gsutil authenticator, which causes the sso_auth to be used over whatever the default authentication is.

bypass_prodaccess is passed in by default to upload_to_google_storage because we expect people who use upload_to_google_storage to not need prodaccess and have their own boto file already.  Also the sso_auth plugin will only request a readonlyi token, which will not work for uploading.

BUG=258152

Review URL: https://codereview.chromium.org/86123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@240266 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
..
gstools Scripts to download files from google storage based on sha1 sums 12 years ago
subversion_config
abandon.sh Fix depot_tools tests external dependency 12 years ago
basic.sh Fix depot_tools tests external dependency 12 years ago
breakpad_unittest.py
checkout_test.py Return unicode commit hashes in checkout.GitCheckout. 12 years ago
download_from_google_storage_unittests.py Adds SSO auth to gsutil 12 years ago
fix_encoding_test.py
gcl_unittest.py Update the R= line with the actual list of reviewers that approved the CL. 12 years ago
gclient_scm_test.py Fix unpinned version to track upstream. 12 years ago
gclient_smoketest.py Add support in gclient for pre-DEPS hooks 12 years ago
gclient_test.py Revert "Revert "Improve description layout. Improve coloring and add legend in help."" 12 years ago
gclient_utils_test.py Consolidate subprocess retry logic into gclient_utils. 12 years ago
git_cl_test.py GERRIT_PORT is no longer used in git_cl.py 12 years ago
git_common_test.py Add git-number script to calculate generation numbers for commits. 12 years ago
git_number_test.py Add git-number script to calculate generation numbers for commits. 12 years ago
hooks.sh
owners.sh Fix depot_tools tests external dependency 12 years ago
owners_finder_test.py An interactive tool to help find owners covering current change list. 12 years ago
owners_unittest.py Add a way to require approval from owners other than the author. 12 years ago
patch.sh Fix depot_tools tests external dependency 12 years ago
patch_test.py
post-dcommit-hook-test.sh
presubmit_unittest.py Print test duration in verbose mode. 12 years ago
push-basic.sh Fix depot_tools tests external dependency 12 years ago
push-from-logs.sh Fix depot_tools tests external dependency 12 years ago
rename.sh Make git-cl more accurately imitate git's editor selection process, and respect $VISUAL. 12 years ago
rietveld_test.py Have Rietveld.get_description() consistently strip CR and whitespace. 12 years ago
sample_pre_commit_hook
save-description-on-failure.sh Make git-cl more accurately imitate git's editor selection process, and respect $VISUAL. 12 years ago
scm_unittest.py Removes DiffItem, which was unused, and moves _DiffItemInternal below GenerateDiff, now its lone caller. 12 years ago
submit-from-new-dir.sh Make git-cl more accurately imitate git's editor selection process, and respect $VISUAL. 12 years ago
submodule-merge-test.sh
subprocess2_test.py Fix many (but not all[1]) depot_tools tests on Windows. 12 years ago
test-lib.sh Fix upstream.sh presubmit test for git 1.8.3+ 12 years ago
trychange_unittest.py Rework bot and test parsing to allow receipt of (bot, set(test)) specifications. 12 years ago
upload-local-tracking-branch.sh Make git-cl more accurately imitate git's editor selection process, and respect $VISUAL. 12 years ago
upload-stale.sh Fix depot_tools tests external dependency 12 years ago
upload_to_google_storage_unittests.py Add no_auth flag to skip auth checking for buckets that don't require it. Also fix tests 12 years ago
upstream.sh Fix upstream.sh presubmit test for git 1.8.3+ 12 years ago
watchlists_unittest.py