Skip to content

Commit 51c94f8

Browse files
saboop-ct
andauthored
Make LDAP client-side TLS authentication optional (#137)
* Make SSSD client-side TLS authentication optional * Add test for client_tls parameter --------- Co-authored-by: op-ct <[email protected]>
1 parent f1595aa commit 51c94f8

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

manifests/provider/ldap.pp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
# @param strip_128_bit_ciphers
3737
# **DEPRECATED** - EL6-only - Will be removed in a future release
3838
#
39+
# @param client_tls
40+
# Set to false to disable setting up client-side TLS
41+
#
3942
# @param debug_level
4043
# @param debug_timestamps
4144
# @param debug_microseconds
@@ -341,7 +344,8 @@
341344
Optional[Integer[0]] $ldap_idmap_range_size = undef,
342345
Optional[String[1]] $ldap_idmap_default_domain_sid = undef,
343346
Optional[String[1]] $ldap_idmap_default_domain = undef,
344-
Boolean $ldap_idmap_autorid_compat = false
347+
Boolean $ldap_idmap_autorid_compat = false,
348+
Boolean $client_tls = true,
345349
) {
346350
include $module_name
347351

@@ -354,19 +358,19 @@
354358

355359
if $app_pki_ca_dir {
356360
$ldap_tls_cacertdir = $app_pki_ca_dir
357-
} else {
361+
} elsif $client_tls {
358362
$ldap_tls_cacertdir = "${sssd::app_pki_dir}/cacerts"
359363
}
360364

361365
if $app_pki_key {
362366
$ldap_tls_key = $app_pki_key
363-
} else {
367+
} elsif $client_tls {
364368
$ldap_tls_key = "${sssd::app_pki_dir}/private/${$facts['networking']['fqdn']}.pem"
365369
}
366370

367371
if $app_pki_cert {
368372
$ldap_tls_cert = $app_pki_cert
369-
} else {
373+
} elsif $client_tls {
370374
$ldap_tls_cert = "${sssd::app_pki_dir}/public/${$facts['networking']['fqdn']}.pub"
371375
}
372376

spec/defines/provider/ldap_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@
167167
}
168168
end
169169

170+
context 'with client_tls set to false' do
171+
let(:params) {{ :client_tls => false }}
172+
173+
it { is_expected.to compile.with_all_deps }
174+
it {
175+
is_expected.to create_sssd__config__entry("puppet_provider_#{title}_ldap")
176+
.without_content(%r(ldap_tls_cacertdir))
177+
.without_content(%r(ldap_tls_key))
178+
.without_content(%r(ldap_tls_cert))
179+
}
180+
end
181+
170182
# This set of parameters exercises the logic in the code but is NOT at all
171183
# realistic!
172184
context 'with other optional parameters set' do

0 commit comments

Comments
 (0)