[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [ANN] Net::LDAP 0.0.4 released

Berger, Daniel

8/15/2006 9:02:00 PM

> -----Original Message-----
> From: Francis Cianfrocca [mailto:garbagecat10@gmail.com]
> Sent: Tuesday, August 15, 2006 2:53 PM
> To: ruby-talk ML
> Subject: Re: [ANN] Net::LDAP 0.0.4 released
>
>
> On 8/15/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:
> >
> > > On 8/15/06, Berger, Daniel <Daniel.Berger@qwest.com> wrote:
> >
> > Works perfectly, thanks! I removed the parens from the filter,
> > however. My experience has showed me that not all platforms
> liked the
> > parens and it works fine without them (at least it does
> here at work).
> >
> > Now, what would be the best way to test for the mere presence of a
> > user record, i.e. no password?
>
>
>
> I noticed you had given your original code sample without
> parens around the filter. Out of curiosity, what kind of LDAP
> server are you connecting to?

I'm afraid I can't say much more than it's a 3rd party solution.

> Searching for a user without
> binding ought to be easy:
>
> require 'net/ldap'
>
> ldap = Net::LDAP.new
> ldap.host = "ldap.foo.com"
> ldap.base = "ou=People,o=foo.com"
>
> rs = ldap.search( :filter => "uid=djberge")
>
> if rs
> puts "DN: #{rs.first.dn}"
> end

Of course, thanks. I should have known that.

> By the way, you don't have to instantiate a Net::LDAP object
> every time you need to hit the server. Just instantiate it
> once and keep it around in a singleton or global.

Yep, thanks.

I'll be putting this into my Rails app this week to replace the ugly
system call + open3 solution I'm using now (ick).

Many thanks for this!

Dan

PS - The ruby-ldap (C extension) library causes Ruby to segfault in
combination with WEBrick, in case you're wondering why I didn't use that
instead.


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

2 Answers

Luke A. Kanies

8/18/2006 5:18:00 PM

0

On Aug 15, 2006, at 4:10 PM, Francis Cianfrocca wrote:
>
>
> I've talked to several people who have pointed out that the native
> LDAP
> library has a variety of problems, including working (well, not
> working)
> with Ruby threads, because of the way it does IO internally. Can't
> explain
> the problem with Webrick but if we do our job right, there will be
> no reason
> to use native LDAP in preference to pure Ruby.
>
> Apropos, does anyone out there have any reasons why they must use
> native
> LDAP as opposed to Net::LDAP? Missing features? Bugs?

I don't do as much with LDAP these days (although I did a bunch of
Rails LDAP work in February), but I'm really excited that you're
building this native Ruby library. I went through the same
transition in perl from perl-wrapped compiled libraries to pure-perl
libraries, and it made a *huge* difference in the reliability and
simplicity of the libraries.

I'm also excited that you're flexible about the interface; the native
LDAP library was a bit too close to the actual LDAP library
interfaces, which are not exactly easy to use.

So, thanks. I look forward to using this for my next LDAP project.
I'll definitely be providing feedback when I have occasion to use.

--
Luke Kanies
http://m... | http://reducti... | 615-594-8199



Francis Cianfrocca

8/18/2006 5:29:00 PM

0

On 8/18/06, Luke Kanies <luke@madstop.com> wrote:
> I'm also excited that you're flexible about the interface; the native
> LDAP library was a bit too close to the actual LDAP library
> interfaces, which are not exactly easy to use.


Thanks- improving the API and making it more Ruby-esque was a major
motivation for building this library, and I'm still looking for ways
to improve it, so anyone with a suggestion please let me know. The
native LDAP API, as clunky as it is, is an RFC standard, so a lot of
people hesitate to change it. But it's so weird and old-fashioned that
I decided to do so anyway.