Graham Ollis > Clustericious > Clustericious::Plugin::PlugAuth

Download:
Clustericious-0.9936.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.9936   Source  

NAME ^

Clustericious::Plugin::PlugAuth - Plugin for clustericious to use PlugAuth.

VERSION ^

version 0.9936

SYNOPSIS ^

MyApp.conf:

 {"plug_auth":{"url":"http://plugauthserver:3000"}}

Application:

 package MyApp;
 
 use base qw( Clustericious::App );
 
 sub startup {
   my $self = shift;
   $self->SUPER::startup(@_);
   # done by default for all clustericious applications.
   #$self->plugin('plug_auth');
 }
 
 package MyApp::Routes;
 
 use Clustericious::RouteBuilder;

 # unprotected 
 get '/public' => 'unprotected';
 
 # require PlugAuth username/password
 authenticate; 
 get '/private1' => 'protected';
 
 # protected by PlugAuth an explicit realm
 autheticate 'realm';
 get '/private2' => 'realm protected';
 
 # check for permissions to do $action on $resource
 authorize 'action', 'resource';
 get '/restricted1' => 'authz_restricted';
 
 # check for premissions to do $action on the resource /restricted2
 authorize 'action';
 get '/restricted2';
 
 # HTTP method as the $action and /http_method_get as the resource
 authorize '<method>';
 get '/http_method_get';

 # HTTP method as the $action and "/prefix/http_method_with_prefix"
 # as the resource.
 authorize '<method>', '/myprefix/<path>';
 get '/http_method_with_prefix';

DESCRIPTION ^

This provides authenticate and authorize methods which can be called from your applications Route class.

ATTRIBUTES ^

config_url

The URL of the PlugAuth server to authenticate against.

METHODS ^

authenticate [ $realm ]

Require username and password authentication, optionally with a realm. If a realm is not provided, '' is used.

authorize [$action, [$resource]]

Require the authenticated user have the authorization to perform the given action on the given resource.

SEE ALSO ^

PlugAuth, Clustericious

AUTHOR ^

original author: Brian Duggan

current maintainer: Graham Ollis <plicease@cpan.org>

contributors:

Curt Tilmes

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 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.

syntax highlighting: