From 2d73fa3c8242755fef1948279f93260ab5798746 Mon Sep 17 00:00:00 2001 From: DEFERME Bert Date: Fri, 12 Aug 2022 11:37:39 +0200 Subject: [PATCH 1/2] Mark ldap3 password attribute as sensitive --- lib/puppet/provider/nexus3_ldap/templates/set_attributes.erb | 4 ++-- lib/puppet/type/nexus3_ldap.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/nexus3_ldap/templates/set_attributes.erb b/lib/puppet/provider/nexus3_ldap/templates/set_attributes.erb index a8f61cf..f3a5499 100644 --- a/lib/puppet/provider/nexus3_ldap/templates/set_attributes.erb +++ b/lib/puppet/provider/nexus3_ldap/templates/set_attributes.erb @@ -9,7 +9,7 @@ connection.setConnectionTimeout(<%= resource[:connection_timeout] %>) connection.setSaslRealm('<%= resource[:sasl_realm] %>') connection.setAuthScheme('<%= resource[:authentication_scheme] %>') connection.setSystemUsername('<%= resource[:username] %>') -connection.setSystemPassword('<%= resource[:password] %>') +connection.setSystemPassword('<%= resource[:password].unwrap %>') ldapConfiguration.setConnection(connection) @@ -36,4 +36,4 @@ mapping.setGroupSubtree(<%= resource[:group_subtree] %>) mapping.setLdapFilter('<%= resource[:ldap_filter] %>') mapping.setLdapGroupsAsRoles(<%= resource[:ldap_groups_as_roles] %>) -ldapConfiguration.setMapping(mapping) \ No newline at end of file +ldapConfiguration.setMapping(mapping) diff --git a/lib/puppet/type/nexus3_ldap.rb b/lib/puppet/type/nexus3_ldap.rb index c6657ce..d5f133e 100644 --- a/lib/puppet/type/nexus3_ldap.rb +++ b/lib/puppet/type/nexus3_ldap.rb @@ -87,6 +87,7 @@ }, password: { type: 'String', + sensitive: true, desc: 'The expected value of the password.', default: '', }, From b80a9ca597563484aef3669d87016f3a4a2a9901 Mon Sep 17 00:00:00 2001 From: DEFERME Bert Date: Wed, 17 Aug 2022 14:40:23 +0200 Subject: [PATCH 2/2] Still not working --- lib/puppet/type/nexus3_ldap.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/puppet/type/nexus3_ldap.rb b/lib/puppet/type/nexus3_ldap.rb index d5f133e..9a68b81 100644 --- a/lib/puppet/type/nexus3_ldap.rb +++ b/lib/puppet/type/nexus3_ldap.rb @@ -86,8 +86,7 @@ default: '', }, password: { - type: 'String', - sensitive: true, + type: 'Sensitive[String]', desc: 'The expected value of the password.', default: '', },