kelaresg / go-skype-bridge

A Matrix-Skype puppeting bridge
GNU Affero General Public License v3.0
38 stars 19 forks source link

Automatically regenerate skype token. #14

Closed OttoHollmann closed 2 years ago

OttoHollmann commented 2 years ago

As proposed in issue #5, adding commands save-password and remove-password to save user password into database. This password will be used to obtain new skype token when the previous one expires.

This is totally opt-in feature, so password will not be saved until user execute command save-password.

Roadmap:

nicodier commented 2 years ago

Thanks, looking forward to see this feature! Actually I created a cron job that does a relogin every night (through matrix chat api) and removed the function to reset portals, because otherwise I always had to accept new portals after a logout/login.

OttoHollmann commented 2 years ago

I think I'm done with this pull request. Feel free to test it and provide feedback because I'm not using skype bridge so often. You can also use my image for testing: docker pull registry.hollmann.cz/otto/public-docker/go-skype-bridge:Automatically_regenerate_skype_token

Automatic relogin should work even without storing password into database. But if you want to be automatically logged in after bridge start, you have to store your password into database.

pidongqianqian commented 2 years ago

looks like a workaround.

my original idea was to refresh the new token from the old token to keep the login state, it was put on hold due to being busy with other things recently.

i'll start testing right away.

pidongqianqian commented 2 years ago

I reviewed the code and tested it.

there are two points:

  1. the password needs to be encrypted before store, although the effect is limited, the risk of storing in plaintext is too great.
  2. for users who log in by email, they cannot log in automatically after restarting the bridge because the characters in the id(xx:xxxxx) are not their valid usernames.

It would be nice if you could fix these, after that I'll merge this commit.

forthommel commented 2 years ago

Hello @pidongqianqian @OttoHollmann I was wondering if there was any update on this (at least for me :slightly_smiling_face:) long-awaited feature?

pidongqianqian commented 2 years ago

Hello @pidongqianqian @OttoHollmann I was wondering if there was any update on this (at least for me 🙂) long-awaited feature?

I may have an update on it next week Looks like it can be merged now

OttoHollmann commented 2 years ago

Thank you for merging and apologies for delay. But one feature is still missing - password encryption before storing it into database, I will try to come with another pull request within one week.