You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2002/12/02 02:32:10 UTC
[RFC] Apache::LDAP
( Actually, the name is chosen to `rhyme' with Apache::DBI. There
are no dependencies on Apache or mod_perl. )
NAME
Apache::LDAP - provides persistent LDAP connections
SYNOPSIS
use Apache::LDAP;
# use Net::LDAP
my $connection = Apache::LDAP -> new(
connection => [ # Net::LDAP -> new parameters ],
tls => [ # Net::LDAP -> start_tls parameters ],
bind => [ # Net::LDAP -> bind parameters ],
);
# use Net::LDAPS
my $connection = Apache::LDAPS -> new(
connection => [ # Net::LDAPS -> new parameters ],
tls => [ # Net::LDAPS -> new tls parameters ],
bind => [ # Net::LDAPS -> bind parameters ],
);
DESCRIPTION
This module initiates a persistant LDAP connection. The LDAP
access uses the Net::LDAP family of modules.
Since a usable LDAP connection usually requires two or three
steps, Apache::LDAP is not a simple drop-in module in the manner
of Apache::DBI. Code must be written to take advantage of
Apache::LDAP.
Unfortunately, LDAP connections are not sharable across
processes. This means that connections must be made in Apache
children processes, not in the startup process (i.e., during
child initialization, not during server configuration).
Connections are cached based on the class and the parameters
passed to the "new" method. A previously cached connection is
returned only if the class and parameters are identical to those
used to create the connection and if the connection appears to be
alive. The connection is tested by requesting the root DSA
information from the server.
Net::LDAPS Support
Apache::LDAPS is included with Apache::LDAP to support
Net::LDAPS. The parameters to "new" are identical. The "tls"
parameters are included with the "connection" parameters when
calling "Net::LDAPS -> new".
SUB-CLASSING
A sub-class of Apache::LDAP may be useful if you want to use an
LDAP module other than Net::LDAP.
package My::Persistant::LDAP;
use base qw(Apache::LDAP);
sub make_connection {
my($class, $params) = @_;
# return new connection
}
sub test_connection {
my($class, $connection) = @_;
# return true if $connection is good
}
__END__
SEE ALSO
the Net::LDAP manpage, the Net::LDAPS manpage.
AUTHOR
James G. Smith <js...@cpan.org>
COPYRIGHT
Copyright (C) 2002 Texas A&M University. All Rights Reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
--
James Smith <JG...@TAMU.Edu>, 979-862-3725
Senior Software Applications Developer,
Texas A&M CIS Operating Systems Group, Unix
Re: [RFC] Apache::LDAP
Posted by Chris Winters <ch...@cwinters.com>.
On Sun, 2002-12-01 at 20:32, James G Smith wrote:
> ( Actually, the name is chosen to `rhyme' with Apache::DBI. There
> are no dependencies on Apache or mod_perl. )
>
> NAME
> Apache::LDAP - provides persistent LDAP connections
Does this overlap with the ResourcePool series of modules?
Chris
--
Chris Winters (chris@cwinters.com)
Building enterprise-capable snack solutions since 1988.
Re: [RFC] Apache::LDAP
Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
Hi James,
At 02:32 02.12.2002, James G Smith wrote:
>( Actually, the name is chosen to `rhyme' with Apache::DBI. There
>are no dependencies on Apache or mod_perl. )
If there is no link with Apache::DBI, I suggest that you choose a more
appropriate namespace, like Persistent::LDAP
--
Per Einar Ellefsen
pereinar@oslo.online.no