sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
948 stars 403 forks source link

Check If authed with Nickserv in modules ( admin module ) #454

Closed davidmann4 closed 9 years ago

davidmann4 commented 10 years ago

Is there any chance to enable authed users with nickserv? Otherwise it is not very secure.

/msg NICKSERV acc username

returns the user state of the user

can you guide me how I can add this functionality to the bot?

tyrope commented 10 years ago

Problem with that is not all networks have the same nickserv software. So this cannot be done reliably.

davidmann4 commented 10 years ago

any idea how I can add it for my bot? seems hard to implement since there is no send msg command which returns the answer ... It is important for me that they are authed

also everyone with the admin module enabled has a high security risk without this - it should be mentioned in the wiki!

elad661 commented 10 years ago

It's not a high risk: most people would either define nick+hostmask for admins, or configure their nickserv/other nick protection service to force nick change very quickly.

In addition to that, you can't do much damage with the admin module.

Regarding implementation of "sending a message and getting a reply", you'll have to use callbacks. IRC is async, and so is Willie. Adding a synchronous API would be terrible.

We could add one-time dynamic callbacks, or add a "source" property to callables - so they'll only be executed on messages from specific nicks - and that would make it a bit easier for you, but not much cause you still need async, and still need a workflow for user verification, and it'll make all Admin commands much slower too.

davidmann4 commented 10 years ago

Are there any examples how to use callbacks within your module framework? Or do I have to send a message to nickserv and create a command which listens to ACC in the message then maybe use a database to store the requested commands/accounts and execute them when the ACC > 1? Sounds very complicated to me ...

A short test showed me that the bot is not responding to NickServ answers aswell ...

used bot.msg("NickServ","acc 1") and had a callback like this:

@rule(r'.ACC.') def nickServCallback(bot,trigger): print trigger.nick print trigger

nothing happend - when I msged the bot directly it showed me the debug output ...

tyrope commented 10 years ago

The rule you're looking for is .*ACC.*

embolalia commented 9 years ago

NAK, as far as including this in the main project is concerned. Not sure why I didn't close this earlier; integration with various NickServs beyond authing the bot itself has never been something we consider inside our scope.