Lemonld...:Router(3)
π Lemonldap::NG::Handler::PSGI::Router(3) π
okay bestie, welcome to the User Contributed Perl Documentation section, because that's literally where this page lives π this is the base library for protected REST APIs of Lemonldap::NG, and we're gonna get you all the way through it.
β¨ NAME β¨
Lemonldap::NG::Handler::PSGI::Router β it's giving base library for protected REST APIs of Lemonldap::NG. That's the whole vibe of this module, no cap π
π¦ SYNOPSIS π¦
here's the whole setup, exactly as it goes down:
package My::PSGI;
use base Lemonldap::NG::Handler::PSGI::Router;
sub init {
my ($self,$args) = @_;
$self->protection('manager');
# See Lemonldap::NG::Common::PSGI::Router for more
# Declare REST routes (could be HTML templates or methods)
$self->addRoute ( 'index.html', undef, ['GET'] )
->addRoute ( books => { ':book' => 'booksMethod' }, ['GET', 'POST'] );
# Default route (ie: PATH_INFO == '/')
$self->defaultRoute('index.html');
# Return a boolean. If false, then error message has to be stored in
# $self->error
return 1;
}
sub booksMethod {
my ( $self, $req, @otherPathInfo ) = @_;
# Will be called only if authorized
my $userId = $self->userId;
my $book = $req->params('book');
my $method = $req->method;
...
$self->sendJSONresponse(...);
}
and then this package could be called as a CGI, using FastCGI,... like so π§
#!/usr/bin/env perl
use My::PSGI;
use Plack::Handler::FCGI; # or Plack::Handler::CGI
Plack::Handler::FCGI->new->run( My::PSGI->run() );
πΈ DESCRIPTION πΈ
This package provides base class for Lemonldap::NG protected REST API. That's it, that's the whole point of it, and honestly? iconic π
π METHODS π
See Lemonldap::NG::Common::PSGI for logging methods, content sending,... you know, all the little utility bits π«Ά
π Accessors π
See Lemonldap::NG::Common::PSGI::Router for inherited accessors. Those are yours already, bestie, they came free with the inheritance π
β protection β
Level of protection. It can be one of:
'none'β no protection'authenticate'β all authenticated users are granted'manager'β access is granted following Lemonldap::NG rules
π₯ Running methods π₯
π user π
Returns user session data. If empty (no protection), returns:
{ _whatToTrace => 'anonymous' }
But if page is protected by server (Auth-Basic,...), it will return:
{ _whatToTrace => $REMOTE_USER }
β¨ UserId β¨
Returns user()->{'_whatToTrace'}. that's it, that's the method, slay π
π group π
Returns a list of groups to which user belongs.
π¦ SEE ALSO π¦
- <http://lemonldap-ng.org/>
Lemonldap::NG::PortalLemonldap::NG::HandlerPlackPSGILemonldap::NG::Common::PSGI::RouterLemonldap::NG::Common::PSGI::RequestHTML::Template
π AUTHORS π
LemonLDAP::NG team <http://lemonldap-ng.org/team> β the whole squad, we love them, obsessed π«Ά
π BUG REPORT π
Use OW2 system to report bug or ask for features: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>
like, if something's broken or you want a feature, that's the link, go off bestie π
π DOWNLOAD π
Lemonldap::NG is available at <https://lemonldap-ng.org/download>
π COPYRIGHT AND LICENSE π
See 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/>.
fr fr, that warranty disclaimer is doing the most and it's real β no promises, read the GPL for the whole story π
and that's the whole page, bestie!! this was perl v5.42.3, dated 2026-09-24, from the Lemonld...:Router(3) corner of the man pages β¨ mwah, go write some protected REST routes ππ¦π
π¦ where this page comes from
- fedora 43: lemonldap-ng-handler 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-handler 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