Skip to content

Commit 9436c0a

Browse files
authored
Merge pull request #2423 from ic248/main
Add MellonSetEnv support
2 parents 7cfe947 + 6de78a4 commit 9436c0a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

spec/defines/vhost_spec.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,21 @@
301301
'ssl_verify_client' => 'optional',
302302
'ssl_verify_depth' => 10
303303
},
304+
{
305+
'path' => '/private_2',
306+
'provider' => 'location',
307+
'mellon_enable' => 'auth',
308+
'mellon_sp_private_key_file' => '/etc/httpd/mellon/example.com_mellon.key',
309+
'mellon_sp_cert_file' => '/etc/httpd/mellon/example.com_mellon.crt',
310+
'mellon_sp_metadata_file' => '/etc/httpd/mellon/example.com_sp_mellon.xml',
311+
'mellon_idp_metadata_file' => '/etc/httpd/mellon/example.com_idp_mellon.xml',
312+
'mellon_set_env' => { 'isMemberOf' => 'urn:oid:1.3.6.1.4.1.5923.1.5.1.1' },
313+
'mellon_set_env_no_prefix' => { 'isMemberOf' => 'urn:oid:1.3.6.1.4.1.5923.1.5.1.1' },
314+
'mellon_user' => 'urn:oid:0.9.2342.19200300.100.1.1',
315+
'mellon_saml_response_dump' => 'Off',
316+
'mellon_cond' => ['isMemberOf "cn=example-access,ou=Groups,o=example,o=com" [MAP]'],
317+
'mellon_session_length' => '300'
318+
},
304319
],
305320
'error_log' => false,
306321
'error_log_file' => 'httpd_error_log',
@@ -613,6 +628,7 @@
613628
it { is_expected.to contain_concat__fragment('rspec.example.com-itk') }
614629
it { is_expected.to contain_concat__fragment('rspec.example.com-fallbackresource') }
615630

631+
# rubocop:disable RSpec/ExampleLength
616632
it {
617633
expect(subject).to contain_concat__fragment('rspec.example.com-directories')
618634
.with_content(%r{^\s+<Proxy "\*">$})
@@ -721,7 +737,18 @@
721737
.with_content(%r{^\s+GssapiUseSessions\sOn$})
722738
.with_content(%r{^\s+SSLVerifyClient\soptional$})
723739
.with_content(%r{^\s+SSLVerifyDepth\s10$})
740+
.with_content(%r{^\s+MellonEnable\s"auth"$})
741+
.with_content(%r{^\s+MellonSPPrivateKeyFile\s"/etc/httpd/mellon/example\.com_mellon\.key"$})
742+
.with_content(%r{^\s+MellonSPCertFile\s"/etc/httpd/mellon/example\.com_mellon\.crt"$})
743+
.with_content(%r{^\s+MellonSPMetadataFile\s"/etc/httpd/mellon/example\.com_sp_mellon\.xml"$})
744+
.with_content(%r{^\s+MellonIDPMetadataFile\s"/etc/httpd/mellon/example\.com_idp_mellon\.xml"$})
745+
.with_content(%r{^\s+MellonSetEnv\s"isMemberOf"\s"urn:oid:1\.3\.6\.1\.4\.1\.5923\.1\.5\.1\.1"$})
746+
.with_content(%r{^\s+MellonSetEnvNoPrefix\s"isMemberOf"\s"urn:oid:1\.3\.6\.1\.4\.1\.5923\.1\.5\.1\.1"$})
747+
.with_content(%r{^\s+MellonUser\s"urn:oid:0\.9\.2342\.19200300\.100\.1\.1"$})
748+
.with_content(%r{^\s+MellonCond\sisMemberOf\s"cn=example-access,ou=Groups,o=example,o=com"\s\[MAP\]$})
749+
.with_content(%r{^\s+MellonSessionLength\s"300"$})
724750
}
751+
# rubocop:enable RSpec/ExampleLength
725752

726753
it { is_expected.to contain_concat__fragment('rspec.example.com-additional_includes') }
727754

templates/vhost/_directories.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@
428428
<%- if directory['mellon_idp_metadata_file'] -%>
429429
MellonIDPMetadataFile "<%= directory['mellon_idp_metadata_file'] %>"
430430
<%- end -%>
431+
<%- if directory['mellon_set_env'] -%>
432+
<%- directory['mellon_set_env'].each do |key, value| -%>
433+
MellonSetEnv "<%= key %>" "<%= value %>"
434+
<%- end -%>
435+
<%- end -%>
431436
<%- if directory['mellon_set_env_no_prefix'] -%>
432437
<%- directory['mellon_set_env_no_prefix'].each do |key, value| -%>
433438
MellonSetEnvNoPrefix "<%= key %>" "<%= value %>"

0 commit comments

Comments
 (0)