Repository navigation
Conversation
|
Sorry for the delay, lot of $dayjob atm. Will review your PR soon! |
| // (persistent search listeners read the modified entry), so the queue must not be | ||
| // bounded : a rejected notification would make this operation fail. | ||
| ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( 10, 10, 1000, TimeUnit.MILLISECONDS, | ||
| new LinkedBlockingQueue<Runnable>(), threadFactory ); |
There was a problem hiding this comment.
Not sure this is a good idea: persistent search can last for days, without any update operations being done.
| try ( Cursor<Entry> cursor = session.getCoreSession().search( req.getBase(), SearchScope.OBJECT, | ||
| new PresenceNode( SchemaConstants.OBJECT_CLASS_AT ), AliasDerefMode.NEVER_DEREF_ALIASES, | ||
| SchemaConstants.NO_ATTRIBUTE ) ) | ||
| { |
There was a problem hiding this comment.
Not sure it's necessary. We can let the cursor being auto-closed without doing anything with it, teh idea is just to check that the user is authorized.
|
The raised issue is really critical: we must absolutely check the authorization for each entry potentially returned to the client. Now, I'm not sure the proposed solution is ideal: it costs a supplemental search for each modified entry, something we want to avoid at all. |
|
It's even more complex than what I thought. Results are sent to the client when a modification is applied, through code like: As you can see, before passing into the listener (list code line) we first fetch the entry ("get the modified entry") which do a lookup using the context. I do think we then pass through the authorization interceptor. To be verified... (and for all operations) |
|
OK thanks @elecharny . Should I close this Pr if you want to pursue a different way of fixing it? |
|
I still have to add some unit test for this one. I have little time atm, but I'll try to dedicate a part of it to this PR, so please, keep it open. Thanks :-) |
Apply search authorization to persistent search notifications
Entries sent to a persistent search client were taken straight from the
operation context, bypassing the authentication and ACI checks applied
to a normal search, as well as the userPassword hiding. With changesOnly
set, no check at all was done on the client before registering it.
the client's own session, with a base level search, and only sends it
if it is visible, with the attributes the client is allowed to read.
userPassword is removed when the server hides passwords.
beforeEntryDeleted() callback, called by the EventInterceptor before
the entry is deleted.
the client's session before the listener is registered, so that an
unauthenticated client is rejected when anonymous access is disabled.
wait for the end of the operation which notifies them, and a rejected
notification made that operation fail.