| Index: third_party/gsutil/gsutil
|
| diff --git a/third_party/gsutil/gsutil b/third_party/gsutil/gsutil
|
| index aca0c7809409cdc81749b558dc1418b667885541..537765303d43ca7ee14d6194bef2bc24c8644c58 100755
|
| --- a/third_party/gsutil/gsutil
|
| +++ b/third_party/gsutil/gsutil
|
| @@ -101,6 +101,7 @@ try:
|
| from oauth2_plugin import oauth2_plugin
|
| except ImportError:
|
| pass
|
| +import plugins.sso_auth
|
|
|
|
|
| def main():
|
| @@ -109,6 +110,7 @@ def main():
|
| if sys.version_info[:3] < (2, 6):
|
| raise CommandException('gsutil requires Python 2.6 or higher.')
|
|
|
| + bypass_prodaccess = False
|
| config_file_list = _GetBotoConfigFileList()
|
| command_runner = CommandRunner(gsutil_bin_dir, boto_lib_dir, config_file_list,
|
| gsutil_ver)
|
| @@ -155,6 +157,8 @@ def main():
|
| headers[hdr_name] = hdr_val
|
| if o in ('-m', '--multithreaded'):
|
| parallel_operations = True
|
| + if o in ('-b', '--bypass_prodaccess'):
|
| + bypass_prodaccess = True
|
| if debug > 1:
|
| sys.stderr.write(
|
| '***************************** WARNING *****************************\n'
|
| @@ -188,7 +192,8 @@ def main():
|
|
|
| return _RunNamedCommandAndHandleExceptions(command_runner, command_name,
|
| args[1:], headers, debug,
|
| - parallel_operations)
|
| + parallel_operations,
|
| + bypass_prodaccess)
|
|
|
|
|
| def _GetBotoConfigFileList():
|
| @@ -244,7 +249,8 @@ def _HandleSigQuit(signal_num, cur_stack_frame):
|
|
|
| def _RunNamedCommandAndHandleExceptions(command_runner, command_name, args=None,
|
| headers=None, debug=0,
|
| - parallel_operations=False):
|
| + parallel_operations=False,
|
| + bypass_prodaccess=False):
|
| try:
|
| # Catch ^C so we can print a brief message instead of the normal Python
|
| # stack trace.
|
| @@ -283,7 +289,7 @@ def _RunNamedCommandAndHandleExceptions(command_runner, command_name, args=None,
|
| # config file (who might previously have been using gsutil only for
|
| # accessing publicly readable buckets and objects).
|
| if e.status == 403:
|
| - if not HasConfiguredCredentials():
|
| + if not HasConfiguredCredentials(bypass_prodaccess):
|
| _OutputAndExit(
|
| 'You are attempting to access protected data with no configured '
|
| 'credentials.\nPlease see '
|
|
|