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 thep->loggeraccessoruserLoggerβ an alias for thep->userLoggeraccessor
π 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->usercontains 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 messageslogger->infoβ simple technical informationlogger->noticeβ technical information that could interest administratorslogger->warnβ technical warninglogger->errorβ error that must be reported to administratoruserLogger->infoβ simple information about user's actionuserLogger->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 availableuserLogger->errorβ bad action of a user that must be reported, (even if another backend is available with Combination)
ok so theuserLogger->warnone 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>
π COPYRIGHT AND LICENSE π
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
- fedora 43: lemonldap-ng-portal 2.23.4-1.fc43 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- fedora 44: lemonldap-ng-portal 2.23.4-1.fc44 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms