Use main Handler module VERSION (#630)

environments/ppa-mbqj77/deployments/1
Clément Oudot 11 years ago
parent bd95df3136
commit 75c3a79abf
  1. 76
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm
  2. 3
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Initialization/LocalInit.pm

@ -1,13 +1,12 @@
## @file ## @file
# Alias for Lemonldap::NG::Handler::SharedConf # Alias for Lemonldap::NG::Handler::DefaultHandler
## @class ## @class
# Alias for Lemonldap::NG::Handler::SharedConf # Alias for Lemonldap::NG::Handler::DefaultHandler
package Lemonldap::NG::Handler; package Lemonldap::NG::Handler;
our $VERSION = '1.3.0'; our $VERSION = '1.4.0';
use Lemonldap::NG::Handler::SharedConf; use base qw(Lemonldap::NG::Handler::DefaultHandler);
use base qw(Lemonldap::NG::Handler::SharedConf);
1; 1;
@ -24,40 +23,17 @@ Lemonldap::NG Web-SSO system.
=head1 SYNOPSIS =head1 SYNOPSIS
=head2 Create your Apache module
Create your own package (example using a central configuration database):
package My::Package;
use Lemonldap::NG::Handler::SharedConf;
@ISA = qw(Lemonldap::NG::Handler::SharedConf);
__PACKAGE__->init ( {
# Local storage used for sessions and configuration
localStorage => "Cache::DBFile",
localStorageOptions => {...},
# How to get my configuration
configStorage => {
type => "DBI",
dbiChain => "DBI:mysql:database=lemondb;host=$hostname",
dbiUser => "lemonldap",
dbiPassword => "password",
}
# Uncomment this to activate status module
# status => 1,
} );
=head2 Configure Apache =head2 Configure Apache
Call your package in /apache-dir/conf/httpd.conf: Call Handler in /apache-dir/conf/httpd.conf:
# Load your package # Load your package
PerlRequire /My/File PerlRequire /My/File
# TOTAL PROTECTION # TOTAL PROTECTION
PerlHeaderParserHandler My::Package PerlHeaderParserHandler Lemonldap::NG::Handler
# OR SELECTED AREA # OR SELECTED AREA
<Location /protected-area> <Location /protected-area>
PerlHeaderParserHandler My::Package PerlHeaderParserHandler Lemonldap::NG::Handler
</Location> </Location>
The configuration is loaded only at Apache start. Create an URI to force The configuration is loaded only at Apache start. Create an URI to force
@ -68,35 +44,16 @@ configuration reload, so you don't need to restart Apache at each change:
Order deny,allow Order deny,allow
Deny from all Deny from all
Allow from my.manager.com Allow from my.manager.com
PerlHeaderParserHandler My::Package->refresh PerlHeaderParserHandler Lemonldap::NG::Handler->refresh
</Location> </Location>
You can also disable access control for specific URIs, but be aware that
this is not really secure, since session cookies are sent to the protected
application (so they could be spoofed), and since a user could forge his
own HTTP request headers and they would not be reset. To disable access
control for specific URIs on a secure way, you should set access rule to
'skip' instead.
<Files "*.gif">
PerlHeaderParserHandler My::Package->unprotect
</Files>
To display the status page, add something like this : To display the status page, add something like this :
<Location /status> <Location /status>
Order deny,allow Order deny,allow
Allow from 10.1.1.0/24 Allow from 10.1.1.0/24
Deny from all Deny from all
PerlHeaderParserHandler My::Package->status PerlHeaderParserHandler Lemonldap::NG::Handler->status
</Location>
If your application has a "logout" URL, you can configure it directly in Apache
configuration file (or in the manager interface). THIS IS DEPRECATED, use the
manager :
<Location /logout>
PerlHeaderParserHandler My::Package->logout
</Location> </Location>
=head1 DESCRIPTION =head1 DESCRIPTION
@ -284,8 +241,8 @@ Lemonldap::NG use 3 levels of cache for authenticated users:
parameter (completed with C<globalStorageOptions>) and used by parameter (completed with C<globalStorageOptions>) and used by
L<lemonldap::NG::Portal> to store authenticated user parameters, L<lemonldap::NG::Portal> to store authenticated user parameters,
=item * a L<Cache::Cache> module choosed with the C<localStorage> parameter =item * a L<Cache::Cache> module choosed with the C<sessionLocalStorage> parameter
(completed with C<localStorageOptions>) and used to share authenticated users (completed with C<sessionLocalStorageOptions>) and used to share authenticated users
between Apache's threads or processus and of course between virtual hosts, between Apache's threads or processus and of course between virtual hosts,
=item * Lemonldap::NG::Handler variables: if the same user use the same thread =item * Lemonldap::NG::Handler variables: if the same user use the same thread
@ -329,15 +286,6 @@ Lemonldap::NG::Handler provides different modules:
=over =over
=item * L<Lemonldap::NG::Handler::Simple>: base module. It can be used
directly to protect a single host.
=item * L<Lemonldap::NG::Handler::Vhost>: module used to managed virtual hosts.
=item * L<Lemonldap::NG::Handler::SharedConf>: with this module, the
configuration can be centralized. Inherits from
L<Lemonldap::NG::Handler::Vhost> and L<Lemonldap::NG::Handler::Simple>.
=item * L<Lemonldap::NG::Handler::CGI>: if you have only a few Perl CGI to =item * L<Lemonldap::NG::Handler::CGI>: if you have only a few Perl CGI to
protect, you can use this module in your CGI instead of protecting it under protect, you can use this module in your CGI instead of protecting it under
L<Lemonldap::NG::Handler::SharedConf>. L<Lemonldap::NG::Handler::SharedConf>.
@ -356,7 +304,7 @@ download a mod_perl2 backport.
=head1 SEE ALSO =head1 SEE ALSO
L<Lemonldap::NG::Handler::SharedConf>, L<Lemonldap::NG::Handler::DefaultHandler>,
L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Manager>, L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Manager>,
L<http://lemonldap-ng.org/> L<http://lemonldap-ng.org/>

@ -15,6 +15,7 @@ package Lemonldap::NG::Handler::Initialization::LocalInit;
use Mouse; use Mouse;
use Lemonldap::NG::Handler; # Needed to get VERSION
use Lemonldap::NG::Handler::Main::Logger; use Lemonldap::NG::Handler::Main::Logger;
our $VERSION = '1.3.0'; our $VERSION = '1.3.0';
@ -208,7 +209,7 @@ sub childInit {
PerlPostConfigHandler => sub { PerlPostConfigHandler => sub {
my ( $c, $l, $t, $s ) = splice @_; my ( $c, $l, $t, $s ) = splice @_;
$s->add_version_component( $s->add_version_component(
'Lemonldap::NG::Handler/' . $VERSION ); 'Lemonldap::NG::Handler/' . $Lemonldap::NG::Handler::VERSION );
} }
) unless ( $args->{hideSignature} ); ) unless ( $args->{hideSignature} );
} }

Loading…
Cancel
Save