From: Ingo S. <st...@un...> - 2005-01-03 10:00:45
|
Am Mo, den 20.12.2004 schrieb Michael Str=F6der um 10:01: > Ingo Steuwer wrote: > >=20 > > To fulfill our upcomming goals we need to use LDAPControls, but the > > latest released version of python-ldap doesn't support them.=20 >=20 > Yes, you'll find a hint in file TODO. >=20 > > We did some experimental implementations in the C-backend (for "proof= of > > concept") and would now like to define a general approach. This shoul= d > > be done in coordination with you to see our work in upcoming versions= of > > python-ldap. >=20 > Since I'm not a C programmer (David wrote the C code) I'd be really gla= d=20 > if someone would jump on in and contribute code for LDAP controls and=20 > extended operations. >=20 > I already tried to wrap the arguments whereever appropriate. Please=20 > review this. >=20 > > My attempt would defining a python-class LDAPControl (containing OID, > > iscritcal and value (dictionary)) and implement a correspondig wrappe= r > > to *LDAPControl. >=20 > But value can be a complex ASN.1 structure as well. >=20 > > I think the most diffcult part will be the > > representation of berval/berelement in python. >=20 > Yes. >=20 > > - is there somebody else implementing this (I didn't look at the cvs)= ? >=20 > No. And I'm currently rather short on time. I'd highly appreciate your=20 > contributions. But note that you should give away copyright for your=20 > contributed code. Make sure that your legal department agrees on that. Sorry for my late answer. It's Ok. > > - are there already thoughts, definitions or an approach I should kno= w ? >=20 > There are several approaches. >=20 > 1. Python classes for controls with a method berencode(). This method=20 > would be called before passing the controls as argument to the function= s=20 > in _ldap. This would be the most flexible approach and independent of=20 > the underlying OpenLDAP API. Drawbacks are that you need a BER module=20 > for this and it's much work for complex controls. >=20 > 1.a Wrap libber. >=20 > 1.b Implement a pure Python BER module. Maybe we could get one from a=20 > SNMP implementation implemented in Python? I'd prefer this way, as mentioned by Hans there are already implementations. In our first attempt we will not include but prepare for them. Ingo Steuwer > 2. We could also wrap the helper functions in libldap (see controls.c,=20 > vlvctrl.c, sortctrl.c). But this would add another strong dependency on= =20 > the OpenLDAP libs. >=20 > > - do you know about wrappers between berval/berelement and python ? >=20 > No. You could try to wrap OpenLDAP's libber. >=20 > Ciao, Michael. --=20 Ingo Steuwer st...@un... fon: +49 421 22 232- 0 Entwicklung Linux for Your Business =20 Univention GmbH http://www.univention.de/ fax: +49 421 22 232-99 |