libv8 5.3.332.38.5 → 5.6.326.50.0beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +2 -0
- data/ext/libv8/builder.rb +2 -2
- data/lib/libv8/version.rb +1 -1
- data/patches/0001-Build-a-standalone-static-library.patch +4 -4
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
- data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
- data/vendor/depot_tools/.gitignore +4 -0
- data/vendor/depot_tools/OWNERS +0 -2
- data/vendor/depot_tools/PRESUBMIT.py +20 -23
- data/vendor/depot_tools/README.gclient.md +3 -3
- data/vendor/depot_tools/README.git-cl.md +13 -12
- data/vendor/depot_tools/README.md +2 -3
- data/vendor/depot_tools/WATCHLISTS +0 -1
- data/vendor/depot_tools/appengine_mapper.py +23 -0
- data/vendor/depot_tools/apply_issue.py +2 -8
- data/vendor/depot_tools/bootstrap/win/README.md +1 -8
- data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
- data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/checkout.py +20 -433
- data/vendor/depot_tools/cipd +73 -0
- data/vendor/depot_tools/cipd.bat +12 -0
- data/vendor/depot_tools/cipd.ps1 +57 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/clang_format.py +9 -6
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
- data/vendor/depot_tools/codereview.settings +3 -2
- data/vendor/depot_tools/commit_queue.py +1 -1
- data/vendor/depot_tools/cpplint.py +2 -0
- data/vendor/depot_tools/fetch.py +1 -54
- data/vendor/depot_tools/fetch_configs/android.py +2 -2
- data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
- data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
- data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
- data/vendor/depot_tools/fetch_configs/dart.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
- data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
- data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
- data/vendor/depot_tools/fetch_configs/infra.py +2 -2
- data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
- data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
- data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
- data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
- data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
- data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
- data/vendor/depot_tools/fetch_configs/v8.py +2 -3
- data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
- data/vendor/depot_tools/fix_encoding.py +6 -6
- data/vendor/depot_tools/gclient.py +136 -368
- data/vendor/depot_tools/gclient_scm.py +108 -647
- data/vendor/depot_tools/gclient_utils.py +22 -86
- data/vendor/depot_tools/gerrit_client.py +105 -0
- data/vendor/depot_tools/gerrit_util.py +174 -67
- data/vendor/depot_tools/git-crrev-parse +6 -7
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git_cache.py +68 -18
- data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
- data/vendor/depot_tools/git_cl.py +1028 -961
- data/vendor/depot_tools/git_common.py +2 -3
- data/vendor/depot_tools/git_drover.py +0 -1
- data/vendor/depot_tools/git_footers.py +3 -43
- data/vendor/depot_tools/git_rebase_update.py +9 -1
- data/vendor/depot_tools/git_squash_branch.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +8 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +3 -11
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
- data/vendor/depot_tools/man/html/git-drover.html +17 -17
- data/vendor/depot_tools/man/html/git-footers.html +2 -2
- data/vendor/depot_tools/man/html/git-freeze.html +4 -4
- data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +2 -2
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
- data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-retry.html +3 -3
- data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
- data/vendor/depot_tools/man/html/git-thaw.html +2 -2
- data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
- data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
- data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map.1 +4 -4
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
- data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
- data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
- data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
- data/vendor/depot_tools/man/src/git-retry.txt +1 -1
- data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
- data/vendor/depot_tools/my_activity.py +6 -3
- data/vendor/depot_tools/my_reviews.py +1 -1
- data/vendor/depot_tools/ninja +2 -2
- data/vendor/depot_tools/ninja-linux32 +0 -0
- data/vendor/depot_tools/ninja-linux64 +0 -0
- data/vendor/depot_tools/ninja-mac +0 -0
- data/vendor/depot_tools/ninja.exe +0 -0
- data/vendor/depot_tools/owners.py +14 -3
- data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
- data/vendor/depot_tools/presubmit_support.py +109 -371
- data/vendor/depot_tools/pylintrc +83 -56
- data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
- data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
- data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
- data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
- data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
- data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
- data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
- data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
- data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
- data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
- data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
- data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
- data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
- data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
- data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
- data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
- data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
- data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
- data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
- data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
- data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
- data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
- data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
- data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
- data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
- data/vendor/depot_tools/recipes.py +52 -28
- data/vendor/depot_tools/repo +216 -69
- data/vendor/depot_tools/rietveld.py +20 -15
- data/vendor/depot_tools/roll_dep.py +1 -1
- data/vendor/depot_tools/scm.py +11 -826
- data/vendor/depot_tools/subprocess2.py +5 -5
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
- data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
- data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
- data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
- data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
- data/vendor/depot_tools/third_party/upload.py +44 -24
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
- metadata +38 -93
- data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
- data/vendor/depot_tools/git-auto-svn +0 -6
- data/vendor/depot_tools/git_auto_svn.py +0 -122
- data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
- data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
- data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
- data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
- data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
- data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
- data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
- data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
- data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
- data/vendor/depot_tools/third_party/gsutil/README +0 -38
- data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
- data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
- data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
- data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
- data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
- data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
- data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
- data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
- data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
- data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
- data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
- data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
- data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
- data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
- data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
- data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
- data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
- data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
- data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
- data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
- data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
- data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -1,102 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# coding=utf8
|
3
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
|
17
|
-
"""Class that runs a named gsutil command."""
|
18
|
-
|
19
|
-
import boto
|
20
|
-
import os
|
21
|
-
|
22
|
-
from boto.storage_uri import BucketStorageUri
|
23
|
-
from gslib.command import Command
|
24
|
-
from gslib.command import COMMAND_NAME
|
25
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
26
|
-
from gslib.exception import CommandException
|
27
|
-
|
28
|
-
|
29
|
-
class CommandRunner(object):
|
30
|
-
|
31
|
-
def __init__(self, gsutil_bin_dir, boto_lib_dir, config_file_list,
|
32
|
-
gsutil_ver, bucket_storage_uri_class=BucketStorageUri):
|
33
|
-
"""
|
34
|
-
Args:
|
35
|
-
gsutil_bin_dir: Bin dir from which gsutil is running.
|
36
|
-
boto_lib_dir: Lib dir where boto runs.
|
37
|
-
config_file_list: Config file list returned by _GetBotoConfigFileList().
|
38
|
-
gsutil_ver: Version string of currently running gsutil command.
|
39
|
-
bucket_storage_uri_class: Class to instantiate for cloud StorageUris.
|
40
|
-
Settable for testing/mocking.
|
41
|
-
"""
|
42
|
-
self.gsutil_bin_dir = gsutil_bin_dir
|
43
|
-
self.boto_lib_dir = boto_lib_dir
|
44
|
-
self.config_file_list = config_file_list
|
45
|
-
self.gsutil_ver = gsutil_ver
|
46
|
-
self.bucket_storage_uri_class = bucket_storage_uri_class
|
47
|
-
self.command_map = self._LoadCommandMap()
|
48
|
-
|
49
|
-
def _LoadCommandMap(self):
|
50
|
-
"""Returns dict mapping each command_name to implementing class."""
|
51
|
-
# Walk gslib/commands and find all commands.
|
52
|
-
commands_dir = os.path.join(self.gsutil_bin_dir, 'gslib', 'commands')
|
53
|
-
for f in os.listdir(commands_dir):
|
54
|
-
# Handles no-extension files, etc.
|
55
|
-
(module_name, ext) = os.path.splitext(f)
|
56
|
-
if ext == '.py':
|
57
|
-
__import__('gslib.commands.%s' % module_name)
|
58
|
-
command_map = {}
|
59
|
-
# Only include Command subclasses in the dict.
|
60
|
-
for command in Command.__subclasses__():
|
61
|
-
command_map[command.command_spec[COMMAND_NAME]] = command
|
62
|
-
for command_name_aliases in command.command_spec[COMMAND_NAME_ALIASES]:
|
63
|
-
command_map[command_name_aliases] = command
|
64
|
-
return command_map
|
65
|
-
|
66
|
-
def RunNamedCommand(self, command_name, args=None, headers=None, debug=0,
|
67
|
-
parallel_operations=False, test_method=None,
|
68
|
-
bypass_prodaccess=True):
|
69
|
-
"""Runs the named command. Used by gsutil main, commands built atop
|
70
|
-
other commands, and tests .
|
71
|
-
|
72
|
-
Args:
|
73
|
-
command_name: The name of the command being run.
|
74
|
-
args: Command-line args (arg0 = actual arg, not command name ala bash).
|
75
|
-
headers: Dictionary containing optional HTTP headers to pass to boto.
|
76
|
-
debug: Debug level to pass in to boto connection (range 0..3).
|
77
|
-
parallel_operations: Should command operations be executed in parallel?
|
78
|
-
test_method: Optional general purpose method for testing purposes.
|
79
|
-
Application and semantics of this method will vary by
|
80
|
-
command and test type.
|
81
|
-
|
82
|
-
Raises:
|
83
|
-
CommandException: if errors encountered.
|
84
|
-
"""
|
85
|
-
if not args:
|
86
|
-
args = []
|
87
|
-
|
88
|
-
# Include api_version header in all commands.
|
89
|
-
api_version = boto.config.get_value('GSUtil', 'default_api_version', '1')
|
90
|
-
if not headers:
|
91
|
-
headers = {}
|
92
|
-
headers['x-goog-api-version'] = api_version
|
93
|
-
|
94
|
-
if command_name not in self.command_map:
|
95
|
-
raise CommandException('Invalid command "%s".' % command_name)
|
96
|
-
command_class = self.command_map[command_name]
|
97
|
-
command_inst = command_class(self, args, headers, debug,
|
98
|
-
parallel_operations, self.gsutil_bin_dir,
|
99
|
-
self.boto_lib_dir, self.config_file_list,
|
100
|
-
self.gsutil_ver, self.bucket_storage_uri_class,
|
101
|
-
test_method, bypass_prodaccess)
|
102
|
-
return command_inst.RunCommand()
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
"""Package marker file."""
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
# Copyright 2011, Nexenta Systems Inc.
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
|
16
|
-
import sys
|
17
|
-
|
18
|
-
from gslib.command import Command
|
19
|
-
from gslib.command import COMMAND_NAME
|
20
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
21
|
-
from gslib.command import CONFIG_REQUIRED
|
22
|
-
from gslib.command import FILE_URIS_OK
|
23
|
-
from gslib.command import MAX_ARGS
|
24
|
-
from gslib.command import MIN_ARGS
|
25
|
-
from gslib.command import PROVIDER_URIS_OK
|
26
|
-
from gslib.command import SUPPORTED_SUB_ARGS
|
27
|
-
from gslib.command import URIS_START_ARG
|
28
|
-
from gslib.exception import CommandException
|
29
|
-
from gslib.help_provider import HELP_NAME
|
30
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
31
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
32
|
-
from gslib.help_provider import HELP_TEXT
|
33
|
-
from gslib.help_provider import HelpType
|
34
|
-
from gslib.help_provider import HELP_TYPE
|
35
|
-
from gslib.util import NO_MAX
|
36
|
-
from gslib.wildcard_iterator import ContainsWildcard
|
37
|
-
|
38
|
-
_detailed_help_text = ("""
|
39
|
-
<B>SYNOPSIS</B>
|
40
|
-
gsutil cat [-h] uri...
|
41
|
-
|
42
|
-
|
43
|
-
<B>DESCRIPTION</B>
|
44
|
-
The cat command outputs the contents of one or more URIs to stdout.
|
45
|
-
It is equivalent to doing:
|
46
|
-
|
47
|
-
gsutil cp uri... -
|
48
|
-
|
49
|
-
(The final '-' causes gsutil to stream the output to stdout.)
|
50
|
-
|
51
|
-
|
52
|
-
<B>OPTIONS</B>
|
53
|
-
-h Prints short header for each object. For example:
|
54
|
-
gsutil cat -h gs://bucket/meeting_notes/2012_Feb/*.txt
|
55
|
-
""")
|
56
|
-
|
57
|
-
|
58
|
-
class CatCommand(Command):
|
59
|
-
"""Implementation of gsutil cat command."""
|
60
|
-
|
61
|
-
# Command specification (processed by parent class).
|
62
|
-
command_spec = {
|
63
|
-
# Name of command.
|
64
|
-
COMMAND_NAME : 'cat',
|
65
|
-
# List of command name aliases.
|
66
|
-
COMMAND_NAME_ALIASES : [],
|
67
|
-
# Min number of args required by this command.
|
68
|
-
MIN_ARGS : 0,
|
69
|
-
# Max number of args required by this command, or NO_MAX.
|
70
|
-
MAX_ARGS : NO_MAX,
|
71
|
-
# Getopt-style string specifying acceptable sub args.
|
72
|
-
SUPPORTED_SUB_ARGS : 'hv',
|
73
|
-
# True if file URIs acceptable for this command.
|
74
|
-
FILE_URIS_OK : False,
|
75
|
-
# True if provider-only URIs acceptable for this command.
|
76
|
-
PROVIDER_URIS_OK : False,
|
77
|
-
# Index in args of first URI arg.
|
78
|
-
URIS_START_ARG : 0,
|
79
|
-
# True if must configure gsutil before running command.
|
80
|
-
CONFIG_REQUIRED : True,
|
81
|
-
}
|
82
|
-
help_spec = {
|
83
|
-
# Name of command or auxiliary help info for which this help applies.
|
84
|
-
HELP_NAME : 'cat',
|
85
|
-
# List of help name aliases.
|
86
|
-
HELP_NAME_ALIASES : [],
|
87
|
-
# Type of help:
|
88
|
-
HELP_TYPE : HelpType.COMMAND_HELP,
|
89
|
-
# One line summary of this help.
|
90
|
-
HELP_ONE_LINE_SUMMARY : 'Concatenate object content to stdout',
|
91
|
-
# The full help text.
|
92
|
-
HELP_TEXT : _detailed_help_text,
|
93
|
-
}
|
94
|
-
|
95
|
-
# Command entry point.
|
96
|
-
def RunCommand(self):
|
97
|
-
show_header = False
|
98
|
-
if self.sub_opts:
|
99
|
-
for o, unused_a in self.sub_opts:
|
100
|
-
if o == '-h':
|
101
|
-
show_header = True
|
102
|
-
elif o == '-v':
|
103
|
-
self.THREADED_LOGGER.info('WARNING: The %s -v option is no longer'
|
104
|
-
' needed, and will eventually be removed.\n'
|
105
|
-
% self.command_name)
|
106
|
-
|
107
|
-
printed_one = False
|
108
|
-
# We manipulate the stdout so that all other data other than the Object
|
109
|
-
# contents go to stderr.
|
110
|
-
cat_outfd = sys.stdout
|
111
|
-
sys.stdout = sys.stderr
|
112
|
-
did_some_work = False
|
113
|
-
|
114
|
-
for uri_str in self.args:
|
115
|
-
for uri in self.WildcardIterator(uri_str).IterUris():
|
116
|
-
if not uri.names_object():
|
117
|
-
raise CommandException('"%s" command must specify objects.' %
|
118
|
-
self.command_name)
|
119
|
-
did_some_work = True
|
120
|
-
if show_header:
|
121
|
-
if printed_one:
|
122
|
-
print
|
123
|
-
print '==> %s <==' % uri.__str__()
|
124
|
-
printed_one = True
|
125
|
-
key = uri.get_key(False, self.headers)
|
126
|
-
key.get_file(cat_outfd, self.headers)
|
127
|
-
sys.stdout = cat_outfd
|
128
|
-
if not did_some_work:
|
129
|
-
raise CommandException('No URIs matched')
|
130
|
-
|
131
|
-
return 0
|
@@ -1,523 +0,0 @@
|
|
1
|
-
# Copyright 2013 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""
|
15
|
-
This module provides the chacl command to gsutil.
|
16
|
-
|
17
|
-
This command allows users to easily specify changes to access control lists.
|
18
|
-
"""
|
19
|
-
|
20
|
-
import random
|
21
|
-
import re
|
22
|
-
import time
|
23
|
-
from xml.dom import minidom
|
24
|
-
from boto.exception import GSResponseError
|
25
|
-
from boto.gs import acl
|
26
|
-
from gslib import name_expansion
|
27
|
-
from gslib.command import Command
|
28
|
-
from gslib.command import COMMAND_NAME
|
29
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
30
|
-
from gslib.command import CONFIG_REQUIRED
|
31
|
-
from gslib.command import FILE_URIS_OK
|
32
|
-
from gslib.command import MAX_ARGS
|
33
|
-
from gslib.command import MIN_ARGS
|
34
|
-
from gslib.command import PROVIDER_URIS_OK
|
35
|
-
from gslib.command import SUPPORTED_SUB_ARGS
|
36
|
-
from gslib.command import URIS_START_ARG
|
37
|
-
from gslib.exception import CommandException
|
38
|
-
from gslib.help_provider import HELP_NAME
|
39
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
40
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
41
|
-
from gslib.help_provider import HELP_TEXT
|
42
|
-
from gslib.help_provider import HELP_TYPE
|
43
|
-
from gslib.help_provider import HelpType
|
44
|
-
from gslib.util import NO_MAX
|
45
|
-
from gslib.util import Retry
|
46
|
-
|
47
|
-
|
48
|
-
class ChangeType(object):
|
49
|
-
USER = 'User'
|
50
|
-
GROUP = 'Group'
|
51
|
-
|
52
|
-
|
53
|
-
class AclChange(object):
|
54
|
-
"""Represents a logical change to an access control list."""
|
55
|
-
public_scopes = ['AllAuthenticatedUsers', 'AllUsers']
|
56
|
-
id_scopes = ['UserById', 'GroupById']
|
57
|
-
email_scopes = ['UserByEmail', 'GroupByEmail']
|
58
|
-
domain_scopes = ['GroupByDomain']
|
59
|
-
scope_types = public_scopes + id_scopes + email_scopes + domain_scopes
|
60
|
-
|
61
|
-
permission_shorthand_mapping = {
|
62
|
-
'R': 'READ',
|
63
|
-
'W': 'WRITE',
|
64
|
-
'FC': 'FULL_CONTROL',
|
65
|
-
}
|
66
|
-
|
67
|
-
def __init__(self, acl_change_descriptor, scope_type, logger):
|
68
|
-
"""Creates an AclChange object.
|
69
|
-
|
70
|
-
acl_change_descriptor: An acl change as described in chacl help.
|
71
|
-
scope_type: Either ChangeType.USER or ChangeType.GROUP, specifying the
|
72
|
-
extent of the scope.
|
73
|
-
logger: An instance of ThreadedLogger.
|
74
|
-
"""
|
75
|
-
self.logger = logger
|
76
|
-
self.identifier = ''
|
77
|
-
|
78
|
-
self.raw_descriptor = acl_change_descriptor
|
79
|
-
self._Parse(acl_change_descriptor, scope_type)
|
80
|
-
self._Validate()
|
81
|
-
|
82
|
-
def __str__(self):
|
83
|
-
return 'AclChange<{0}|{1}|{2}>'.format(self.scope_type, self.perm,
|
84
|
-
self.identifier)
|
85
|
-
|
86
|
-
def _Parse(self, change_descriptor, scope_type):
|
87
|
-
"""Parses an ACL Change descriptor."""
|
88
|
-
|
89
|
-
def _ClassifyScopeIdentifier(text):
|
90
|
-
re_map = {
|
91
|
-
'AllAuthenticatedUsers': r'^(AllAuthenticatedUsers|AllAuth)$',
|
92
|
-
'AllUsers': '^(AllUsers|All)$',
|
93
|
-
'Email': r'^.+@.+\..+$',
|
94
|
-
'Id': r'^[0-9A-Fa-f]{64}$',
|
95
|
-
'Domain': r'^[^@]+\..+$',
|
96
|
-
}
|
97
|
-
for type_string, regex in re_map.items():
|
98
|
-
if re.match(regex, text, re.IGNORECASE):
|
99
|
-
return type_string
|
100
|
-
|
101
|
-
if change_descriptor.count(':') != 1:
|
102
|
-
raise CommandException('{0} is an invalid change description.'
|
103
|
-
.format(change_descriptor))
|
104
|
-
|
105
|
-
scope_string, perm_token = change_descriptor.split(':')
|
106
|
-
|
107
|
-
perm_token = perm_token.upper()
|
108
|
-
if perm_token in self.permission_shorthand_mapping:
|
109
|
-
self.perm = self.permission_shorthand_mapping[perm_token]
|
110
|
-
else:
|
111
|
-
self.perm = perm_token
|
112
|
-
|
113
|
-
scope_class = _ClassifyScopeIdentifier(scope_string)
|
114
|
-
if scope_class == 'Domain':
|
115
|
-
# This may produce an invalid UserByDomain scope,
|
116
|
-
# which is good because then validate can complain.
|
117
|
-
self.scope_type = '{0}ByDomain'.format(scope_type)
|
118
|
-
self.identifier = scope_string
|
119
|
-
elif scope_class in ['Email', 'Id']:
|
120
|
-
self.scope_type = '{0}By{1}'.format(scope_type, scope_class)
|
121
|
-
self.identifier = scope_string
|
122
|
-
elif scope_class == 'AllAuthenticatedUsers':
|
123
|
-
self.scope_type = 'AllAuthenticatedUsers'
|
124
|
-
elif scope_class == 'AllUsers':
|
125
|
-
self.scope_type = 'AllUsers'
|
126
|
-
else:
|
127
|
-
# This is just a fallback, so we set it to something
|
128
|
-
# and the validate step has something to go on.
|
129
|
-
self.scope_type = scope_string
|
130
|
-
|
131
|
-
def _Validate(self):
|
132
|
-
"""Validates a parsed AclChange object."""
|
133
|
-
|
134
|
-
def _ThrowError(msg):
|
135
|
-
raise CommandException('{0} is not a valid ACL change\n{1}'
|
136
|
-
.format(self.raw_descriptor, msg))
|
137
|
-
|
138
|
-
if self.scope_type not in self.scope_types:
|
139
|
-
_ThrowError('{0} is not a valid scope type'.format(self.scope_type))
|
140
|
-
|
141
|
-
if self.scope_type in self.public_scopes and self.identifier:
|
142
|
-
_ThrowError('{0} requires no arguments'.format(self.scope_type))
|
143
|
-
|
144
|
-
if self.scope_type in self.id_scopes and not self.identifier:
|
145
|
-
_ThrowError('{0} requires an id'.format(self.scope_type))
|
146
|
-
|
147
|
-
if self.scope_type in self.email_scopes and not self.identifier:
|
148
|
-
_ThrowError('{0} requires an email address'.format(self.scope_type))
|
149
|
-
|
150
|
-
if self.scope_type in self.domain_scopes and not self.identifier:
|
151
|
-
_ThrowError('{0} requires domain'.format(self.scope_type))
|
152
|
-
|
153
|
-
if self.perm not in self.permission_shorthand_mapping.values():
|
154
|
-
perms = ', '.join(self.permission_shorthand_mapping.values())
|
155
|
-
_ThrowError('Allowed permissions are {0}'.format(perms))
|
156
|
-
|
157
|
-
def _YieldMatchingEntries(self, current_acl):
|
158
|
-
"""Generator that yields entries that match the change descriptor.
|
159
|
-
|
160
|
-
current_acl: An instance of bogo.gs.acl.ACL which will be searched
|
161
|
-
for matching entries.
|
162
|
-
"""
|
163
|
-
for entry in current_acl.entries.entry_list:
|
164
|
-
if entry.scope.type == self.scope_type:
|
165
|
-
if self.scope_type in ['UserById', 'GroupById']:
|
166
|
-
if self.identifier == entry.scope.id:
|
167
|
-
yield entry
|
168
|
-
elif self.scope_type in ['UserByEmail', 'GroupByEmail']:
|
169
|
-
if self.identifier == entry.scope.email_address:
|
170
|
-
yield entry
|
171
|
-
elif self.scope_type == 'GroupByDomain':
|
172
|
-
if self.identifier == entry.scope.domain:
|
173
|
-
yield entry
|
174
|
-
elif self.scope_type in ['AllUsers', 'AllAuthenticatedUsers']:
|
175
|
-
yield entry
|
176
|
-
else:
|
177
|
-
raise CommandException('Found an unrecognized ACL '
|
178
|
-
'entry type, aborting.')
|
179
|
-
|
180
|
-
def _AddEntry(self, current_acl):
|
181
|
-
"""Adds an entry to an ACL."""
|
182
|
-
if self.scope_type in ['UserById', 'UserById', 'GroupById']:
|
183
|
-
entry = acl.Entry(type=self.scope_type, permission=self.perm,
|
184
|
-
id=self.identifier)
|
185
|
-
elif self.scope_type in ['UserByEmail', 'GroupByEmail']:
|
186
|
-
entry = acl.Entry(type=self.scope_type, permission=self.perm,
|
187
|
-
email_address=self.identifier)
|
188
|
-
elif self.scope_type == 'GroupByDomain':
|
189
|
-
entry = acl.Entry(type=self.scope_type, permission=self.perm,
|
190
|
-
domain=self.identifier)
|
191
|
-
else:
|
192
|
-
entry = acl.Entry(type=self.scope_type, permission=self.perm)
|
193
|
-
|
194
|
-
current_acl.entries.entry_list.append(entry)
|
195
|
-
|
196
|
-
def Execute(self, uri, current_acl):
|
197
|
-
"""Executes the described change on an ACL.
|
198
|
-
|
199
|
-
uri: The URI object to change.
|
200
|
-
current_acl: An instance of boto.gs.acl.ACL to permute.
|
201
|
-
"""
|
202
|
-
self.logger.debug('Executing {0} on {1}'
|
203
|
-
.format(self.raw_descriptor, uri))
|
204
|
-
|
205
|
-
if self.perm == 'WRITE' and uri.names_object():
|
206
|
-
self.logger.warn(
|
207
|
-
'Skipping {0} on {1}, as WRITE does not apply to objects'
|
208
|
-
.format(self.raw_descriptor, uri))
|
209
|
-
return 0
|
210
|
-
|
211
|
-
matching_entries = list(self._YieldMatchingEntries(current_acl))
|
212
|
-
change_count = 0
|
213
|
-
if matching_entries:
|
214
|
-
for entry in matching_entries:
|
215
|
-
if entry.permission != self.perm:
|
216
|
-
entry.permission = self.perm
|
217
|
-
change_count += 1
|
218
|
-
else:
|
219
|
-
self._AddEntry(current_acl)
|
220
|
-
change_count = 1
|
221
|
-
|
222
|
-
parsed_acl = minidom.parseString(current_acl.to_xml())
|
223
|
-
self.logger.debug('New Acl:\n{0}'.format(parsed_acl.toprettyxml()))
|
224
|
-
return change_count
|
225
|
-
|
226
|
-
|
227
|
-
class AclDel(AclChange):
|
228
|
-
"""Represents a logical change from an access control list."""
|
229
|
-
scope_regexes = {
|
230
|
-
r'All(Users)?': 'AllUsers',
|
231
|
-
r'AllAuth(enticatedUsers)?': 'AllAuthenticatedUsers',
|
232
|
-
}
|
233
|
-
|
234
|
-
def __init__(self, identifier, logger):
|
235
|
-
self.raw_descriptor = '-d {0}'.format(identifier)
|
236
|
-
self.logger = logger
|
237
|
-
self.identifier = identifier
|
238
|
-
for regex, scope in self.scope_regexes.items():
|
239
|
-
if re.match(regex, self.identifier, re.IGNORECASE):
|
240
|
-
self.identifier = scope
|
241
|
-
self.scope_type = 'Any'
|
242
|
-
self.perm = 'NONE'
|
243
|
-
|
244
|
-
def _YieldMatchingEntries(self, current_acl):
|
245
|
-
for entry in current_acl.entries.entry_list:
|
246
|
-
if self.identifier == entry.scope.id:
|
247
|
-
yield entry
|
248
|
-
elif self.identifier == entry.scope.email_address:
|
249
|
-
yield entry
|
250
|
-
elif self.identifier == entry.scope.domain:
|
251
|
-
yield entry
|
252
|
-
elif self.identifier == 'AllUsers' and entry.scope.type == 'AllUsers':
|
253
|
-
yield entry
|
254
|
-
elif (self.identifier == 'AllAuthenticatedUsers'
|
255
|
-
and entry.scope.type == 'AllAuthenticatedUsers'):
|
256
|
-
yield entry
|
257
|
-
|
258
|
-
def Execute(self, uri, current_acl):
|
259
|
-
self.logger.debug('Executing {0} on {1}'
|
260
|
-
.format(self.raw_descriptor, uri))
|
261
|
-
matching_entries = list(self._YieldMatchingEntries(current_acl))
|
262
|
-
for entry in matching_entries:
|
263
|
-
current_acl.entries.entry_list.remove(entry)
|
264
|
-
parsed_acl = minidom.parseString(current_acl.to_xml())
|
265
|
-
self.logger.debug('New Acl:\n{0}'.format(parsed_acl.toprettyxml()))
|
266
|
-
return len(matching_entries)
|
267
|
-
|
268
|
-
|
269
|
-
_detailed_help_text = ("""
|
270
|
-
<B>SYNOPSIS</B>
|
271
|
-
gsutil chacl [-R] -u|-g|-d <grant>... uri...
|
272
|
-
|
273
|
-
where each <grant> is one of the following forms:
|
274
|
-
-u <id|email>:<perm>
|
275
|
-
-g <id|email|domain|All|AllAuth>:<perm>
|
276
|
-
-d <id|email|domain|All|AllAuth>
|
277
|
-
|
278
|
-
<B>DESCRIPTION</B>
|
279
|
-
The chacl command updates access control lists, similar in spirit to the Linux
|
280
|
-
chmod command. You can specify multiple access grant additions and deletions
|
281
|
-
in a single command run; all changes will be made atomically to each object in
|
282
|
-
turn. For example, if the command requests deleting one grant and adding a
|
283
|
-
different grant, the ACLs being updated will never be left in an intermediate
|
284
|
-
state where one grant has been deleted but the second grant not yet added.
|
285
|
-
Each change specifies a user or group grant to add or delete, and for grant
|
286
|
-
additions, one of R, W, FC (for the permission to be granted). A more formal
|
287
|
-
description is provided in a later section; below we provide examples.
|
288
|
-
|
289
|
-
Note: If you want to set a simple "canned" ACL on each object (such as
|
290
|
-
project-private or public), or if you prefer to edit the XML representation
|
291
|
-
for ACLs, you can do that with the setacl command (see 'gsutil help setacl').
|
292
|
-
|
293
|
-
|
294
|
-
<B>EXAMPLES</B>
|
295
|
-
|
296
|
-
Grant the user john.doe@example.com WRITE access to the bucket
|
297
|
-
example-bucket:
|
298
|
-
|
299
|
-
gsutil chacl -u john.doe@example.com:WRITE gs://example-bucket
|
300
|
-
|
301
|
-
Grant the group admins@example.com FULL_CONTROL access to all jpg files in
|
302
|
-
the top level of example-bucket:
|
303
|
-
|
304
|
-
gsutil chacl -g admins@example.com:FC gs://example-bucket/*.jpg
|
305
|
-
|
306
|
-
Grant the user with the specified canonical ID READ access to all objects in
|
307
|
-
example-bucket that begin with folder/:
|
308
|
-
|
309
|
-
gsutil chacl -R \\
|
310
|
-
-u 84fac329bceSAMPLE777d5d22b8SAMPLE77d85ac2SAMPLE2dfcf7c4adf34da46:R \\
|
311
|
-
gs://example-bucket/folder/
|
312
|
-
|
313
|
-
Grant all users from my-domain.org READ access to the bucket
|
314
|
-
gcs.my-domain.org:
|
315
|
-
|
316
|
-
gsutil chacl -g my-domain.org:R gs://gcs.my-domain.org
|
317
|
-
|
318
|
-
Remove any current access by john.doe@example.com from the bucket
|
319
|
-
example-bucket:
|
320
|
-
|
321
|
-
gsutil chacl -d john.doe@example.com gs://example-bucket
|
322
|
-
|
323
|
-
If you have a large number of objects to update, enabling multi-threading with
|
324
|
-
the gsutil -m flag can significantly improve performance. The following
|
325
|
-
command adds FULL_CONTROL for admin@example.org using multi-threading:
|
326
|
-
|
327
|
-
gsutil -m chacl -R -u admin@example.org:FC gs://example-bucket
|
328
|
-
|
329
|
-
Grant READ access to everyone from my-domain.org and to all authenticated
|
330
|
-
users, and grant FULL_CONTROL to admin@mydomain.org, for the buckets
|
331
|
-
my-bucket and my-other-bucket, with multi-threading enabled:
|
332
|
-
|
333
|
-
gsutil -m chacl -R -g my-domain.org:R -g AllAuth:R \\
|
334
|
-
-u admin@mydomain.org:FC gs://my-bucket/ gs://my-other-bucket
|
335
|
-
|
336
|
-
|
337
|
-
<B>SCOPES</B>
|
338
|
-
There are four different scopes: Users, Groups, All Authenticated Users, and
|
339
|
-
All Users.
|
340
|
-
|
341
|
-
Users are added with -u and a plain ID or email address, as in
|
342
|
-
"-u john-doe@gmail.com:r"
|
343
|
-
|
344
|
-
Groups are like users, but specified with the -g flag, as in
|
345
|
-
"-g power-users@example.com:fc". Groups may also be specified as a full
|
346
|
-
domain, as in "-g my-company.com:r".
|
347
|
-
|
348
|
-
AllAuthenticatedUsers and AllUsers are specified directly, as
|
349
|
-
in "-g AllUsers:R" or "-g AllAuthenticatedUsers:FC". These are case
|
350
|
-
insensitive, and may be shortened to "all" and "allauth", respectively.
|
351
|
-
|
352
|
-
Removing permissions is specified with the -d flag and an ID, email
|
353
|
-
address, domain, or one of AllUsers or AllAuthenticatedUsers.
|
354
|
-
|
355
|
-
Many scopes can be specified on the same command line, allowing bundled
|
356
|
-
changes to be executed in a single run. This will reduce the number of
|
357
|
-
requests made to the server.
|
358
|
-
|
359
|
-
|
360
|
-
<B>PERMISSIONS</B>
|
361
|
-
You may specify the following permissions with either their shorthand or
|
362
|
-
their full name:
|
363
|
-
|
364
|
-
R: READ
|
365
|
-
W: WRITE
|
366
|
-
FC: FULL_CONTROL
|
367
|
-
|
368
|
-
|
369
|
-
<B>OPTIONS</B>
|
370
|
-
-R, -r Performs chacl request recursively, to all objects under the
|
371
|
-
specified URI.
|
372
|
-
|
373
|
-
-u Add or modify a user permission as specified in the SCOPES
|
374
|
-
and PERMISSIONS sections.
|
375
|
-
|
376
|
-
-g Add or modify a group permission as specified in the SCOPES
|
377
|
-
and PERMISSIONS sections.
|
378
|
-
|
379
|
-
-d Remove all permissions associated with the matching argument, as
|
380
|
-
specified in the SCOPES and PERMISSIONS sections.
|
381
|
-
""")
|
382
|
-
|
383
|
-
|
384
|
-
class ChAclCommand(Command):
|
385
|
-
"""Implementation of gsutil chacl command."""
|
386
|
-
|
387
|
-
# Command specification (processed by parent class).
|
388
|
-
command_spec = {
|
389
|
-
# Name of command.
|
390
|
-
COMMAND_NAME : 'chacl',
|
391
|
-
# List of command name aliases.
|
392
|
-
COMMAND_NAME_ALIASES : [],
|
393
|
-
# Min number of args required by this command.
|
394
|
-
MIN_ARGS : 1,
|
395
|
-
# Max number of args required by this command, or NO_MAX.
|
396
|
-
MAX_ARGS : NO_MAX,
|
397
|
-
# Getopt-style string specifying acceptable sub args.
|
398
|
-
SUPPORTED_SUB_ARGS : 'Rrfg:u:d:',
|
399
|
-
# True if file URIs acceptable for this command.
|
400
|
-
FILE_URIS_OK : False,
|
401
|
-
# True if provider-only URIs acceptable for this command.
|
402
|
-
PROVIDER_URIS_OK : False,
|
403
|
-
# Index in args of first URI arg.
|
404
|
-
URIS_START_ARG : 1,
|
405
|
-
# True if must configure gsutil before running command.
|
406
|
-
CONFIG_REQUIRED : True,
|
407
|
-
}
|
408
|
-
help_spec = {
|
409
|
-
# Name of command or auxiliary help info for which this help applies.
|
410
|
-
HELP_NAME : 'chacl',
|
411
|
-
# List of help name aliases.
|
412
|
-
HELP_NAME_ALIASES : ['chmod'],
|
413
|
-
# Type of help:
|
414
|
-
HELP_TYPE : HelpType.COMMAND_HELP,
|
415
|
-
# One line summary of this help.
|
416
|
-
HELP_ONE_LINE_SUMMARY : 'Add / remove entries on bucket and/or object ACLs',
|
417
|
-
# The full help text.
|
418
|
-
HELP_TEXT : _detailed_help_text,
|
419
|
-
}
|
420
|
-
|
421
|
-
# Command entry point.
|
422
|
-
def RunCommand(self):
|
423
|
-
"""This is the point of entry for the chacl command."""
|
424
|
-
self.parse_versions = True
|
425
|
-
self.changes = []
|
426
|
-
|
427
|
-
if self.sub_opts:
|
428
|
-
for o, a in self.sub_opts:
|
429
|
-
if o == '-g':
|
430
|
-
self.changes.append(AclChange(a, scope_type=ChangeType.GROUP,
|
431
|
-
logger=self.THREADED_LOGGER))
|
432
|
-
if o == '-u':
|
433
|
-
self.changes.append(AclChange(a, scope_type=ChangeType.USER,
|
434
|
-
logger=self.THREADED_LOGGER))
|
435
|
-
if o == '-d':
|
436
|
-
self.changes.append(AclDel(a, logger=self.THREADED_LOGGER))
|
437
|
-
|
438
|
-
if not self.changes:
|
439
|
-
raise CommandException(
|
440
|
-
'Please specify at least one access change '
|
441
|
-
'with the -g, -u, or -d flags')
|
442
|
-
|
443
|
-
storage_uri = self.UrisAreForSingleProvider(self.args)
|
444
|
-
if not (storage_uri and storage_uri.get_provider().name == 'google'):
|
445
|
-
raise CommandException('The "{0}" command can only be used with gs:// URIs'
|
446
|
-
.format(self.command_name))
|
447
|
-
|
448
|
-
bulk_uris = set()
|
449
|
-
for uri_arg in self.args:
|
450
|
-
for result in self.WildcardIterator(uri_arg):
|
451
|
-
uri = result.uri
|
452
|
-
if uri.names_bucket():
|
453
|
-
if self.recursion_requested:
|
454
|
-
bulk_uris.add(uri.clone_replace_name('*').uri)
|
455
|
-
else:
|
456
|
-
# If applying to a bucket directly, the threading machinery will
|
457
|
-
# break, so we have to apply now, in the main thread.
|
458
|
-
self.ApplyAclChanges(uri)
|
459
|
-
else:
|
460
|
-
bulk_uris.add(uri_arg)
|
461
|
-
|
462
|
-
try:
|
463
|
-
name_expansion_iterator = name_expansion.NameExpansionIterator(
|
464
|
-
self.command_name, self.proj_id_handler, self.headers, self.debug,
|
465
|
-
self.bucket_storage_uri_class, bulk_uris, self.recursion_requested)
|
466
|
-
except CommandException as e:
|
467
|
-
# NameExpansionIterator will complain if there are no URIs, but we don't
|
468
|
-
# want to throw an error if we handled bucket URIs.
|
469
|
-
if e.reason == 'No URIs matched':
|
470
|
-
return 0
|
471
|
-
else:
|
472
|
-
raise e
|
473
|
-
|
474
|
-
self.everything_set_okay = True
|
475
|
-
self.Apply(self.ApplyAclChanges,
|
476
|
-
name_expansion_iterator,
|
477
|
-
self._ApplyExceptionHandler)
|
478
|
-
if not self.everything_set_okay:
|
479
|
-
raise CommandException('ACLs for some objects could not be set.')
|
480
|
-
|
481
|
-
return 0
|
482
|
-
|
483
|
-
def _ApplyExceptionHandler(self, exception):
|
484
|
-
self.THREADED_LOGGER.error('Encountered a problem: {0}'.format(exception))
|
485
|
-
self.everything_set_okay = False
|
486
|
-
|
487
|
-
@Retry(GSResponseError, tries=3, delay=1, backoff=2)
|
488
|
-
def ApplyAclChanges(self, uri_or_expansion_result):
|
489
|
-
"""Applies the changes in self.changes to the provided URI."""
|
490
|
-
if isinstance(uri_or_expansion_result, name_expansion.NameExpansionResult):
|
491
|
-
uri = self.suri_builder.StorageUri(
|
492
|
-
uri_or_expansion_result.expanded_uri_str)
|
493
|
-
else:
|
494
|
-
uri = uri_or_expansion_result
|
495
|
-
|
496
|
-
try:
|
497
|
-
current_acl = uri.get_acl()
|
498
|
-
except GSResponseError as e:
|
499
|
-
self.THREADED_LOGGER.warning('Failed to set acl for {0}: {1}'
|
500
|
-
.format(uri, e.reason))
|
501
|
-
return
|
502
|
-
|
503
|
-
modification_count = 0
|
504
|
-
for change in self.changes:
|
505
|
-
modification_count += change.Execute(uri, current_acl)
|
506
|
-
if modification_count == 0:
|
507
|
-
self.THREADED_LOGGER.info('No changes to {0}'.format(uri))
|
508
|
-
return
|
509
|
-
|
510
|
-
# TODO: Remove the concept of forcing when boto provides access to
|
511
|
-
# bucket generation and meta_generation.
|
512
|
-
headers = dict(self.headers)
|
513
|
-
force = uri.names_bucket()
|
514
|
-
if not force:
|
515
|
-
key = uri.get_key()
|
516
|
-
headers['x-goog-if-generation-match'] = key.generation
|
517
|
-
headers['x-goog-if-metageneration-match'] = key.meta_generation
|
518
|
-
|
519
|
-
# If this fails because of a precondition, it will raise a
|
520
|
-
# GSResponseError for @Retry to handle.
|
521
|
-
uri.set_acl(current_acl, uri.object_name, False, headers)
|
522
|
-
self.THREADED_LOGGER.info('Updated ACL on {0}'.format(uri))
|
523
|
-
|