Cataly...tpasswd(3pm)
π Catalyst::Authentication::Store::Htpasswd β the manual, but make it cute π
okay bestie, buckle up, because this is Catalyst::Authentication::Store::Htpasswd, a lil Perl module from the User Contributed Perl Documentation corner of the universe. it does user storage + authentication, and it's giving "old money" energy: classic, reliable, quietly slaying since forever. β¨
πΈ VERSION πΈ
version 1.006 β yeah she's got a number and she's proud of it. π
π¦ SYNOPSIS π¦
here's the whole vibe, copy-paste ready, no notes:
use Catalyst qw/
Authentication
/;
__PACKAGE__->config(
authentication => {
default_realm => 'test',
realms => {
test => {
credential => {
class => 'Password',
password_field => 'password',
password_type => 'self_check',
},
store => {
class => 'Htpasswd',
file => 'htpasswd',
},
},
},
},
);
sub login : Global {
my ( $self, $c ) = @_;
$c->authenticate({ username => $c->req->param("login"), password => $c->req->param("password") });
}
literally that's it. login sub, config block, done. main character behaviour. π
π DESCRIPTION π
so this plugin uses Authen::Htpasswd to let your application use .htpasswd files as its authentication storage. that's the whole tea. your app gets to authenticate against a good old-fashioned .htpasswd file and honestly? iconic. π«Ά
β¨ METHODS β¨
π new
a simple constructor, fr fr. it dies if the htpassword file can't be found. so likeβ¦ if you typo the path, she's not being polite about it. π
π find_user
looks up the user, and returns a Catalyst::Authentication::Store::Htpasswd::User object. that's the return type, no substitutions, no cap. π₯
π user_supports
delegates to Catalyst::Authentication::User->supports β or an override in user_class, if you've got one. your call, bestie. π
π from_session
delegates the user lookup to find_user. short king. does one thing. respects it. π
π CONFIGURATION π
π file
the path to the htpasswd file. here's the rules:
- if the path starts with a slash, it's assumed to be a fully qualified path.
- otherwise, the path is fed through
$c->path_toand so normalised to the application root.
alternatively, it is possible to pass in an Authen::Htpasswd object right here, and that will be used as the htpasswd file. yes, an actual object, not a path. options, we love to see it. β¨
π user_class
change the user class which this store returns. defaults to Catalyst::Authentication::Store::Htpasswd::User.
you can use this to add extra functionality to the user class by sub-classing it, but ngl you will not normally need to. it's the "break glass in case of emergency" setting. π
π user_field
change the field that the username is found in, in the information passed into the call to $c->authenticate().
this defaults to username, and generally you should be able to use the module as shown in the synopsis. but if you need a different field name, this setting can change the default. periodt. π
example:
__PACKAGE__->config( authentication => { realms => { test => {
store => {
class => 'Htpasswd',
user_field => 'email_address',
},
}}});
# Later in your code
$c->authenticate({ email_address => $c->req->param("email"), password => $c->req->param("password") });
π SEE ALSO π
Authen::Htpasswd. that's the one. iykyk. π¦
π«Ά SUPPORT π«Ά
bugs may be submitted through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Authentication-Store-Htpasswd> β or by email to bug-Catalyst-Authentication-Store-Htpasswd@rt.cpan.org. pick your fighter. π
there's also a mailing list available for users of this distribution, at <http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst>.
and there's also an irc channel available for users of this distribution, at #catalyst on irc.perl.org (<irc://irc.perl.org/#catalyst>). come hang out, we're nice. π
π AUTHOR π
XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org>
β CONTRIBUTORS β
- David Kamholz
<dkamholz@cpan.org> - Tomas Doran
<bobtfish@bobtfish.net> - Karen Etheridge
<ether@cpan.org> - Tom Bloor
<t.bloor@shadowcat.co.uk> - Christopher Hoskin
<christopher.hoskin@gmail.com> - Ilmari Vacklin
<ilmari.vacklin@cs.helsinki.fi>
absolute legends, every single one. π
π COPYRIGHT AND LICENCE π
this software is copyright (c) 2005 by XXXX XXX'XX (Yuval Kogman).
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild, but respectfully. π
and that's the whole page bestie, no skips, no summaries, every flag and every email intact. slay. π
signing off from perl v5.36.0, dated 2022-12-06, on the page formerly known as Cataly...tpasswd(3pm) β mwah, catch you in the next manpage. π§β¨
π¦ where this page comes from
- debian bookworm: libcatalyst-authentication-store-htpasswd-perl 1.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-authentication-store-htpasswd-perl 1.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-authentication-store-htpasswd-perl 1.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-authentication-store-htpasswd-perl 1.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-authentication-store-htpasswd-perl 1.006-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms