Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was 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

@anoadragon453

Description

@anoadragon453

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

Binding a 3PID to your Matrix ID on an identity server

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 of 200, {"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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-3PID3rd party identifiers: e.g. email, phone numberO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MinorBlocks non-critical functionality, workarounds exist.T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions