Cataly...tpasswd(3pm)

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

πŸ’– 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_to and 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. πŸ’œ


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