Skip to content

Commit 89708eb

Browse files
committed
keep old comment
1 parent 7229421 commit 89708eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/puppet/provider/base_dsc_lite/powershell.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ def self.escape_quotes(text)
5353
end
5454

5555
def self.redact_content(content)
56-
# Redact Sensitive unwraps that appear as "'secret' # PuppetSensitive"
56+
# Note that here we match after an equals to ensure we redact the value being passed, but not the key.
57+
# This means a redaction of a string not including '= ' before the string value will not redact.
58+
# Every secret unwrapped in this module will unwrap as "'secret' # PuppetSensitive" and, currently,
59+
# always inside a hash table to be passed along. This means we can (currently) expect the value to
60+
# always come after an equals sign.
61+
# Note that the line may include a semi-colon and/or a newline character after the sensitive unwrap.
5762
content.gsub(%r{= '.+' # PuppetSensitive;?(\\n)?$}, "= '[REDACTED]'")
5863
end
5964

0 commit comments

Comments
 (0)