Skip to content

Commit

Permalink
Fixes #35468 - Verify boolean settings in modules
Browse files Browse the repository at this point in the history
Since debffb8 it's possible to validate
boolean settings. Validating settings makes it harder to misconfigure
modules.
  • Loading branch information
ekohl committed Aug 31, 2022
1 parent bb7bffb commit d6ddfc8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/dhcp/dhcp_plugin.rb
Expand Up @@ -3,6 +3,7 @@ class Proxy::DhcpPlugin < ::Proxy::Plugin

uses_provider
default_settings :use_provider => 'dhcp_isc', :server => '127.0.0.1', :subnets => [], :ping_free_ip => true
validate :ping_free_ip, boolean: true
plugin :dhcp, ::Proxy::VERSION

load_classes ::Proxy::DHCP::ConfigurationLoader
Expand Down
1 change: 1 addition & 0 deletions modules/dhcp_native_ms/dhcp_native_ms_plugin.rb
Expand Up @@ -3,6 +3,7 @@ class Plugin < ::Proxy::Provider
plugin :dhcp_native_ms, ::Proxy::VERSION

default_settings :disable_ddns => true, :blacklist_duration_minutes => 30 * 60
validate :disable_ddns, boolean: true

requires :dhcp, ::Proxy::VERSION

Expand Down
Expand Up @@ -4,6 +4,7 @@ class Plugin < ::Proxy::Provider

requires :puppetca, ::Proxy::VERSION
default_settings :sign_all => false, :tokens_file => '/var/lib/foreman-proxy/tokens.yml', :token_ttl => 360
validate :sign_all, boolean: true

load_classes ::Proxy::PuppetCa::TokenWhitelisting::PluginConfiguration
load_dependency_injection_wirings ::Proxy::PuppetCa::TokenWhitelisting::PluginConfiguration
Expand Down
1 change: 1 addition & 0 deletions modules/realm_freeipa/realm_freeipa_plugin.rb
Expand Up @@ -3,6 +3,7 @@ class Plugin < Proxy::Provider
default_settings :ipa_config => '/etc/ipa/default.conf',
:remove_dns => true,
:verify_ca => true
validate :remove_dns, :verify_ca, boolean: true

load_classes ::Proxy::FreeIPARealm::ConfigurationLoader
load_dependency_injection_wirings ::Proxy::FreeIPARealm::ConfigurationLoader
Expand Down
1 change: 1 addition & 0 deletions modules/tftp/tftp_plugin.rb
Expand Up @@ -7,6 +7,7 @@ class Plugin < ::Proxy::Plugin
default_settings :tftproot => '/var/lib/tftpboot',
:tftp_connect_timeout => 10,
:verify_server_cert => true
validate :verify_server_cert, boolean: true

expose_setting :tftp_servername
end
Expand Down

0 comments on commit d6ddfc8

Please sign in to comment.