-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for require ldap-group #232
Changes from 11 commits
1033bed
3408cc3
003f649
a97f7d5
a684660
eaf8f18
947a3a2
9fd0092
4969327
f6ec045
5221e39
3f6b744
c18563a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,14 @@ | |
# (string) Determines if other authentication providers are used | ||
# when a user can be mapped to a DN but the server cannot bind with the credentials | ||
# No default ($::puppetboard::params::ldap_bind_authoritative) | ||
# | ||
# [*ldap_require_group] | ||
# (bool) LDAP group to require on login | ||
# Default to False ($::puppetboard::params::ldap_require_group) | ||
# | ||
# [*$ldap_require_group_dn] | ||
# (string) LDAP group DN for LDAP group | ||
# No default | ||
class puppetboard::apache::vhost ( | ||
String $vhost_name, | ||
String $wsgi_alias = '/', | ||
|
@@ -88,6 +96,8 @@ | |
Optional[String] $ldap_bind_password = undef, | ||
Optional[String] $ldap_url = undef, | ||
Optional[String] $ldap_bind_authoritative = undef, | ||
Boolean $ldap_require_group = $::puppetboard::params::ldap_require_group, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the leading colons are not needed here anymore, so |
||
Optional[String] $ldap_require_group_dn = undef, | ||
Hash $custom_apache_parameters = {}, | ||
) inherits ::puppetboard::params { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,8 @@ class { 'puppetboard::apache::conf': | |
ldap_bind_dn => 'cn=user,dc=puppet,dc=example,dc=com', | ||
ldap_bind_password => 'password', | ||
ldap_url => 'ldap://puppet.example.com', | ||
ldap_require_group => true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi - Yes, I think this is pretty close. But we should test both cases, so one context for ldap auth, and test that the config file does not contain "Require ldap-group". Then make another conext that sets those parameters explicitly, and test for the expected results. |
||
ldap_require_group_dn => 'cn=admins,=cn=groups,dc=puppet,dc=example,dc=com', | ||
} | ||
EOS | ||
|
||
|
@@ -138,6 +140,7 @@ class { 'puppetboard::apache::conf': | |
it { is_expected.to contain 'AuthBasicProvider ldap' } | ||
it { is_expected.to contain 'AuthLDAPBindDN "cn=user,dc=puppet,dc=example,dc=com"' } | ||
it { is_expected.to contain 'AuthLDAPURL "ldap://puppet.example.com"' } | ||
it { is_expected.to contain 'Require ldap-group "cn=admins,=cn=groups,dc=puppet,dc=example,dc=com"' } | ||
end | ||
describe file('/srv/puppetboard/puppetboard/settings.py') do | ||
it { is_expected.to contain "PUPPETDB_KEY = '/var/lib/puppet/ssl/private_keys/test.networkninjas.net.pem'" } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$puppetboard::
vs$::puppetboard
.