Lemonld...r::PSGI(3)

πŸ’– Lemonldap::NG::Handler::PSGI β€” the manual page, but make it cute πŸ’–

okay bestie, gather round, because this is Lemonld...r::PSGI(3) from the User Contributed Perl Documentation and it's genuinely iconic. it's the base library for protected PSGI applications, and honestly? it ate. πŸ’…


✨ NAME ✨

Lemonldap::NG::Handler::PSGI β€” the base library for protected PSGI applications, no cap. 🫢


🌸 SYNOPSIS 🌸

so here's the vibe. you make your own package, you inherit the handler, you do the little init dance:

package My::PSGI;

use base Lemonldap::NG::Handler;

sub init {
  my ( $self, $args ) = @_;
  $self->protection('manager');
  # See Lemonldap::NG::Common::PSGI for more
  ...
  # Return a boolean. If false, then error message has to be stored in
  # $self->error
  return 1;
}

sub handler {
  my ( $self, $req ) = @_;

  # Will be called only if authorized
  my $userId = $self->userId;
  ...
  $self->sendJSONresponse(...);
}

and then β€” plot twist β€” this package could be called as a CGI, using FastCGI,... yes really, look:

#!/usr/bin/env perl

use My::PSGI;
use Plack::Handler::FCGI; # or Plack::Handler::CGI

Plack::Handler::FCGI->new->run( My::PSGI->run() );

slay. that's the whole entrance. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

This package provides base class for Lemonldap::NG protected REST API. it's giving "foundation", it's giving "main character energy", and it's literally the thing you build on. πŸ’œ


πŸ‘‘ METHODS πŸ‘‘

okay so for logging methods, content sending,... you gotta go check Lemonldap::NG::Common::PSGI. that's where that stuff lives. πŸ’«

πŸ’– Accessors πŸ’–

See Lemonldap::NG::Common::PSGI::Router for inherited accessors. yes, they're inherited, they're family, they're coming to the function with you. 🫢

🌈 protection

Level of protection. It can be one of:

  • 'none' β€” no protection. the doors are wide open, we're all just vibing πŸ’€
  • 'authenticate' β€” all authenticated users are granted. if you got in, you got in πŸ’…
  • 'manager' β€” access is granted following Lemonldap::NG rules. the manager has entered the chat πŸ”₯

⭐ 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 }

either way you get a _whatToTrace, bestie. that's the whole point. ✨

🧚 UserId

Returns user()->{'_whatToTrace'}. that's it. that's the method. short and iconic. πŸ’–

πŸ“ group

Returns a list of groups to which user belongs. friendship circle reveal fr fr. πŸ‘―


πŸ”— SEE ALSO πŸ”—

go read these, they're all in the group chat:

  • <http://lemonldap-ng.org/>
  • Lemonldap::NG::Portal
  • Lemonldap::NG::Handler
  • Plack
  • PSGI
  • Lemonldap::NG::Common::PSGI::Router
  • Lemonldap::NG::Common::PSGI::Request
  • HTML::Template

πŸ’œ AUTHORS πŸ’œ

LemonLDAP::NG team <http://lemonldap-ng.org/team> β€” the OGs, the blueprint, the reason we're all here. πŸ‘‘


πŸ™ˆ BUG REPORT πŸ™ˆ

Use OW2 system to report bug or ask for features: <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues>

not me telling you to actually file the bug instead of just complaining in the group chat 😭 do it, they wanna hear it πŸ’–

🌈 DOWNLOAD 🌈

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

go get it bestie, it's free, it's there, it's waiting for you πŸŽ€


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/>.

the all-caps part is not me being dramatic, that's literally what it says, no warranty, no promises, it's giving "you're on your own but like, lovingly" πŸ’€πŸ’–

and that's the whole page, babe. this was perl v5.42.3, dated 2026-09-24, and it's Lemonld...r::PSGI(3) forever and always. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from