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

Matrix: Change display name (or status) to OOO when on vacation (from bamboo) #37

Closed
mordamax opened this issue Jul 27, 2022 · 8 comments

Comments

@mordamax
Copy link
Collaborator

mordamax commented Jul 27, 2022

This could be a bot which talks to the user and reminds you on something like display-name or status.
Or automatic change accordingly to Bamboo OOO status

You can do it via the synapse admin API. You need the access_token of an admin account. Then you can do:

curl -X PUT --header 'Authorization: Bearer <access_token>' --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "displayname": "[ooo] Mak" }' 'https://matrix.parity.io/_synapse/admin/v2/users/@maksym:matrix.parity.io' -i
@yncyrydybyl
Copy link

I think this can work togeter with #32

@mordamax
Copy link
Collaborator Author

@yncyrydybyl i'm curious how technically it's possible?
afaik it's possible only if you provide the access_token of account? or any other ways?

There are couple of problems with tokens as I see -

  • token invalidates automatically if user logs out from session
  • everyone needs to find/attach it explicitly, which naturally makes the feature Ignored, as pain in ass

@lovelaced
Copy link

We should absolutely not have users give access tokens for their accounts away.

@mutantcornholio
Copy link
Contributor

mutantcornholio commented Sep 14, 2022

Can [email protected] Bamboo account (that we have for some reason) help here?

@mordamax
Copy link
Collaborator Author

@mutantcornholio the question is who is able to change someone's name ? :)
Per https://matrix.org/docs/api/#put-/_matrix/client/v3/profile/-userId-/displayname

This API sets the given user's display name. You must have permission to set this user's display name, e.g. you need to have their access_token

if there's no secure/good way to share person's matrix access_token - my question is: what are the other ways to do this?

@yncyrydybyl
Copy link

You can do it via the synapse admin API. You need the access_token of an admin account. Then you can do:

curl -X PUT --header 'Authorization: Bearer <access_token>' --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "displayname": "[ooo] Mak" }' 'https://matrix.parity.io/_synapse/admin/v2/users/@maksym:matrix.parity.io' -i

@gabreal
Copy link

gabreal commented Dec 21, 2022

imo a endpoint witch could be used to query absences could be useful and probably integrated into matrix as a widget or something somehow. i don't think it would be good to automate this for everyone directly, as it would reveal confidential information to externals in public rooms.

@lovelaced
Copy link

I'm going to close this as not planned because 1) what gabriel said, 2) we don't want to get in the business of changing anything about people's accounts with the admin api beyond password resets and explicit requests.

If teams want the absences bot that should do for the time being until statuses are finalized in element.

@lovelaced lovelaced closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2022
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

No branches or pull requests

5 participants