-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1987 from asieraguado/master
(MODULES-10432) Add mod_auth_openidc support
- Loading branch information
Showing
8 changed files
with
323 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# @summary | ||
# Installs and configures `mod_auth_openidc`. | ||
# | ||
# @see https://github.com/zmartzone/mod_auth_openidc for additional documentation. | ||
# | ||
class apache::mod::auth_openidc ( | ||
) inherits ::apache::params { | ||
|
||
include ::apache | ||
include ::apache::mod::authz_user | ||
apache::mod { 'auth_openidc': } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
require 'spec_helper' | ||
|
||
describe 'apache::mod::auth_openidc', type: :class do | ||
it_behaves_like 'a mod class, without including apache' | ||
|
||
context 'default configuration with parameters' do | ||
context 'on a Debian OS', :compile do | ||
let :facts do | ||
{ | ||
id: 'root', | ||
kernel: 'Linux', | ||
lsbdistcodename: 'jessie', | ||
osfamily: 'Debian', | ||
operatingsystem: 'Debian', | ||
operatingsystemrelease: '8', | ||
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
is_pe: false, | ||
} | ||
end | ||
|
||
it { is_expected.to contain_class('apache::params') } | ||
it { is_expected.to contain_apache__mod('auth_openidc') } | ||
it { is_expected.to contain_package('libapache2-mod-auth-openidc') } | ||
end | ||
context 'on a RedHat OS', :compile do | ||
let :facts do | ||
{ | ||
id: 'root', | ||
kernel: 'Linux', | ||
osfamily: 'RedHat', | ||
operatingsystem: 'RedHat', | ||
operatingsystemrelease: '6', | ||
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
is_pe: false, | ||
} | ||
end | ||
|
||
it { is_expected.to contain_class('apache::params') } | ||
it { is_expected.to contain_apache__mod('auth_openidc') } | ||
it { is_expected.to contain_package('mod_auth_openidc') } | ||
end | ||
context 'on a FreeBSD OS', :compile do | ||
let :facts do | ||
{ | ||
id: 'root', | ||
kernel: 'FreeBSD', | ||
osfamily: 'FreeBSD', | ||
operatingsystem: 'FreeBSD', | ||
operatingsystemrelease: '9', | ||
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
is_pe: false, | ||
} | ||
end | ||
|
||
it { is_expected.to contain_class('apache::params') } | ||
it { is_expected.to contain_apache__mod('auth_openidc') } | ||
it { is_expected.to contain_package('www/mod_auth_openidc') } | ||
end | ||
end | ||
context 'overriding mod_packages' do | ||
context 'on a RedHat OS', :compile do | ||
let :facts do | ||
{ | ||
id: 'root', | ||
kernel: 'Linux', | ||
osfamily: 'RedHat', | ||
operatingsystem: 'RedHat', | ||
operatingsystemrelease: '6', | ||
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
is_pe: false, | ||
} | ||
end | ||
let :pre_condition do | ||
<<-MANIFEST | ||
include apache::params | ||
class { 'apache': | ||
mod_packages => merge($::apache::params::mod_packages, { | ||
'auth_openidc' => 'httpd24-mod_auth_openidc', | ||
}) | ||
} | ||
MANIFEST | ||
end | ||
|
||
it { is_expected.to contain_apache__mod('auth_openidc') } | ||
it { is_expected.to contain_package('httpd24-mod_auth_openidc') } | ||
it { is_expected.not_to contain_package('mod_auth_openidc') } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if @auth_oidc -%> | ||
<% @oidc_settings.each do |key, value| %> | ||
OIDC<%= key %> <%= value -%> | ||
<% end %> | ||
<% end -%> |
Oops, something went wrong.