Lemonld...Password(3)

✨ NAME ✨

Lemonldap:NG::Portal::Password β€” bestie, this is the whole vibe for writing password modification modules for LemonLDAP::NG πŸ’…

It's a page from the User Contributed Perl Documentation manual, section 3, and it's giving "how do I even make my own password module" energy. Come thru 🫢


🌸 SYNOPSIS 🌸

okay so here's the whole shape of a password module, no cap:

package Lemonldap::NG::Portal::Password::My;

use strict;
use Mouse;

# Add constants used by this module
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);

our $VERSION = '0.1';

extends 'Lemonldap::NG::Portal::Password::Base';

sub init {
    my ($self) = @_;
    ...
}

sub confirm {
    my ( $self, $req, $old_password ) = @_;
    ...
}

sub modifyPassword {
    my ( $self, $req, $new_password, %args ) = @_;
    ...
}

like. that's it. that's the blueprint. iconic honestly ⭐


πŸ¦‹ DESCRIPTION πŸ¦‹

Password modules are the little guys in charge of changing the user's password β€” whether it's a regular password change or a password reset. Think of them as independent objects that get instantiated by the Lemonldap::NG portal, and they must provide the methods listed down below. No methods, no slay. Periodt.


πŸ‘‘ METHODS πŸ‘‘

πŸ’– Accessors and methods provided by Lemonldap::NG::Common::Module

free stuff you already get, bestie:

  • p β€” the portal object πŸŒ€
  • conf β€” the configuration hash (as a reference, bestie, it's a ref)
  • logger β€” an alias for the p->logger accessor
  • userLogger β€” an alias for the p->userLogger accessor

🌈 Methods that must be provided by a Password module

πŸŽ€ init()

This one runs after object creation β€” and lowkey it runs again after every configuration reload too. It must return a true value if initialization was successful. If it doesn't? That's not slay, that's a fail. πŸ’€

✨ Methods called on demand

All of these methods must return a Lemonldap::NG::Portal::Main::Constants value. And they get called with exactly one argument: a Lemonldap::NG::Portal::Main::Request object. That's the whole contract. 🫢

πŸ“ confirm($req, $old_password)

This method gets called to validate that the supplied old password is correct. And here's the juicy part β€” it's slightly different from authentication, because an expired old password cannot be used to log in, but it can be used to set a new password. so valid actually 😭

🧚 modifyPassword($req, $new_password, %args)

This is the one that does the actual password change. the main character of the whole operation ngl πŸ‘‘

Possible %args:

  • passwordReset β€” set in the case of a password reset (old password is not known)
  • useMail β€” set if $req->user contains the user's email

πŸ”₯ LOGGING πŸ”₯

Logging comes to you courtesy of $self->logger and $self->userLogger. And bestie, the following rules must be applied, fr fr:

  • logger->debug β€” technical debugging messages
  • logger->info β€” simple technical information
  • logger->notice β€” technical information that could interest administrators
  • logger->warn β€” technical warning
  • logger->error β€” error that must be reported to administrator
  • userLogger->info β€” simple information about user's action
  • userLogger->notice β€” information that may be registered (auth success,...)
  • userLogger->warn β€” bad action of a user (auth failure). Auth/Combination transform it to "info" when another authentication scheme is available
  • userLogger->error β€” bad action of a user that must be reported, (even if another backend is available with Combination)
ok so the userLogger->warn one is the sneaky one β€” Auth/Combination will transform it to "info" when another authentication scheme is available. it's giving "soft launch the failure" πŸ’…

πŸ’œ AUTHORS πŸ’œ

LemonLDAP::NG team <http://lemonldap-ng.org/team>


πŸ› BUG REPORT πŸ›

Found a bug? Need a feature? Use the OW2 system, bestie: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>


⭐ DOWNLOAD ⭐

Lemonldap::NG is available at <https://lemonldap-ng.org/download>


See the COPYING file for details.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


and that's the whole page, bestie!! πŸŽ€ this little beauty is Lemonld...Password(3) from the User Contributed Perl Documentation, and the footer was repping perl v5.42.3 dated 2026-09-24 β€” so yes, it's fresh, it's current, it's eating πŸ’–βœ¨ go write ur module, i believe in u 🫢🌈

πŸ“¦ where this page comes from