diff --git a/README.md b/README.md index 258f9bf13..9b19a3adb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/spec/classes/rabbitmq_spec.rb b/spec/classes/rabbitmq_spec.rb index 8429c98c4..1740e5309 100644 --- a/spec/classes/rabbitmq_spec.rb +++ b/spec/classes/rabbitmq_spec.rb @@ -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 @@ -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 @@ -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 @@ -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