-
Notifications
You must be signed in to change notification settings - Fork 48
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
(POOLER-113) Add support for multiple LDAP search bases #267
Conversation
This commit updates vmpooler to support setting an array of search bases in addition to a single base provided as a string. Without this change it is not possible to specify multiple search bases to use with the LDAP authentication provider. Additionally, test coverage is added to the authentication helper method.
The new LDAP tests did not pass in travis |
Interesting. Those tests work if I test the file they're in alone. However, I get the same failures when running the full suite. I'll investigate and update this. |
This commit removes a additional authenticate method that is defined in the token_spec tests. Instead, authenticate is used from api/helpers. To support this change the config provided is updated to specify a dummy provider. Without this change authenticate cannot be tested along with token_spec because token_spec redefines authenticate.
It looks like tests were failing because |
lib/vmpooler/api/helpers.rb
Outdated
@@ -54,35 +54,63 @@ def authorized? | |||
return false | |||
end | |||
|
|||
def authenticate_ldap(port, host, user_object, base, username_str, password_str) | |||
require 'rubygems' | |||
require 'net/ldap' |
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.
@mattkirby Just curious why you are putting the require statement inside the authenticate_ldap method instead of at the top of the file. Is there a reason to limit the scope?
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.
Only because it's what was already being done. It probably should be at the top of the file.
This commit moves net/ldap require from authenticate_ldap in api/helpers to vmpooler.rb. Without this change net/ldap and rubygems are required again every time authenticate_ldap is run.
This commit updates vmpooler to support setting an array of search bases
in addition to a single base provided as a string. Without this change
it is not possible to specify multiple search bases to use with the LDAP
authentication provider. Additionally, test coverage is added to
the authentication helper method.