Bot::B...::Auth(3pm)

πŸ“¦
version 1.30 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Bot::B...::Auth β€” authentication for Bot::BasicBot::Pluggable modules πŸ’–

okay bestie, so this is Bot::B...::Auth(3pm), part of the User Contributed Perl Documentation situation, and it's genuinely one of those little modules that's doing the most important job in the whole group chat. it's the bouncer. the vibe check. the "you're not on the list, babe" at the door. πŸšͺ✨


✨ VERSION ✨

version 1.30 β€” iconic, as always πŸŽ€


🌸 SYNOPSIS 🌸

so here's the tea: this module catches messages at priority 1 and straight-up stops anything starting with ! unless the user is authed. periodt. πŸ›‘

the way that works is gorgeous actually: most admin modules, like Loader, can just chill at priority 2 and assume the user is authed if the !command even reaches them, because Auth already filtered out all the randos. no cap.

so like, if you want to use modules that can change bot state β€” Loader or Vars, iykyk β€” you almost certainly want this module. don't skip it. she's necessary. πŸ’…


πŸ¦‹ IRC USAGE πŸ¦‹

⚠️ the default user is admin with password julia. Change this. fr fr, immediately. 🚨
  • !auth <username> <password> β€” authenticate as an administrators πŸ’« (yes, the grammar is a little off, we don't gatekeep). heads up tho: logins timeout after an hour. ⏰
  • !adduser <username> <password> β€” adds a user with the given password. welcome to the club, bestie 🫢
  • !deluser <username> β€” deletes a user. don't delete yourself tho, that's probably not a good idea πŸ’€ (we've all been there)
  • !password <old password> <new password> β€” change your current password. you must be logged in first, no exceptions πŸ”
  • !users β€” list all the users the bot knows about. like a little roster. a guest list. πŸ‘‘

πŸ’œ VARIABLES πŸ’œ

  • password_admin β€” this variable specifies the admin password. it's normally set via the !password directive and defaults to 'julia'. Please change this as soon as possible. i am begging you. πŸ™
  • allow_anonymous β€” if this variable is true, the implicit authentication handling is disabled. every module will have to check for authentication via the authed method, otherwise access is just granted. this is only useful to allow modules to handle directives starting with an exclamation mark without needing any authentication. and to make things even more interesting, you won't be warned that you haven't authenticated, so modules needing authentication will fail without any warning. it defaults to false and should probably never be changed. You've been warned. 😭
lowkey allow_anonymous is giving "chaos mode" and highkey you should leave it alone. just saying. πŸ™ˆ

⭐ METHODS ⭐

the only useful method is authed():

  • authed($username) β€” Returns 1 if the given username is logged in, 0 otherwise:
if ($bot->module("Auth")->authed("jerakeen")) { ... }

look at that. clean. slay. ✨


πŸ’€ BUGS πŸ’€

okay so, the honest moment:

  • All users are admins. this is fine at the moment, as the only things that need you to be logged in are admin functions.
  • Passwords are stored in plaintext, and are trivial to extract for any module on the system. the author doesn't consider this a bug, because he assumes you trust the modules you're loading. (main character trust exercise energy ngl 🫠)
  • If Auth is not loaded, all users effectively have admin permissions. this may not be a good idea, but is also not an Auth bug β€” it's an architecture bug.
πŸ’€ the whole "everyone is admin, passwords are plaintext" thing is genuinely cursed but it is what it is. know what you're loading, bestie.

πŸ‘‘ AUTHOR πŸ‘‘

Mario Domgoergen <mdom@cpan.org> πŸ’–

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie! 🌈 this one's Bot::B...::Auth(3pm), living under perl v5.40.0, dated 2024-08-24. go change that default password, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from