389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
211 stars 93 forks source link

PR - Ticket 50980 - RFE extend usability for slapi_compute_add_search_rewriter and slapi_compute_add_evaluator #4034

Closed 389-ds-bot closed 4 years ago

389-ds-bot commented 4 years ago

Cloned from Pagure Pull-Request: https://pagure.io/389-ds-base/pull-request/50981


Bug Description: plugin api allows to register filter rewriter callback (slapi_compute_add_search_rewriter) and computed attribute callback (slapi_compute_add_evaluator) This requires to write a new plugin to register callbacks. This RFE is to simplify the use of those plugin api interfaces so that rewriters (filter or computed attribute) in shared library can be taken into account as soon as listed in config entries

Fix Description: It follows the design http://www.port389.org/docs/389ds/design/search_rewriters.html registers callback listed in children of 'cn=rewriters,cn=config' The rewriters.c files contains examples of filter rewriter and computed attribute

Resolves: #4033

Reviewed by: Mark Reynolds, Alexander Bokovoy, William Brown (thanks !!)

Platforms tested: F30

Flag Day: no

Doc impact: no

389-ds-bot commented 4 years ago

Comment from tbordaz (@tbordaz) at 2020-04-09 15:07:40

rebased onto 2710bbbb3f93f9f1c015f355989ba8f836861289

389-ds-bot commented 4 years ago

Comment from tbordaz (@tbordaz) at 2020-04-09 15:20:20

Thanks @Firstyear for your comment. If you agree with the patch but want some changes with int32_t I can do that on the fly and push that patch before the end of the week.

389-ds-bot commented 4 years ago

Comment from firstyear (@Firstyear) at 2020-04-14 07:46:45

This one was on purpose it is a callback for slapi_filter_apply that is 'typedef int (FILTER_APPLY_FN)(Slapi_Filter f, void *arg);' I wanted to stick on the definition even if I guess int32_t would be accepted as well

It would be good to comment these :)

389-ds-bot commented 4 years ago

Comment from firstyear (@Firstyear) at 2020-04-14 07:47:10

It is used to retrieve pblock[SLAPI_PLUGIN_INTOP_RESULT] and sets a 'int', this is why I declared it as an int. Should it preferably be int32_t ?

If it's an array deref then size_t I think is the correct type here ....

389-ds-bot commented 4 years ago

Comment from firstyear (@Firstyear) at 2020-04-14 07:47:23

Anyway, with those two last comments, ack from me :)

389-ds-bot commented 4 years ago

Comment from tbordaz (@tbordaz) at 2020-04-14 13:55:02

rebased onto a11bae3243faebc8f277398ab2905aaba45094b3

389-ds-bot commented 4 years ago

Comment from tbordaz (@tbordaz) at 2020-04-14 13:56:25

Pull-Request has been merged by tbordaz

389-ds-bot commented 4 years ago

Patch 50981.patch