bonsai icon indicating copy to clipboard operation
bonsai copied to clipboard

Question: Persistent Search and Extended Operations

Open tck42 opened this issue 4 years ago • 3 comments

I don't think persistent search is implemented in this library, nor a generic way to expose calling an arbitrary extended operation from python - would you be open to a pull request for those features?

If so, are there any requirements you have before you'd merge that you can think of off the top of your head, or should I take my best guess at the API for each feature, issue the request and just work from there?

tck42 avatar Apr 10 '20 20:04 tck42

I'd be open to it, but I've never figured out what would be the best way to integrate this feature into the module. Do you have a specific API in mind?

noirello avatar Apr 11 '20 23:04 noirello

For persistent search I was thinking basically the search API, with the three additional arguments tacked on to the end of the args (change_types, changes_only, return_ecs). Result would be a an ldapsearchiter or something very similar to it; the only question there is how to return the entrychangenotification if it's requested, I was thinking a tuple, (entry,entrychangenotification).

For extended operation, was thinking extendedoperation(req_oid, req_value, decode_resp, encode_req=None). If missing, req would assumed to be bytes, otherwise it'd be called to on req_value before sending to get bytes. decode_resp signature would be decode_resp(oid, resp_bytes).

Though apparently extended ops can be single request multiple response, I'll have to see if I can find a good test case for that, maybe the return from decode_resp can be a tuple of the result and a boolean indicating if there are more messages expected. I'll have to think a bit more on how that would look,

tck42 avatar Apr 12 '20 19:04 tck42

Sounds good. I'd happily see a PR and go from there.

noirello avatar Apr 13 '20 11:04 noirello