RouxRC / gazouilleur

IRC bot for collaborative use and monitoring of Twitter
GNU Affero General Public License v3.0
19 stars 13 forks source link

Support for SASL authentication (Issue #64) #65

Closed wincelau closed 2 years ago

wincelau commented 2 years ago

Addition of a SASL Authentication option in the config and implementation using this code: https://github.com/habnabit/txsocksx/blob/master/examples/tor-irc.py

I don't do a lot of python, so I'm not sure I put the code in good places

Relating to issue #64

RouxRC commented 2 years ago

Seems really straightforward and with no border effects, so i'm merging right away (and the source code is using an MIT like licence so no problem to integrate their code)

Thanks Vince!

RouxRC commented 2 years ago

Just one thing, I see while testing it that I now receive these two lines, which make total sense:

2022-01-02 17:48:44+0100 [IRC/Gazouilleur_test] SERVER NOTICE [SaslServ!SaslServ@services.libera.chat]: Last login from: ~Gazouille@XXX.XXX.XXX.XXX on Jan 02 16:47:51 2022 +0000.
2022-01-02 17:48:45+0100 [IRC/Gazouilleur_test] SERVER NOTICE [NickServ!NickServ@services.libera.chat]: You are already logged in as Gazouilleur_test.

It might be worth adding an option to skip the classic authentication with NickServ when SASL is activated to avoid the second line, although I don't believe this should have much impact, will try and see

edit: well, this is handled natively by the twisted IRC client, so disabling it would require to retake the whole functions from the sourcecode, not sure it is worth it, I guess we can live with a double authentication attempt at each start ;)