SATOSA
SATOSA copied to clipboard
Add option search_filter to ldap
This patch adds the option to override the search_filter in ldap with an own complex search_filter, because sometimes a single simple argument is not sufficient.
All Submissions:
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
- [x] Have you added an explanation of what problem you are trying to solve with this PR?
- [x] Have you added information on what your changes do and why you chose this as your solution?
- [ ] Have you written new tests for your changes?
- [x] Does your submission pass tests?
- [x] This project follows PEP8 style guide. Have you run your code against the 'flake8' linter?
I tested this PR against v8.0.1 and found no issues. Thank you for this nice commit. I have two simple requests for changes:
- There is a typo, can you please change 'komplex' to 'complex'.
- In the example configuration, can you add a simple example, like
# Override the contructed search_filter with ldap_identifier_attribute
# with an own filter. This allows more complex queries.
# {0} will be injected with the ordered_identifier_candidates.
# For example:
# search_filter: "(&(uid={0})(isMemberOf=authorized))"
I updated the example as requested.
Any update here? This PR is approved for quite some time now.
@shaardie I talked with the group about this PR and also the other PRs you submitted around the LDAP attribute microservice and after new tests have been added to the test harness for the new functionality they will be merged. You and I corresponded before about adding tests and you indicated you were not going to do it. I have begun the work of adding tests using the ldap3 mocking functionality (see https://ldap3.readthedocs.io/en/latest/mocking.html) but it is not a high priority for me and I only have an hour every couple of weeks to work on it.
If you change your mind and want to contribute to developing the tests please let me know and we can try to make faster progress on getting this PR merged. Thanks.