-
Notifications
You must be signed in to change notification settings - Fork 27
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
Force user logout option #44
Comments
Hi, thanks for the idea but is there an API available for that? Did you check the Synapse admin API docs yet? https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/index.html Synadm is actually just a cli frontend for what these API's are offering. |
maybe have a look in the user admin section of the docs and see what would suit your usecase. thank |
I suppose it requires two steps: First get all devices belonging to the user: The API is: GET /_synapse/admin/v2/users/<user_id>/devices And second - delete devices: The API is: POST /_synapse/admin/v2/users/<user_id>/delete_devices { Is it more clear now? :-) |
I will make a patch for this. Use case: mass delete unused devices/sessions for all users in a room, e.g. for performance reasons (encryption cost for each message grows with the number of recipient devices) and to reduce the attack surface. Acceptance criteria:
|
@nemobis nice! thanks in advance, that's great news! :-)
My first idea when I read this feature suggestion was that the delete command should simply accept device id's as returned by https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#list-all-devices, but having it accept user id's is probably closer to real world use cases. Also, at first, I was thinking that actually I am seeing 3 commands here:
Those two are very nice convenience features, and features that incorporate "days" instead of timestamps would fit user experience of synadm as this concept is already used in So that's my thoughts on that. What do you think of splitting into several commands? If you'd rather prefer to have all of above proposal into one big multi-functional |
Fixes issues JOJ0#44
Thank you @JOJ0 for your comments! For now I've implemented something quick that I needed to do some cleanup on my instance (and seems to work fine), but hopefully it's not too far from what you're describing.
That's what I thought initially too, but the deletion API requires a user_id so we'd need to iterate through all users if we're not provided with a user_id, no? I'm not sure there's a real usefulness to that.
That makes sense to me but a command like I also lost more time than I care to admit deciding whether to use the words "devices" or "sessions"... |
Fixes issues JOJ0#44
Hi @nemobis as you probably noticed, I merged your PR a couple of days ago. I started refactoring and advancing it in this branch: https://github.com/JOJ0/synadm/tree/pr45_refactor. This is the diff so far: master...pr45_refactor @ser Please help us test the new feature. Does it do everything you expected when you filed the feature request? Also now would be a good time to request changes in how the output gets formatted and the general workflow of the new command. Do you have synadm installed via pip or via git? If you are unsure how to let it run from the feature branch |
Also up for discussion: Default values of
|
Feature released in: https://github.com/JOJ0/synadm/releases/tag/v0.32 |
Thank you! That's great. Sorry for becoming unresponsive. x_x
|
I've forgotten to acknowledge that everything works amazing and it a function I use every day. Thank you @nemobis <3 |
Il 13/06/22 04:51, ᎠᎡ. Ѕϵrgϵ Ѵictor ha scritto:
I've forgotten to acknowledge that everything works amazing and it a function I use every day. Thank you @nemobis <3
That's great to hear!
|
There should be an option to invalidate all access tokens for particular user = force logout.
The text was updated successfully, but these errors were encountered: