diff --git a/README.md b/README.md index abf7d47fe..bfd7dc369 100644 --- a/README.md +++ b/README.md @@ -310,19 +310,19 @@ omnibus manifest PROJECT -l warn This will output a JSON-formatted manifest containing the resolved version of every software definition. -## Whitelisting Libraries +## Allowing/Ignoring Libraries -Sometimes a platform has libraries that need to be whitelisted so the healthcheck can pass. The whitelist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms. +Sometimes a platform has libraries that need to be allowed so the healthcheck can pass. The allowlist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms. -To add your own whitelisted library, simply add a regex to your software definition in your omnibus project as follows: +To add your own allowed library, simply add a regex to your software definition in your omnibus project as follows: ``` -whitelist_file /libpcrecpp\.so\..+/ +allow_file /libpcrecpp\.so\..+/ ``` -It is typically a good idea to add a conditional to whitelist based on the specific platform that requires it. +It is typically a good idea to add a conditional to allowlist based on the specific platform that requires it. -_Warning: You should only add libraries to the whitelist that are guaranteed to be on the system you install to; if a library comes from a non-default package you should instead build it into the package._ +_Warning: You should only add libraries to the allowlist that are guaranteed to be on the system you install to; if a library comes from a non-default package you should instead build it into the package._ ## Changelog diff --git a/lib/omnibus/health_check.rb b/lib/omnibus/health_check.rb index eefa9fc4d..cc18afada 100644 --- a/lib/omnibus/health_check.rb +++ b/lib/omnibus/health_check.rb @@ -384,9 +384,9 @@ def hex # # @return [Array] # - def whitelist_files + def allow_files project.library.components.inject([]) do |array, component| - array += component.whitelist_files + array += component.allow_files array end end @@ -446,7 +446,7 @@ def check_for_bad_library(bad_libs, current_library, name, linked) safe ||= true if reg.match(name) end - whitelist_files.each do |reg| + allow_files.each do |reg| safe ||= true if reg.match(current_library) end diff --git a/lib/omnibus/software.rb b/lib/omnibus/software.rb index aef6f747b..e123fce26 100644 --- a/lib/omnibus/software.rb +++ b/lib/omnibus/software.rb @@ -540,7 +540,7 @@ def version(val = NULL, &block) # Add a file to the healthcheck allowlist. # # @example - # whitelist_file '/path/to/file' + # allow_file '/path/to/file' # # @param [String, Regexp] file # the name of a file to ignore in the healthcheck @@ -548,12 +548,12 @@ def version(val = NULL, &block) # @return [Array] # the list of currently allowed files # - def whitelist_file(file) + def allow_file(file) file = Regexp.new(file) unless file.is_a?(Regexp) - whitelist_files << file - whitelist_files.dup + allow_files << file + allow_files.dup end - expose :whitelist_file + expose :allow_file # # The path relative to fetch_dir where relevant project files are @@ -926,8 +926,8 @@ def dependencies # # @return [Array] # - def whitelist_files - @whitelist_files ||= [] + def allow_files + @allow_files ||= [] end # diff --git a/spec/unit/software_spec.rb b/spec/unit/software_spec.rb index b544f449a..1a08c5b38 100644 --- a/spec/unit/software_spec.rb +++ b/spec/unit/software_spec.rb @@ -43,7 +43,7 @@ module Omnibus it_behaves_like "a cleanroom setter", :license_file, %{license_file 'LICENSES/artistic.txt'} it_behaves_like "a cleanroom setter", :skip_transitive_dependency_licensing, %{skip_transitive_dependency_licensing true} it_behaves_like "a cleanroom setter", :dependency_licenses, %{dependency_licenses [{license: "MIT"}]} - it_behaves_like "a cleanroom setter", :whitelist_file, %{whitelist_file '/opt/whatever'} + it_behaves_like "a cleanroom setter", :allow_file, %{allow_file '/opt/whatever'} it_behaves_like "a cleanroom setter", :relative_path, %{relative_path '/path/to/extracted'} it_behaves_like "a cleanroom setter", :build, %|build {}| it_behaves_like "a cleanroom getter", :project_dir @@ -453,17 +453,17 @@ module Omnibus end end - describe "#whitelist_file" do - it "appends to the whitelist_files array" do - expect(subject.whitelist_files.size).to eq(0) - subject.whitelist_file(%r{foo/bar}) - expect(subject.whitelist_files.size).to eq(1) + describe "#allow_file" do + it "appends to the allow_files array" do + expect(subject.allow_files.size).to eq(0) + subject.allow_file(%r{foo/bar}) + expect(subject.allow_files.size).to eq(1) end it "converts Strings to Regexp instances" do - subject.whitelist_file "foo/bar" - expect(subject.whitelist_files.size).to eq(1) - expect(subject.whitelist_files.first).to be_kind_of(Regexp) + subject.allow_file "foo/bar" + expect(subject.allow_files.size).to eq(1) + expect(subject.allow_files.first).to be_kind_of(Regexp) end end