Skip to content

Commit da9aaa6

Browse files
committed
Hide user password
Override the is_to_s and should_to_s methods in the puppet property to make sure it's not shown in outputs. Closes: #839
1 parent 77b0033 commit da9aaa6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/puppet/type/rabbitmq_user.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ def insync?(_is)
4646
def change_to_s(_current, _desired)
4747
'password has been changed'
4848
end
49+
50+
# rubocop:disable Style/PredicateName
51+
def is_to_s(_value)
52+
'[old password redacted]'
53+
end
54+
# rubocop:enable Style/PredicateName
55+
56+
def should_to_s(_value)
57+
'[new password redacted]'
58+
end
4959
end
5060

5161
newproperty(:admin) do

0 commit comments

Comments
 (0)