-
Notifications
You must be signed in to change notification settings - Fork 48
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
Pass secrets as sensitive data types to katello/candlepin #493
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
Optional[Stdlib::Port] $db_port = undef, | ||
String $db_name = 'candlepin', | ||
String $db_user = 'candlepin', | ||
Optional[String] $db_password = undef, | ||
Variant[Undef, Sensitive[String], String] $db_password = undef, | ||
Boolean $db_ssl = false, | ||
Boolean $db_ssl_verify = true, | ||
Optional[Stdlib::Absolutepath] $db_ssl_ca = undef, | ||
|
@@ -54,9 +54,9 @@ | |
ca_key => $certs::candlepin::ca_key, | ||
ca_cert => $certs::candlepin::ca_cert, | ||
keystore_file => $certs::candlepin::keystore, | ||
keystore_password => $certs::candlepin::keystore_password, | ||
keystore_password => Sensitive($certs::candlepin::keystore_password), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coding for the Future: keystore_password => Sensitive($certs::candlepin::keystore_password.unwrap), because the Day will come, when |
||
truststore_file => $certs::candlepin::truststore, | ||
truststore_password => $certs::candlepin::truststore_password, | ||
truststore_password => Sensitive($certs::candlepin::truststore_password), | ||
artemis_client_dn => $artemis_client_dn, | ||
java_home => '/usr/lib/jvm/jre-17', | ||
java_package => 'java-17-openjdk', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
Optional[Stdlib::Port] $candlepin_db_port = undef, | ||
String $candlepin_db_name = 'candlepin', | ||
String $candlepin_db_user = 'candlepin', | ||
Optional[String] $candlepin_db_password = undef, | ||
Variant[Undef, Sensitive[String[1]], String] $candlepin_db_password = undef, | ||
Boolean $candlepin_db_ssl = false, | ||
Boolean $candlepin_db_ssl_verify = true, | ||
Optional[Stdlib::Absolutepath] $candlepin_db_ssl_ca = undef, | ||
|
@@ -55,8 +55,8 @@ | |
Integer[0] $hosts_queue_workers = 1, | ||
) { | ||
class { 'katello::params': | ||
candlepin_oauth_key => $candlepin_oauth_key, | ||
candlepin_oauth_secret => $candlepin_oauth_secret, | ||
candlepin_oauth_key => Sensitive($candlepin_oauth_key), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO wrong Order. Define in the Class-Header Optional[Variant[Sensitive[String], String]] $candlepin_oauth_key = undef, and just pass over the Variable here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My Guideline is: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was conservative here: I don't yet know if our installer handles it properly and only |
||
candlepin_oauth_secret => Sensitive($candlepin_oauth_secret), | ||
} | ||
|
||
if $katello::params::meta_package != '' { | ||
|
@@ -75,7 +75,7 @@ | |
db_port => $candlepin_db_port, | ||
db_name => $candlepin_db_name, | ||
db_user => $candlepin_db_user, | ||
db_password => $candlepin_db_password, | ||
db_password => if $candlepin_db_password { Sensitive($candlepin_db_password) } else { $candlepin_db_password }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A db_password => if $candlepin_db_password =~ Sensitive { $candlepin_db_password } else { Sensitive($candlepin_db_password) }, but this could be written simpler with db_password => Sensitive($candlepin_db_password.unwrap), There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to avoid |
||
db_ssl => $candlepin_db_ssl, | ||
db_ssl_verify => $candlepin_db_ssl_verify, | ||
db_ssl_ca => $candlepin_db_ssl_ca, | ||
|
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.
Why do you prefer
Variant[Undef…
overOptional[
?The latter is more common.
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'm not sure. It's a bit shorter but perhaps also less readable