NAME

Lemonldap::NG::Handler::SharedConf - Perl extension for adding dynamic configuration to Lemonldap::NG::Handler. To use for inheritance.

See Lemonldap::NG::Handler::SharedConf::DBI for a complete example.

SYNOPSIS

  package My::Package;
  use Lemonldap::NG::Handler::SharedConf;
  @ISA = qw(Lemonldap::NG::Handler::SharedConf);
  
  sub getConf {
    # Write here your configuration download system
    # It has to return a hash reference containing
    # global configuration variables:
    # {
    #  locationRules => { '^/.*$' => '$ou =~ /brh/'},
    #  globalStorage        => 'Apache::Session::MySQL',
    #  globalStorageOptions => {
    #    ...
    #  }
    #  portal               => 'https://portal/',
    # }
    # See L<Lemonldap::NG::Handler> for more
  }
  
  __PACKAGE__->init ( {
    localStorage        => "Cache::DBFile",
    localStorageOptions => {},
    reloadTime          => 1200, # Default: 600
  } );

The configuration is loaded only at Apache start. Create an URI to force configuration reload, so you don't need to restart Apache at each change :

  # <apache>/conf/httpd.conf
  <Location /location/that/I/ve/choosed>
    Order deny,allow
    Deny from all
    Allow from my.manager.com
    PerlInitHandler My::Package->refresh
  </Location>

DESCRIPTION

Lemonldap is a simple Web-SSO based on Apache::Session modules. It simplifies the build of a protected area with a few changes in the application (they just have to read some headers for accounting).

It manages both authentication and authorization and provides headers for accounting. So you can have a full AAA protection for your web space.

This library splits Lemonldap::NG::Handler initialization into 2 phases: local initialization and global configuration set. It can be used if you want to write a module that can change its global configuration without restarting Apache.

OVERLOADED SUBROUTINES

init

Like Lemonldap::NG::Handler::init() but read only localStorage related options. You may change default time between two configuration checks with the reloadTime parameter (default 600s).

SUBROUTINE TO WRITE

getConf

Does nothing by default. You've to overload it to write your own configuration download system.

EXPORT

Same as Lemonldap::NG::Handler.

OPERATION

Each new Apache child checks if there's a configuration stored in the local store. If not, it calls getConf to get one and store it in the local store by calling setconf.

Every 600 seconds, each Apache child checks if the local stored configuration has changed and reload it if it has.

When refresh subroutine is called (by http for example: see synopsis), getConf is called to get the new configuration and setconf is called to store it in the local store.

SEE ALSO

Lemonldap::NG::Handler, Lemonldap::NG::Handler::SharedConf::DBI

AUTHOR

Xavier Guimard, <x.guimard@free.fr>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Xavier Guimard <x.guimard@free.fr>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

Lemonldap was originaly written by Eric german who decided to publish him in 2003 under the terms of the GNU General Public License version 2. Lemonldap::NG is a complete rewrite of Lemonldap and is able to have different policies in a same Apache virtual host.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 217:

=back without =over