Use Puppet-Datatype Sensitive#1400
Use Puppet-Datatype Sensitive#1400pmcmaw merged 1 commit intopuppetlabs:mainfrom cocker-cc:Use_Puppet-Datatype_Sensitive
Conversation
cocker-cc
commented
Jun 16, 2021
- fix some Puppetlint-Complaints, f.e. use Hash $::facts['blubb'] instead of specific global Variables
- let Function mysql::password accept Datatype Sensitive for Password
- let Function mysql_password accept Datatype Sensitive for Password
- add Parameter "sensitive" to Function mysql::password to decide if its Returnvalue should be of Datatype Sensitive
- add Parameter "sensitive" to Function mysql_password to decide if its Returnvalue should be of Datatype Sensitive
- let mysql_user accept Datatype Sensitive for Parameter password_hash
- let mysql::backup::mysqlbackup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::backup::mysqldump accept Datatype Sensitive for Parameter $backuppassword
- let mysql::backup::xtrabackup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::db accept Datatype Sensitive for Parameter $password
- let mysql::server accept Datatype Sensitive for Parameter $root_password
- let mysql::server::backup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::server::monitor accept Datatype Sensitive for Parameter $mysql_monitor_password
- let mysql::server::root_password accept Datatype Sensitive for $root_password
- refactor Logic for unset Password for mysql::server::root_password
| end | ||
|
|
||
| # Test of a Returnvalue of Datatype Sensitive does not work: | ||
| # it 'returns Sensitive with sensitive=true' do |
There was a problem hiding this comment.
Hey @cocker-cc
Just wondering if you have more information on why this test does not work? I would be inclined to advise if there is a suitable reason, marking this test in the suite as pending and just adding the comment as to why for future reference.
There was a problem hiding this comment.
Here is an example from stdlib on how to mark as pending: https://github.com/puppetlabs/puppetlabs-stdlib/blob/276e7b7cd97580c9c08b264b3727e5902df1f487/spec/functions/is_mac_address_spec.rb#L22
There was a problem hiding this comment.
Just wondering if you have more information on why this test does not work?
Too bad, I have no Idea how to make this Test work
| $compression_extension = undef, | ||
| ) inherits mysql::params { | ||
| if $backuppassword =~ Sensitive { | ||
| $_backuppassword = $backuppassword.unwrap |
There was a problem hiding this comment.
I know this isn't a big deal but would it be possible to rename this variable? I found when reviewing this PR with a colleague it took us a while to work out what it is doing. I would suggest using something such as plaintext_backuppassword. (this name change will need revisited throughout your codebase changes).
There was a problem hiding this comment.
Now it's done. I needed a second push.
There was a problem hiding this comment.
|
Hey @cocker-cc |
Thanks. Reason for that one is: we switched from Trocla to Vault, and our Function |
- fix some Puppetlint-Complaints, f.e. use Hash $::facts['blubb'] instead of specific global Variables - let Function mysql::password accept Datatype Sensitive for Password - let Function mysql_password accept Datatype Sensitive for Password - add Parameter "sensitive" to Function mysql::password to decide if its Returnvalue should be of Datatype Sensitive - add Parameter "sensitive" to Function mysql_password to decide if its Returnvalue should be of Datatype Sensitive - let mysql_user accept Datatype Sensitive for Parameter password_hash - let mysql::backup::mysqlbackup accept Datatype Sensitive for Parameter $backuppassword - let mysql::backup::mysqldump accept Datatype Sensitive for Parameter $backuppassword - let mysql::backup::xtrabackup accept Datatype Sensitive for Parameter $backuppassword - let mysql::db accept Datatype Sensitive for Parameter $password - let mysql::server accept Datatype Sensitive for Parameter $root_password - let mysql::server::backup accept Datatype Sensitive for Parameter $backuppassword - let mysql::server::monitor accept Datatype Sensitive for Parameter $mysql_monitor_password - let mysql::server::root_password accept Datatype Sensitive for $root_password - refactor Logic for unset Password for mysql::server::root_password
|
What a fantastic addition to our code base @cocker-cc. |
|
Changes will be released on our next Community Day (Monday) |