Skip to content

Commit ceb617f

Browse files
author
Cocker Koch
committed
Accept Datatype Sensitive for Secrets
1 parent 2e0a67a commit ceb617f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.puppet-lint.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
--relative
2+
--no-140chars-check

.sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
unmanaged: false
3939
.github/workflows/release.yml:
4040
unmanaged: false
41+
.puppet-lint.rc:
42+
extra_disabled_lint_checks:
43+
- 140chars-check
4144
.travis.yml:
4245
delete: true
4346
Gemfile:

manifests/config/server/tomcat_users.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @summary Configures roles and users in $CATALINA_BASE/conf/tomcat-users.xml or any other specified file
22
#
33
# @param catalina_base
4-
# Specifies the base directory of the Tomcat installation. Valid options: a string containing an absolute path.
4+
# Specifies the base directory of the Tomcat installation. Valid options: a string containing an absolute path.
55
# @param element
66
# Specifies the type of element to manage.
77
# @param element_name
@@ -32,7 +32,7 @@
3232
Boolean $manage_file = true,
3333
$owner = undef,
3434
$group = undef,
35-
$password = undef,
35+
Optional[Variant[String, Sensitive[String]]] $password = undef,
3636
Array $roles = [],
3737
Boolean $show_diff = true,
3838
) {
@@ -41,6 +41,7 @@
4141
fail('Server configurations require Augeas >= 1.0.0')
4242
}
4343

44+
$password_unsensitive = if $password =~ Sensitive { $password.unwrap } else { $password }
4445
$_owner = pick($owner, $::tomcat::user)
4546
$_group = pick($group, $::tomcat::group)
4647

@@ -90,7 +91,7 @@
9091
$add_entry = "set ${path}/#attribute/${element_identifier} '${_element_name}'"
9192
$remove_entry = undef
9293
if $element == 'user' {
93-
$add_password = "set ${path}/#attribute/password '${password}'"
94+
$add_password = "set ${path}/#attribute/password '${password_unsensitive}'"
9495
$add_roles = join(["set ${path}/#attribute/roles '",join($roles, ','),"'"])
9596
} else {
9697
$add_password = undef

0 commit comments

Comments
 (0)