Skip to content

Commit c9b4d0c

Browse files
author
Cocker Koch
committed
Fix "password" as Property
Having "password" defined with newparam, any Content of Type Sensitive will lead to "Unable to mark 'password' as sensitive: password is a parameter and not a property, and cannot be automatically redacted." In Fact "password" (as well as others) should be a Property. (compare https://puppet.com/docs/puppet/7/custom_types.html#tandp_properties_and_parameters)
1 parent b9d6405 commit c9b4d0c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Diff for: lib/puppet/type/java_ks.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def insync?(is)
100100
from a file separate from the server certificate. This will autorequire the specified file.'
101101
end
102102

103-
newparam(:password) do
103+
newproperty(:password) do
104104
desc 'The password used to protect the keystore. If private keys are
105105
subsequently also protected this password will be used to attempt
106106
unlocking. Must be six or more characters in length. Cannot be used

Diff for: pdk.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
ignore: []

Diff for: spec/unit/puppet/type/java_ks_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
end
3939

4040
describe 'when validating attributes' do
41-
[:name, :target, :private_key, :private_key_type, :certificate, :password, :password_file, :trustcacerts, :destkeypass, :password_fail_reset, :source_password].each do |param|
41+
[:name, :target, :private_key, :private_key_type, :certificate, :password_file, :trustcacerts, :destkeypass, :password_fail_reset, :source_password].each do |param|
4242
it "has a #{param} parameter" do
4343
expect(described_class.attrtype(param)).to eq(:param)
4444
end
4545
end
4646

47-
[:ensure].each do |prop|
47+
[:ensure, :password].each do |prop|
4848
it "has a #{prop} property" do
4949
expect(described_class.attrtype(prop)).to eq(:property)
5050
end

0 commit comments

Comments
 (0)