Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: third_party/gsutil/gslib/command.py

Issue 86123002: Adds SSO auth to gsutil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Bug fix or -> and Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/gsutil/README.chromium ('k') | third_party/gsutil/gslib/util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gsutil/gslib/command.py
diff --git a/third_party/gsutil/gslib/command.py b/third_party/gsutil/gslib/command.py
index 076455baf5a28225128f4d622b9d06a31dec3f7b..308b04839861f85e4af2b57d98f70a8f6300b076 100644
--- a/third_party/gsutil/gslib/command.py
+++ b/third_party/gsutil/gslib/command.py
@@ -169,7 +169,8 @@ class Command(object):
def __init__(self, command_runner, args, headers, debug, parallel_operations,
gsutil_bin_dir, boto_lib_dir, config_file_list, gsutil_ver,
- bucket_storage_uri_class, test_method=None):
+ bucket_storage_uri_class, test_method=None,
+ bypass_prodaccess=True):
"""
Args:
command_runner: CommandRunner (for commands built atop other commands).
@@ -186,6 +187,7 @@ class Command(object):
test_method: Optional general purpose method for testing purposes.
Application and semantics of this method will vary by
command and test type.
+ bypass_prodaccess: Boolean to ignore the existance of prodaccess.
Implementation note: subclasses shouldn't need to define an __init__
method, and instead depend on the shared initialization that happens
@@ -209,6 +211,7 @@ class Command(object):
self.exclude_symlinks = False
self.recursion_requested = False
self.all_versions = False
+ self.bypass_prodaccess = bypass_prodaccess
# Process sub-command instance specifications.
# First, ensure subclass implementation sets all required keys.
@@ -343,9 +346,9 @@ class Command(object):
if os.path.isfile(acl_arg):
acl_file = open(acl_arg, 'r')
acl_arg = acl_file.read()
-
+
# TODO: Remove this workaround when GCS allows
- # whitespace in the Permission element on the server-side
+ # whitespace in the Permission element on the server-side
acl_arg = re.sub(r'<Permission>\s*(\S+)\s*</Permission>',
r'<Permission>\1</Permission>', acl_arg)
@@ -642,7 +645,7 @@ class Command(object):
def _ConfigureNoOpAuthIfNeeded(self):
"""Sets up no-op auth handler if no boto credentials are configured."""
config = boto.config
- if not util.HasConfiguredCredentials():
+ if not util.HasConfiguredCredentials(self.bypass_prodaccess):
if self.config_file_list:
if (config.has_option('Credentials', 'gs_oauth2_refresh_token')
and not HAVE_OAUTH2):
« no previous file with comments | « third_party/gsutil/README.chromium ('k') | third_party/gsutil/gslib/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698