PlugAuth::Client - PlugAuth Client
version 0.34
In a perl program :
my $r = PlugAuth::Client->new; # Check auth server status and version my $check = $r->status; my $version = $r->version; # Authenticate user "alice", pw "sesame" $r->login("alice", "sesame"); if ($r->auth) { print "authentication succeeded\n"; } else { print "authentication failed\n"; } # Authorize "alice" to "POST" to "/board" if ($r->authz("alice","POST","board")) { print "authorization succeeded\n"; } else { print "authorization failed\n"; }
This module provides a perl front-end to the PlugAuth API. For a stripped down interface to just the authentication and authorization API (that is not including the user/group/authorization management functions), see PlugAuth::Client::Tiny.
Returns true if the PlugAuth server can authenticate the user. Username and passwords can be specified with the login method or via the application's configuration file, see Clustericious::Client for details.
Returns true if the given user ($user) is authorized to perform the given action ($action) on the given resource ($resource).
Returns a list reference containing all usernames.
Create a user with the given username and password.
user
The new user's username
REQUIRED
password
The new user's password
groups
List of groups as a comma separated string. Using this option requires that the server is running PlugAuth 0.21 or better.
Delete the user with the given username.
Returns a list reference containing the groups that the given user ($user) belongs to.
Change the password of the given user ($user) to a new password ($password).
Returns a list reference containing all group names.
Returns the list of users belonging to the given group ($group).
Create a group.
group
The name of the new group
users
Comma separated list (as a string) of the users that should initially belong to this group.
Update the given group ($group) replacing the existing list with the new list ($users), which is a comma separated list as a string.
Delete the given group ($group).
Adds the given user ($user) to the given group ($group)
Delete the given user ($user) from the given group ($group)
Grants the given user ($user) the authorization to perform the given action ($action) on the given resource ($resource).
Revokes permission for the give user ($user) to perform the given action ($action) on the given resource ($resource).
Returns a list of granted permissions
Returns a list reference containing the actions that the PlugAuth server knows about.
Returns true if the host specified by the given IP address ($ip_address) has the given host tag ($tag).
Returns a list reference containing the resources that match the regex provided ($resource_regex) that the given user ($user) can perform the given action ($action). To see all the resources that the user can perform the given action against, pass in '.*' as the regex.
Returns a hash reference of all actions and resources that the given user ($user) can perform. The keys in the returned hash are the actions and the values are list references containing the resources where those actions can be performed by the user.
Interface to the Audit plugin, if it is available.
Clustericious::Client, PlugAuth, plugauthclient, plugauthpasswd, PlugAuth::Client::Tiny
Graham Ollis <gollis@sesda3.com>
This software is copyright (c) 2012 by NASA GSFC.
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 PlugAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PlugAuth
CPAN shell
perl -MCPAN -e shell install PlugAuth
For more information on module installation, please visit the detailed CPAN module installation guide.