-
Notifications
You must be signed in to change notification settings - Fork 612
Prevent nested sensitive wrap of password alter query #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent nested sensitive wrap of password alter query #1418
Conversation
postgresql::server::role is a typeBreaking changes to this file WILL impact these 22 modules (exact match):
Breaking changes to this file MAY impact these 6 modules (near match):This module is declared in 70 of 580 indexed public
|
Thanks for the heads-up. Somehow I did miss the existing Issue and PR - sorry for that. I've cherry-picked the tests from #1404 to this PR. |
Broken tests for RHEL9 and SLES15 seem to be infrastructure related... |
Sry to be the party popper but make it even sense to call the That is why in #1404 i just turned the sensitive return of the value off:
This also means that the unwrap for the Deferred is not needed in this change because the function already returns a not sensitive value.puppetlabs-postgresql/lib/puppet/functions/postgresql/postgresql_password.rb Lines 39 to 43 in 83be16e
|
I guess both ways are valid and it's mostly personal preference. However, I do prefer unwrapping in Puppet, as passing in a Sensitive also returns a Sensitive in this case - so the function itself does not change the datatype. |
I've merged #1404 because it was a quick fix, but I still wouldn't mind merging this. If you're still interested in this then please rebase. |
Rebased this MR against current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused. Can you provide a non-working unit test that this change fix?
I feel like this got fixed by accident while fixing other misbehavior.
@@ -160,7 +160,7 @@ | |||
$hash, | |||
$salt, | |||
] | |||
) | |||
).unwrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3rd arguments should prevent the return value from being a Sensitive, so this should be noop.
@@ -169,7 +169,7 @@ | |||
false, | |||
$hash, | |||
$salt, | |||
) | |||
).unwrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
This PR fixes the same problem as #1404 does, but in a different way (as I wrote on Apr 28). Because of that, there are no broken tests at the moment. I just followed the advice of @ekohl to rebase. However, I'm fine with closing this as well... |
I see, it looks like the bugfix was also in Thanks! |
Fixes #1417