This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
The on_threepid_bind
module API is called when a 3PID is *added* (associated locally), not when it is *bound*
#14955
Labels
A-3PID
3rd party identifiers: e.g. email, phone number
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Confusing terminology strikes again. Generally, if you "add" a third-party ID (3PID) to your account in Matrix, you are making an association between your Matrix ID and a 3PID that is scoped to your homeserver. You can allow your Matrix ID to be discovered by remote users who have your 3PID by "binding" the 3PID to your Matrix ID on an identity server.
This terminology is reflected in the endpoints, and was coined during the privacy sprint.
Associating your 3PID with your Matrix ID on your homeserver
POST /_matrix/client/v3/account/3pid/add
POST /_matrix/client/v3/account/3pid/delete
Binding a 3PID to your Matrix ID on an identity server
POST /_matrix/client/v3/account/3pid/bind
POST /_matrix/client/v3/account/3pid/unbind
We have a
on_threepid_bind
module callback which fires when you add an association between a 3PID and your Matrix ID on your local homeserver. It specifically does not fire when you perform a bind against and identity server.I think the ideal scenario would be to have 2 module callback methods:
async def on_update_user_third_party_identifier(user_id: str, medium: str, address: str)
- called before a user adds or removes a 3PID to their account at the homeserver scope.async def on_update_identity_server_binding(id_server: str, user_id: str, medium: str, address: str)
- called before a user adds or removes a binding of their 3PID and Matrix to a given identity server.It may also be advantageous to allow these methods to block the action. When a module decides to block a local association, this could result in a
400/M_UNKNOWN
(?) response to the client. If blocking a bind against an identity server, this could instead result in a response of200, {"id_server_unbind_result": "no-support"}
being sent to the client. This would allow you to prevent a user from making a binding of non-company email addresses, or to identity servers other than those that are authorised.The text was updated successfully, but these errors were encountered: