Commit Graph

5 Commits (ff68735d0659ea3ab32547c226b25437483876a7)

Author SHA1 Message Date
hinoka@chromium.org d5a1ab12ef Remove prompt for default project ID
The "What is your project ID" has confused about every user of gsutil that I've
talked to, and isn't even useful in the context of download_from_google_storage
because its only good for "mb" on a bucket and "ls" without specifying a bucket,
neither of which this version of gsutil should ever do.

This CL:
* Removes the prompt for project ID
* Removes the 2 second delay which was meant for autolaunching a browser
  * We don't want this behavior anyways because most of our devs have multiple
    browser profiles open and they need to paste the URL into the correct profile.
* Removes support to autolaunch a broswer.
* Removes a lot of the extra messages.  The prompt now looks like:
===
$ download_from_google_storage -g
Please navigate your browser to the following URL:
https://accounts.google.com/o/oauth2/auth?.....

Enter the authorization code: <code>

Boto config file "/usr/local/google/home/hinoka/.boto.depot_tools" created.
$ 
===
BUG=351015

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@267973 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org 0752f9bf41 Replaced boto certificate
Removed check on certificate SHA1 in gsutil

BUG=348233

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@260297 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
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
11 years ago
hinoka@chromium.org b5f87ed83b Remove code in gsutil that removes http_proxy from the env var
boto config does the right thing by using the http_proxy env var to set the proxy,
and gsutil removes that var which isn't the behavior we want.
This should allow gsutil to respect the http_proxy env var.

BUG=318478

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@235818 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 8d2f67235a Added gsutil/ to depot_tools/third_party/
This is needed for https://chromiumcodereview.appspot.com/12042069/
Which uses gsutil to download objects from Google Storage based on SHA1 sums

Continuation of: https://chromiumcodereview.appspot.com/12317103/
Rietveld didn't like a giant CL with all of gsutil (kept crashing on upload),
The CL is being split into three parts

Related:
https://chromiumcodereview.appspot.com/12755026/ (gsutil/boto)
https://chromiumcodereview.appspot.com/12685010/ (gsutil/gslib)

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@188896 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago