by Thomas Gagné
Last updated: April 12, 2004
The latest version is 0.4.1, updated March 19, 2004. It contains important bug fixes for memory leaks caused by not properly allocating (then deallocating) heap memory.
Download the latest by clicking here!
(4/12/2004) It was pointed out to me by Kurt Zeilenga, executive director of OpenLDAP Foundation that the LDAP API isn't specifically OpenLDAP's and that this Smalltalk interface might be able to work with Netscape's, Novell's, or IBM's among others.
"Note that all of these LDAP C libraries implement the same basic API which OpenLDAP LDAP C libraries do. In fact, most of these LDAP C libraries are based, in part, on OpenLDAP LDAP C libraries or the U-Mich LDAP C libraries (which OpenLDAP LDAP C libraries derive from).
"That is, you'll find ldap_search_s(3) in everyone of the LDAP C LDAP libraries. And you'll find ldap_initialize(3) (which was original introduced by the OpenLDAP Project) in many of these LDAP C libraries. And, as the providers of LDAP C libraries share API development efforts, you can expect commonality to increase in their implementations of the API over time (eventually will be published as an RFC updating RFC 1823). It should be clear that the LDAP C API isn't OpenLDAP's, it's the community. OpenLDAP Project just offers an implementation of the LDAP C API."With that information in-hand, I've some renaming to do because Kurt's right. It is misleading to advertise the package as an OpenLDAP ST API when in fact it might work with multiple libraries.
There already exists an LDAP implementation for both VW 5i.x and 7 implemented totally in Smalltalk, originally created by Matt Rosen. From his original work I borrowed some class and method names.
There were some odd behaviors when it came to referrals and it was more complicated than I was able to debug. In the spirit of reuse I thought it would be valuable to interface Smalltalk to the OpenLDAP libraries.
Download the latest .tgz, unpack it and load it into a VW image. Look for the classes
- OpenLDAP
- OpenLDAPConnection
- OpenLDAPException
- LDAPEntry
- LDAPAttribute
- LDAPAttributeSet
- LDAPMessage
- LDAPSearchResults
Feel free to contact me with questions.
I updated my OpenLDAP from 2.0.17 to 2.1.25. This necessitated some of the changes below. The modifications listed below were all added to the 0.3.tgz below.
Added ldap_set_option() functionality to LDAPConnection.
Added #setOption:value:, #setProtocolVersion:, and #setDebugLevel: to LDAPConnection.
Added #passwdForDN:* to change passwords. Much easier than the command line. Works for simple passwords. I also think it only works with v3-compatible servers, but I'm not sure.
ldap_add functionality is working. Download OpenLDAP-0.3.tgz for the latest 0.3 release.
IBM's Rick Trotter let me know IBM released the source code to their Smalltalk LDAP client which we discussed briefly last summer. He was generous in noting OpenLDAP/ST as prior art. I'm probably going to take a look at what they've done (and how they documented it) to see what might be considered for OpenLDAP/ST. I can't decide if I prefer raising exceptions on certain errors or if returning an LDAPError object would be better. I'd like it to be both fairly OO and idiomatic of Smalltalk. Hmm.
I've added SUnit tests for the package which found some painful errors in some obvious features--that I never checked.
I've added a new exception class, LDAPOpenException, for ldap_open() errors.
I've parceled up the package. Download OpenLDAP-0.2.tgz for the latest 0.2 release.
I'd really like to get ldap_modify (and add) working, but there's some overly complicated structures involved (with unions) that I need to wrestle with. If you're interested in helping, let me know!
The unit tests assume you've a local LDAP server running in the dc=home,dc=lan space. If you don't, you can run one or change the tests. In a future version I'll make changing the unit tests easier.