add option to check allowed groups using the ldap connection of the search user #183 #185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request contains two things (Sorry, I know, bad practice):
allowed_groups
with the ldap connection of the search user instead of the ldap connection with the user being authenticated (default behavior) (seeallowed_groups
are looked up with authenticated user instead of search user #183)Please inform me if you want separate pull requests or just one for 1).
The diff for 1) should be straight forward but the diff tools struggle a bit on the method
resolve_username
cause they compare their changes with the added option. Eventually a parameter was added to the method and the connection establishment was moved to methodauthenticate
.On the test side I decided to use mock objects for the connections and verify if the correct connection is used and the correct methods are called. This test doesn't require the ldap server running.