Skip to content
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

add command 3pid for finding user by their 3PID #81

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

ashfame
Copy link
Contributor

@ashfame ashfame commented Nov 25, 2022

This PR adds support for 3PID endpoint for finding users by their 3PID value which could be an email or msidn (specified as medium).

Please note this requires Synapse v1.72.0 (I currently haven't been able to test this as our EMS server is still v1.71.0 and would get upgraded hopefully next week but this is relatively straight forward).

Unlike other endpoints but similar to auth-provider endpoint, it requires 2 values:

  • medium (email or msidn)
  • address (actual email address or phone number as per medium specified)

Documentation for this admin api endpoint

Correct usage

$ synadm user 3pid -m email universe@github.com
{"user_id": "@ashfame:synapse.dev"}

Looking forward to your feedback! :)

@JOJ0
Copy link
Owner

JOJ0 commented Nov 28, 2022

I can't test it either since my Synapse is too old as well but as you say it's pretty straightforward. I'll merge it now but will wait for your tests before I'll approach a next synadm release. Also if you feel like it, let's discuss in #synadm if it makes sense to include convenience commands into synadm user search with those last 2 PR's features.

A further thing I was wondering about is if it would make sense to build a Synapse version check into some of these "newer" synadm commands. The version api method could be used for that: https://github.com/JOJ0/synadm/blob/master/synadm/api.py#L923-L926, but that shouldn't bother this PR and could be introduced for several commands in a sperate submission.

@JOJ0 JOJ0 merged commit cfdd428 into JOJ0:master Nov 28, 2022
@ashfame
Copy link
Contributor Author

ashfame commented Nov 28, 2022

I can't test it either since my Synapse is too old as well but as you say it's pretty straightforward. I'll merge it now but will wait for your tests before I'll approach a next synadm release.

Sure thing! I will ping you here once I am able to test it and confirm.

Also if you feel like it, let's discuss in #synadm if it makes sense to include convenience commands into synadm user search with those last 2 PR's features.

Might be better done in a separate Github issue so that notifications and follow ups are a little easier? I don't have any urgency for it though. Also, haven't evaluated how it would make sense under the search command as of now.

A further thing I was wondering about is if it would make sense to build a Synapse version check into some of these "newer" synadm commands. The version api method could be used for that: https://github.com/JOJ0/synadm/blob/master/synadm/api.py#L923-L926, but that shouldn't bother this PR and could be introduced for several commands in a sperate submission.

Sounds like that would be a nice enhancement. My thoughts: The way I think it would make sense to implement is, such commands could defined upwards what version of Synapse is supported and then whenever an API hits a 404, we check whether the current version is less than specified Synapse version for that command and display a message to the user. That way, its not slowing down the command since it requires checking version every time its invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants