Hi,
I've been working on this for some time now. The current interface has
several disadvantages, mostly code duplication, poor memory hierarchy
and it is hard to add new DP methods. I also disliked the fact that
there is no module constructor and we have to create id_context
everywhere and that we work with DBus on module side. All this and more
should be solved in these patches.
See:
https://fedorapeople.org/cgit/pbrezina/public_git/sssd.git/log/?h=backend
It is still work in progress and this is a showcase or proof of concept
if you will. In the first version I want to keep DP methods as is, just
use a new interface between DP and backend. This allows us to take
advantage of the new code without actually changing anything in
responder. I would also like to implement module's constructor so id
context may be shared in a better way.
Currently only sudo is implemented and I'd like to wait for you opinions
before continuing.
In the second version I would like to change DP methods to be more
granular and to have automatically parsed parameters and different
output parameters so we donẗ have to misuse return codes. This, however,
will require changes on responder side (mostly to handle error
correctly). I'm thinking about writing something similar as cache_req
for this purpose. There is a commented code in the last patch that shows
how this change may simplify handlers.
Here is a short list of benefits over current code:
* data provider is a black box completely separated from backend
* method handlers are just simple tevent requests on backend side
* no need of spy on be_client
* simplified and error proof adding of new responders
* simplified adding of new methods
* reply to D-Bus message is completely handled by DP code
* each target can have several methods defined
* properties can be added on objects
* each method can have output parameters
* modules now support constructor
* improved debugging
* clear memory hierarchy
The code compiles but it is not yet used.
The first patches just rename files so it is clear what is data provider
and what is backend. It is something I know we wanted to do a long time
ago but there was never a good enough reason to touch those files.
I hope you like it.