PlugAuth::Lite - Pluggable (lite) authentication and authorization server.
version 0.38
command line:
% plugauthlite
Mojolicious Plugin:
use Mojolicious::Lite; plugin 'plug_auth_lite', auth => sub { my($user, $pass) = @_; if($user eq 'optimus' && $pass eq 'matrix') { return 1; } else { return 0; } }, authz => sub { my($user, $action, $resource) = @_; if($user eq 'optimus && $action eq 'open' && $resource =~ m{^/matrix}) { return 1 } else { return 0 } };
Mojolicious App:
use PlugAuth::Lite; my $app = PlugAuth::Lite->new({ auth => sub { my($user, $pass) = @_; if($user eq 'optimus' && $pass eq 'matrix') { return 1; } else { return 0; } }, authz => sub { my($user, $action, $resource) = @_; if($user eq 'optimus && $action eq 'open' && $resource =~ m{^/matrix}) { return 1 } else { return 0 } }, });
This distribution provides
PlugAuth compatible server in the form of a Mojolicious::Lite application.
Mojolicious plugin that adds PlugAuth compatible routes to a new or existing Mojolicious application.
Mojolicious application with PlugAuth compatible routes that can be spawned from within a perl application.
In the future it will also contain a testing interface for testing authentication and authorization rules in Clustericious applications.
It has fewer prerequisites that the full fledged PlugAuth server (simply Mojolicious and perl itself) but also fewer features (it notably lacks the management interface).
Subroutine reference to call to check authentication. Passes in ($user, $pass) should return true for authenticated, false otherwise.
($user, $pass)
If not provided, all authentications fail.
Subroutine reference to call to check authorization. Passes in ($user, $action, $resource) and should return true for authorized, false otherwise.
($user, $action, $resource)
If not provided, all authorizations succeed.
Subroutine reference to call to check host information.
plugauthlite, Mojolicious::Plugin::PlugAuthLite, Test::PlugAuth, Clustericious
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2013 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::Clustericious::Cluster, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Clustericious::Cluster
CPAN shell
perl -MCPAN -e shell install Test::Clustericious::Cluster
For more information on module installation, please visit the detailed CPAN module installation guide.