linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

CustomIdentityDAO support callback mechanism when delete #5198

Open vttranlina opened 1 month ago

vttranlina commented 1 month ago

To update the delete method in IdentityRepository to call a callback after successful deletion. Create the interface callback looks like this:

trait IdentityCallback {
  def identityRemoved(username: Username, identityId: IdentityId): Publisher[Void]
}

class IdentityCallbackNoop extends IdentityCallback {
  override def identityRemoved(username: Username, identityId: IdentityId): Publisher[Void] = SMono.empty
}

Invoke callback in IdentityRepository#delete

Dod:

chibenwa commented 1 month ago

Hmmmm

This is OK when the user explicitly deletes an identity.

But what happens when the administrator removes an alias? Would it remove (or render innaccessible) the identities? If so, would that callback be called?