Skip to content

Commit 824b052

Browse files
committed
(CONT-577) - allow deferred function for password/secret
1 parent 8c07b77 commit 824b052

File tree

6 files changed

+55
-41
lines changed

6 files changed

+55
-41
lines changed

manifests/vhost.pp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,7 +2604,18 @@
26042604
concat::fragment { "${name}-auth_kerb":
26052605
target => "${priority_real}${filename}.conf",
26062606
order => 230,
2607-
content => template('apache/vhost/_auth_kerb.erb'),
2607+
content => stdlib::deferrable_epp('apache/vhost/_auth_kerb.epp', {
2608+
'auth_kerb' => $auth_kerb,
2609+
'krb_method_negotiate' => $krb_method_negotiate,
2610+
'krb_method_k5passwd' => Deferred('sprintf', [$krb_method_k5passwd]),
2611+
'krb_authoritative' => $krb_authoritative,
2612+
'krb_auth_realms' => $krb_auth_realms,
2613+
'krb_5keytab' => $krb_5keytab,
2614+
'krb_local_user_mapping' => $krb_local_user_mapping,
2615+
'krb_verify_kdc' => $krb_verify_kdc,
2616+
'krb_servicename' => $krb_servicename,
2617+
'krb_save_credentials' => $krb_save_credentials,
2618+
}),
26082619
}
26092620
}
26102621

@@ -2849,7 +2860,10 @@
28492860
concat::fragment { "${name}-auth_oidc":
28502861
target => "${priority_real}${filename}.conf",
28512862
order => 360,
2852-
content => template('apache/vhost/_auth_oidc.erb'),
2863+
content => stdlib::deferrable_epp('apache/vhost/_auth_oidc.epp', {
2864+
'auth_oidc' => $auth_oidc,
2865+
'oidc_settings' => $oidc_settings,
2866+
}),
28532867
}
28542868
}
28552869

spec/defines/vhost_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
describe 'apache::vhost', type: :define do
66
describe 'os-independent items' do
7-
on_supported_os.each do |os, os_facts|
7+
os, os_facts = on_supported_os.first
8+
89
let(:apache_name) { (facts[:os]['family'] == 'RedHat') ? 'httpd' : 'apache2' }
910

1011
let :pre_condition do
@@ -2119,6 +2120,5 @@
21192120
end
21202121
end
21212122
end
2122-
end
21232123
end
21242124
end

templates/vhost/_auth_kerb.epp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<% if $auth_kerb { -%>
2+
3+
## Kerberos directives
4+
<%- if $krb_method_negotiate { -%>
5+
KrbMethodNegotiate <%= $krb_method_negotiate %>
6+
<%- } -%>
7+
<%- if $krb_method_k5passwd { -%>
8+
KrbMethodK5Passwd <%= $krb_method_k5passwd %>
9+
<%- } -%>
10+
<%- if $krb_authoritative { -%>
11+
KrbAuthoritative <%= $krb_authoritative %>
12+
<%- } -%>
13+
<%- if $krb_auth_realms and $krb_auth_realms.length >= 1 { -%>
14+
KrbAuthRealms <%= $krb_auth_realms.join(' ') %>
15+
<%- } -%>
16+
<%- if $krb_5keytab { -%>
17+
Krb5Keytab <%= $krb_5keytab %>
18+
<%- } -%>
19+
<%- if $krb_local_user_mapping { -%>
20+
KrbLocalUserMapping <%= $krb_local_user_mapping %>
21+
<%- } -%>
22+
<%- if $krb_verify_kdc { -%>
23+
KrbVerifyKDC <%= $krb_verify_kdc %>
24+
<%- } -%>
25+
<%- if $krb_servicename { -%>
26+
KrbServiceName <%= $krb_servicename %>
27+
<%- } -%>
28+
<%- if $krb_save_credentials { -%>
29+
KrbSaveCredentials <%= $krb_save_credentials -%>
30+
<%- } -%>
31+
32+
<% } -%>

templates/vhost/_auth_kerb.erb

Lines changed: 0 additions & 32 deletions
This file was deleted.

templates/vhost/_auth_oidc.epp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<% if $auth_oidc { -%>
2+
<% $oidc_settings.map |Any $key, Any $value| { %>
3+
OIDC<%= $key %> <% if $key == 'Scope' { -%>"<%= $value -%>"<% } else { -%><%= $value -%><% }-%>
4+
<% } %>
5+
<% } -%>

templates/vhost/_auth_oidc.erb

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)