summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shestoperov <dmitry@shestoperov.info>2017-09-26 21:29:08 -0400
committerDmitry Shestoperov <dmitry@shestoperov.info>2017-09-26 21:29:08 -0400
commit48031f02cfe9aec08ab0e783b658da89060f05c3 (patch)
tree333d46c75bcfc4027f81d52a2714dce3d7fe2c30
parent8242ac9f65f841030ba4a3cc3cc91a8208b3c4f8 (diff)
downloadchef-48031f02cfe9aec08ab0e783b658da89060f05c3.tar.gz
Revert "sensitive? returns true by default for password property"
This reverts commit 8242ac9f65f841030ba4a3cc3cc91a8208b3c4f8. Signed-off-by: Dmitry Shestoperov <dmitry@shestoperov.info>
-rw-r--r--lib/chef/property.rb6
-rw-r--r--spec/unit/property_spec.rb14
-rw-r--r--spec/unit/resource/mount_spec.rb2
3 files changed, 2 insertions, 20 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index e258498189..a72e41a61e 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -242,11 +242,7 @@ class Chef
# @return [Boolean]
#
def sensitive?
- if name == :password
- options.fetch(:sensitive, true)
- else
- options.fetch(:sensitive, false)
- end
+ options.fetch(:sensitive, false)
end
#
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index 510b0f94d7..b8cf7f5d1b 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -118,20 +118,6 @@ describe "Chef::Resource.property" do
end
end
- with_property ":password, String" do
- it "password is sensitive by default" do
- expect(resource.password "Jetstream123!").to eql("Jetstream123!")
- expect(resource.state_for_resource_reporter[:password]).to eql("*sensitive value suppressed*")
- end
- end
-
- with_property ":password, String, sensitive: false" do
- it "password is no longer sensitive" do
- expect(resource.password "Jetstream123!").to eql("Jetstream123!")
- expect(resource.state_for_resource_reporter[:password]).to eql("Jetstream123!")
- end
- end
-
with_property ":x, name_property: true" do
context "and subclass" do
let(:subresource_class) do
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index caa2e2f65a..466b6ac8c0 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -205,7 +205,7 @@ describe Chef::Resource::Mount do
state = @resource.state_for_resource_reporter
expect(state[:mount_point]).to eq("T:")
expect(state[:username]).to eq("Administrator")
- expect(state[:password]).to eq("*sensitive value suppressed*")
+ expect(state[:password]).to eq("Jetstream123!")
expect(state[:domain]).to eq("TEST_DOMAIN")
expect(state[:device_type]).to eql(:device)
expect(state[:fstype]).to eq("auto")