Issue Description: Add generic filter to DSLdapObjects
topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, "mail=*")
We'll need to add a generic filter type to handle the mail=* case.
The hereby reasoning itself is pretty vague. Please, always link back whenever possible. I guess this is a follow-up to https://pagure.io/389-ds-base/pull-request/50176#comment-74615 - if not, fix, please. Thanks.
Metadata Update from @mhonek: - Custom field origin adjusted to None - Custom field reviewstatus adjusted to None
So I think the best way to do this, is to have in DSLdapObjects, I think we should have a "filter" type. This would be similar to https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/_mapped_object.py#_903
My thinking is that it should look like:
dso = DSLdapObjects(inst) cand = dso.filter(mail='*', objectClass='bar')
It would be implemented with a signature like:
def filter(self, **kwargs):
Then, we'd unpack the kwargs dict, and use the _gen types to create the filter of the object requirements AND the filter requirements. You'd probably do something like:
_gen_filter(kwargs.keys, kwargs.values)
That would turn the dict into two arrays, one keys, one values, where the indexes correlate.
https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/_mapped_object.py#_57
The main limit of this would be that we could only represent "AND" conditions in this function definition. How we represent an or condition I'm not sure of. Perhaps we need to think about a different function sig? I think that filtering like this is not super common outside of tests - it's been literal years, and this is the first time i've had a request for this behaviour.
Metadata Update from @firstyear: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This issue has been cloned to Github and is available here: - https://github.com/389ds/389-ds-base/issues/3278
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: fixed)