CGI::A...TGroup(3pm)

πŸ‘‘ NAME πŸ‘‘

CGI::Application::Plugin::Authorization::Driver::HTGroup β€” the HTGroup Authorization driver πŸŽ€

okay so real talk, this is the manual page for that driver. It's giving "small but mighty", and it's here to tell your app who's allowed in based on good old Apache-style group files. slay πŸ’…


✨ SYNOPSIS ✨

bestie, this is the whole vibe right here:

use base qw(CGI::Application);
use CGI::Application::Plugin::Authorization);

__PACKAGE__->authz->config(
    DRIVER => [ 'HTGroup', '/etc/apache/myapp/htgroup', '/etc/apache/htgroup' ],
);

wait, no, let me not do you dirty β€” here it is exactly, character for character, because I love you:

use base qw(CGI::Application);
use CGI::Application::Plugin::Authorization;

__PACKAGE__->authz->config(
    DRIVER => [ 'HTGroup', '/etc/apache/myapp/htgroup', '/etc/apache/htgroup' ],
);

so you're subclassing CGI::Application, you pull in CGI::Application::Plugin::Authorization, and then you configure it with the driver named HTGroup followed by your htgroup file paths β€” in the example that's '/etc/apache/myapp/htgroup' and '/etc/apache/htgroup'. literally just a list of files, no cap πŸ“βœ¨


🌸 METHODS 🌸

πŸ¦‹ authorize_user

okay so this method takes a username, and right after it a list of group names β€” and it returns true if that user belongs to at least one of those groups. 🫢

that's it. that's the whole method. one (1) job, and it eats every single time πŸ‘‘

ngl, "at least one" is doing a LOT of heavy lifting in that sentence. It's not asking for all of them, bestie. One group match and you're in. πŸ’€

🌈 SEE ALSO 🌈

go be nosy, these are your people:

  • CGI::Application::Plugin::Authorization::Driver β€” the driver base, the blueprint, the blueprint-iest 🧚
  • CGI::Application::Plugin::Authorization β€” the plugin that runs the whole show πŸ‘‘
  • perl(1) β€” hi, it's perl, you know her ⭐

Copyright (c) 2005, SiteSuite. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt πŸ’–


πŸ’€ DISCLAIMER OF WARRANTY πŸ’€

bestie, this part is in ALL CAPS for a reason, so listen up β€” it's legally serious and I am not paraphrasing it, I'm just presenting it with the drama it deserves:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
⚠️ tl;dr bestie: free software, zero promises, all the risk is on you. read the caps, they're not decorative. 😭

and that's the whole page!! this one shipped as part of perl v5.30.3, dated 2020-09-25 β€” and it lives under the name CGI::A...TGroup(3pm) in the User Contributed Perl Documentation section. go forth and authorize, you gorgeous thing πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from