synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Add 3pid unbind callback to module API

Open MatMaul opened this issue 2 years ago • 1 comments

Currently we have a module interface that can react on a 3pid bind action, but it doesn't exist for unbind.

We rely on the fact that the identity server where we want to unbind should be stored in user_threepid_id_server table. Unfortunately the info there doesn't include the scheme, hence a bind to http://localhost:7777 will fail on unbind because https://localhost:7777 is called instead.

To overcome that this PR introduces a similar callback for 3pid unbind, so we can also override the identity server URL there for example.

MatMaul avatar Jul 08 '22 14:07 MatMaul

This is now tested alongside https://github.com/matrix-org/synapse-bind-sydent/pull/2, and tests seems to pass outside of an unrelated (flaky ?) one I think.

MatMaul avatar Jul 12 '22 21:07 MatMaul

Currently we have a module interface that can react on a 3pid bind action, but it doesn't exist for unbind.

Not quite I'm afraid. Currently we have a on_threepid_bind method which has nothing to do with identity servers association bindings. It is called when a local association is made on the homeserver. The method proposed in this PR would only be tangentially related to the existing method (and it would be confusing if they were given similar names). I've outlined this problem in more detail at https://github.com/matrix-org/synapse/issues/14955.

Additionally in the same issue, I've tweaked the design of the module callback method proposed by this PR: https://github.com/matrix-org/synapse/issues/14955#issuecomment-1410783719. The tweaked design only returns a single boolean while still fitting the use case of synapse-bind-sydent.

anoadragon453 avatar Jan 31 '23 17:01 anoadragon453

This PR has been superseded by https://github.com/matrix-org/synapse/pull/15044.

anoadragon453 avatar Feb 13 '23 19:02 anoadragon453