Skip to content

Commit

Permalink
Restrict params to non-empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Aug 13, 2024
1 parent 77891b3 commit b3e13fd
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 158 deletions.
4 changes: 2 additions & 2 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# Path to `icingacli' comand line tool.
#
class icingaweb2::globals (
String $package_name,
String[1] $package_name,
Stdlib::Absolutepath $conf_dir,
Stdlib::Absolutepath $state_dir,
Stdlib::Absolutepath $data_dir,
Expand All @@ -86,7 +86,7 @@
Stdlib::Absolutepath $pgsql_idoreports_sla_percent,
Stdlib::Absolutepath $mysql_x509_schema,
Stdlib::Absolutepath $pgsql_x509_schema,
String $gettext_package_name,
String[1] $gettext_package_name,
Stdlib::Absolutepath $icingacli_bin,
) {
$stdlib_version = load_module_metadata('stdlib')['version']
Expand Down
10 changes: 5 additions & 5 deletions manifests/inisection.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
# }
#
define icingaweb2::inisection (
Stdlib::Absolutepath $target,
String $section_name = $title,
Hash $settings = {},
Variant[String, Integer] $order = '01',
Boolean $replace = true,
Stdlib::Absolutepath $target,
String[1] $section_name = $title,
Hash $settings = {},
Variant[String[1], Integer[1]] $order = '01',
Boolean $replace = true,
) {
$conf_user = $icingaweb2::conf_user
$conf_group = $icingaweb2::conf_group
Expand Down
34 changes: 17 additions & 17 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -214,29 +214,29 @@
#
class icingaweb2 (
Stdlib::Absolutepath $logging_file,
String $conf_user,
String $conf_group,
String[1] $conf_user,
String[1] $conf_group,
Enum['mysql', 'pgsql'] $db_type,
Variant[Icingaweb2::AdminRole, Boolean[false]] $admin_role,
String $default_admin_username,
String[1] $default_admin_username,
Icingaweb2::Secret $default_admin_password,
Enum['file', 'syslog', 'php', 'none'] $logging,
Enum['ERROR', 'WARNING', 'INFO', 'DEBUG'] $logging_level,
Pattern[/user|local[0-7]/] $logging_facility,
String $logging_application,
String[1] $logging_application,
Boolean $show_stacktraces,
String $theme,
String[1] $theme,
Boolean $theme_disabled,
Boolean $manage_repos,
Boolean $manage_package,
Hash[String, Hash[String, Any]] $resources,
Variant[String, Boolean[false]] $default_auth_backend,
Hash[String, Hash[String, Any]] $user_backends,
Hash[String, Hash[String, Any]] $group_backends,
String $db_resource_name,
Hash[String[1], Hash[String[1], Any]] $resources,
Variant[String[1], Boolean[false]] $default_auth_backend,
Hash[String[1], Hash[String[1], Any]] $user_backends,
Hash[String[1], Hash[String[1], Any]] $group_backends,
String[1] $db_resource_name,
Stdlib::Host $db_host,
String $db_name,
String $db_username,
String[1] $db_name,
String[1] $db_username,
Optional[Icingaweb2::Secret] $db_password = undef,
Optional[Stdlib::Port] $db_port = undef,
Optional[Icingaweb2::ImportSchema] $import_schema = undef,
Expand All @@ -246,14 +246,14 @@
Optional[Stdlib::Absolutepath] $tls_cacert_file = undef,
Optional[Stdlib::Absolutepath] $tls_capath = undef,
Optional[Icingaweb2::Secret] $tls_key = undef,
Optional[String] $tls_cert = undef,
Optional[String] $tls_cacert = undef,
Optional[String[1]] $tls_cert = undef,
Optional[String[1]] $tls_cacert = undef,
Optional[Boolean] $tls_noverify = undef,
Optional[String] $tls_cipher = undef,
Optional[String[1]] $tls_cipher = undef,
Optional[Variant[Stdlib::Absolutepath,
Array[Stdlib::Absolutepath]]] $module_path = undef,
Optional[Array[String]] $extra_packages = undef,
Optional[String] $default_domain = undef,
Optional[Array[String[1]]] $extra_packages = undef,
Optional[String[1]] $default_domain = undef,
Optional[Stdlib::Absolutepath] $cookie_path = undef,
) {
require icingaweb2::globals
Expand Down
8 changes: 4 additions & 4 deletions manifests/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
#
define icingaweb2::module (
Enum['absent', 'present'] $ensure = 'present',
String $module = $title,
String[1] $module = $title,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/${title}",
Enum['git', 'none', 'package'] $install_method = 'git',
Optional[String] $git_repository = undef,
Optional[String[1]] $git_repository = undef,
String $git_revision = 'master',
Optional[String] $package_name = undef,
Hash $settings = {},
Optional[String[1]] $package_name = undef,
Hash[String[1], Any] $settings = {},
) {
require icingaweb2

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/audit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
class icingaweb2::module::audit (
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
Enum['git', 'none', 'package'] $install_method,
String[1] $package_name,
Enum['file', 'syslog', 'none'] $log_type,
Variant[
Enum['auth', 'user', 'authpriv'],
Expand All @@ -61,7 +61,7 @@
Optional[Stdlib::Absolutepath] $log_file = undef,
Optional[String] $log_ident = undef,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/audit",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
) {
require icingaweb2

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/businessprocess.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
class icingaweb2::module::businessprocess (
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
String[1] $package_name,
Enum['git', 'none', 'package'] $install_method,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/businessprocess",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
) {
require icingaweb2

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/cube.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
class icingaweb2::module::cube (
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
String[1] $package_name,
Enum['git', 'none', 'package'] $install_method,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/cube",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
) {
require icingaweb2

Expand Down
24 changes: 12 additions & 12 deletions manifests/module/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,37 @@
Enum['absent', 'present'] $ensure,
Enum['git', 'package', 'none'] $install_method,
Stdlib::HTTPUrl $git_repository,
String $package_name,
String[1] $package_name,
Boolean $manage_service,
Stdlib::Ensure::Service $service_ensure,
Boolean $service_enable,
String $service_user,
String[1] $service_user,
Stdlib::Host $api_host,
Stdlib::Port $api_port,
Boolean $kickstart,
Enum['mysql', 'pgsql'] $db_type,
String $db_resource_name,
String[1] $db_resource_name,
Stdlib::Host $db_host,
String $db_name,
String $db_username,
String[1] $db_name,
String[1] $db_username,
Optional[Stdlib::Port] $db_port = undef,
Optional[Icingaweb2::Secret] $db_password = undef,
Optional[String] $db_charset = undef,
Optional[String[1]] $db_charset = undef,
Optional[Boolean] $import_schema = undef,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/director",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
Optional[Boolean] $use_tls = undef,
Optional[Stdlib::Absolutepath] $tls_key_file = undef,
Optional[Stdlib::Absolutepath] $tls_cert_file = undef,
Optional[Stdlib::Absolutepath] $tls_cacert_file = undef,
Optional[Stdlib::Absolutepath] $tls_capath = undef,
Optional[Icingaweb2::Secret] $tls_key = undef,
Optional[String] $tls_cert = undef,
Optional[String] $tls_cacert = undef,
Optional[String[1]] $tls_cert = undef,
Optional[String[1]] $tls_cacert = undef,
Optional[Boolean] $tls_noverify = undef,
Optional[String] $tls_cipher = undef,
Optional[String] $endpoint = undef,
Optional[String] $api_username = undef,
Optional[String[1]] $tls_cipher = undef,
Optional[String[1]] $endpoint = undef,
Optional[String[1]] $api_username = undef,
Optional[Icingaweb2::Secret] $api_password = undef,
) {
require icingaweb2
Expand Down
4 changes: 2 additions & 2 deletions manifests/module/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
String[1] $package_name,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/elasticsearch",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
Optional[Hash] $instances = undef,
Optional[Hash] $eventtypes = undef,
) {
Expand Down
10 changes: 5 additions & 5 deletions manifests/module/elasticsearch/eventtype.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
# @api private
#
define icingaweb2::module::elasticsearch::eventtype (
String $eventtype_name = $title,
Optional[String] $instance = undef,
Optional[String] $index = undef,
Optional[String] $filter = undef,
Optional[String] $fields = undef,
String[1] $eventtype_name = $title,
Optional[String[1]] $instance = undef,
Optional[String[1]] $index = undef,
Optional[String[1]] $filter = undef,
Optional[String[1]] $fields = undef,
) {
assert_private("You're not supposed to use this defined type manually.")

Expand Down
6 changes: 3 additions & 3 deletions manifests/module/elasticsearch/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
# @api private
#
define icingaweb2::module::elasticsearch::instance (
String $instance_name = $title,
String $uri = undef,
Optional[String] $user = undef,
String[1] $instance_name = $title,
Optional[String[1]] $uri = undef,
Optional[String[1]] $user = undef,
Optional[Icingaweb2::Secret] $password = undef,
Optional[Stdlib::Absolutepath] $ca = undef,
Optional[Stdlib::Absolutepath] $client_certificate = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/module/fileshipper.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
String[1] $package_name,
Hash $base_directories,
Hash $directories,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/fileshipper",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
) {
require icingaweb2

Expand Down
2 changes: 1 addition & 1 deletion manifests/module/fileshipper/basedir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# @api private
#
define icingaweb2::module::fileshipper::basedir (
String $identifier = $title,
String[1] $identifier = $title,
Optional[Stdlib::Absolutepath] $basedir = undef,
) {
assert_private("You're not supposed to use this defined type manually.")
Expand Down
4 changes: 2 additions & 2 deletions manifests/module/fileshipper/directory.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# @api private
#
define icingaweb2::module::fileshipper::directory (
String $identifier = $title,
String[1] $identifier = $title,
Optional[Stdlib::Absolutepath] $source = undef,
Optional[Stdlib::Absolutepath] $target = undef,
String $extensions = '.conf',
String[1] $extensions = '.conf',
) {
assert_private("You're not supposed to use this defined type manually.")

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/generictts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
String[1] $package_name,
Hash $ticketsystems,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/generictts",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
) {
require icingaweb2

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/generictts/ticketsystem.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# @api private
#
define icingaweb2::module::generictts::ticketsystem (
String $ticketsystem = $title,
Optional[String] $pattern = undef,
String[1] $ticketsystem = $title,
Optional[String[1]] $pattern = undef,
Optional[Stdlib::HTTPUrl] $url = undef,
) {
assert_private("You're not supposed to use this defined type manually.")
Expand Down
12 changes: 6 additions & 6 deletions manifests/module/graphite.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
String[1] $package_name,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/graphite",
Optional[String] $git_revision = undef,
Optional[String[1]] $git_revision = undef,
Optional[Stdlib::HTTPUrl] $url = undef,
Optional[Boolean] $insecure = undef,
Optional[String] $user = undef,
Optional[String[1]] $user = undef,
Optional[Icingaweb2::Secret] $password = undef,
Optional[String] $graphite_writer_host_name_template = undef,
Optional[String] $graphite_writer_service_name_template = undef,
Optional[String] $customvar_obscured_check_command = undef,
Optional[String[1]] $graphite_writer_host_name_template = undef,
Optional[String[1]] $graphite_writer_service_name_template = undef,
Optional[String[1]] $customvar_obscured_check_command = undef,
Optional[Enum[
'minutes', 'hours', 'days',
'weeks', 'months', 'years'
Expand Down
22 changes: 11 additions & 11 deletions manifests/module/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -124,28 +124,28 @@
#
class icingaweb2::module::icingadb (
Enum['absent', 'present'] $ensure,
String $package_name,
String[1] $package_name,
Stdlib::Host $redis_host,
Hash[String, Hash] $commandtransports,
Hash[String, Any] $settings,
Hash[String[1], Hash] $commandtransports,
Hash[String[1], Any] $settings,
Enum['mysql', 'pgsql'] $db_type,
String $db_resource_name,
String[1] $db_resource_name,
Stdlib::Host $db_host,
String $db_name,
String $db_username,
String[1] $db_name,
String[1] $db_username,
Optional[Stdlib::Port] $db_port = undef,
Optional[Icingaweb2::Secret] $db_password = undef,
Optional[String] $db_charset = undef,
Optional[String[1]] $db_charset = undef,
Optional[Boolean] $db_use_tls = undef,
Optional[String] $db_tls_cert = undef,
Optional[Icingaweb2::Secret] $db_tls_key = undef,
Optional[String] $db_tls_cacert = undef,
Optional[String[1]] $db_tls_cacert = undef,
Optional[Stdlib::Absolutepath] $db_tls_cert_file = undef,
Optional[Stdlib::Absolutepath] $db_tls_key_file = undef,
Optional[Stdlib::Absolutepath] $db_tls_cacert_file = undef,
Optional[Stdlib::Absolutepath] $db_tls_capath = undef,
Optional[Boolean] $db_tls_noverify = undef,
Optional[String] $db_tls_cipher = undef,
Optional[String[1]] $db_tls_cipher = undef,
Optional[Stdlib::Port] $redis_port = undef,
Optional[Icingaweb2::Secret] $redis_password = undef,
Stdlib::Host $redis_primary_host = $redis_host,
Expand All @@ -155,9 +155,9 @@
Optional[Stdlib::Port] $redis_secondary_port = undef,
Optional[Icingaweb2::Secret] $redis_secondary_password = undef,
Optional[Boolean] $redis_use_tls = undef,
Optional[String] $redis_tls_cert = undef,
Optional[String[1]] $redis_tls_cert = undef,
Optional[Icingaweb2::Secret] $redis_tls_key = undef,
Optional[String] $redis_tls_cacert = undef,
Optional[String[1]] $redis_tls_cacert = undef,
Optional[Stdlib::Absolutepath] $redis_tls_cert_file = undef,
Optional[Stdlib::Absolutepath] $redis_tls_key_file = undef,
Optional[Stdlib::Absolutepath] $redis_tls_cacert_file = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/module/icingadb/commandtransport.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
# Password for the transport.
#
define icingaweb2::module::icingadb::commandtransport (
String $username,
String[1] $username,
Icingaweb2::Secret $password,
String $commandtransport = $title,
String[1] $commandtransport = $title,
Stdlib::Host $host = 'localhost',
Stdlib::Port $port = 5665,
) {
Expand Down
Loading

0 comments on commit b3e13fd

Please sign in to comment.