diff options
| author | The Bundler Bot <bot@bundler.io> | 2017-06-27 21:48:42 +0000 |
|---|---|---|
| committer | The Bundler Bot <bot@bundler.io> | 2017-06-27 21:48:42 +0000 |
| commit | 87352ed7b1891cab8314f2b5c7e64edac1bb822b (patch) | |
| tree | cc5f20b8dfc1767a55a3861c4178f08d7412371f /lib/bundler/feature_flag.rb | |
| parent | ff4a522e8e75eb4ce5675a99698fb3df23b680be (diff) | |
| parent | 4dcd33379bdf203493f4ecbd28c04e519a8eab3d (diff) | |
| download | bundler-87352ed7b1891cab8314f2b5c7e64edac1bb822b.tar.gz | |
Auto merge of #5792 - bundler:seg-remove-rubygems-aggregate, r=segiddins
[2.0] Remove RubyGems Aggregate & support transitive source pinning
### What was the end-user problem that led to this PR?
The problem was that the resolver could resolve specs from _any_ of the sources specified in the Gemfile, even if that source had nothing to do with the spec in question. This was such a large security vulnerability that, when discovered, it warranted a CVE and its own minor release of Bundler.
Closes #3671.
Closes #3696.
Closes #4059.
### Was was your diagnosis of the problem?
My diagnosis was that we needed to get rid of the notion of a `rubygems aggregate` and enforce that specs could only come either from the source they were declared to come from (the top-level source if declared at the top-level of the Gemfile, else a scoped source), or a source that it transitively "inherited" from the gems that required it.
### What is your fix for the problem, implemented in this PR?
My fix is to disable multiple top-level sources in the Gemfile, remove the RubyGems aggregate, and filter the sources gems could come from as described above.
### Why did you choose this fix out of the possible options?
I chose this fix because it allows doing the filtering in a reasonably performant manner, and refactors the way we handle sources to abstract some of the grossness in such a way that the machinations to make sure that all of the necessary gem info is downloaded is encapsulated into a single method, driven from the definition, rather than being specific to rubygems sources.
See https://github.com/bundler/bundler/pull/4714 and https://github.com/bundler/bundler/pull/4930 for the prior implementation.
Diffstat (limited to 'lib/bundler/feature_flag.rb')
| -rw-r--r-- | lib/bundler/feature_flag.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index b2b1ef3f99..4ba1780cee 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -28,9 +28,11 @@ module Bundler settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? } settings_flag(:allow_offline_install) { bundler_2_mode? } + settings_flag(:disable_multisource) { bundler_2_mode? } settings_flag(:error_on_stderr) { bundler_2_mode? } settings_flag(:global_gem_cache) { bundler_2_mode? } settings_flag(:init_gems_rb) { bundler_2_mode? } + settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? } settings_flag(:only_update_to_newer_versions) { bundler_2_mode? } settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") } settings_flag(:prefer_gems_rb) { bundler_2_mode? } |
