#12750 Updating StandupBot to support accesstoken login
Opened 4 months ago by gwmngilfen. Modified 3 months ago

Context: We currently use a matrix standupbot for logging our daily updates (my fork is at https://github.com/GregSutcliffe/standupbot). However, it is using an account on the Ansible homeserver (ansible.im) because the current code relies on password login, which fedora.im has disabled. It would be nice to use a fedora.im account for this purpose.

I've attempted to tackle this, but hit a wall. Here's where I got to:
- An account exists
- I can log in manually (via Element Web) and get an access token.
- The bot uses the Mautrix-Go framework, which builds to a single binary (as normal) so it's fairly easy to test
- However, the code is old, and is on v0.10.12 which is 3+ years old

I managed to alter the code to accept an AccessToken (see my last commit on the "openshift" branch which does actually work, however encryption does not. The accesstoken flow is different to the password flow - AIUI password flow sets up a new deviceID and all required encryption, while accesstoken flow reuses an existing ID and needs some kind of key sync to work in encrypted rooms.

After some hours banging my head on this, I gave up and deployed the Communishift version using the Ansible matrix account. Fixing this might be a nice Friday/day-of-learning task for someone interested in Go & Matrix?

If so, steps to reproduce:
- clone the code and build the master branch
- create a Matrix account somewhere to run as a bot test user (ideally somewhere using passwords)
- configure and run the bot, and start a DM with it - check it responds
- then build the openshift branch, grab an accesstoken, reconfigure, and start another DM
- this will fail, whereas it should respond in an unencrypted room

@abompard might interest you? Low priority ofc!


Metadata Update from @gwmngilfen:
- Issue tagged with: low-gain

4 months ago

Metadata Update from @smoliicek:
- Issue tagged with: medium-trouble

4 months ago

@ryanlerch may have some knowledge in this area due to the other bots?

but maubot may do things very differently, not sure.

Maubot abstracts all the login/logout stuff for you, so you only have to write what to do when the bot receives events. It's a great framework, but since the issue here is setup-related, I don't expect much overlap.

That said, Maubot handles access-tokens, so perhaps looking at the framework code might help.

Metadata Update from @kevin:
- Issue priority set to: Waiting on Assignee (was: Needs Review)

3 months ago

Log in to comment on this ticket.

Metadata