Password(3pm)

πŸ“¦
version 1.9 Β· 2 versions
  • 1.9 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.9 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Password(3pm) πŸ’–

okay bestie, so this is the manual page for DBIx::Password, from the User Contributed Perl Documentation, and it's lowkey one of those modules that just makes your life easier, no cap. sit down, grab a strawberry πŸ“, and let's get into it.


✨ SYNOPSIS ✨

use DBIx::Password;
my $dbh = DBIx::Password->connect($user);
my $dbh = DBIx::Password->connect_cached($user);
$dbh->getDriver;
DBIx::Password::getDriver($user);
DBIx::Password::checkVirtualUser($user);

DBIx::Password::clearConfig();
DBIx::Password::readConfig("$ENV{HOME}/.my.secret.file");

that's the whole vibe right there, periodt. πŸ‘‘


🌸 DESCRIPTION 🌸

okay so picture this: you're out here keeping track of database passwords and such throughout all your scripts, and honestly? it's giving chaos. πŸ’€ and then there's the whole nightmare of changing those passwords on a mass scale β€” not it. this module is one possible solution, and she ate. πŸ’…

it stores all your virtual users and data in /etc/dbix-password.conf. for each user you need to specify the database module to use, the database connect string, the username, and the password. you will have to give a name to this virtual user, and bestie, you can add as many as you like. as many as you want. iconic. ✨

lowkey a PSA from the author: I would recommend that if you are only using this with web applications that you change the final permissions on this package after it is installed in site_perl such that only the webserver can read it. 🫢

a method called getDriver has been added so that you can determine what driver is being used β€” super handy for working out database indepence issues. (that's the author's spelling, we respect it, we don't touch it, no cap. πŸŽ€)

if you want to find out if the virtual user is valid, you can call the class method checkVirtualUser(). it returns true (1) if the username is valid, and zero if not. so clean. so simple. obsessed. πŸ¦‹

once your are done you can use the connect method (or the connect_cache method) that comes with DBIx-Password and just specify one of the virtual users you defined while making the module. easy peasy, main character energy only. πŸ’–

btw the author learned the bless hack that is used from Apache::DBI so some credit should go to the authors of that module β€” shoutout to them, they're the real ones. 🌈 and this is a rewrite of the module Tangent::DB that was done for slashcode. glow-up fr fr. ✨

if your program does not need the system-wide information stored in the /etc/dbix-password.conf file, you may use the clearConfig() and readConfig() functions to get the data from another source. and at any time, readConfig() may also be used to merge the data from another file into the currently-loaded configuration. merge queen. πŸ‘‘

hope you enjoy it. πŸ₯° (author's words, and honestly? we do.)


🏠 HOME 🏠

to find out more information look at:

http://www.tangent.org/DBIx-Password/

πŸ‘‘ AUTHOR πŸ‘‘

Brian Aker, brian@tangent.org


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page bestie, you're fully caught up πŸ’œ β€” this was Password(3pm), perl v5.36.0, dated 2022-12-04. go forth and never hardcode a password again, iykyk. 🧚✨

πŸ“¦ where this page comes from