Skip to content

Commit

Permalink
Add documentation and tests for new ldap params
Browse files Browse the repository at this point in the history
  • Loading branch information
Colleen Murphy committed Feb 23, 2015
1 parent 35fd70e commit ed77028
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ LDAP server to use for auth.

User DN pattern for LDAP auth.

####`ldap_other_bind`

How to bind to the LDAP server. Defaults to 'anon'.

####`ldap_config_variables`

Hash of other LDAP config variables.

####`ldap_use_ssl`

Boolean, set to true to use SSL for the LDAP server.
Expand Down
28 changes: 16 additions & 12 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,15 @@

describe 'configuring ldap authentication' do
let :params do
{ :config_stomp => true,
:ldap_auth => true,
:ldap_server => 'ldap.example.com',
:ldap_user_dn_pattern => 'ou=users,dc=example,dc=com',
:ldap_use_ssl => false,
:ldap_port => '389',
:ldap_log => true
{ :config_stomp => true,
:ldap_auth => true,
:ldap_server => 'ldap.example.com',
:ldap_user_dn_pattern => 'ou=users,dc=example,dc=com',
:ldap_other_bind => 'as_user',
:ldap_use_ssl => false,
:ldap_port => '389',
:ldap_log => true,
:ldap_config_variables => { 'foo' => 'bar' }
}
end

Expand All @@ -419,10 +421,10 @@
it 'should contain ldap parameters' do
verify_contents(subject, 'rabbitmq.config',
['[', ' {rabbit, [', ' {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},', ' ]}',
' {rabbitmq_auth_backend_ldap, [', ' {other_bind, anon},',
' {rabbitmq_auth_backend_ldap, [', ' {other_bind, as_user},',
' {servers, ["ldap.example.com"]},',
' {user_dn_pattern, "ou=users,dc=example,dc=com"},', ' {use_ssl, false},',
' {port, 389},', ' {log, true}'])
' {port, 389},', ' {foo, bar},', ' {log, true}'])
end
end

Expand All @@ -432,9 +434,11 @@
:ldap_auth => true,
:ldap_server => 'ldap.example.com',
:ldap_user_dn_pattern => 'ou=users,dc=example,dc=com',
:ldap_other_bind => 'as_user',
:ldap_use_ssl => false,
:ldap_port => '389',
:ldap_log => true
:ldap_log => true,
:ldap_config_variables => { 'foo' => 'bar' }
}
end

Expand All @@ -443,10 +447,10 @@
it 'should contain ldap parameters' do
verify_contents(subject, 'rabbitmq.config',
['[', ' {rabbit, [', ' {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},', ' ]}',
' {rabbitmq_auth_backend_ldap, [', ' {other_bind, anon},',
' {rabbitmq_auth_backend_ldap, [', ' {other_bind, as_user},',
' {servers, ["ldap.example.com"]},',
' {user_dn_pattern, "ou=users,dc=example,dc=com"},', ' {use_ssl, false},',
' {port, 389},', ' {log, true}'])
' {port, 389},', ' {foo, bar},', ' {log, true}'])
end
end

Expand Down

0 comments on commit ed77028

Please sign in to comment.