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

Removing of threepid is not supported #135

Closed
JOJ0 opened this issue Nov 13, 2023 · 2 comments · Fixed by #136
Closed

Removing of threepid is not supported #135

JOJ0 opened this issue Nov 13, 2023 · 2 comments · Fixed by #136

Comments

@JOJ0
Copy link
Owner

JOJ0 commented Nov 13, 2023

From what I understand of the docs and my tests, this option does not allow to remove/override the existing 3pids, only to add more:

-t, --threepid <threepid>

Add a third-party identifier. [...]

Originally posted by @n-peugnet in #100 (comment)

@JOJ0
Copy link
Owner Author

JOJ0 commented Nov 13, 2023

Actually there are several issues with user modify --threepid

  • It does not add threepid, it replaces ALL existing threepids with those passed as --threepid options
  • It seems to only be possible to pass exactly one email address and one msisdn entry via synadm. I couldn't get multiple email addresses to work....not sure if the API does not accept that....further investigation required. The API docs are unclear about that https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#create-or-modify-account
  • The documentation/--help is wrong, it states "add threepids", but scould be "replace threepids"
  • It is not possible to pass something that says "clear all threepids"

As a workaround @n-peugnet, you could remove ALL threepids by issuing a plain request to the API using the raw command: https://synadm.readthedocs.io/en/latest/synadm.cli.raw.html

synadm -vv raw v2/users/@testuser1:yourdomain.org -m put --data '{"threepids":""}'

@JOJ0
Copy link
Owner Author

JOJ0 commented Nov 13, 2023

Some testing reveals that the second bulletpoint in the list above is indeed a bug within synadm. Adding several email adresses via a plain API call works! Both are added:

$ synadm -vv raw v2/users/@testuser1:peek-a-boo.at -m put --data '{"displayname":"New long testuser1 name","threepids":[{"medium":"email","address":"abc@123.com"},{"medium":"email","address":"def@456.com"}]}'
...
...
...
DEBUG {"displayname":"New long testuser1 name","threepids":[{"medium":"email","address":"abc@123.com"},{"medium":"email","address":"def@456.com"}]}
INFO  Querying put on https://peek-a-boo.at/_synapse/admin/v2/users/@testuser1:peek-a-boo.at
admin: false
appservice_id: null
avatar_url: null
consent_server_notice_sent: null
consent_ts: null
consent_version: null
creation_ts: 1573653091
deactivated: false
displayname: New long testuser1 name
erased: false
external_ids: []
is_guest: 0
last_seen_ts: null
locked: true
name: '@testuser1:peek-a-boo.at'
shadow_banned: false
threepids:
- added_at: 1699885788372
  address: def@456.com
  medium: email
  validated_at: 1699885788372
- added_at: 1699885821397
  address: abc@123.com
  medium: email
  validated_at: 1699885821397
user_type: support

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 a pull request may close this issue.

1 participant