Skip Menu |

This queue is for tickets about the Authen-Simple-LDAP CPAN distribution.

Report information
The Basics
Id: 84608
Status: new
Priority: 0/
Queue: Authen-Simple-LDAP

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: allow Dependency Injection
Date: Sat, 13 Apr 2013 12:14:50 -0500
To: bugs-authen-simple-ldap [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
It would be nice to have the ability to Inject an exiting Net::LDAP object into Authen::SImple::LDAP. my $ldap = Net::LDAP->new( host => 'ldap.company.com', basedn => 'ou=People,dc=company,dc=net', ); my $auth = Authen::Simple::LDAP->new( ldap => $ldap ); This would provide the following benefits. 1. Inject a mock object for testing, e.g Test::Net::LDAP::Mock a. includes the obvious benefit of not having to have a running ldap server to run tests 2. use one Net::LDAP instance for authentication and user loading a. less memory/cpu consumed by reusing the object (negliible) b. less connections to the ldap server? (I'm not sure this is true, because I'm not sure if Net::LDAP (or ldap in general) would need to reconnect later to get the users full information when requested outside of Authen::Simple::LDAP -- Caleb Cushing http://xenoterracide.com