Skip to content

MSC2845: Phone number lookups using third party API #2845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: old_master
Choose a base branch
from

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Nov 2, 2020

A proposal for using the existing thirdparty API to look up bridged users for phone numbers.

Rendered

@turt2live turt2live changed the title MSC for phone number lookups using third party API [WIP] MSC2845: Phone number lookups using third party API Nov 2, 2020
@dbkr dbkr marked this pull request as ready for review November 2, 2020 19:59
@turt2live turt2live added kind:feature MSC for not-core and not-maintenance stuff proposal A matrix spec change proposal proposal-in-review labels Nov 2, 2020
@turt2live turt2live changed the title [WIP] MSC2845: Phone number lookups using third party API MSC2845: Phone number lookups using third party API Nov 2, 2020
@turt2live turt2live self-requested a review November 2, 2020 20:06
@@ -0,0 +1,88 @@
# MSC2845: Thirdparty Lookup API for Telephone Numbers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lgtm - i'm well up for (finally) using the /thirdparty/user/{protocol} API and generally improving our bridge user/room discovery UX than creating some phone-specific thing.

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems like a good use of an API we haven't used :D

Comment on lines +15 to +16
entered by the user (as defined for phone number identifiers elsewhere in the
Matrix spec).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link would be good

Comment on lines +33 to +36
Protocols are currently not namespaced and it is up to the Homeserver admin to
avoid collisions within the configuration. Any further protocols defined by the
specification should be namespaced, but collision avoidance remains the
responsibility of the Homeserver admin.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to consider saying "unspecified identifiers should follow MSC2758" just to cover future cases, and to help steer the problem towards modern spec practices.


## Proposal
The Matrix API defines the thirdparty lookup API for this purpose: the
`GET /_matrix/client/r0/thirdparty/user/{protocol}` endpoint would be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to the API please

```
[
{
"userid": "@_sip_01818118181%40sip.example.org:example.org",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we fix the naming of this while we're here? If no clients implement it, I'd consider it safe to do.

allow much less flexibility on how a Matrix ID was formed given a phone number.

## Security considerations
None known.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are security considerations to be had:

  • Do we need a rate limit? (yes - the spec doesn't define one)
  • Is there a risk of data harvesting to pick out valid/registered phone numbers?
  • etc

Comment on lines +25 to +28
The bridge is not expected to perform any canonicalisation of phone numbers at
this point: if a user dials a local number, a Matrix User ID representing that
local number should be returned. For this reason, there is no 'country' field
(or any other fields to indicate the user's location).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the expected behaviour if the client provides a local number? Is resolved relative to where-ever the bridge happens to be? To where the client is? Some other value? What if the bridge moves? What if the bridge doesn't support local numbers?

It seems like for least surprise we should require an "absolute" number here. That way the returned matrix ID can represent that number no matter what bridge is serving it and what that bridge defines "local" as.

If this isn't the case it would be nice to provide some justification.

@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants